|
@@ -34,12 +34,13 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
private DefaultListModel listModel = new DefaultListModel();
|
|
private DefaultListModel listModel = new DefaultListModel();
|
|
private Model model;
|
|
private Model model;
|
|
private Control controller;
|
|
private Control controller;
|
|
- private StatisticGraph statGraph1;
|
|
|
|
- //private JPanel statGraph1;
|
|
|
|
- private StatisticGraph statGraph2;
|
|
|
|
- //private JPanel statGraph2;
|
|
|
|
|
|
+ //private StatisticGraph statGraph1;
|
|
|
|
+ private JPanel statGraph1;
|
|
|
|
+ //private StatisticGraph statGraph2;
|
|
|
|
+ private JPanel statGraph2;
|
|
private HashMap<String, HolonObject> objectHashMap = new HashMap<String, HolonObject>();
|
|
private HashMap<String, HolonObject> objectHashMap = new HashMap<String, HolonObject>();
|
|
private JLabel nameThreshHolder;
|
|
private JLabel nameThreshHolder;
|
|
|
|
+ private GroupLayout groupLayout;
|
|
|
|
|
|
|
|
|
|
public StatisticPane(Model m, Control c){
|
|
public StatisticPane(Model m, Control c){
|
|
@@ -71,8 +72,8 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
JCheckBox checkBox_1 = new JCheckBox("total production");
|
|
JCheckBox checkBox_1 = new JCheckBox("total production");
|
|
checkBox_1.setForeground(Color.BLUE);
|
|
checkBox_1.setForeground(Color.BLUE);
|
|
|
|
|
|
- statGraph1 = new StatisticGraph(model, controller);
|
|
|
|
- //statGraph1 = new JPanel();
|
|
|
|
|
|
+ //statGraph1 = new StatisticGraph(model, controller);
|
|
|
|
+ statGraph1 = new JPanel();
|
|
|
|
|
|
JButton btnRefresh = new JButton("Refresh Tracked Objects");
|
|
JButton btnRefresh = new JButton("Refresh Tracked Objects");
|
|
btnRefresh.addActionListener(new ActionListener() {
|
|
btnRefresh.addActionListener(new ActionListener() {
|
|
@@ -81,8 +82,8 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- statGraph2 = new StatisticGraph(model, controller);
|
|
|
|
- //statGraph2 = new JPanel();
|
|
|
|
|
|
+ //statGraph2 = new StatisticGraph(model, controller);
|
|
|
|
+ statGraph2 = new JPanel();
|
|
|
|
|
|
JButton btnUntrack = new JButton("Untrack");
|
|
JButton btnUntrack = new JButton("Untrack");
|
|
btnUntrack.addActionListener(new ActionListener() {
|
|
btnUntrack.addActionListener(new ActionListener() {
|
|
@@ -92,7 +93,15 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
nameThreshHolder.setText("...");
|
|
nameThreshHolder.setText("...");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- GroupLayout groupLayout = new GroupLayout(this);
|
|
|
|
|
|
+
|
|
|
|
+ JButton btnAddGraph = new JButton("add Graph");
|
|
|
|
+ btnAddGraph.addActionListener(new ActionListener() {
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
+ JPanel tmp = new JPanel();
|
|
|
|
+ //groupLayout.
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ groupLayout = new GroupLayout(this);
|
|
groupLayout.setHorizontalGroup(
|
|
groupLayout.setHorizontalGroup(
|
|
groupLayout.createParallelGroup(Alignment.LEADING)
|
|
groupLayout.createParallelGroup(Alignment.LEADING)
|
|
.addGroup(groupLayout.createSequentialGroup()
|
|
.addGroup(groupLayout.createSequentialGroup()
|
|
@@ -120,8 +129,11 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
.addComponent(chckbxNewCheckBox_1)
|
|
.addComponent(chckbxNewCheckBox_1)
|
|
.addComponent(chckbxNewCheckBox)))
|
|
.addComponent(chckbxNewCheckBox)))
|
|
.addComponent(lblObject, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(lblObject, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)
|
|
- .addComponent(btnUntrack))
|
|
|
|
- .addGap(147)
|
|
|
|
|
|
+ .addGroup(groupLayout.createSequentialGroup()
|
|
|
|
+ .addComponent(btnUntrack)
|
|
|
|
+ .addGap(18)
|
|
|
|
+ .addComponent(btnAddGraph)))
|
|
|
|
+ .addGap(125)
|
|
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
|
|
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
|
|
.addComponent(statGraph2, GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
|
|
.addComponent(statGraph2, GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
|
|
.addComponent(statGraph1, GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)))
|
|
.addComponent(statGraph1, GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)))
|
|
@@ -154,14 +166,16 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
.addPreferredGap(ComponentPlacement.RELATED)
|
|
.addPreferredGap(ComponentPlacement.RELATED)
|
|
.addComponent(checkBox_1)
|
|
.addComponent(checkBox_1)
|
|
.addPreferredGap(ComponentPlacement.UNRELATED)
|
|
.addPreferredGap(ComponentPlacement.UNRELATED)
|
|
- .addComponent(btnUntrack)
|
|
|
|
|
|
+ .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
|
|
|
|
+ .addComponent(btnUntrack)
|
|
|
|
+ .addComponent(btnAddGraph))
|
|
.addGap(30)
|
|
.addGap(30)
|
|
.addComponent(btnRefresh)
|
|
.addComponent(btnRefresh)
|
|
.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(listScrollPane, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(listScrollPane, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(ComponentPlacement.RELATED))
|
|
.addPreferredGap(ComponentPlacement.RELATED))
|
|
.addComponent(statGraph2, GroupLayout.PREFERRED_SIZE, 122, GroupLayout.PREFERRED_SIZE))
|
|
.addComponent(statGraph2, GroupLayout.PREFERRED_SIZE, 122, GroupLayout.PREFERRED_SIZE))
|
|
- .addContainerGap(212, GroupLayout.PREFERRED_SIZE))
|
|
|
|
|
|
+ .addContainerGap(89, GroupLayout.PREFERRED_SIZE))
|
|
);
|
|
);
|
|
setLayout(groupLayout);
|
|
setLayout(groupLayout);
|
|
|
|
|
|
@@ -187,7 +201,7 @@ public class StatisticPane extends JPanel implements GraphListener{
|
|
listModel.addElement(name);
|
|
listModel.addElement(name);
|
|
objectHashMap.put(name, controller.getTrackingObj().get(i));
|
|
objectHashMap.put(name, controller.getTrackingObj().get(i));
|
|
if(i < 8){
|
|
if(i < 8){
|
|
- statGraph1.addObject(controller.getTrackingObj().get(i));
|
|
|
|
|
|
+ //statGraph1.addObject(controller.getTrackingObj().get(i));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|