|
|
@ -3,6 +3,7 @@ package ru.egspt; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JButton; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JScrollPane; |
|
|
|
import javax.swing.JScrollPane; |
|
|
|
import javax.swing.JTable; |
|
|
|
import javax.swing.JTable; |
|
|
@ -15,20 +16,36 @@ public class ReportPane extends JPanel { |
|
|
|
private ReportTableModel reportTableModel; |
|
|
|
private ReportTableModel reportTableModel; |
|
|
|
private JTable reportTable; |
|
|
|
private JTable reportTable; |
|
|
|
private JPanel reportTextPane = new JPanel(); |
|
|
|
private JPanel reportTextPane = new JPanel(); |
|
|
|
private JPanel reportSettingsPane = new JPanel(); |
|
|
|
private JPanel reportControlsPane = new JPanel(); |
|
|
|
|
|
|
|
private JButton getExcellReportButton = new JButton(); |
|
|
|
|
|
|
|
private JButton implantDataButton = new JButton(); |
|
|
|
|
|
|
|
|
|
|
|
//панель по данным App
|
|
|
|
//панель по данным App
|
|
|
|
public ReportPane(App app){ |
|
|
|
public ReportPane(App app){ |
|
|
|
setupReportTablePane(app.getData()); |
|
|
|
setupReportTablePane(app.getData()); |
|
|
|
|
|
|
|
setupReportControlsPane(app); |
|
|
|
} |
|
|
|
} |
|
|
|
public void init(){ |
|
|
|
public void init(){ |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(reportTablePane, BorderLayout.CENTER); |
|
|
|
this.add(reportTablePane, BorderLayout.CENTER); |
|
|
|
//this.add(reportTablePane, BorderLayout.NORTH);
|
|
|
|
this.add(reportControlsPane, BorderLayout.NORTH); |
|
|
|
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "report", TitledBorder.CENTER, TitledBorder.CENTER); |
|
|
|
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "report", TitledBorder.CENTER, TitledBorder.CENTER); |
|
|
|
this.setBorder(border); |
|
|
|
this.setBorder(border); |
|
|
|
this.setVisible(true); |
|
|
|
this.setVisible(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setupReportControlsPane(App app){ |
|
|
|
|
|
|
|
getExcellReportButton.setText("create excell"); |
|
|
|
|
|
|
|
getExcellReportButton.addActionListener(e -> ReportControls.getExcellReport(app)); |
|
|
|
|
|
|
|
implantDataButton.setText("implant data"); |
|
|
|
|
|
|
|
implantDataButton.addActionListener(e -> ReportControls.implantData(app)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reportControlsPane.add(getExcellReportButton); |
|
|
|
|
|
|
|
reportControlsPane.add(implantDataButton); |
|
|
|
|
|
|
|
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "report-controls-pane", TitledBorder.CENTER, TitledBorder.CENTER); |
|
|
|
|
|
|
|
reportControlsPane.setBorder(border); |
|
|
|
|
|
|
|
reportControlsPane.setVisible(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
public void setupReportTablePane(Data report){ |
|
|
|
public void setupReportTablePane(Data report){ |
|
|
|
reportTableModel = new ReportTableModel(report); |
|
|
|
reportTableModel = new ReportTableModel(report); |
|
|
|
reportTable = new JTable(reportTableModel); |
|
|
|
reportTable = new JTable(reportTableModel); |
|
|
|