|
@@ -37,6 +37,7 @@ import java.awt.event.ActionListener;
|
|
|
import java.awt.event.ItemEvent;
|
|
|
import java.awt.event.ItemListener;
|
|
|
|
|
|
+import javax.swing.border.CompoundBorder;
|
|
|
import javax.swing.border.LineBorder;
|
|
|
import javax.swing.JPopupMenu;
|
|
|
import java.awt.Component;
|
|
@@ -44,8 +45,11 @@ import java.awt.Dimension;
|
|
|
import java.awt.event.MouseAdapter;
|
|
|
import java.awt.event.MouseEvent;
|
|
|
import javax.swing.JMenuItem;
|
|
|
+import javax.swing.BorderFactory;
|
|
|
+import javax.swing.Box;
|
|
|
import javax.swing.BoxLayout;
|
|
|
import java.awt.FlowLayout;
|
|
|
+import java.awt.BorderLayout;
|
|
|
|
|
|
public class splitPane extends JSplitPane implements GraphListener {
|
|
|
private JTextField graphNrTxtField;
|
|
@@ -76,7 +80,6 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
dataPane.setViewportView(panel);
|
|
|
|
|
|
JScrollPane treeScrollPane = new JScrollPane();
|
|
|
-
|
|
|
JLabel lblObject = new JLabel("Object(s):");
|
|
|
|
|
|
showObjectlbl = new JLabel("...");
|
|
@@ -339,10 +342,25 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
JButton btnAdd = new JButton("Add");
|
|
|
btnAdd.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
- StatisticGraph tmp = new StatisticGraph(controller.getModel(), controller);
|
|
|
- graphPanel.add(tmp);
|
|
|
- graphPanel.revalidate();
|
|
|
- graphPanel.updateUI();
|
|
|
+ /*
|
|
|
+ DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)objectTree.getLastSelectedPathComponent();
|
|
|
+ if(selectedNode == null){
|
|
|
+ return;
|
|
|
+ }else{
|
|
|
+ if(selectedNode.getLevel() == 3){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+ StatisticGraph tmp = new StatisticGraph(controller.getModel(), controller);
|
|
|
+ tmp.setPreferredSize(new Dimension(280,120));
|
|
|
+ tmp.setMaximumSize(new Dimension(1000,120));
|
|
|
+ tmp.setMinimumSize(new Dimension(100,45));
|
|
|
+ tmp.setBorder(new LineBorder(new Color(0, 0, 0), 2));
|
|
|
+ graphPanel.add(tmp);
|
|
|
+ graphPanel.add(Box.createRigidArea(new Dimension(50,50)));
|
|
|
+ graphPanel.revalidate();
|
|
|
+ graphPanel.updateUI();
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -354,11 +372,9 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
gl_panel.createParallelGroup(Alignment.LEADING)
|
|
|
.addGroup(gl_panel.createSequentialGroup()
|
|
|
.addContainerGap()
|
|
|
- .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
|
|
|
- .addGroup(gl_panel.createSequentialGroup()
|
|
|
- .addComponent(treeScrollPane, GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
|
|
|
- .addContainerGap())
|
|
|
- .addGroup(gl_panel.createSequentialGroup()
|
|
|
+ .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING, false)
|
|
|
+ .addComponent(treeScrollPane, Alignment.LEADING)
|
|
|
+ .addGroup(Alignment.LEADING, gl_panel.createSequentialGroup()
|
|
|
.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
|
|
|
.addComponent(lblGraph)
|
|
|
.addComponent(lblObject)
|
|
@@ -386,8 +402,8 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
.addPreferredGap(ComponentPlacement.RELATED)
|
|
|
.addComponent(lblB)
|
|
|
.addPreferredGap(ComponentPlacement.RELATED)
|
|
|
- .addComponent(blueField, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)))
|
|
|
- .addGap(32))))
|
|
|
+ .addComponent(blueField, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)))))
|
|
|
+ .addGap(32))
|
|
|
);
|
|
|
gl_panel.setVerticalGroup(
|
|
|
gl_panel.createParallelGroup(Alignment.LEADING)
|
|
@@ -516,11 +532,10 @@ public class splitPane extends JSplitPane implements GraphListener {
|
|
|
setRightComponent(graphScrollPane);
|
|
|
|
|
|
graphPanel = new JPanel();
|
|
|
- graphScrollPane.setViewportView(graphPanel);
|
|
|
graphPanel.setLayout(new BoxLayout(graphPanel, BoxLayout.Y_AXIS));
|
|
|
-
|
|
|
- JPanel panel_1 = new JPanel();
|
|
|
- graphPanel.add(panel_1);
|
|
|
+ graphPanel.revalidate();
|
|
|
+ graphPanel.updateUI();
|
|
|
+ graphScrollPane.setViewportView(graphPanel);
|
|
|
repaintGraph();
|
|
|
}
|
|
|
@Override
|