diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form index 86453b1adf7c74bae9d8f06bdeff3ab4213deb12..e2f6cea41a9fb3f71650fc4f1957b34b7fd47cf9 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.form @@ -9,65 +9,62 @@ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-113,0,0,3,-57"/> </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" min="-2" pref="967" max="-2" attributes="0"/> + <Component id="tablePanel1" min="-2" pref="967" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <Component id="tablePanel1" min="-2" pref="519" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> <Property name="horizontalAlignment" type="int" value="0"/> <Property name="text" type="java.lang.String" value="Untitled"/> </Properties> - <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> <Component class="nl.astron.lofar.sas.otbcomponents.TablePanel" name="tablePanel1"> - <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> <Container class="javax.swing.JPanel" name="jPanel1"> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> - <BorderConstraints direction="South"/> - </Constraint> - </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> + <EmptySpace min="14" pref="14" max="14" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="14" pref="14" max="14" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="LogParamStartTimeLabel" min="-2" max="-2" attributes="0"/> - <Component id="LogParamNameLabel" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="logParamCancelButton" min="-2" max="-2" attributes="0"/> - </Group> + <Component id="logParamCancelButton" min="-2" max="-2" attributes="0"/> + <Component id="LogParamStartTimeLabel" min="-2" max="-2" attributes="0"/> + <Component id="LogParamNameLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="LogParamStartTimeText" min="-2" max="-2" attributes="1"/> - <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> - <Component id="LogParamEndTimeLabel" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="LogParamEndTimeText" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> - <Component id="LogParamRecentOnlyCheckbox" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="LogParamStartTimeText" min="-2" max="-2" attributes="1"/> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Component id="LogParamEndTimeLabel" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="LogParamEndTimeText" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> + <Component id="LogParamRecentOnlyCheckbox" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="LogParamNameText" alignment="0" max="32767" attributes="1"/> </Group> - <Component id="logParamApplyButton" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="LogParamNameText" alignment="0" max="32767" attributes="1"/> + <Component id="logParamApplyButton" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="277" max="32767" attributes="0"/> + <EmptySpace pref="406" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java index 3a422b02d4d2a16772ef94d9068a46346821e89d..5d02ecd36c1893311fa42dc7ddc11332e11effdf 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/LogParamPanel.java @@ -9,18 +9,20 @@ package nl.astron.lofar.sas.otbcomponents; import javax.swing.ListSelectionModel; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; +import nl.astron.lofar.sas.otb.util.IViewPanel; import nl.astron.lofar.sas.otb.util.LogParamTableModel; import nl.astron.lofar.sas.otb.util.OtdbRmi; +import nl.astron.lofar.sas.otb.util.UserAccount; import org.apache.log4j.Logger; /** * * @author coolen */ -public class LogParamPanel extends javax.swing.JPanel { +public class LogParamPanel extends javax.swing.JPanel implements IViewPanel { static Logger logger = Logger.getLogger(LogParamPanel.class); - static String name="LogParamPanel"; + static String name="Log"; /** Creates new form BeanForm based upon aNode @@ -35,7 +37,7 @@ public class LogParamPanel extends javax.swing.JPanel { itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi(); initializeTabs(); - initPanel(aNode); + initPanel(); } /** Creates new form BeanForm */ @@ -59,26 +61,104 @@ public class LogParamPanel extends javax.swing.JPanel { } } - public void setNode(jOTDBnode aNode) { - initPanel(aNode); + public String getShortName() { + return name; } - - private void initPanel(jOTDBnode aNode) { + + public void setContent(Object anObject) { + itsNode=(jOTDBnode)anObject; + initPanel(); + } + + private void initPanel() { + // check access + UserAccount userAccount = itsMainFrame.getUserAccount(); + if(userAccount.isAdministrator()) { + // enable/disable certain controls + } + if(userAccount.isAstronomer()) { + // enable/disable certain controls + } + if(userAccount.isInstrumentScientist()) { + // enable/disable certain controls + } + tablePanel1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - itsNode = aNode; LogParamTableModel model = new LogParamTableModel(); tablePanel1.setTableModel(model); - if (aNode == null ) { + if (itsNode == null ) { logger.debug("ERROR: empty node supplied"); LogParamNameText.setText(""); } else { - LogParamNameText.setText(aNode.name); + LogParamNameText.setText(itsNode.name); } } - + /** Sets the buttons visible/invisible + * + * @param visible true/false visible/invisible + */ + public void setButtonsVisible(boolean visible) { + this.logParamApplyButton.setVisible(visible); + this.logParamCancelButton.setVisible(visible); + } + + /** Enables/disables the buttons + * + * @param enabled true/false enabled/disabled + */ + public void enableButtons(boolean enabled) { + this.logParamApplyButton.setEnabled(enabled); + this.logParamCancelButton.setEnabled(enabled); + } + + + /** Enables/disables the complete form + * + * @param enabled true/false enabled/disabled + */ + public void setAllEnabled(boolean enabled) { + enableParamName(enabled); + enableStartTime(enabled); + enableEndTime(enabled); + enableRecentOnly(enabled); + enableButtons(enabled); + } + + /** Enables/disables this inputfield + * + * @param enabled true/false enabled/disabled + */ + public void enableParamName(boolean enabled) { + this.LogParamNameText.setEnabled(enabled); + } + + /** Enables/disables this inputfield + * + * @param enabled true/false enabled/disabled + */ + public void enableStartTime(boolean enabled) { + this.LogParamStartTimeText.setEnabled(enabled); + } + + /** Enables/disables this inputfield + * + * @param enabled true/false enabled/disabled + */ + public void enableEndTime(boolean enabled) { + this.LogParamEndTimeText.setEnabled(enabled); + } + + /** Enables/disables this inputfield + * + * @param enabled true/false enabled/disabled + */ + public void enableRecentOnly(boolean enabled) { + this.LogParamRecentOnlyCheckbox.setEnabled(enabled); + } + + - /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -99,13 +179,8 @@ public class LogParamPanel extends javax.swing.JPanel { LogParamNameText = new javax.swing.JTextField(); LogParamRecentOnlyCheckbox = new javax.swing.JCheckBox(); - setLayout(new java.awt.BorderLayout()); - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Untitled"); - add(jLabel1, java.awt.BorderLayout.NORTH); - - add(tablePanel1, java.awt.BorderLayout.CENTER); LogParamNameLabel.setText("Name"); @@ -146,28 +221,25 @@ public class LogParamPanel extends javax.swing.JPanel { jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() + .add(14, 14, 14) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel1Layout.createSequentialGroup() - .add(14, 14, 14) - .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(LogParamStartTimeLabel) - .add(LogParamNameLabel))) - .add(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .add(logParamCancelButton))) + .add(logParamCancelButton) + .add(LogParamStartTimeLabel) + .add(LogParamNameLabel)) .add(10, 10, 10) - .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(jPanel1Layout.createSequentialGroup() - .add(LogParamStartTimeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(40, 40, 40) - .add(LogParamEndTimeLabel) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(LogParamEndTimeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(13, 13, 13) - .add(LogParamRecentOnlyCheckbox)) - .add(logParamApplyButton) - .add(LogParamNameText)) - .addContainerGap(277, Short.MAX_VALUE)) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(jPanel1Layout.createSequentialGroup() + .add(LogParamStartTimeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(40, 40, 40) + .add(LogParamEndTimeLabel) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(LogParamEndTimeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(13, 13, 13) + .add(LogParamRecentOnlyCheckbox)) + .add(LogParamNameText)) + .add(logParamApplyButton)) + .addContainerGap(406, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -189,8 +261,22 @@ public class LogParamPanel extends javax.swing.JPanel { .add(logParamApplyButton)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - add(jPanel1, java.awt.BorderLayout.SOUTH); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 967, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(tablePanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 967, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(jLabel1) + .add(tablePanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 519, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + ); }// </editor-fold>//GEN-END:initComponents private void logParamApplyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logParamApplyButtonActionPerformed diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.form index 1a532dc5066ced24435c74ad52bed1f85d329dc7..4ecfebce2e874c8b9f3977e9192f7c049e0b9fa3 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.form @@ -1,57 +1,110 @@ <?xml version="1.0" encoding="UTF-8" ?> -<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-113,0,0,2,115"/> </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="false"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="70" pref="70" max="70" attributes="0"/> + <Component id="jLabel1" min="-2" pref="460" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="40" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="NodeIndexLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="NodeNameLabel" alignment="0" min="-2" pref="80" max="-2" attributes="0"/> + <Component id="NodeInstancesLabel" min="-2" max="-2" attributes="0"/> + <Component id="NodeLimitsLabel" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="NodeLimitsText" min="-2" max="-2" attributes="0"/> + <Component id="NodeInstancesText" min="-2" max="-2" attributes="0"/> + <Component id="NodeIndexText" min="-2" max="-2" attributes="0"/> + <Component id="NodeNameText" alignment="0" min="-2" pref="430" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="NodeDescriptionText" alignment="0" min="-2" pref="540" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="NodeCancelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="NodeApplyButton" min="-2" pref="70" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="390" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> + <Component id="jLabel1" min="-2" pref="20" max="-2" attributes="0"/> + <EmptySpace min="20" pref="20" max="20" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeNameLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeNameText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeIndexLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeIndexText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeInstancesLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeInstancesText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeLimitsLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeLimitsText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Component id="NodeDescriptionText" min="-2" pref="100" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeApplyButton" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="NodeNameLabel"> <Properties> <Property name="text" type="java.lang.String" value="Name :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="50" width="80" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="NodeIndexLabel"> <Properties> <Property name="text" type="java.lang.String" value="Index :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="70" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="NodeInstancesLabel"> <Properties> <Property name="text" type="java.lang.String" value="Instances :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="100" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="NodeLimitsLabel"> <Properties> <Property name="text" type="java.lang.String" value="Limits :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="120" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="NodeIndexText"> <Properties> @@ -66,11 +119,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="70" width="200" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="NodeInstancesText"> <Properties> @@ -86,11 +134,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="100" width="200" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="NodeLimitsText"> <Properties> @@ -106,11 +149,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="120" width="200" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="NodeNameText"> <Properties> @@ -126,11 +164,6 @@ <Dimension value="[440, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="50" width="430" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="NodeCancelButton"> <Properties> @@ -139,11 +172,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="NodeCancelButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="280" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="NodeApplyButton"> <Properties> @@ -152,11 +180,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="NodeApplyButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="110" y="280" width="70" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextArea" name="NodeDescriptionText"> <Properties> @@ -172,22 +195,12 @@ </Property> <Property name="enabled" type="boolean" value="false"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="150" width="540" height="100"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> <Property name="horizontalAlignment" type="int" value="0"/> <Property name="text" type="java.lang.String" value="Node View Panel"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="70" y="10" width="460" height="20"/> - </Constraint> - </Constraints> </Component> </SubComponents> </Form> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.java index e9f0b928770ab8c7c42dcf7b878bf35cdb6f92f4..ae4416be6677c05f76b191f6e9e686717147303e 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/NodeViewPanel.java @@ -9,17 +9,19 @@ package nl.astron.lofar.sas.otbcomponents; import java.rmi.RemoteException; import nl.astron.lofar.sas.otb.MainFrame; import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; -import nl.astron.lofar.sas.otb.panels.MainPanel; +import nl.astron.lofar.sas.otb.util.IViewPanel; import nl.astron.lofar.sas.otb.util.OtdbRmi; +import nl.astron.lofar.sas.otb.util.UserAccount; import org.apache.log4j.Logger; /** * * @author coolen */ -public class NodeViewPanel extends javax.swing.JPanel { +public class NodeViewPanel extends javax.swing.JPanel implements IViewPanel{ static Logger logger = Logger.getLogger(NodeViewPanel.class); + static String name = "Node"; /** Creates new form BeanForm based upon aNode @@ -30,9 +32,9 @@ public class NodeViewPanel extends javax.swing.JPanel { public NodeViewPanel(MainFrame aMainFrame,jOTDBnode aNode) { initComponents(); itsMainFrame = aMainFrame; - itsNode = aNode; + itsNode=aNode; itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi(); - initPanel(aNode); + initPanel(); } /** Creates new form BeanForm */ @@ -49,25 +51,49 @@ public class NodeViewPanel extends javax.swing.JPanel { } } - public void setNode(jOTDBnode aNode) { - initPanel(aNode); + public String getShortName() { + return name; + } + + public void setContent(Object anObject) { + itsNode=(jOTDBnode)anObject; + initPanel(); } - private void initPanel(jOTDBnode aNode) { - itsNode = aNode; - if (aNode != null) { - setNodeName(aNode.name); - setIndex(String.valueOf(aNode.index)); - setInstances(String.valueOf(aNode.instances)); - setLimits(String.valueOf(aNode.limits)); - setDescription(aNode.description); + private void initPanel() { + // check access + UserAccount userAccount = itsMainFrame.getUserAccount(); + + // for now: + enableInstances(true); + enableLimits(true); + enableDescription(true); + + if(userAccount.isAdministrator()) { + // enable/disable certain controls + } + if(userAccount.isAstronomer()) { + // enable/disable certain controls + } + if(userAccount.isInstrumentScientist()) { + // enable/disable certain controls + } + + + + if (itsNode != null) { + setNodeName(itsNode.name); + setIndex(String.valueOf(itsNode.index)); + setInstances(String.valueOf(itsNode.instances)); + setLimits(String.valueOf(itsNode.limits)); + setDescription(itsNode.description); } else { logger.debug("ERROR: no node given"); } } /** Returns the Given Name for this Node */ - public String getNodeName() { + private String getNodeName() { return this.NodeNameText.getText(); } @@ -76,7 +102,7 @@ public class NodeViewPanel extends javax.swing.JPanel { } /** Returns the Given Index for this Node */ - public String getIndex() { + private String getIndex() { return this.NodeIndexText.getText(); } @@ -85,7 +111,7 @@ public class NodeViewPanel extends javax.swing.JPanel { } /** Returns the Given Instances for this Node */ - public String getInstances() { + private String getInstances() { return this.NodeInstancesText.getText(); } @@ -94,7 +120,7 @@ public class NodeViewPanel extends javax.swing.JPanel { } /** Returns the Given Limits for this Node */ - public String getLimits() { + private String getLimits() { return this.NodeLimitsText.getText(); } @@ -103,7 +129,7 @@ public class NodeViewPanel extends javax.swing.JPanel { } /** Returns the Given Description for this Node */ - public String getDescription() { + private String getDescription() { return this.NodeDescriptionText.getText(); } @@ -111,43 +137,23 @@ public class NodeViewPanel extends javax.swing.JPanel { this.NodeDescriptionText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableNodeName(boolean enabled) { + private void enableNodeName(boolean enabled) { this.NodeNameText.setEnabled(enabled); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableIndex(boolean enabled) { + private void enableIndex(boolean enabled) { this.NodeIndexText.setEnabled(enabled); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableInstances(boolean enabled) { + private void enableInstances(boolean enabled) { this.NodeInstancesText.setEnabled(enabled); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableLimits(boolean enabled) { + private void enableLimits(boolean enabled) { this.NodeLimitsText.setEnabled(enabled); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableDescription(boolean enabled) { + private void enableDescription(boolean enabled) { this.NodeDescriptionText.setEnabled(enabled); this.NodeDescriptionText.setEditable(enabled); } @@ -240,46 +246,36 @@ public class NodeViewPanel extends javax.swing.JPanel { NodeDescriptionText = new javax.swing.JTextArea(); jLabel1 = new javax.swing.JLabel(); - setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - NodeNameLabel.setText("Name :"); - add(NodeNameLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, 80, -1)); NodeIndexLabel.setText("Index :"); - add(NodeIndexLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 70, -1, -1)); NodeInstancesLabel.setText("Instances :"); - add(NodeInstancesLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, -1)); NodeLimitsLabel.setText("Limits :"); - add(NodeLimitsLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 120, -1, -1)); NodeIndexText.setText("None"); NodeIndexText.setMaximumSize(new java.awt.Dimension(200, 19)); NodeIndexText.setMinimumSize(new java.awt.Dimension(200, 19)); NodeIndexText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(NodeIndexText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 70, 200, -1)); NodeInstancesText.setText("-1"); NodeInstancesText.setToolTipText("Number of Instances for this Node "); NodeInstancesText.setMaximumSize(new java.awt.Dimension(200, 19)); NodeInstancesText.setMinimumSize(new java.awt.Dimension(200, 19)); NodeInstancesText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(NodeInstancesText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 100, 200, -1)); NodeLimitsText.setText("None"); NodeLimitsText.setToolTipText("Limits for this Node"); NodeLimitsText.setMaximumSize(new java.awt.Dimension(200, 19)); NodeLimitsText.setMinimumSize(new java.awt.Dimension(200, 19)); NodeLimitsText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(NodeLimitsText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 120, 200, -1)); NodeNameText.setText("None"); NodeNameText.setToolTipText("Name for this Node"); NodeNameText.setMaximumSize(new java.awt.Dimension(440, 19)); NodeNameText.setMinimumSize(new java.awt.Dimension(440, 19)); NodeNameText.setPreferredSize(new java.awt.Dimension(440, 19)); - add(NodeNameText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 50, 430, -1)); NodeCancelButton.setText("Cancel"); NodeCancelButton.addActionListener(new java.awt.event.ActionListener() { @@ -288,8 +284,6 @@ public class NodeViewPanel extends javax.swing.JPanel { } }); - add(NodeCancelButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 280, -1, -1)); - NodeApplyButton.setText("Apply"); NodeApplyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -297,17 +291,73 @@ public class NodeViewPanel extends javax.swing.JPanel { } }); - add(NodeApplyButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 280, 70, -1)); - NodeDescriptionText.setRows(4); NodeDescriptionText.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Description")); NodeDescriptionText.setEnabled(false); - add(NodeDescriptionText, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 150, 540, 100)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Node View Panel"); - add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 10, 460, 20)); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(70, 70, 70) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 460, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(layout.createSequentialGroup() + .add(40, 40, 40) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(NodeIndexLabel) + .add(NodeNameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(NodeInstancesLabel) + .add(NodeLimitsLabel)) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(NodeLimitsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(NodeInstancesText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(NodeIndexText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(NodeNameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 430, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(NodeDescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 540, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createSequentialGroup() + .add(NodeCancelButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(NodeApplyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) + .add(390, 390, 390)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(10, 10, 10) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeNameLabel) + .add(NodeNameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(6, 6, 6) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeIndexLabel) + .add(NodeIndexText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeInstancesLabel) + .add(NodeInstancesText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeLimitsLabel) + .add(NodeLimitsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(20, 20, 20) + .add(NodeDescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(25, 25, 25) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeCancelButton) + .add(NodeApplyButton)) + .addContainerGap()) + ); }// </editor-fold>//GEN-END:initComponents private void NodeApplyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NodeApplyButtonActionPerformed @@ -315,7 +365,7 @@ public class NodeViewPanel extends javax.swing.JPanel { }//GEN-LAST:event_NodeApplyButtonActionPerformed private void NodeCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NodeCancelButtonActionPerformed - initPanel(itsNode); + initPanel(); }//GEN-LAST:event_NodeCancelButtonActionPerformed private jOTDBnode itsNode = null; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form index 663eb72b17609178ec4375bea71cb9b0b736f5c5..6ba57e1ff17a65939be326b8fef285a012d42d17 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.form @@ -1,57 +1,139 @@ <?xml version="1.0" encoding="UTF-8" ?> -<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-43,0,0,2,115"/> </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="false"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="114" pref="114" max="114" attributes="0"/> + <Component id="jLabel1" min="-2" pref="320" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="40" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamIndexLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamNameLabel" alignment="0" min="-2" pref="80" max="-2" attributes="0"/> + <Component id="ParamTypeLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamUnitLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamPruningLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamValMomentLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamRuntimeModLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ParamLimitsLabel" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamLimitsText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamRuntimeModText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamValMomentText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamPruningText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamUnitText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamTypeText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + <Component id="ParamNameText" alignment="0" min="-2" pref="430" max="-2" attributes="0"/> + <Component id="ParamIndexText" alignment="0" min="-2" pref="240" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="ParamDescriptionText" alignment="0" min="-2" pref="530" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="ParamCancelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ParamApplyButton" min="-2" pref="70" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="403" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> + <Component id="jLabel1" min="-2" pref="20" max="-2" attributes="0"/> + <EmptySpace min="20" pref="20" max="20" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="ParamNameLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ParamNameText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamIndexLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamIndexText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="6" pref="6" max="6" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamTypeLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamTypeText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamUnitLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamUnitText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamPruningLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamPruningText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamValMomentLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamValMomentText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ParamRuntimeModLabel" min="-2" max="-2" attributes="0"/> + <Component id="ParamRuntimeModText" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="ParamLimitsText" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ParamLimitsLabel" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> + <Component id="ParamDescriptionText" min="-2" pref="80" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="ParamApplyButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ParamCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="26" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="ParamNameLabel"> <Properties> <Property name="text" type="java.lang.String" value="Name :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="50" width="80" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamIndexLabel"> <Properties> <Property name="text" type="java.lang.String" value="Index :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="75" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamTypeLabel"> <Properties> <Property name="text" type="java.lang.String" value="Type :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="100" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamLimitsLabel"> <Properties> <Property name="text" type="java.lang.String" value="Limits :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="225" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ParamIndexText"> <Properties> @@ -66,11 +148,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="75" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ParamPruningText"> <Properties> @@ -86,11 +163,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="150" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ParamNameText"> <Properties> @@ -106,11 +178,6 @@ <Dimension value="[440, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="50" width="430" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="ParamCancelButton"> <Properties> @@ -119,11 +186,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ParamCancelButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="400" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="ParamApplyButton"> <Properties> @@ -132,11 +194,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ParamApplyButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="120" y="400" width="70" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextArea" name="ParamDescriptionText"> <Properties> @@ -151,62 +208,32 @@ </Border> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="250" width="530" height="80"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamUnitLabel"> <Properties> <Property name="text" type="java.lang.String" value="Unit :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="125" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamPruningLabel"> <Properties> <Property name="text" type="java.lang.String" value="Pruning :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="150" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamValMomentLabel"> <Properties> <Property name="text" type="java.lang.String" value="ValMoment :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="175" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ParamRuntimeModLabel"> <Properties> <Property name="text" type="java.lang.String" value="RuntimeMod :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="200" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> <Property name="horizontalAlignment" type="int" value="0"/> <Property name="text" type="java.lang.String" value="Parameter View Panel"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="114" y="10" width="320" height="20"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JComboBox" name="ParamTypeText"> <Properties> @@ -215,11 +242,6 @@ <StringArray count="0"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="100" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JComboBox" name="ParamUnitText"> <Properties> @@ -228,31 +250,16 @@ <StringArray count="0"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="125" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ParamValMomentText"> <Properties> <Property name="text" type="java.lang.String" value="None"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="175" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ParamLimitsText"> <Properties> <Property name="text" type="java.lang.String" value="None"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="225" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JComboBox" name="ParamRuntimeModText"> <Properties> @@ -264,11 +271,6 @@ </StringArray> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="200" width="240" height="-1"/> - </Constraint> - </Constraints> </Component> </SubComponents> </Form> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java index 58ce4a4dd0a0b3f7df9a5368ca9704c6cfd122c2..a377651ce5c7131000404b2f3d5ccc5aec938cfd 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParameterViewPanel.java @@ -11,20 +11,23 @@ import java.util.Iterator; import java.util.TreeMap; import javax.swing.DefaultComboBoxModel; import nl.astron.lofar.sas.otb.MainFrame; +import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; import nl.astron.lofar.sas.otb.jotdb2.jOTDBparam; +import nl.astron.lofar.sas.otb.util.IViewPanel; import nl.astron.lofar.sas.otb.util.OtdbRmi; +import nl.astron.lofar.sas.otb.util.UserAccount; import org.apache.log4j.Logger; /** * * @author coolen */ -public class ParameterViewPanel extends javax.swing.JPanel { +public class ParameterViewPanel extends javax.swing.JPanel implements IViewPanel { static Logger logger = Logger.getLogger(ParameterViewPanel.class); - + static String name = "Parameter"; - /** Creates new form BeanForm based upon aParameter + /** Creates new form based upon aParameter * * @params aParam Param to obtain the info from * @@ -35,9 +38,24 @@ public class ParameterViewPanel extends javax.swing.JPanel { itsParam = aParam; itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi(); initComboLists(); - initPanel(aParam); + initPanel(); } + /** Creates new form based upon aNode + * + * @params aNode Node to obtain the info from + * + */ + public ParameterViewPanel(MainFrame aMainFrame,jOTDBnode aNode) { + initComponents(); + itsMainFrame = aMainFrame; + itsNode = aNode; + getParam(itsNode); + itsOtdbRmi=itsMainFrame.getSharedVars().getOTDBrmi(); + initComboLists(); + initPanel(); + } + /** Creates new form BeanForm */ public ParameterViewPanel() { initComponents(); @@ -53,15 +71,36 @@ public class ParameterViewPanel extends javax.swing.JPanel { } } - public void setParam(jOTDBparam aParam) { - if (aParam != null) { - itsParam=aParam; - initPanel(aParam); + public String getShortName() { + return name; + } + + public void setContent(Object anObject) { + if (anObject != null) { + itsNode=(jOTDBnode)anObject; + getParam(itsNode); + initPanel(); } else { - logger.debug("No param supplied"); + logger.debug("No node supplied"); } } + private void getParam(jOTDBnode aNode) { + if (aNode == null) { + logger.debug("ERROR: Empty Node supplied for getParam"); + return; + } + itsNode=aNode; + try { + itsParam = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getParam(itsMainFrame.getSharedVars().getTreeID(), + aNode.paramDefID()); + } catch (RemoteException ex) { + logger.debug("Error during getParam: "+ ex); + itsParam=null; + return; + } + } + private void initComboLists() { DefaultComboBoxModel aTypeModel = new DefaultComboBoxModel(); TreeMap aTypeMap = itsOtdbRmi.getParamType(); @@ -80,24 +119,41 @@ public class ParameterViewPanel extends javax.swing.JPanel { ParamUnitText.setModel(aUnitModel); } - private void initPanel(jOTDBparam aParam) { - if (aParam != null) { - setParamName(aParam.name); - setIndex(String.valueOf(aParam.index)); - setType(aParam.type); - setUnit(aParam.unit); - setPruning(String.valueOf(aParam.pruning)); - setValMoment(String.valueOf(aParam.valMoment)); - setRuntimeMod(aParam.runtimeMod); - setLimits(String.valueOf(aParam.limits)); - setDescription(aParam.description); + private void initPanel() { + + // check access + UserAccount userAccount = itsMainFrame.getUserAccount(); + + // For now: + enableLimits(true); + enableDescription(true); + + if(userAccount.isAdministrator()) { + // enable/disable certain controls + } + if(userAccount.isAstronomer()) { + // enable/disable certain controls + } + if(userAccount.isInstrumentScientist()) { + // enable/disable certain controls + } + + if (itsParam != null) { + setParamName(itsParam.name); + setIndex(String.valueOf(itsParam.index)); + setType(itsParam.type); + setUnit(itsParam.unit); + setPruning(String.valueOf(itsParam.pruning)); + setValMoment(String.valueOf(itsParam.valMoment)); + setRuntimeMod(itsParam.runtimeMod); + setLimits(String.valueOf(itsParam.limits)); + setDescription(itsParam.description); } else { logger.debug("ERROR: no Param given"); } } - /** Returns the Given Name for this Param */ - public String getParamName() { + private String getParamName() { return this.ParamNameText.getText(); } @@ -105,16 +161,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamNameText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableParamName(boolean enabled) { + private void enableParamName(boolean enabled) { this.ParamNameText.setEnabled(enabled); } - /** Returns the Given Index for this Param */ - public String getIndex() { + private String getIndex() { return this.ParamIndexText.getText(); } @@ -122,16 +173,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamIndexText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableIndex(boolean enabled) { + private void enableIndex(boolean enabled) { this.ParamIndexText.setEnabled(enabled); } - /** Returns the Given Type for this Param */ - public String getType() { + private String getType() { return (String)this.ParamTypeText.getSelectedItem(); } @@ -143,17 +189,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { } } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableType(boolean enabled) { + private void enableType(boolean enabled) { this.ParamTypeText.setEnabled(enabled); } - - /** Returns the Given Unit for this Param */ - public String getUnit() { + private String getUnit() { return (String)this.ParamUnitText.getSelectedItem(); } @@ -165,16 +205,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { } } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableUnit(boolean enabled) { + private void enableUnit(boolean enabled) { this.ParamUnitText.setEnabled(enabled); } - /** Returns the Given pruning for this Param */ - public String getPruning() { + private String getPruning() { return this.ParamPruningText.getText(); } @@ -182,16 +217,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamPruningText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enablePruning(boolean enabled) { + private void enablePruning(boolean enabled) { this.ParamPruningText.setEnabled(enabled); } - /** Returns the Given valMoment for this Param */ - public String getValMoment() { + private String getValMoment() { return this.ParamValMomentText.getText(); } @@ -199,16 +229,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamValMomentText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableValMoment(boolean enabled) { + private void enableValMoment(boolean enabled) { this.ParamValMomentText.setEnabled(enabled); } - /** Returns the Given runtimeMod for this Param */ - public boolean getRuntimeMod() { + private boolean getRuntimeMod() { if (this.ParamRuntimeModText.getSelectedItem().equals("true")) { return true; } else { @@ -224,17 +249,12 @@ public class ParameterViewPanel extends javax.swing.JPanel { } } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableRuntimeMod(boolean enabled) { + private void enableRuntimeMod(boolean enabled) { this.ParamRuntimeModText.setEnabled(enabled); } - /** Returns the Given Limits for this Param */ - public String getLimits() { + private String getLimits() { return this.ParamLimitsText.getText(); } @@ -242,16 +262,11 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamLimitsText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableLimits(boolean enabled) { + private void enableLimits(boolean enabled) { this.ParamLimitsText.setEnabled(enabled); } - /** Returns the Given Description for this Param */ - public String getDescription() { + private String getDescription() { return this.ParamDescriptionText.getText(); } @@ -259,19 +274,14 @@ public class ParameterViewPanel extends javax.swing.JPanel { this.ParamDescriptionText.setText(aS); } - /** Enables/disables this inputfield - * - * @param enabled true/false enabled/disabled - */ - public void enableDescription(boolean enabled) { + private void enableDescription(boolean enabled) { this.ParamDescriptionText.setEnabled(enabled); this.ParamDescriptionText.setEditable(enabled); } - - /** Enables/disables the buttons + /** Enables the buttons * - * @param enabled true/false enabled/disabled + * @param enabled true/false enable/disable */ public void enableButtons(boolean enabled) { this.ParamApplyButton.setEnabled(enabled); @@ -388,39 +398,30 @@ public class ParameterViewPanel extends javax.swing.JPanel { ParamLimitsText = new javax.swing.JTextField(); ParamRuntimeModText = new javax.swing.JComboBox(); - setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - ParamNameLabel.setText("Name :"); - add(ParamNameLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, 80, -1)); ParamIndexLabel.setText("Index :"); - add(ParamIndexLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 75, -1, -1)); ParamTypeLabel.setText("Type :"); - add(ParamTypeLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, -1)); ParamLimitsLabel.setText("Limits :"); - add(ParamLimitsLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 225, -1, -1)); ParamIndexText.setText("None"); ParamIndexText.setMaximumSize(new java.awt.Dimension(200, 19)); ParamIndexText.setMinimumSize(new java.awt.Dimension(200, 19)); ParamIndexText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(ParamIndexText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 75, 240, -1)); ParamPruningText.setText("-1"); ParamPruningText.setToolTipText("Number of Instances for this Node "); ParamPruningText.setMaximumSize(new java.awt.Dimension(200, 19)); ParamPruningText.setMinimumSize(new java.awt.Dimension(200, 19)); ParamPruningText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(ParamPruningText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 150, 240, -1)); ParamNameText.setText("None"); ParamNameText.setToolTipText("Name for this Node"); ParamNameText.setMaximumSize(new java.awt.Dimension(440, 19)); ParamNameText.setMinimumSize(new java.awt.Dimension(440, 19)); ParamNameText.setPreferredSize(new java.awt.Dimension(440, 19)); - add(ParamNameText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 50, 430, -1)); ParamCancelButton.setText("Cancel"); ParamCancelButton.addActionListener(new java.awt.event.ActionListener() { @@ -429,8 +430,6 @@ public class ParameterViewPanel extends javax.swing.JPanel { } }); - add(ParamCancelButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 400, -1, -1)); - ParamApplyButton.setText("Apply"); ParamApplyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -438,44 +437,116 @@ public class ParameterViewPanel extends javax.swing.JPanel { } }); - add(ParamApplyButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 400, 70, -1)); - ParamDescriptionText.setRows(3); ParamDescriptionText.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Description")); - add(ParamDescriptionText, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 250, 530, 80)); ParamUnitLabel.setText("Unit :"); - add(ParamUnitLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 125, -1, -1)); ParamPruningLabel.setText("Pruning :"); - add(ParamPruningLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 150, -1, -1)); ParamValMomentLabel.setText("ValMoment :"); - add(ParamValMomentLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 175, -1, -1)); ParamRuntimeModLabel.setText("RuntimeMod :"); - add(ParamRuntimeModLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 200, -1, -1)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Parameter View Panel"); - add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(114, 10, 320, 20)); ParamTypeText.setEditable(true); - add(ParamTypeText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 100, 240, -1)); ParamUnitText.setEditable(true); - add(ParamUnitText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 125, 240, -1)); ParamValMomentText.setText("None"); - add(ParamValMomentText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 175, 240, -1)); ParamLimitsText.setText("None"); - add(ParamLimitsText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 225, 240, -1)); ParamRuntimeModText.setEditable(true); ParamRuntimeModText.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "false", "true" })); - add(ParamRuntimeModText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 200, 240, -1)); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(114, 114, 114) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 320, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(layout.createSequentialGroup() + .add(40, 40, 40) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamIndexLabel) + .add(ParamNameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamTypeLabel) + .add(ParamUnitLabel) + .add(ParamPruningLabel) + .add(ParamValMomentLabel) + .add(ParamRuntimeModLabel) + .add(ParamLimitsLabel)) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamLimitsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamRuntimeModText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamValMomentText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamPruningText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamUnitText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamTypeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamNameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 430, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamIndexText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(ParamDescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 530, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createSequentialGroup() + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(ParamCancelButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(ParamApplyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) + .add(403, 403, 403)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(10, 10, 10) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(ParamNameLabel) + .add(ParamNameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(11, 11, 11) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamIndexLabel) + .add(ParamIndexText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(6, 6, 6) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamTypeLabel) + .add(ParamTypeText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamUnitLabel) + .add(ParamUnitText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamPruningLabel) + .add(ParamPruningText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamValMomentLabel) + .add(ParamValMomentText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ParamRuntimeModLabel) + .add(ParamRuntimeModText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(ParamLimitsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ParamLimitsLabel)) + .add(19, 19, 19) + .add(ParamDescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(30, 30, 30) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(ParamApplyButton) + .add(ParamCancelButton)) + .addContainerGap(26, Short.MAX_VALUE)) + ); }// </editor-fold>//GEN-END:initComponents private void ParamApplyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ParamApplyButtonActionPerformed @@ -483,11 +554,12 @@ public class ParameterViewPanel extends javax.swing.JPanel { }//GEN-LAST:event_ParamApplyButtonActionPerformed private void ParamCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ParamCancelButtonActionPerformed - initPanel(itsParam); + initPanel(); }//GEN-LAST:event_ParamCancelButtonActionPerformed private MainFrame itsMainFrame; private OtdbRmi itsOtdbRmi; + private jOTDBnode itsNode; private jOTDBparam itsParam; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.form index 0695157f5df1c38d59f0226071e66a1ebf202d2a..1343a6cefb9871f2e85aacfb36fddaa2a4f95396 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.form @@ -37,6 +37,7 @@ </Properties> <Events> <EventHandler event="valueChanged" listener="javax.swing.event.TreeSelectionListener" parameters="javax.swing.event.TreeSelectionEvent" handler="jTree1ValueChanged"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTree1MousePressed"/> </Events> </Component> </SubComponents> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.java index 18460340a53bd07220b72b1062f03fef74923c02..f04957324ce4bc89307f7d778fd93b75cf53ad9f 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/TreePanel.java @@ -91,6 +91,11 @@ public class TreePanel extends javax.swing.JPanel { jTree1ValueChanged(evt); } }); + jTree1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + jTree1MousePressed(evt); + } + }); jScrollPane1.setViewportView(jTree1); @@ -98,6 +103,11 @@ public class TreePanel extends javax.swing.JPanel { }// </editor-fold>//GEN-END:initComponents + private void jTree1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MousePressed + logger.debug("mouse pressed event: " + evt); + fireMouseListenerMousePressed(evt); + }//GEN-LAST:event_jTree1MousePressed + /** * Exports the TreeSelection.valueChanged event from tree to the outside world of this panel. * @param evt The TreeSelection event @@ -155,4 +165,98 @@ public class TreePanel extends javax.swing.JPanel { } } } + + /** + * Registers MouseListener to receive events. + * @param listener The listener to register. + */ + public synchronized void addMouseListener(java.awt.event.MouseListener listener) { + if (listenerList == null ) { + listenerList = new javax.swing.event.EventListenerList(); + } + listenerList.add (java.awt.event.MouseListener.class, listener); + } + + /** + * Removes MouseListener from the list of listeners. + * @param listener The listener to remove. + */ + public synchronized void removeMouseListener(java.awt.event.MouseListener listener) { + listenerList.remove (java.awt.event.MouseListener.class, listener); + } + + /** + * Notifies all registered listeners about the event. + * + * @param event The event to be fired + */ + private void fireMouseListenerMouseClicked(java.awt.event.MouseEvent event) { + if (listenerList == null) return; + Object[] listeners = listenerList.getListenerList (); + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i]==java.awt.event.MouseListener.class) { + ((java.awt.event.MouseListener)listeners[i+1]).mouseClicked (event); + } + } + } + + /** + * Notifies all registered listeners about the event. + * + * @param event The event to be fired + */ + private void fireMouseListenerMousePressed(java.awt.event.MouseEvent event) { + if (listenerList == null) return; + Object[] listeners = listenerList.getListenerList (); + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i]==java.awt.event.MouseListener.class) { + ((java.awt.event.MouseListener)listeners[i+1]).mousePressed (event); + } + } + } + + /** + * Notifies all registered listeners about the event. + * + * @param event The event to be fired + */ + private void fireMouseListenerMouseReleased(java.awt.event.MouseEvent event) { + if (listenerList == null) return; + Object[] listeners = listenerList.getListenerList (); + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i]==java.awt.event.MouseListener.class) { + ((java.awt.event.MouseListener)listeners[i+1]).mouseReleased (event); + } + } + } + + /** + * Notifies all registered listeners about the event. + * + * @param event The event to be fired + */ + private void fireMouseListenerMouseEntered(java.awt.event.MouseEvent event) { + if (listenerList == null) return; + Object[] listeners = listenerList.getListenerList (); + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i]==java.awt.event.MouseListener.class) { + ((java.awt.event.MouseListener)listeners[i+1]).mouseEntered (event); + } + } + } + + /** + * Notifies all registered listeners about the event. + * + * @param event The event to be fired + */ + private void fireMouseListenerMouseExited(java.awt.event.MouseEvent event) { + if (listenerList == null) return; + Object[] listeners = listenerList.getListenerList (); + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i]==java.awt.event.MouseListener.class) { + ((java.awt.event.MouseListener)listeners[i+1]).mouseExited (event); + } + } + } } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.form index 4cbdecc64db7f2f1af26c1a81b7d58a50dadd2a5..4127efab9184d1c4b30c5a281d1e260c3f8be843 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.form @@ -1,15 +1,90 @@ <?xml version="1.0" encoding="UTF-8" ?> -<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <AuxValues> <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-108,0,0,2,-84"/> </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> - <Property name="useNullLayout" type="boolean" value="false"/> + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="70" pref="70" max="70" attributes="0"/> + <Component id="jLabel1" min="-2" pref="460" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="40" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="DescriptionText" alignment="0" min="-2" pref="540" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="NameLabel" min="-2" pref="80" max="-2" attributes="0"/> + <Component id="VersionLabel" min="-2" max="-2" attributes="0"/> + <Component id="ClassificationLabel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="ConstraintsLabel" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="ConstraintsText" alignment="0" min="-2" pref="430" max="-2" attributes="0"/> + <Component id="ClassificationText" alignment="0" min="-2" pref="200" max="-2" attributes="0"/> + <Component id="NameText" min="-2" pref="430" max="-2" attributes="0"/> + <Component id="VersionText" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="NodeCancelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="NodeApplyButton" min="-2" pref="70" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="104" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> + <Component id="jLabel1" min="-2" pref="20" max="-2" attributes="0"/> + <EmptySpace min="20" pref="20" max="20" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NameLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NameText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="VersionLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="VersionText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="ClassificationLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ClassificationText" alignment="3" min="-2" pref="20" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="ConstraintsLabel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ConstraintsText" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Component id="DescriptionText" min="-2" pref="100" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="NodeCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="NodeApplyButton" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> @@ -17,21 +92,11 @@ <Property name="horizontalAlignment" type="int" value="0"/> <Property name="text" type="java.lang.String" value="VICnodeDef View Panel"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="70" y="10" width="460" height="20"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="NameLabel"> <Properties> <Property name="text" type="java.lang.String" value="Name :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="50" width="80" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="NameText"> <Properties> @@ -47,21 +112,11 @@ <Dimension value="[440, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="50" width="430" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="VersionLabel"> <Properties> <Property name="text" type="java.lang.String" value="Version :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="80" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="VersionText"> <Properties> @@ -77,21 +132,11 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="80" width="200" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ClassificationLabel"> <Properties> <Property name="text" type="java.lang.String" value="Classification :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="110" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JComboBox" name="ClassificationText"> <Properties> @@ -104,21 +149,11 @@ </StringArray> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="110" width="200" height="20"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JLabel" name="ConstraintsLabel"> <Properties> <Property name="text" type="java.lang.String" value="Constraints :"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="140" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextField" name="ConstraintsText"> <Properties> @@ -134,11 +169,6 @@ <Dimension value="[200, 19]"/> </Property> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="140" y="140" width="430" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JTextArea" name="DescriptionText"> <Properties> @@ -154,11 +184,6 @@ </Property> <Property name="enabled" type="boolean" value="false"/> </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="220" width="540" height="100"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="NodeCancelButton"> <Properties> @@ -167,11 +192,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="NodeCancelButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="40" y="350" width="-1" height="-1"/> - </Constraint> - </Constraints> </Component> <Component class="javax.swing.JButton" name="NodeApplyButton"> <Properties> @@ -180,11 +200,6 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="NodeApplyButtonActionPerformed"/> </Events> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="110" y="350" width="70" height="-1"/> - </Constraint> - </Constraints> </Component> </SubComponents> </Form> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.java index 968c6c192e311dc8bb3b0c4c38c08fc9ae5d7410..1c2a421103e983cdac33869a748e126d6691aec6 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/VICnodeDefViewPanel.java @@ -259,52 +259,40 @@ public class VICnodeDefViewPanel extends javax.swing.JPanel { NodeCancelButton = new javax.swing.JButton(); NodeApplyButton = new javax.swing.JButton(); - setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("VICnodeDef View Panel"); - add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 10, 460, 20)); NameLabel.setText("Name :"); - add(NameLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 50, 80, -1)); NameText.setText("None"); NameText.setToolTipText("Name for this Node"); NameText.setMaximumSize(new java.awt.Dimension(440, 19)); NameText.setMinimumSize(new java.awt.Dimension(440, 19)); NameText.setPreferredSize(new java.awt.Dimension(440, 19)); - add(NameText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 50, 430, -1)); VersionLabel.setText("Version :"); - add(VersionLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 80, -1, -1)); VersionText.setText("None"); VersionText.setToolTipText("Version number for this VICnodeDef"); VersionText.setMaximumSize(new java.awt.Dimension(200, 19)); VersionText.setMinimumSize(new java.awt.Dimension(200, 19)); VersionText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(VersionText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 80, 200, -1)); ClassificationLabel.setText("Classification :"); - add(ClassificationLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 110, -1, -1)); ClassificationText.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - add(ClassificationText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 110, 200, 20)); ConstraintsLabel.setText("Constraints :"); - add(ConstraintsLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 140, -1, -1)); ConstraintsText.setText("None"); ConstraintsText.setToolTipText("Limits for this Node"); ConstraintsText.setMaximumSize(new java.awt.Dimension(200, 19)); ConstraintsText.setMinimumSize(new java.awt.Dimension(200, 19)); ConstraintsText.setPreferredSize(new java.awt.Dimension(200, 19)); - add(ConstraintsText, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 140, 430, -1)); DescriptionText.setRows(4); DescriptionText.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Description")); DescriptionText.setEnabled(false); - add(DescriptionText, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, 540, 100)); NodeCancelButton.setText("Cancel"); NodeCancelButton.addActionListener(new java.awt.event.ActionListener() { @@ -313,8 +301,6 @@ public class VICnodeDefViewPanel extends javax.swing.JPanel { } }); - add(NodeCancelButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 350, -1, -1)); - NodeApplyButton.setText("Apply"); NodeApplyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -322,8 +308,66 @@ public class VICnodeDefViewPanel extends javax.swing.JPanel { } }); - add(NodeApplyButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 350, 70, -1)); - + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(70, 70, 70) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 460, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(layout.createSequentialGroup() + .add(40, 40, 40) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(DescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 540, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(NameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(VersionLabel) + .add(ClassificationLabel) + .add(ConstraintsLabel)) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(ConstraintsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 430, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(ClassificationText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(NameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 430, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(VersionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(layout.createSequentialGroup() + .add(NodeCancelButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(NodeApplyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) + .add(104, 104, 104)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(10, 10, 10) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(20, 20, 20) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NameLabel) + .add(NameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(VersionLabel) + .add(VersionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(ClassificationLabel) + .add(ClassificationText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(ConstraintsLabel) + .add(ConstraintsText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(27, 27, 27) + .add(DescriptionText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(27, 27, 27) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(NodeCancelButton) + .add(NodeApplyButton)) + .add(37, 37, 37)) + ); }// </editor-fold>//GEN-END:initComponents private void NodeApplyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NodeApplyButtonActionPerformed