Skip to content
Snippets Groups Projects
Commit 854deb5f authored by pompert's avatar pompert
Browse files

BugID: 791

Additions:
-TreeManager foundation for displaying BBS Steps in a tree format
Mods:
-Slightly modified Stations list in Strategy panel and inclusion of TreePanel OTB component with custom Tree Manager
parent 0071e5ae
No related branches found
No related tags found
No related merge requests found
...@@ -136,93 +136,105 @@ ...@@ -136,93 +136,105 @@
</Constraint> </Constraint>
</Constraints> </Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents> <SubComponents>
<Component class="javax.swing.JCheckBox" name="stationsUseAllCheckbox"> <Component class="javax.swing.JTextField" name="modifyStationText">
<Properties>
<Property name="text" type="java.lang.String" value="Use all stations"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="stationsUseAllCheckboxStateChanged"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="addStationButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Add16.gif"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Add the station entered to the list"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addStationButtonActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="deleteStationButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Remove the selected Station from the list"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
</Properties>
<Events> <Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteStationButtonActionPerformed"/> <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="modifyStationTextKeyReleased"/>
</Events> </Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/> <BorderConstraints direction="Center"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
<Component class="javax.swing.JTextField" name="modifyStationText"> <Container class="javax.swing.JPanel" name="stationsButtonPanel">
<Events>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="modifyStationTextKeyReleased"/>
</Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/> <BorderConstraints direction="South"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JButton" name="deleteStationButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Remove the selected Station from the list"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteStationButtonActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="addStationButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Add16.gif"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Add the station entered to the list"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 25]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addStationButtonActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="javax.swing.JCheckBox" name="stationsUseAllCheckbox">
<Properties>
<Property name="text" type="java.lang.String" value="Use all stations"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="stationsUseAllCheckboxStateChanged"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="North"/>
</Constraint>
</Constraints>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="stepsPanel"> <Container class="javax.swing.JPanel" name="stepsPanel">
...@@ -245,25 +257,6 @@ ...@@ -245,25 +257,6 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="stepsScrollPane">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTree" name="stepsTree">
<Properties>
<Property name="toolTipText" type="java.lang.String" value="The names of the steps that compose the strategy."/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="stepsModsPanel"> <Container class="javax.swing.JPanel" name="stepsModsPanel">
<Properties> <Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
...@@ -298,7 +291,7 @@ ...@@ -298,7 +291,7 @@
</Properties> </Properties>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
...@@ -423,6 +416,16 @@ ...@@ -423,6 +416,16 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="nl.astron.lofar.sas.otbcomponents.TreePanel" name="stepsTreePanel">
<Properties>
<Property name="title" type="java.lang.String" value="Strategy Step Tree"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="correlationPanel"> <Container class="javax.swing.JPanel" name="correlationPanel">
......
...@@ -32,8 +32,6 @@ import javax.swing.JList; ...@@ -32,8 +32,6 @@ import javax.swing.JList;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.lofarutils.LofarUtils;
import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.MainFrame;
...@@ -41,6 +39,8 @@ import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; ...@@ -41,6 +39,8 @@ import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode;
import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam; import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam;
import nl.astron.lofar.sas.otb.util.IViewPanel; import nl.astron.lofar.sas.otb.util.IViewPanel;
import nl.astron.lofar.sas.otb.util.UserAccount; import nl.astron.lofar.sas.otb.util.UserAccount;
import nl.astron.lofar.sas.otb.util.treenodes.TreeNode;
import nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement.BBSStepTreeManager;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
...@@ -114,6 +114,33 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -114,6 +114,33 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
this.retrieveAndDisplayChildDataForNode(aNode); this.retrieveAndDisplayChildDataForNode(aNode);
} }
} }
//Add steps that make up the strategy to the steps tree browser
Vector steps = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getItemList(itsNode.treeID(), itsNode.parentID(), 1);
// get all the params per child
Enumeration se = steps.elements();
while( se.hasMoreElements() ) {
aParam=null;
jOTDBnode aNode = (jOTDBnode)se.nextElement();
// We need to keep all the nodes needed by this panel
// if the node is a leaf we need to get the pointed to value via Param.
if (aNode.leaf) {
//we need to get all the childs from the following nodes as well.
}else if (LofarUtils.keyName(aNode.name).equals("Step")) {
//Add steps to tree
String[] rootNodeArgs = new String[3];
rootNodeArgs[0]= "Strategy Steps";
rootNodeArgs[1]=aNode.name;
rootNodeArgs[2]="";
TreeNode newStepRootNode = BBSStepTreeManager.getInstance(itsMainFrame.getUserAccount()).getRootNode(rootNodeArgs);
this.stepsTreePanel.newRootNode(newStepRootNode);
}
}
} catch (RemoteException ex) { } catch (RemoteException ex) {
logger.debug("Error during getComponentParam: "+ ex); logger.debug("Error during getComponentParam: "+ ex);
itsParamList=null; itsParamList=null;
...@@ -335,6 +362,10 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -335,6 +362,10 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
this.fillSelectionListFromString(correlationTypeList,aNode.limits,true); this.fillSelectionListFromString(correlationTypeList,aNode.limits,true);
} }
} }
} else if(parentName.equals("Step")){
//Detected Step node
} }
} }
...@@ -561,13 +592,12 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -561,13 +592,12 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
stationsScrollPane = new javax.swing.JScrollPane(); stationsScrollPane = new javax.swing.JScrollPane();
stationsList = new javax.swing.JList(); stationsList = new javax.swing.JList();
stationsModPanel = new javax.swing.JPanel(); stationsModPanel = new javax.swing.JPanel();
stationsUseAllCheckbox = new javax.swing.JCheckBox();
addStationButton = new javax.swing.JButton();
deleteStationButton = new javax.swing.JButton();
modifyStationText = new javax.swing.JTextField(); modifyStationText = new javax.swing.JTextField();
stationsButtonPanel = new javax.swing.JPanel();
deleteStationButton = new javax.swing.JButton();
addStationButton = new javax.swing.JButton();
stationsUseAllCheckbox = new javax.swing.JCheckBox();
stepsPanel = new javax.swing.JPanel(); stepsPanel = new javax.swing.JPanel();
stepsScrollPane = new javax.swing.JScrollPane();
stepsTree = new javax.swing.JTree();
stepsModsPanel = new javax.swing.JPanel(); stepsModsPanel = new javax.swing.JPanel();
addStepButton = new javax.swing.JButton(); addStepButton = new javax.swing.JButton();
removeStepButton = new javax.swing.JButton(); removeStepButton = new javax.swing.JButton();
...@@ -576,6 +606,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -576,6 +606,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
stepsMoveUpDownPanel = new javax.swing.JPanel(); stepsMoveUpDownPanel = new javax.swing.JPanel();
moveStepUpButton = new javax.swing.JButton(); moveStepUpButton = new javax.swing.JButton();
moveStepDownButton = new javax.swing.JButton(); moveStepDownButton = new javax.swing.JButton();
stepsTreePanel = new nl.astron.lofar.sas.otbcomponents.TreePanel();
correlationPanel = new javax.swing.JPanel(); correlationPanel = new javax.swing.JPanel();
correlationSelectionLabel = new javax.swing.JLabel(); correlationSelectionLabel = new javax.swing.JLabel();
correlationSelectionBox = new javax.swing.JComboBox(); correlationSelectionBox = new javax.swing.JComboBox();
...@@ -648,43 +679,17 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -648,43 +679,17 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
stationsPanel.add(stationsScrollPane, java.awt.BorderLayout.CENTER); stationsPanel.add(stationsScrollPane, java.awt.BorderLayout.CENTER);
stationsModPanel.setLayout(new java.awt.GridBagLayout()); stationsModPanel.setLayout(new java.awt.BorderLayout());
stationsUseAllCheckbox.setText("Use all stations"); modifyStationText.addKeyListener(new java.awt.event.KeyAdapter() {
stationsUseAllCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); public void keyReleased(java.awt.event.KeyEvent evt) {
stationsUseAllCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); modifyStationTextKeyReleased(evt);
stationsUseAllCheckbox.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
stationsUseAllCheckboxStateChanged(evt);
} }
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); stationsModPanel.add(modifyStationText, java.awt.BorderLayout.CENTER);
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
stationsModPanel.add(stationsUseAllCheckbox, gridBagConstraints);
addStationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Add16.gif"))); stationsButtonPanel.setLayout(new java.awt.GridBagLayout());
addStationButton.setToolTipText("Add the station entered to the list");
addStationButton.setEnabled(false);
addStationButton.setMaximumSize(new java.awt.Dimension(30, 25));
addStationButton.setMinimumSize(new java.awt.Dimension(30, 25));
addStationButton.setPreferredSize(new java.awt.Dimension(30, 25));
addStationButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addStationButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
stationsModPanel.add(addStationButton, gridBagConstraints);
deleteStationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif"))); deleteStationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif")));
deleteStationButton.setToolTipText("Remove the selected Station from the list"); deleteStationButton.setToolTipText("Remove the selected Station from the list");
...@@ -699,28 +704,47 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -699,28 +704,47 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1; gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
stationsModPanel.add(deleteStationButton, gridBagConstraints); stationsButtonPanel.add(deleteStationButton, gridBagConstraints);
modifyStationText.addKeyListener(new java.awt.event.KeyAdapter() { addStationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Add16.gif")));
public void keyReleased(java.awt.event.KeyEvent evt) { addStationButton.setToolTipText("Add the station entered to the list");
modifyStationTextKeyReleased(evt); addStationButton.setEnabled(false);
addStationButton.setMaximumSize(new java.awt.Dimension(30, 25));
addStationButton.setMinimumSize(new java.awt.Dimension(30, 25));
addStationButton.setPreferredSize(new java.awt.Dimension(30, 25));
addStationButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addStationButtonActionPerformed(evt);
} }
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0; gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
stationsModPanel.add(modifyStationText, gridBagConstraints); stationsButtonPanel.add(addStationButton, gridBagConstraints);
stationsModPanel.add(stationsButtonPanel, java.awt.BorderLayout.SOUTH);
stationsPanel.add(stationsModPanel, java.awt.BorderLayout.SOUTH); stationsPanel.add(stationsModPanel, java.awt.BorderLayout.SOUTH);
stationsUseAllCheckbox.setText("Use all stations");
stationsUseAllCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
stationsUseAllCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
stationsUseAllCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0));
stationsUseAllCheckbox.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
stationsUseAllCheckboxStateChanged(evt);
}
});
stationsPanel.add(stationsUseAllCheckbox, java.awt.BorderLayout.NORTH);
strategyPanel.add(stationsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 220, 330)); strategyPanel.add(stationsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, 220, 330));
stepsPanel.setLayout(new java.awt.BorderLayout()); stepsPanel.setLayout(new java.awt.BorderLayout());
...@@ -728,11 +752,6 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -728,11 +752,6 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
stepsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Steps")); stepsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Steps"));
stepsPanel.setToolTipText("The names of the steps that compose the strategy."); stepsPanel.setToolTipText("The names of the steps that compose the strategy.");
stepsPanel.setPreferredSize(new java.awt.Dimension(100, 100)); stepsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
stepsTree.setToolTipText("The names of the steps that compose the strategy.");
stepsScrollPane.setViewportView(stepsTree);
stepsPanel.add(stepsScrollPane, java.awt.BorderLayout.CENTER);
stepsModsPanel.setLayout(new java.awt.GridBagLayout()); stepsModsPanel.setLayout(new java.awt.GridBagLayout());
stepsModsPanel.setMinimumSize(new java.awt.Dimension(100, 30)); stepsModsPanel.setMinimumSize(new java.awt.Dimension(100, 30));
...@@ -741,7 +760,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -741,7 +760,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
addStepButton.setMaximumSize(new java.awt.Dimension(30, 25)); addStepButton.setMaximumSize(new java.awt.Dimension(30, 25));
addStepButton.setMinimumSize(new java.awt.Dimension(30, 25)); addStepButton.setMinimumSize(new java.awt.Dimension(30, 25));
addStepButton.setPreferredSize(new java.awt.Dimension(30, 25)); addStepButton.setPreferredSize(new java.awt.Dimension(30, 25));
stepsModsPanel.add(addStepButton, new java.awt.GridBagConstraints()); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
stepsModsPanel.add(addStepButton, gridBagConstraints);
removeStepButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif"))); removeStepButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif")));
removeStepButton.setMaximumSize(new java.awt.Dimension(30, 25)); removeStepButton.setMaximumSize(new java.awt.Dimension(30, 25));
...@@ -802,6 +823,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -802,6 +823,9 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
stepsPanel.add(stepsMoveUpDownPanel, java.awt.BorderLayout.EAST); stepsPanel.add(stepsMoveUpDownPanel, java.awt.BorderLayout.EAST);
stepsTreePanel.setTitle("Strategy Step Tree");
stepsPanel.add(stepsTreePanel, java.awt.BorderLayout.CENTER);
strategyPanel.add(stepsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 150, 400, 330)); strategyPanel.add(stepsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 150, 400, 330));
correlationPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); correlationPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
...@@ -880,7 +904,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -880,7 +904,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
add(strategyScrollPane, java.awt.BorderLayout.CENTER); add(strategyScrollPane, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void modifyStationTextKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_modifyStationTextKeyReleased private void modifyStationTextKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_modifyStationTextKeyReleased
String toBeAddedStation = modifyStationText.getText(); String toBeAddedStation = modifyStationText.getText();
if(!toBeAddedStation.equals("")){ if(!toBeAddedStation.equals("")){
...@@ -889,7 +913,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -889,7 +913,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
this.addStationButton.setEnabled(false); this.addStationButton.setEnabled(false);
} }
}//GEN-LAST:event_modifyStationTextKeyReleased }//GEN-LAST:event_modifyStationTextKeyReleased
private void stationsListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_stationsListValueChanged private void stationsListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_stationsListValueChanged
int[] selectedIndices = ((JList)evt.getSource()).getSelectedIndices(); int[] selectedIndices = ((JList)evt.getSource()).getSelectedIndices();
if(selectedIndices.length>0){ if(selectedIndices.length>0){
...@@ -898,7 +922,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -898,7 +922,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
this.deleteStationButton.setEnabled(false); this.deleteStationButton.setEnabled(false);
} }
}//GEN-LAST:event_stationsListValueChanged }//GEN-LAST:event_stationsListValueChanged
private void deleteStationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteStationButtonActionPerformed private void deleteStationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteStationButtonActionPerformed
DefaultListModel theStationModel = (DefaultListModel)stationsList.getModel(); DefaultListModel theStationModel = (DefaultListModel)stationsList.getModel();
int[] selectedIndices = stationsList.getSelectedIndices(); int[] selectedIndices = stationsList.getSelectedIndices();
...@@ -910,7 +934,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -910,7 +934,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
this.deleteStationButton.setEnabled(false); this.deleteStationButton.setEnabled(false);
} }
}//GEN-LAST:event_deleteStationButtonActionPerformed }//GEN-LAST:event_deleteStationButtonActionPerformed
private void addStationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStationButtonActionPerformed private void addStationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStationButtonActionPerformed
String toBeAddedStation = this.modifyStationText.getText(); String toBeAddedStation = this.modifyStationText.getText();
if(!toBeAddedStation.equals("")){ if(!toBeAddedStation.equals("")){
...@@ -985,6 +1009,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -985,6 +1009,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
private javax.swing.JButton moveStepDownButton; private javax.swing.JButton moveStepDownButton;
private javax.swing.JButton moveStepUpButton; private javax.swing.JButton moveStepUpButton;
private javax.swing.JButton removeStepButton; private javax.swing.JButton removeStepButton;
private javax.swing.JPanel stationsButtonPanel;
private javax.swing.JList stationsList; private javax.swing.JList stationsList;
private javax.swing.JPanel stationsModPanel; private javax.swing.JPanel stationsModPanel;
private javax.swing.JPanel stationsPanel; private javax.swing.JPanel stationsPanel;
...@@ -993,8 +1018,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{ ...@@ -993,8 +1018,7 @@ public class BBSStrategyPanel extends javax.swing.JPanel implements IViewPanel{
private javax.swing.JPanel stepsModsPanel; private javax.swing.JPanel stepsModsPanel;
private javax.swing.JPanel stepsMoveUpDownPanel; private javax.swing.JPanel stepsMoveUpDownPanel;
private javax.swing.JPanel stepsPanel; private javax.swing.JPanel stepsPanel;
private javax.swing.JScrollPane stepsScrollPane; private nl.astron.lofar.sas.otbcomponents.TreePanel stepsTreePanel;
private javax.swing.JTree stepsTree;
private javax.swing.JPanel strategyPanel; private javax.swing.JPanel strategyPanel;
private javax.swing.JButton strategyRevertButton; private javax.swing.JButton strategyRevertButton;
private javax.swing.JScrollPane strategyScrollPane; private javax.swing.JScrollPane strategyScrollPane;
......
//# BBSStepNode.java: Structure containing a tree node.
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
//#
//# This program is free software; you can redistribute it and/or modify
//# it under the terms of the GNU General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or
//# (at your option) any later version.
//#
//# This program is distributed in the hope that it will be useful,
//# but WITHOUT ANY WARRANTY; without even the implied warranty of
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//# GNU General Public License for more details.
//#
//# You should have received a copy of the GNU General Public License
//# along with this program; if not, write to the Free Software
//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//#
package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement;
public class BBSStepNode implements java.io.Serializable {
// private members
private String name;
private boolean leaf;
private boolean rootNode;
private String itsNodeID;
private String itsParentID;
public BBSStepNode(String nodeID, String parentID) {
leaf = false;
itsNodeID = nodeID;
itsParentID = parentID;
rootNode = false;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isLeaf() {
return leaf;
}
public void setLeaf(boolean leaf) {
this.leaf = leaf;
}
public boolean isRootNode() {
return rootNode;
}
public void setRootNode(boolean isRootNode) {
this.rootNode = isRootNode;
}
public String getNodeID() {
return (itsNodeID);
}
public void setNodeID(String nodeId) {
itsNodeID = nodeId;
}
public String getParentID() {
return (itsParentID);
}
public void setParentID(String parentID) {
itsParentID = parentID;
}
}
/*
* BBSStepTreeManager.java
*
* Copyright (C) 2002-2007
* ASTRON (Netherlands Foundation for Research in Astronomy)
* P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement;
import java.util.Enumeration;
import java.util.Vector;
import nl.astron.lofar.sas.otb.util.UserAccount;
import nl.astron.lofar.sas.otb.util.treemanagers.GenericTreeManager;
import nl.astron.lofar.sas.otb.util.treemanagers.ITreeManager;
import nl.astron.lofar.sas.otb.util.treenodes.TreeNode;
import org.apache.log4j.Logger;
/**
* Base BBSStepTreeManager Class
*
* @author pompert
* @version $Id$
* @created 25-7-2006, 13:56
* @updated
*/
public class BBSStepTreeManager extends GenericTreeManager implements ITreeManager{
// Create a Log4J logger instance
private static Logger logger = Logger.getLogger(BBSStepTreeManager.class);
private static BBSStepTreeManager instance;
private static String BBSSTEP_TREENODE_SEPARATOR_CHAR = ".";
/**
* default constructor, protected by a singleton pattern
*/
private BBSStepTreeManager(UserAccount anAccount) {
super(anAccount);
}
public static BBSStepTreeManager getInstance(UserAccount anAccount){
if(instance==null){
instance = new BBSStepTreeManager(anAccount);
}
return instance;
}
public String getNameForNode(TreeNode aNode){
String name = ((BBSStepNode)aNode.getUserObject()).getName();
return name;
}
public boolean isNodeLeaf(TreeNode aNode){
boolean leaf = false;
if (aNode.getUserObject() != null) {
leaf = ((BBSStepNode)aNode.getUserObject()).isLeaf();
}
return leaf;
}
public void defineChildsForNode(TreeNode aNode) {
/*
logger.trace("Entry - TreeManager BBSStepNode-defineChildNodes("+aNode.getName()+" ("+((BBSStepNode)aNode.getUserObject()).getNodeID()+"))");
try {
// You must set the flag before defining children if you
// use "add" for the new children. Otherwise you get an infinite
// recursive loop, since add results in a call to getChildCount.
// However, you could use "insert" in such a case.
aNode.areChildrenDefined = true;
Vector childs = null;
BBSStepNode containedNode = (BBSStepNode)aNode.getUserObject();
if(((BBSStepNode)aNode.getUserObject()).isRootNode()){
//childs = SharedVars.getJParmFacade().getNames(""+containedNode.getNodeID().substring(containedNode.getParmDBIdentifier().length())+"*");
}else{
//childs = SharedVars.getJParmFacade().getNames("*"+containedNode.getNodeID().substring(containedNode.getParmDBIdentifier().length()+1)+this.PARMDB_TREENODE_SEPARATOR_CHAR+"*");
}
Vector<String> uniqueNames = new Vector<String>();
Enumeration e = childs.elements();
while( e.hasMoreElements() ) {
String aValue = (String)e.nextElement();
BBSStepNode item = new BBSStepNode(containedNode.getNodeID()+this.BBSSTEP_TREENODE_SEPARATOR_CHAR+childName,((BBSStepNode)aNode.getUserObject()).getNodeID());
//item.leaf=true;
item.setName(childName);
logger.trace("Node name selected : "+item.getName());
((jParmDBnode)aNode.getUserObject()).setLeaf(false);
TreeNode newNode = new TreeNode(this.instance,item,item.getNodeID());
aNode.add(newNode);
TreeModelEvent evt = new TreeModelEvent(newNode,newNode.getPath());
fireTreeInsertionPerformed(evt);
}
if(uniqueNames.size() == 0){
((BBSStepNode)aNode.getUserObject()).setLeaf(true);
}
} catch(Exception e) {
logger.fatal("Exception during TreeManager BBSStepNode-defineChildNodes: " + e);
}
logger.trace("Exit - TreeManager defineChildNodes("+toString()+")");
*/
}
public TreeNode getRootNode(Object arguments){
String[] argumentArray = (String[])arguments;
BBSStepNode newPNode = new BBSStepNode(argumentArray[0],argumentArray[1]);
if(argumentArray.length==3){
if(!argumentArray[2].equals("")){
newPNode.setRootNode(true);
}
}
newPNode.setName(argumentArray[0]);
TreeNode bbsNode = new TreeNode(this.instance,newPNode,newPNode.getName());
return bbsNode;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment