diff --git a/.gitattributes b/.gitattributes index 084630caa5d06d64ffa70e079d32f28083d33e12..bb4c77520ee86bc87430f9a5c454fb3477208235 100644 --- a/.gitattributes +++ b/.gitattributes @@ -886,6 +886,7 @@ SAS/OTB/MoM-OTDB-adapter/lib/xercesImpl.jar -text SAS/OTB/MoM-OTDB-adapter/lib/xml-apis.jar -text SAS/OTB/MoM-OTDB-adapter/sharedlib/jotdb.jar -text SAS/OTB/OTB/doc/OTB.EAP -text +SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Add16.gif -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Delete16.gif -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/bbs/icons/general/Edit16.gif -text diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java new file mode 100644 index 0000000000000000000000000000000000000000..21b2ee7d00bdb937587c5955f1642d935510b8f8 --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java @@ -0,0 +1,212 @@ +/* + * BeamConfigurationTableModel.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * Implements the data model behind the BeamConfiguration table + * + * @created 11-02-2008, 13:30 + * + * + * @version $Id$ + * + * @updated + */ + +package nl.astron.lofar.sas.otb.util.tablemodels; + +import java.util.Vector; +import nl.astron.lofar.sas.otb.jotdb2.jOTDBnode; +import org.apache.log4j.Logger; + +/** + * + * @author Coolen + */ +public class BeamConfigurationTableModel extends javax.swing.table.DefaultTableModel { + + static Logger logger = Logger.getLogger(BeamConfigurationTableModel.class); + static String name = "BeamConfigurationTableModel"; + + private String itsTreeType; + + /** Creates a new instance of BeamConfigurationTableModel */ + public BeamConfigurationTableModel() { + this.addColumn("dirtype"); + this.addColumn("angle 1"); + this.addColumn("angle 2"); + this.addColumn("subbands"); + this.addColumn("beamlets"); + } + + /** fills the table with the initial settings + * + * @param aDirTypes Vector<String> of all direction Types + * @param anAngles1 Vector<String> of all direction 1 angles + * @param anAngels2 Vector<String> of all direction 1 angles + * @param aSubbands Vector<String> of all Subbands involved + * @param aBeamlets Vector<String> of all Beamlets involved + * + * @return True if succes else False + */ + public boolean fillTable(String treeType, Vector<String> aDirTypes,Vector<String> anAngles1,Vector<String> anAngles2, + Vector<String> aSubbands, Vector<String> aBeamlets) { + + itsTreeType=treeType; + + // "clear" the table + setRowCount(0); + if (aDirTypes==null||anAngles1==null||anAngles2==null||aSubbands==null||aBeamlets==null) { + logger.error("Error in fillTable, null value in input found."); + return false; + } + int length = aDirTypes.size(); + + // need to skip first entry because it is the default (dummy) TBBsetting in other then VHTree's + int offset=1; + if (itsTreeType.equals("VHtree")) { + offset=0; + } + + // need to skip first entry because it is the default (dummy) TBBsetting + for (int i=0; i<length-offset; i++) { + String[] newRow = { aDirTypes.elementAt(i+offset), + anAngles1.elementAt(i+offset), + anAngles2.elementAt(i+offset), + aSubbands.elementAt(i+offset), + aBeamlets.elementAt(i+offset)}; + + this.addRow(newRow); + } + fireTableDataChanged(); + return true; + } + + /** fills the table with the initial settings + * + * @param aDirTypes Vector<String> of all direction Types + * @param anAngles1 Vector<String> of all direction 1 angles + * @param anAngels2 Vector<String> of all direction 1 angles + * @param aSubbands Vector<String> of all Subbands involved + * @param aBeamlets Vector<String> of all Beamlets involved + * + * @return True if succes else False + */ + public boolean getTable(Vector<String> aDirTypes,Vector<String> anAngles1,Vector<String> anAngles2, + Vector<String> aSubbands, Vector<String> aBeamlets) { + + int length = aDirTypes.size(); + + // need to skip first entry because it is the default (dummy) TBBsetting + // empty all elements except the default + aDirTypes.setSize(1); + anAngles1.setSize(1); + anAngles2.setSize(1); + aSubbands.setSize(1); + aBeamlets.setSize(1); + + for (int i=0; i<getRowCount(); i++) { + aDirTypes.addElement((String)getValueAt(i,0)); + anAngles1.addElement((String)getValueAt(i,1)); + anAngles2.addElement((String)getValueAt(i,2)); + aSubbands.addElement((String)getValueAt(i,3)); + aBeamlets.addElement((String)getValueAt(i,4)); + } + return true; + } + + + /** Add an entry to the tableModel + * + * @param aDirTypes direction Type + * @param anAngles1 direction 1 angle + * @param anAngels2 direction 2 angle + * @param aSubbands Subbands involved + * @param aBeamlets Beamlets involved + * + * @return True if succes else False + */ + public boolean addRow(String aDirType,String anAngle1,String anAngle2, String aSubbands, String aBeamlets) { + + if (aDirType==null||anAngle1==null||anAngle2==null||aSubbands==null||aBeamlets==null) { + logger.error("Error in addRow, null value in input found."); + return false; + } + String[] newRow = { aDirType,anAngle1,anAngle2,aSubbands,aBeamlets}; + this.addRow(newRow); + + return true; + } + + /** Update a row with new information + * + * @param newRow String[] that contains all values as they should be for this row + * @param row int with the rownumber. + */ + public boolean updateRow(String[] newRow,int row) { + if (row < this.getRowCount() && row >= 0) { + this.setValueAt(newRow[0],row,0); + this.setValueAt(newRow[1],row,1); + this.setValueAt(newRow[2],row,2); + this.setValueAt(newRow[3],row,3); + this.setValueAt(newRow[4],row,4); + } else { + logger.error("Error in updateRow, illegal rownumber supplied"); + return false; + } + fireTableDataChanged(); + return true; + } + + /** get the values from the given row + * + * @param row int with row number + * + * @return String[] containing all values from the given row + */ + public String[] getSelection(int row) { + if (row < this.getRowCount() && row >= 0) { + String[] selection = { (String)this.getValueAt(row,0), + (String)this.getValueAt(row,1), + (String)this.getValueAt(row,2), + (String)this.getValueAt(row,3), + (String)this.getValueAt(row,4)}; + return selection; + } else { + return null; + } + + } + + /** returns the isEditable flag from the given row and column. + * we need to override this method, since originally all ros/colums from the DefaultTableModel are editable + * + * @param row rownumber + * @param column columnnumber + * + * @return true if the asked cell is editable + */ + public boolean isCellEditable(int row, int column) { + return false; + } + + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java index a57e51bb439b77a43ca5a28489b43f0b40d7073c..d88c0d26f8fdc1aa46a910a8a4f9a7db59427ef1 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/TBBConfigurationTableModel.java @@ -26,7 +26,7 @@ * @created 07-06-2006, 13:30 * * - * @version $Id:$ + * @version $Id$ * * @updated */ @@ -43,9 +43,11 @@ import org.apache.log4j.Logger; */ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableModel { - static Logger logger = Logger.getLogger(RSPMACTableModel.class); + static Logger logger = Logger.getLogger(TBBConfigurationTableModel.class); static String name = "TBBConfigurationTableModel"; + private String itsTreeType; + /** Creates a new instance of TBBConfigurationTableModel */ public TBBConfigurationTableModel() { @@ -79,12 +81,13 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo * * @return True if succes else False */ - public boolean fillTable(Vector<String> aMode,Vector<String> aBase,Vector<String> aStart, + public boolean fillTable(String treeType,Vector<String> aMode,Vector<String> aBase,Vector<String> aStart, Vector<String> aStop, Vector<String> aFilter, Vector<String> aWindow, Vector<String> aC0, Vector<String> aC1, Vector<String> aC2, Vector<String> aC3, Vector<String> aRCUs) { + itsTreeType=treeType; // "clear" the table - setRowCount(0); + setRowCount(0); if (aMode==null||aBase==null||aStart==null||aStop==null||aFilter==null||aWindow==null||aC0==null||aC1==null|| aC2==null||aC3==null||aRCUs==null) { logger.error("Error in fillTable, null value in input found."); @@ -92,19 +95,23 @@ public class TBBConfigurationTableModel extends javax.swing.table.DefaultTableMo } int length = aMode.size(); - // need to skip first entry because it is the default (dummy) TBBsetting - for (int i=0; i<length-1; i++) { - String[] newRow = { aMode.elementAt(i+1), - aBase.elementAt(i+1), - aStart.elementAt(i+1), - aStop.elementAt(i+1), - aFilter.elementAt(i+1), - aWindow.elementAt(i+1), - aC0.elementAt(i+1), - aC1.elementAt(i+1), - aC2.elementAt(i+1), - aC3.elementAt(i+1), - aRCUs.elementAt(i+1)}; + // need to skip first entry because it is the default (dummy) TBBsetting in other then VHTree's + int offset=1; + if (itsTreeType.equals("VHtree")) { + offset=0; + } + for (int i=0; i<length-offset; i++) { + String[] newRow = { aMode.elementAt(i+offset), + aBase.elementAt(i+offset), + aStart.elementAt(i+offset), + aStop.elementAt(i+offset), + aFilter.elementAt(i+offset), + aWindow.elementAt(i+offset), + aC0.elementAt(i+offset), + aC1.elementAt(i+offset), + aC2.elementAt(i+offset), + aC3.elementAt(i+offset), + aRCUs.elementAt(i+offset)}; this.addRow(newRow); } fireTableDataChanged(); diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form new file mode 100644 index 0000000000000000000000000000000000000000..d1ee0b4259fa698020273d78c97fdf34f96fc51c --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="LOFAR View TreeInfo"/> + <Property name="alwaysOnTop" type="boolean" value="true"/> + <Property name="modal" type="boolean" value="true"/> + <Property name="name" type="java.lang.String" value="loadFileDialog"/> + <Property name="resizable" type="boolean" value="false"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <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,0,-55,0,0,3,-75"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder justification="2" title="Edit/Add Beam"> + <Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> + <EtchetBorder/> + </Border> + <Font PropertyName="font" name="Tahoma" size="11" style="1"/> + </TitledBorder> + </Border> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="950" height="200"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace 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"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="labelBeamletList" alignment="0" max="32767" attributes="0"/> + <Component id="labelSubbandList" alignment="0" max="32767" attributes="0"/> + <Component id="labelAngle2" alignment="0" max="32767" attributes="1"/> + <Component id="labelAngle1" alignment="0" max="32767" attributes="1"/> + </Group> + <Component id="labelDirectionTypes" 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"> + <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> + <Component id="inputDirectionTypes" alignment="0" min="-2" pref="75" max="-2" attributes="0"/> + <Component id="inputAngle2" alignment="0" pref="185" max="32767" attributes="1"/> + <Component id="inputAngle1" alignment="0" max="32767" attributes="1"/> + </Group> + <Component id="inputSubbandList" alignment="0" pref="821" max="32767" attributes="0"/> + <Component id="inputBeamletList" alignment="0" pref="821" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="cancelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="saveButton" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="inputDirectionTypes" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="labelDirectionTypes" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="labelAngle1" alignment="3" min="-2" pref="14" max="-2" attributes="0"/> + <Component id="inputAngle1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="labelAngle2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="inputAngle2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="labelSubbandList" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="inputSubbandList" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="labelBeamletList" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="inputBeamletList" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="27" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="saveButton" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JComboBox" name="inputDirectionTypes"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="Item 1"/> + </StringArray> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="labelAngle1"> + <Properties> + <Property name="text" type="java.lang.String" value="Angle 1:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="inputAngle1"> + </Component> + <Component class="javax.swing.JLabel" name="labelAngle2"> + <Properties> + <Property name="text" type="java.lang.String" value="Angle 2 :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="inputAngle2"> + </Component> + <Component class="javax.swing.JLabel" name="labelSubbandList"> + <Properties> + <Property name="text" type="java.lang.String" value="Subbands :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="inputSubbandList"> + </Component> + <Component class="javax.swing.JLabel" name="labelBeamletList"> + <Properties> + <Property name="text" type="java.lang.String" value="Beamlets :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="inputBeamletList"> + </Component> + <Component class="javax.swing.JButton" name="cancelButton"> + <Properties> + <Property name="text" type="java.lang.String" value="Cancel"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="saveButton"> + <Properties> + <Property name="text" type="java.lang.String" value="Save"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="labelDirectionTypes"> + <Properties> + <Property name="text" type="java.lang.String" value="directionTypes :"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java new file mode 100644 index 0000000000000000000000000000000000000000..6450f507746c7550de9998fe296a6b13cf75f537 --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java @@ -0,0 +1,311 @@ +/* BeamDialog.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package nl.astron.lofar.sas.otbcomponents; +import java.util.BitSet; +import java.util.Vector; +import javax.swing.JOptionPane; +import javax.swing.border.TitledBorder; +import nl.astron.lofar.lofarutils.LofarUtils; +import nl.astron.lofar.sas.otb.MainFrame; +import org.apache.log4j.Logger; + + +/** + * + * @created 11-02-2008, 13:35 + * + * @author coolen + * + * @version $Id$ + */ +public class BeamDialog extends javax.swing.JDialog { + static Logger logger = Logger.getLogger(BeamDialog.class); + static String name = "BeamDialog"; + + /** Creates new form BeanForm + * + * @param parent Frame where this dialog belongs + * @param modal Should the Dialog be modal or not + * @param usedBeamlets Bitset of all used beamlets(in case edit, the old ones have been xorred allready) + * @param angle1 Vector of all Angle1's allready used + * @param angle2 Vector of all Angle2's allready used + * @param directionTypes Vector of all directionTypes allready used + * @param subbandList Vector of all subbandLists allready used + * @param beamletList Vector of all beamLetLists allready used + * @param directionTypeChoices String with all possible choices + default for combobox + * @param edit indicates edit or add mode + */ + public BeamDialog(java.awt.Frame parent, boolean modal,BitSet usedBeamlets, String[] selection, String directionTypeChoices, boolean edit ) { + + super(parent, modal); + initComponents(); + LofarUtils.setPopupComboChoices(inputDirectionTypes,directionTypeChoices); + itsDirectionTypes=selection[0]; + itsAngle1=selection[1]; + itsAngle2=selection[2]; + itsSubbandList=selection[3]; + itsBeamletList=selection[4]; + editting=edit; + itsUsedBeamlets=usedBeamlets; + itsSavedBeamlets=usedBeamlets; + initialize(); + } + + // check if Beamlets are spelled correctly and if Beamlets are not used by other Beams' + private boolean checkBeamlets(){ + if (inputBeamletList.getText().length() <=2) { + return false; + } + + BitSet aBitSet = LofarUtils.beamletToBitSet(inputBeamletList.getText()); + if(itsUsedBeamlets.intersects(aBitSet)) { + return false; + } else { + itsUsedBeamlets.or(aBitSet); + } + return true; + } + + private void initialize() { + + inputDirectionTypes.setSelectedItem(itsDirectionTypes); + inputAngle1.setText(itsAngle1); + inputAngle2.setText(itsAngle2); + inputSubbandList.setText(itsSubbandList); + inputBeamletList.setText(itsBeamletList); + } + + public boolean hasChanged() { + return isChanged; + } + + public BitSet getBeamletList() { + return itsUsedBeamlets; + } + + public void setBorderTitle(String text) { + TitledBorder aBorder=(TitledBorder)jPanel1.getBorder(); + aBorder.setTitle(text); + } + + + + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + jPanel1 = new javax.swing.JPanel(); + inputDirectionTypes = new javax.swing.JComboBox(); + labelAngle1 = new javax.swing.JLabel(); + inputAngle1 = new javax.swing.JTextField(); + labelAngle2 = new javax.swing.JLabel(); + inputAngle2 = new javax.swing.JTextField(); + labelSubbandList = new javax.swing.JLabel(); + inputSubbandList = new javax.swing.JTextField(); + labelBeamletList = new javax.swing.JLabel(); + inputBeamletList = new javax.swing.JTextField(); + cancelButton = new javax.swing.JButton(); + saveButton = new javax.swing.JButton(); + labelDirectionTypes = new javax.swing.JLabel(); + + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("LOFAR View TreeInfo"); + setAlwaysOnTop(true); + setModal(true); + setName("loadFileDialog"); + setResizable(false); + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Edit/Add Beam", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); + inputDirectionTypes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1" })); + + labelAngle1.setText("Angle 1:"); + + labelAngle2.setText("Angle 2 :"); + + labelSubbandList.setText("Subbands :"); + + labelBeamletList.setText("Beamlets :"); + + cancelButton.setText("Cancel"); + cancelButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cancelButtonActionPerformed(evt); + } + }); + + saveButton.setText("Save"); + saveButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + saveButtonActionPerformed(evt); + } + }); + + labelDirectionTypes.setText("directionTypes :"); + + org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) + .add(org.jdesktop.layout.GroupLayout.LEADING, labelBeamletList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, labelSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, labelAngle2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, labelAngle1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .add(labelDirectionTypes)) + .add(20, 20, 20) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(inputDirectionTypes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(inputAngle2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE) + .add(inputAngle1)) + .add(inputSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE) + .add(inputBeamletList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE))) + .add(jPanel1Layout.createSequentialGroup() + .add(cancelButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(saveButton))) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(inputDirectionTypes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(labelDirectionTypes)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(labelAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(inputAngle1, 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(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(labelAngle2) + .add(inputAngle2, 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(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(labelSubbandList) + .add(inputSubbandList, 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(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(labelBeamletList) + .add(inputBeamletList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(cancelButton) + .add(saveButton))) + ); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 950, 200)); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed + //check if input is correct + checkChanged(); + if (hasChanged() && !checkBeamlets()) { + if (JOptionPane.showConfirmDialog(this,"There is an error in the beamletList, some of them are allready in use by other Beams. continueing discards all changes. Continue?","Beamlet Error",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) { + isChanged=false; + setVisible(false); + dispose(); + } else { + return; + } + } else { + setVisible(false); + dispose(); + } + }//GEN-LAST:event_saveButtonActionPerformed + + private void checkChanged() { + if (!itsDirectionTypes.equals(inputDirectionTypes.getSelectedItem().toString())) { + isChanged=true; + } + if (!itsAngle1.equals(inputAngle1.getText())) { + isChanged=true; + } + if (!itsAngle2.equals(inputAngle2.getText())) { + isChanged=true; + } + if (!itsSubbandList.equals(inputSubbandList.getText())) { + isChanged=true; + } + if (!itsBeamletList.equals(inputBeamletList.getText())) { + isChanged=true; + } + } + + public String[] getBeam() { + String[] newRow = {inputDirectionTypes.getSelectedItem().toString(), + inputAngle1.getText(), + inputAngle2.getText(), + inputSubbandList.getText(), + inputBeamletList.getText() + }; + + return newRow; + } + + private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed + isChanged=false; + setVisible(false); + dispose(); + }//GEN-LAST:event_cancelButtonActionPerformed + + + private MainFrame itsMainFrame = null; + private boolean isChanged=false; + + private String itsAngle1 = ""; + private String itsAngle2 = ""; + private String itsDirectionTypes = ""; + private String itsSubbandList = ""; + private String itsBeamletList = ""; + private boolean editting = false; + private BitSet itsUsedBeamlets = new BitSet(216); + private BitSet itsSavedBeamlets = new BitSet(216); + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton cancelButton; + private javax.swing.JTextField inputAngle1; + private javax.swing.JTextField inputAngle2; + private javax.swing.JTextField inputBeamletList; + private javax.swing.JComboBox inputDirectionTypes; + private javax.swing.JTextField inputSubbandList; + private javax.swing.JPanel jPanel1; + private javax.swing.JLabel labelAngle1; + private javax.swing.JLabel labelAngle2; + private javax.swing.JLabel labelBeamletList; + private javax.swing.JLabel labelDirectionTypes; + private javax.swing.JLabel labelSubbandList; + private javax.swing.JButton saveButton; + // End of variables declaration//GEN-END:variables + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form index 17d558a810ef783af7d01dc7338f21c48b223375..c436c926300fc3d79a9bfba79e730a46a8494b0c 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.form @@ -7,7 +7,7 @@ <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,-46,0,0,3,-104"/> + <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,-54,0,0,4,19"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> @@ -68,12 +68,10 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel7" alignment="0" max="32767" attributes="0"/> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel7" min="-2" max="-2" attributes="0"/> - <Component id="jPanel4" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> + <Component id="labelStationList" max="32767" attributes="1"/> + <EmptySpace min="10" pref="10" max="10" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -82,8 +80,8 @@ <Group type="102" attributes="0"> <Component id="jPanel7" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel4" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="37" max="32767" attributes="0"/> + <Component id="labelStationList" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="525" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -94,24 +92,29 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel3" pref="564" max="32767" attributes="1"/> - <Component id="jPanel10" alignment="1" min="0" pref="564" max="32767" attributes="1"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="jPanel10" max="32767" attributes="1"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jPanel3" alignment="0" pref="1008" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel5" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel5" alignment="0" max="32767" attributes="1"/> <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel3" min="-2" pref="125" max="-2" attributes="1"/> + <Component id="jPanel3" min="-2" pref="213" max="-2" attributes="1"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel10" min="-2" pref="128" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jPanel10" max="32767" attributes="1"/> + <Component id="jPanel5" alignment="0" max="32767" attributes="1"/> + </Group> + <EmptySpace pref="13" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -121,7 +124,7 @@ <Properties> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="Beam Input"> + <TitledBorder title="Beam Configuration"> <Font PropertyName="font" name="Tahoma" size="11" style="1"/> <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> </TitledBorder> @@ -140,96 +143,63 @@ <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="labelDirectionTypes" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="labelAngleTimes" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="inputDirectionTypes" max="32767" attributes="1"/> - <Component id="inputAngleTimes" alignment="0" pref="131" max="32767" attributes="1"/> - </Group> - <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="labelAngle2" max="32767" attributes="1"/> - <Component id="labelAngle1" alignment="0" pref="66" max="32767" attributes="1"/> - </Group> - <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="inputAngle1" max="32767" attributes="1"/> - <Component id="inputAngle2" alignment="0" pref="190" max="32767" attributes="1"/> + <Component id="beamConfigurationPanel" alignment="0" pref="982" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="addBeamButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="editBeamButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="deleteBeamButton" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="345" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace pref="31" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputAngleTimes" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="labelAngle1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputAngle1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="15" pref="15" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="beamConfigurationPanel" min="-2" pref="154" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelDirectionTypes" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputDirectionTypes" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="labelAngle2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputAngle2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="editBeamButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="addBeamButton" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="deleteBeamButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="46" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <Component class="javax.swing.JLabel" name="labelAngle1"> - <Properties> - <Property name="text" type="java.lang.String" value="Angle 1:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputAngle1"> + <Component class="nl.astron.lofar.sas.otbcomponents.TablePanel" name="beamConfigurationPanel"> <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputAngle1FocusGained"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="beamConfigurationPanelMouseClicked"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="labelAngle2"> + <Component class="javax.swing.JButton" name="addBeamButton"> <Properties> - <Property name="text" type="java.lang.String" value="Angle 2 :"/> + <Property name="text" type="java.lang.String" value="add beam"/> </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputAngle2"> <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputAngle2FocusGained"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addBeamButtonActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="labelAngleTimes"> + <Component class="javax.swing.JButton" name="editBeamButton"> <Properties> - <Property name="text" type="java.lang.String" value="AngleTimes :"/> + <Property name="text" type="java.lang.String" value="edit beam"/> + <Property name="enabled" type="boolean" value="false"/> </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputAngleTimes"> <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputAngleTimesFocusGained"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editBeamButtonActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="labelDirectionTypes"> + <Component class="javax.swing.JButton" name="deleteBeamButton"> <Properties> - <Property name="text" type="java.lang.String" value="DirectionTypes:"/> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="inputDirectionTypes"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="1"> - <StringItem index="0" value="Item 1"/> - </StringArray> - </Property> + <Property name="text" type="java.lang.String" value="delete beam"/> + <Property name="enabled" type="boolean" value="false"/> </Properties> <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputDirectionTypesFocusGained"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteBeamButtonActionPerformed"/> </Events> </Component> </SubComponents> @@ -251,17 +221,14 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="stationsPanel" min="-2" pref="200" max="-2" attributes="0"/> - <EmptySpace pref="68" max="32767" attributes="0"/> + <Component id="stationsPanel" min="-2" pref="217" max="-2" attributes="0"/> + <EmptySpace pref="40" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="stationsPanel" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="20" max="32767" attributes="0"/> - </Group> + <Component id="stationsPanel" min="-2" pref="176" max="-2" attributes="0"/> </Group> </DimensionLayout> </Layout> @@ -424,34 +391,21 @@ <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="labelAntennaArray" alignment="0" max="32767" attributes="1"/> - <Component id="labelBandFilter" max="32767" attributes="1"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="inputAntennaArray" alignment="0" pref="143" max="32767" attributes="1"/> - <Component id="inputBandFilter" alignment="0" max="32767" attributes="1"/> - </Group> - <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="labelClockMode" max="32767" attributes="1"/> - <Component id="labelNyquistZone" alignment="0" max="32767" attributes="1"/> - </Group> - <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="inputClockMode" max="32767" attributes="1"/> - <Component id="inputNyquistZone" alignment="0" pref="178" max="32767" attributes="1"/> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="labelMSNameMask" min="-2" pref="80" max="-2" attributes="1"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="inputMSNameMask" min="-2" pref="331" max="-2" attributes="1"/> + <Component id="labelAntennaArray" pref="103" max="32767" attributes="1"/> + <Component id="labelClockMode" alignment="0" min="-2" max="-2" attributes="1"/> + <Component id="labelBandFilter" alignment="0" min="-2" max="-2" attributes="1"/> + <Component id="labelMSNameMask" alignment="0" min="-2" pref="103" max="-2" attributes="1"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="inputMSNameMask" alignment="0" min="-2" pref="490" max="-2" attributes="1"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="inputBandFilter" alignment="0" max="32767" attributes="1"/> + <Component id="inputClockMode" alignment="0" max="32767" attributes="1"/> + <Component id="inputAntennaArray" alignment="0" pref="213" max="32767" attributes="1"/> </Group> </Group> - <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="96" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -462,10 +416,13 @@ <Component id="labelMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputMSNameMask" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="24" max="32767" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="labelAntennaArray" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputAntennaArray" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> <Component id="labelClockMode" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputClockMode" alignment="3" min="-2" max="-2" attributes="0"/> </Group> @@ -473,8 +430,6 @@ <Group type="103" groupAlignment="3" attributes="0"> <Component id="labelBandFilter" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="inputBandFilter" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="labelNyquistZone" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputNyquistZone" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" pref="47" max="-2" attributes="0"/> </Group> @@ -547,26 +502,6 @@ <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputClockModeFocusGained"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="labelNyquistZone"> - <Properties> - <Property name="text" type="java.lang.String" value="Nyquist Zone:"/> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="inputNyquistZone"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="4"> - <StringItem index="0" value="Item 1"/> - <StringItem index="1" value="Item 2"/> - <StringItem index="2" value="Item 3"/> - <StringItem index="3" value="Item 4"/> - </StringArray> - </Property> - </Properties> - <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputNyquistZoneFocusGained"/> - </Events> - </Component> <Component class="javax.swing.JLabel" name="labelClockMode"> <Properties> <Property name="text" type="java.lang.String" value="Clock Mode:"/> @@ -576,182 +511,114 @@ </Container> </SubComponents> </Container> - <Container class="javax.swing.JPanel" name="jPanel4"> + <Container class="javax.swing.JPanel" name="labelStationList"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Generic Observation Lists"> + <Font PropertyName="font" name="Tahoma" size="11" style="1"/> + <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> + </TitledBorder> + </Border> + </Property> + </Properties> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="labelStationList" min="-2" max="-2" attributes="1"/> - <EmptySpace pref="20" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="treeDescriptionScrollPane" alignment="0" pref="982" max="32767" attributes="1"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="labelReceiverList" min="-2" pref="75" max="-2" attributes="1"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="inputReceiverList" pref="903" max="32767" attributes="1"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="descriptionScrollPane" pref="972" max="32767" attributes="1"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="labelStationList" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="44" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="labelReceiverList" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="inputReceiverList" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="treeDescriptionScrollPane" min="-2" pref="72" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="descriptionScrollPane" min="-2" pref="54" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <Container class="javax.swing.JPanel" name="labelStationList"> + <Component class="javax.swing.JLabel" name="labelReceiverList"> + <Properties> + <Property name="text" type="java.lang.String" value="Receivers :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="inputReceiverList"> + <Events> + <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputReceiverListFocusGained"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="treeDescriptionScrollPane"> <Properties> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="Generic Observation Lists"> + <TitledBorder title="Observation Tree Description"> <Font PropertyName="font" name="Tahoma" size="11" style="1"/> <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> </TitledBorder> </Border> </Property> </Properties> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="descriptionScrollPane" alignment="0" pref="848" max="32767" attributes="1"/> - <Component id="treeDescriptionScrollPane" alignment="1" pref="848" max="32767" attributes="0"/> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="labelSubbandList" pref="93" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="labelReceiverList" pref="90" max="32767" attributes="1"/> - <EmptySpace min="-2" pref="7" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="labelBeamletList" pref="88" max="32767" attributes="1"/> - <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="inputBeamletList" alignment="1" pref="741" max="32767" attributes="1"/> - <Component id="inputReceiverList" alignment="1" pref="741" max="32767" attributes="1"/> - <Component id="inputSubbandList" alignment="1" pref="741" max="32767" attributes="1"/> - </Group> - </Group> - </Group> - <EmptySpace max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace pref="24" max="32767" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelReceiverList" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputReceiverList" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelSubbandList" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputSubbandList" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="labelBeamletList" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="inputBeamletList" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="treeDescriptionScrollPane" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="descriptionScrollPane" min="-2" pref="54" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="javax.swing.JLabel" name="labelBeamletList"> - <Properties> - <Property name="text" type="java.lang.String" value="Beamlets :"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputBeamletList"> - <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputBeamletListFocusGained"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="labelReceiverList"> - <Properties> - <Property name="text" type="java.lang.String" value="Receivers :"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="inputReceiverList"> - <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputReceiverListFocusGained"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="labelSubbandList"> + <Component class="javax.swing.JTextArea" name="inputTreeDescription"> <Properties> - <Property name="text" type="java.lang.String" value="Subbands :"/> + <Property name="columns" type="int" value="20"/> + <Property name="rows" type="int" value="5"/> + <Property name="toolTipText" type="java.lang.String" value="The description set here will go to the Tree Description"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="inputSubbandList"> - <Events> - <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="inputSubbandListFocusGained"/> - </Events> - </Component> - <Container class="javax.swing.JScrollPane" name="treeDescriptionScrollPane"> - <Properties> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="Observation Tree Description"> - <Font PropertyName="font" name="Tahoma" size="11" style="1"/> - <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> - </TitledBorder> - </Border> - </Property> - </Properties> - <AuxValues> - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> - </AuxValues> + </SubComponents> + </Container> + <Container class="javax.swing.JScrollPane" name="descriptionScrollPane"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Field Descriptions."> + <Font PropertyName="font" name="Tahoma" size="11" style="1"/> + <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> + </TitledBorder> + </Border> + </Property> + </Properties> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTextArea" name="inputTreeDescription"> - <Properties> - <Property name="columns" type="int" value="20"/> - <Property name="rows" type="int" value="5"/> - <Property name="toolTipText" type="java.lang.String" value="The description set here will go to the Tree Description"/> - </Properties> - </Component> - </SubComponents> - </Container> - <Container class="javax.swing.JScrollPane" name="descriptionScrollPane"> + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="inputDescription"> <Properties> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="Field Descriptions."> - <Font PropertyName="font" name="Tahoma" size="11" style="1"/> - <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> - </TitledBorder> - </Border> - </Property> + <Property name="columns" type="int" value="20"/> + <Property name="editable" type="boolean" value="false"/> + <Property name="rows" type="int" value="5"/> </Properties> - <AuxValues> - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> - </AuxValues> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTextArea" name="inputDescription"> - <Properties> - <Property name="columns" type="int" value="20"/> - <Property name="editable" type="boolean" value="false"/> - <Property name="rows" type="int" value="5"/> - </Properties> - </Component> - </SubComponents> - </Container> + </Component> </SubComponents> </Container> </SubComponents> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java index fe65fe6cf53330fe742979a5be167d775b8dee95..3d23d8450c080ee6db4172cdc3c0e3126a604a45 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java @@ -28,6 +28,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.rmi.RemoteException; +import java.util.BitSet; import java.util.Enumeration; import java.util.Vector; import javax.swing.DefaultListModel; @@ -37,6 +38,7 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; +import javax.swing.ListSelectionModel; import javax.swing.border.TitledBorder; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.MainFrame; @@ -46,6 +48,8 @@ import nl.astron.lofar.sas.otb.jotdb2.jOTDBtree; 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 nl.astron.lofar.sas.otb.util.tablemodels.BeamConfigurationTableModel; +import nl.astron.lofar.sas.otbcomponents.BeamDialog; import org.apache.log4j.Logger; /** @@ -120,7 +124,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ aParam = itsOtdbRmi.getRemoteMaintenance().getParam(aNode); setField(itsNode,aParam,aNode); //we need to get all the childs from the following nodes as well. - }else if (LofarUtils.keyName(aNode.name).equals("Beam")) { + }else if (LofarUtils.keyName(aNode.name).contains("Beam")) { + itsBeams.addElement(aNode); this.retrieveAndDisplayChildDataForNode(aNode); } else if (LofarUtils.keyName(aNode.name).equals("VirtualInstrument")) { this.retrieveAndDisplayChildDataForNode(aNode); @@ -278,10 +283,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ String parentName = LofarUtils.keyName(String.valueOf(parent.name)); /* Set's the different fields in the GUI */ - // Generic OLAP - if (aParam==null) { - return; - } logger.debug("setField for: "+ aNode.name); try { if (itsOtdbRmi.getRemoteTypes().getParamType(aParam.type).substring(0,1).equals("p")) { @@ -323,21 +324,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ inputClockMode.setSelectedItem(aNode.limits); } itsClockMode=aNode; - } else if (aKeyName.equals("nyquistZone")) { - inputNyquistZone.setToolTipText(aParam.description); - LofarUtils.setPopupComboChoices(inputNyquistZone,aParam.limits); - if (!aNode.limits.equals("")) { - inputNyquistZone.setSelectedItem(aNode.limits); - } - itsNyquistZone=aNode; - } else if (aKeyName.equals("beamletList")) { - inputBeamletList.setToolTipText(aParam.description); - itsBeamletList=aNode; - if (isRef && aParam != null) { - inputBeamletList.setText(aNode.limits + " : " + aParam.limits); - } else { - inputBeamletList.setText(aNode.limits); - } } else if (aKeyName.equals("receiverList")) { inputReceiverList.setToolTipText(aParam.description); itsReceiverList=aNode; @@ -345,49 +331,39 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ inputReceiverList.setText(aNode.limits + " : " + aParam.limits); } else { inputReceiverList.setText(aNode.limits); - } - } else if (aKeyName.equals("subbandList")) { - inputSubbandList.setToolTipText(aParam.description); - itsSubbandList=aNode; - if (isRef && aParam != null) { - inputSubbandList.setText(aNode.limits + " : " + aParam.limits); - } else { - inputSubbandList.setText(aNode.limits); - } + } + } else if (aKeyName.equals("nrBeams")) { + itsNrBeams=aNode; } - } else if(parentName.equals("Beam")){ + } else if(parentName.contains("Beam")){ // Observation Beam parameters if (aKeyName.equals("angle1")) { - inputAngle1.setToolTipText(aParam.description); - itsAngle1=aNode; if (isRef && aParam != null) { - inputAngle1.setText(aNode.limits + " : " + aParam.limits); + itsAngle1.add(aNode.limits + " : " + aParam.limits); } else { - inputAngle1.setText(aNode.limits); + itsAngle1.add(aNode.limits); } } else if (aKeyName.equals("angle2")) { - inputAngle2.setToolTipText(aParam.description); - itsAngle2=aNode; if (isRef && aParam != null) { - inputAngle2.setText(aNode.limits + " : " + aParam.limits); + itsAngle2.add(aNode.limits + " : " + aParam.limits); } else { - inputAngle2.setText(aNode.limits); + itsAngle2.add(aNode.limits); } - } else if (aKeyName.equals("angleTimes")) { - inputAngleTimes.setToolTipText(aParam.description); - itsAngleTimes=aNode; + } else if (aKeyName.equals("directionTypes")) { + itsDirectionTypeChoices=aParam.limits; + itsDirectionTypes.add(aNode.limits); + } else if (aKeyName.equals("beamletList")) { if (isRef && aParam != null) { - inputAngleTimes.setText(aNode.limits + " : " + aParam.limits); + itsBeamletList.add(aNode.limits + " : " + aParam.limits); + } else { + itsBeamletList.add(aNode.limits); + } + } else if (aKeyName.equals("subbandList")) { + if (isRef && aParam != null) { + itsSubbandList.add(aNode.limits + " : " + aParam.limits); } else { - inputAngleTimes.setText(aNode.limits); - } - } else if (aKeyName.equals("directionTypes")) { - inputDirectionTypes.setToolTipText(aParam.description); - LofarUtils.setPopupComboChoices(inputDirectionTypes,aParam.limits); - if (!aNode.limits.equals("")) { - inputDirectionTypes.setSelectedItem(aNode.limits); - } - itsDirectionTypes=aNode; + itsSubbandList.add(aNode.limits); + } } } else if(parentName.equals("VirtualInstrument")){ // Observation VirtualInstrument parameters @@ -417,24 +393,29 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ /** Restore original Values in panel */ private void restore() { + // Observation Specific parameters inputMSNameMask.setText(itsMSNameMask.limits); inputAntennaArray.setSelectedItem(itsAntennaArray.limits); inputBandFilter.setSelectedItem(itsBandFilter.limits); inputClockMode.setSelectedItem(itsClockMode.limits); - inputNyquistZone.setSelectedItem(itsNyquistZone.limits); - inputBeamletList.setText(itsBeamletList.limits); inputReceiverList.setText(itsReceiverList.limits); - inputSubbandList.setText(itsSubbandList.limits); inputDescription.setText(""); inputTreeDescription.setText(itsOldTreeDescription); - // Observation Beam parameters - inputAngle1.setText(itsAngle1.limits); - inputAngle2.setText(itsAngle2.limits); - inputAngleTimes.setText(itsAngleTimes.limits); - inputDirectionTypes.setSelectedItem(itsDirectionTypes.limits); - + if (!itsTreeType.equals("VHtree")) { + // Observation Beam parameters + // create original Beamlet Bitset + fillBeamletBitset(); + } + + // set table back to initial values + itsBeamConfigurationTableModel.fillTable(itsTreeType,itsDirectionTypes,itsAngle1,itsAngle2,itsSubbandList,itsBeamletList); + + + + buttonPanel1.setButtonEnabled("Restore",false); + buttonPanel1.setButtonEnabled("Save",false); // Observation VirtualInstrument parameters //set the checkbox correctly when no stations are provided in the data @@ -445,9 +426,36 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ aBorder.setTitle("Station Names"); LofarUtils.fillList(stationsList,itsStationList.limits,false); } + + if (beamConfigurationPanel.getTableModel().getRowCount() == 8) { + this.addBeamButton.setEnabled(false); + } else { + this.addBeamButton.setEnabled(true); + } } + /** fill the Beamlet bitset to see what Beamlets have been set. To be able to determine later if a given Beamlet is indeed free. + */ + private void fillBeamletBitset() { + itsUsedBeamlets.clear(); + for (int i=1;i<itsBeamletList.size();i++) { + BitSet aNewBitSet=LofarUtils.beamletToBitSet(itsBeamletList.elementAt(i)); + + // check if no duplication between the two bitsets + if (itsUsedBeamlets.intersects(aNewBitSet)) { + String errorMsg = "ERROR: This BeamletList has beamlets defined that are allready used in a prior BeamConfiguration!!!!! BeamNr: "+i; + JOptionPane.showMessageDialog(this,errorMsg,"BeamletError",JOptionPane.ERROR_MESSAGE); + logger.error(errorMsg ); + return; + } + + // No intersection, both bitsets can be or + itsUsedBeamlets.or(aNewBitSet); + } + } + + private void initialize() { buttonPanel1.addButton("Restore"); buttonPanel1.addButton("Save"); @@ -461,9 +469,22 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ this.modifyStationsCombobox.addItem("CS008"); this.modifyStationsCombobox.addItem("CS010"); this.modifyStationsCombobox.addItem("CS016"); + + itsBeamConfigurationTableModel = new BeamConfigurationTableModel(); + beamConfigurationPanel.setTableModel(itsBeamConfigurationTableModel); + beamConfigurationPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + beamConfigurationPanel.setColumnSize("dirtype",20); + beamConfigurationPanel.setColumnSize("angle 1",20); + beamConfigurationPanel.setColumnSize("angle 2",20); + beamConfigurationPanel.setColumnSize("subbands",250); + beamConfigurationPanel.setColumnSize("beamlets",250); + beamConfigurationPanel.repaint(); } private void initPanel() { + + itsMainFrame.setHourglassCursor(); + // check access UserAccount userAccount = itsMainFrame.getUserAccount(); @@ -492,6 +513,19 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ } } else { logger.debug("ERROR: no node given"); } + + // set defaults + // create initial beamletBitset + // create initial table + restore(); + + if (itsTreeType.equals("VHtree")) { + this.setButtonsVisible(false); + this.setAllEnabled(false); + } + + itsMainFrame.setNormalCursor(); + } /** saves the given node back to the database @@ -512,6 +546,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ * @param enabled true/false enabled/disabled */ public void enableButtons(boolean enabled) { + addBeamButton.setEnabled(enabled); + editBeamButton.setEnabled(enabled); + deleteBeamButton.setEnabled(enabled); + addStationButton.setEnabled(enabled); + deleteStationButton.setEnabled(enabled); + buttonPanel1.setButtonEnabled("Restore",enabled); + buttonPanel1.setButtonEnabled("Save",enabled); } /** Sets the buttons visible/invisible @@ -519,6 +560,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ * @param visible true/false visible/invisible */ public void setButtonsVisible(boolean visible) { + addBeamButton.setVisible(visible); + editBeamButton.setVisible(visible); + deleteBeamButton.setVisible(visible); + addStationButton.setVisible(visible); + deleteStationButton.setVisible(visible); + buttonPanel1.setButtonVisible("Restore",visible); + buttonPanel1.setButtonVisible("Save",visible); } /** Enables/disables the complete form @@ -526,25 +574,82 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ * @param enabled true/false enabled/disabled */ public void setAllEnabled(boolean enabled) { + this.inputAntennaArray.setEnabled(enabled); + this.inputBandFilter.setEnabled(enabled); + this.inputClockMode.setEnabled(enabled); + this.inputDescription.setEnabled(enabled); + this.inputMSNameMask.setEnabled(enabled); + this.inputReceiverList.setEnabled(enabled); + this.inputTreeDescription.setEnabled(enabled); + this.modifyStationsCombobox.setEnabled(enabled); } - private void saveInput() { + private boolean saveInput() { // Beam - if (itsAngleTimes != null && !inputAngleTimes.equals(itsAngleTimes.limits)) { - itsAngleTimes.limits = inputAngleTimes.getText(); - saveNode(itsAngleTimes); - } - if (itsAngle1 != null && !inputAngle1.equals(itsAngle1.limits)) { - itsAngle1.limits = inputAngle1.getText(); - saveNode(itsAngle1); - } - if (itsAngle2 != null && !inputAngle2.equals(itsAngle2.limits)) { - itsAngle2.limits = inputAngle2.getText(); - saveNode(itsAngle2); - } - if (itsDirectionTypes != null && !inputDirectionTypes.getSelectedItem().toString().equals(itsDirectionTypes.limits)) { - itsDirectionTypes.limits = inputDirectionTypes.getSelectedItem().toString(); - saveNode(itsDirectionTypes); + int i=0; + //delete all Beams from the table (excluding the Default one); + + // Keep the 1st one, it's the default Beam + try { + for (i=1; i< itsBeams.size(); i++) { + itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().deleteNode(itsBeams.elementAt(i)); + } + } catch (RemoteException ex) { + logger.error("Error during deletion of defaultNode: "+ex); + return false; + } + + // now that all Nodes are deleted we should collect the tables input and create new Beams to save to the database. + itsBeamConfigurationTableModel.getTable(itsDirectionTypes,itsAngle1,itsAngle2,itsSubbandList,itsBeamletList); + // keep defaultTBBsetting save + jOTDBnode aDefaultNode= itsBeams.elementAt(0); + itsBeams.clear(); + try { + // for all elements + for (i=1; i < itsDirectionTypes.size();i++) { + + // make a dupnode from the default node, give it the next number in the count,get the elements and fill all values from the elements + // with the values from the set fields and save the elements again + // + // Duplicates the given node (and its parameters and children) + int aN = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().dupNode(itsNode.treeID(),aDefaultNode.nodeID(),(short)(i)); + if (aN <= 0) { + logger.error("Something went wrong with duplicating tree no ("+i+") will try to save remainder"); + } else { + // we got a new duplicate whos children need to be filled with the settings from the panel. + jOTDBnode aNode = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getNode(itsNode.treeID(),aN); + // store new duplicate in itsBeams. + itsBeams.add(aNode); + + Vector HWchilds = itsMainFrame.getSharedVars().getOTDBrmi().getRemoteMaintenance().getItemList(aNode.treeID(), aNode.nodeID(), 1); + // get all the params per child + Enumeration e1 = HWchilds.elements(); + while( e1.hasMoreElements() ) { + jOTDBnode aHWNode = (jOTDBnode)e1.nextElement(); + String aKeyName = LofarUtils.keyName(aHWNode.name); + if (aKeyName.equals("directionTypes")) { + aHWNode.limits=itsDirectionTypes.elementAt(i); + } else if (aKeyName.equals("angle1")) { + aHWNode.limits=itsAngle1.elementAt(i); + } else if (aKeyName.equals("angle2")) { + aHWNode.limits=itsAngle2.elementAt(i); + } else if (aKeyName.equals("subbandList")) { + aHWNode.limits=itsSubbandList.elementAt(i); + } else if (aKeyName.equals("beamletList")) { + aHWNode.limits=itsBeamletList.elementAt(i); + } + saveNode(aHWNode); + } + } + } + + // store new number of instances in baseSetting + aDefaultNode.instances=(short)(itsDirectionTypes.size()-1); // - default at 0 + saveNode(aDefaultNode); + + } catch (RemoteException ex) { + logger.error("Error during duplication and save : " + ex); + return false; } //VirtualInstrument @@ -559,18 +664,10 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ itsMSNameMask.limits = inputMSNameMask.getText(); saveNode(itsMSNameMask); } - if (itsBeamletList != null && !inputBeamletList.equals(itsBeamletList.limits)) { - itsBeamletList.limits = inputBeamletList.getText(); - saveNode(itsBeamletList); - } if (itsReceiverList != null && !inputReceiverList.equals(itsReceiverList.limits)) { itsReceiverList.limits = inputReceiverList.getText(); saveNode(itsReceiverList); } - if (itsSubbandList != null && !inputSubbandList.equals(itsSubbandList.limits)) { - itsSubbandList.limits = inputSubbandList.getText(); - saveNode(itsSubbandList); - } if (itsAntennaArray != null && !inputAntennaArray.getSelectedItem().toString().equals(itsAntennaArray.limits)) { itsAntennaArray.limits = inputAntennaArray.getSelectedItem().toString(); saveNode(itsAntennaArray); @@ -583,10 +680,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ itsClockMode.limits = inputClockMode.getSelectedItem().toString(); saveNode(itsClockMode); } - if (itsNyquistZone != null && !inputNyquistZone.getSelectedItem().toString().equals(itsNyquistZone.limits)) { - itsNyquistZone.limits = inputNyquistZone.getSelectedItem().toString(); - saveNode(itsNyquistZone); - } // treeDescription if (itsOldTreeDescription != null && !inputTreeDescription.getText().equals(itsOldTreeDescription)) { @@ -601,7 +694,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ itsMainFrame.setChanged("Home",true); } - + // reset all buttons, flags and tables to initial start position. So the panel now reflects the new, saved situation + initPanel(); + + itsMainFrame.setChanged("Template_Maintenance("+itsNode.treeID()+")" ,true); + itsMainFrame.checkChanged("Template_Maintenance("+itsNode.treeID()+")"); + + return true; } private void changeDescription(jOTDBnode aNode) { @@ -631,7 +730,90 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ return; } } + + + private void deleteBeam() { + int row = beamConfigurationPanel.getSelectedRow(); + // if removed then the old Beamlets's should be removed form the checklist also + String oldBeamlets = itsBeamConfigurationTableModel.getSelection(row)[4]; + BitSet beamletSet = LofarUtils.beamletToBitSet(oldBeamlets); + + if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this Beam ?","Delete Beam",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) { + if (row > -1) { + itsBeamConfigurationTableModel.removeRow(row); + itsUsedBeamlets.xor(beamletSet); + // No selection anymore after delete, so buttons disabled again + this.editBeamButton.setEnabled(false); + this.deleteBeamButton.setEnabled(false); + + // something obviously changed, so enable restore and save buttons + buttonPanel1.setButtonEnabled("Restore",true); + buttonPanel1.setButtonEnabled("Save",true); + + } + } + + if (beamConfigurationPanel.getTableModel().getRowCount() == 8) { + this.addBeamButton.setEnabled(false); + } else { + this.addBeamButton.setEnabled(true); + } + } + + private void addBeam() { + + BitSet aBS=itsUsedBeamlets; + int index=0; + // set selection to defaults. + String [] selection = {itsDirectionTypes.elementAt(0),itsAngle1.elementAt(0), + itsAngle2.elementAt(0),itsSubbandList.elementAt(0),itsBeamletList.elementAt(0)}; + if (editting) { + index = beamConfigurationPanel.getSelectedRow(); + selection = itsBeamConfigurationTableModel.getSelection(index); + BitSet oldBeamlets = LofarUtils.beamletToBitSet(selection[4]); + aBS.xor(oldBeamlets); + // if no row is selected, nothing to be done + if (selection == null || selection[0] == "") { + return; + } + } + beamDialog = new BeamDialog(itsMainFrame,true,aBS,selection,itsDirectionTypeChoices,editting); + beamDialog.setLocationRelativeTo(this); + if (editting) { + beamDialog.setBorderTitle("edit Beam"); + } else { + beamDialog.setBorderTitle("add new Beam"); + } + beamDialog.setVisible(true); + + // check if something has changed + if (beamDialog.hasChanged()) { + String[] newRow = beamDialog.getBeam(); + itsUsedBeamlets=beamDialog.getBeamletList(); + // check if we are editting an entry or adding a new entry + if (editting) { + itsBeamConfigurationTableModel.updateRow(newRow,itsSelectedRow); + // set editting = false + editting=false; + } else { + itsBeamConfigurationTableModel.addRow(newRow); + } + } + + this.editBeamButton.setEnabled(false); + this.deleteBeamButton.setEnabled(false); + if (beamConfigurationPanel.getTableModel().getRowCount() == 8 ) { + this.addBeamButton.setEnabled(false); + } else { + this.addBeamButton.setEnabled(true); + } + + // something obviously changed, so enable restore and save buttons + buttonPanel1.setButtonEnabled("Restore",true); + buttonPanel1.setButtonEnabled("Save",true); + + } // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { @@ -643,14 +825,10 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ jPanel2 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); - labelAngle1 = new javax.swing.JLabel(); - inputAngle1 = new javax.swing.JTextField(); - labelAngle2 = new javax.swing.JLabel(); - inputAngle2 = new javax.swing.JTextField(); - labelAngleTimes = new javax.swing.JLabel(); - inputAngleTimes = new javax.swing.JTextField(); - labelDirectionTypes = new javax.swing.JLabel(); - inputDirectionTypes = new javax.swing.JComboBox(); + beamConfigurationPanel = new nl.astron.lofar.sas.otbcomponents.TablePanel(); + addBeamButton = new javax.swing.JButton(); + editBeamButton = new javax.swing.JButton(); + deleteBeamButton = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); stationsPanel = new javax.swing.JPanel(); stationsScrollPane = new javax.swing.JScrollPane(); @@ -668,17 +846,10 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ labelBandFilter = new javax.swing.JLabel(); inputBandFilter = new javax.swing.JComboBox(); inputClockMode = new javax.swing.JComboBox(); - labelNyquistZone = new javax.swing.JLabel(); - inputNyquistZone = new javax.swing.JComboBox(); labelClockMode = new javax.swing.JLabel(); - jPanel4 = new javax.swing.JPanel(); labelStationList = new javax.swing.JPanel(); - labelBeamletList = new javax.swing.JLabel(); - inputBeamletList = new javax.swing.JTextField(); labelReceiverList = new javax.swing.JLabel(); inputReceiverList = new javax.swing.JTextField(); - labelSubbandList = new javax.swing.JLabel(); - inputSubbandList = new javax.swing.JTextField(); treeDescriptionScrollPane = new javax.swing.JScrollPane(); inputTreeDescription = new javax.swing.JTextArea(); descriptionScrollPane = new javax.swing.JScrollPane(); @@ -699,40 +870,36 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ add(jPanel1, java.awt.BorderLayout.NORTH); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("")); - jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Beam Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Beam Configuration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); jPanel3.setPreferredSize(new java.awt.Dimension(200, 125)); jPanel3.setRequestFocusEnabled(false); jPanel3.setVerifyInputWhenFocusTarget(false); - labelAngle1.setText("Angle 1:"); - - inputAngle1.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputAngle1FocusGained(evt); + beamConfigurationPanel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + beamConfigurationPanelMouseClicked(evt); } }); - labelAngle2.setText("Angle 2 :"); - - inputAngle2.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputAngle2FocusGained(evt); + addBeamButton.setText("add beam"); + addBeamButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + addBeamButtonActionPerformed(evt); } }); - labelAngleTimes.setText("AngleTimes :"); - - inputAngleTimes.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputAngleTimesFocusGained(evt); + editBeamButton.setText("edit beam"); + editBeamButton.setEnabled(false); + editBeamButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + editBeamButtonActionPerformed(evt); } }); - labelDirectionTypes.setText("DirectionTypes:"); - - inputDirectionTypes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1" })); - inputDirectionTypes.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputDirectionTypesFocusGained(evt); + deleteBeamButton.setText("delete beam"); + deleteBeamButton.setEnabled(false); + deleteBeamButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + deleteBeamButtonActionPerformed(evt); } }); @@ -743,38 +910,24 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel3Layout.createSequentialGroup() .addContainerGap() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(labelDirectionTypes) - .add(labelAngleTimes)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(inputDirectionTypes, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(inputAngleTimes, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)) - .add(28, 28, 28) - .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(labelAngle2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(labelAngle1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)) - .add(13, 13, 13) - .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(inputAngle1) - .add(inputAngle2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)) - .addContainerGap(31, Short.MAX_VALUE)) + .add(beamConfigurationPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 982, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup() + .add(addBeamButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(editBeamButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(deleteBeamButton) + .add(345, 345, 345)))) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(labelAngleTimes) - .add(inputAngleTimes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(labelAngle1) - .add(inputAngle1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(15, 15, 15) + .add(beamConfigurationPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 154, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(labelDirectionTypes) - .add(inputDirectionTypes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(labelAngle2) - .add(inputAngle2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(46, 46, 46)) + .add(editBeamButton) + .add(addBeamButton) + .add(deleteBeamButton))) ); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Virtual Instrument Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); @@ -857,14 +1010,12 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .addContainerGap() - .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap(68, Short.MAX_VALUE)) + .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 217, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap(40, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel5Layout.createSequentialGroup() - .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap(20, Short.MAX_VALUE)) + .add(stationsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 176, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ); jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Generic Observation Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); @@ -901,15 +1052,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ } }); - labelNyquistZone.setText("Nyquist Zone:"); - - inputNyquistZone.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - inputNyquistZone.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputNyquistZoneFocusGained(evt); - } - }); - labelClockMode.setText("Clock Mode:"); org.jdesktop.layout.GroupLayout jPanel10Layout = new org.jdesktop.layout.GroupLayout(jPanel10); @@ -919,27 +1061,18 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel10Layout.createSequentialGroup() .addContainerGap() .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel10Layout.createSequentialGroup() - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(labelAntennaArray, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(labelBandFilter, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(inputAntennaArray, 0, 143, Short.MAX_VALUE) - .add(inputBandFilter, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .add(12, 12, 12) - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(labelClockMode, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(labelNyquistZone, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .add(18, 18, 18) - .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) - .add(inputClockMode, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(inputNyquistZone, 0, 178, Short.MAX_VALUE))) - .add(jPanel10Layout.createSequentialGroup() - .add(labelMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 331, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .add(36, 36, 36)) + .add(labelAntennaArray, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE) + .add(labelClockMode) + .add(labelBandFilter) + .add(labelMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 103, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 490, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) + .add(org.jdesktop.layout.GroupLayout.LEADING, inputBandFilter, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, inputClockMode, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.LEADING, inputAntennaArray, 0, 213, Short.MAX_VALUE))) + .add(96, 96, 96)) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -947,18 +1080,18 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelMSNameMask) .add(inputMSNameMask, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 24, Short.MAX_VALUE) .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelAntennaArray) - .add(inputAntennaArray, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(inputAntennaArray, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(12, 12, 12) + .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelClockMode) .add(inputClockMode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(13, 13, 13) .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelBandFilter) - .add(inputBandFilter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(labelNyquistZone) - .add(inputNyquistZone, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(inputBandFilter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(47, 47, 47)) ); @@ -968,30 +1101,25 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup() .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel10, 0, 564, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel7Layout.createSequentialGroup() + .add(jPanel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1008, Short.MAX_VALUE)) .addContainerGap()) ); jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel7Layout.createSequentialGroup() - .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 125, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 213, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 128, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(jPanel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(13, Short.MAX_VALUE)) ); labelStationList.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Generic Observation Lists", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); - labelBeamletList.setText("Beamlets :"); - - inputBeamletList.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputBeamletListFocusGained(evt); - } - }); - labelReceiverList.setText("Receivers :"); inputReceiverList.addFocusListener(new java.awt.event.FocusAdapter() { @@ -1000,14 +1128,6 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ } }); - labelSubbandList.setText("Subbands :"); - - inputSubbandList.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusGained(java.awt.event.FocusEvent evt) { - inputSubbandListFocusGained(evt); - } - }); - treeDescriptionScrollPane.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Observation Tree Description", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); inputTreeDescription.setColumns(20); inputTreeDescription.setRows(5); @@ -1024,81 +1144,46 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ labelStationList.setLayout(labelStationListLayout); labelStationListLayout.setHorizontalGroup( labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, labelStationListLayout.createSequentialGroup() - .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(org.jdesktop.layout.GroupLayout.LEADING, descriptionScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE) - .add(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE) + .add(labelStationListLayout.createSequentialGroup() + .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 982, Short.MAX_VALUE) .add(labelStationListLayout.createSequentialGroup() + .add(labelReceiverList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(inputReceiverList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 903, Short.MAX_VALUE)) + .add(org.jdesktop.layout.GroupLayout.TRAILING, labelStationListLayout.createSequentialGroup() .addContainerGap() - .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(labelStationListLayout.createSequentialGroup() - .add(labelSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) - .add(labelStationListLayout.createSequentialGroup() - .add(labelReceiverList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE) - .add(7, 7, 7)) - .add(labelStationListLayout.createSequentialGroup() - .add(labelBeamletList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) - .add(9, 9, 9))) - .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, inputBeamletList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, inputReceiverList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, inputSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE)))) + .add(descriptionScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE))) .addContainerGap()) ); labelStationListLayout.setVerticalGroup( labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(labelStationListLayout.createSequentialGroup() - .addContainerGap(24, Short.MAX_VALUE) .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(labelReceiverList) .add(inputReceiverList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(14, 14, 14) - .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(labelSubbandList) - .add(inputSubbandList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(15, 15, 15) - .add(labelStationListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(labelBeamletList) - .add(inputBeamletList, 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(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(treeDescriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(descriptionScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); - org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); - jPanel4.setLayout(jPanel4Layout); - jPanel4Layout.setHorizontalGroup( - jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel4Layout.createSequentialGroup() - .add(labelStationList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap(20, Short.MAX_VALUE)) - ); - jPanel4Layout.setVerticalGroup( - jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel4Layout.createSequentialGroup() - .add(labelStationList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(44, 44, 44)) - ); - org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel2Layout.createSequentialGroup() - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .add(labelStationList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(10, 10, 10)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(jPanel7, 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(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap(37, Short.MAX_VALUE)) + .add(labelStationList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap(525, Short.MAX_VALUE)) ); jScrollPane1.setViewportView(jPanel2); @@ -1114,22 +1199,28 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ }// </editor-fold>//GEN-END:initComponents - private void inputSubbandListFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputSubbandListFocusGained - changeDescription(itsSubbandList); - }//GEN-LAST:event_inputSubbandListFocusGained + private void deleteBeamButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBeamButtonActionPerformed + deleteBeam(); + }//GEN-LAST:event_deleteBeamButtonActionPerformed + + private void editBeamButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBeamButtonActionPerformed + editting=true; + addBeam(); + }//GEN-LAST:event_editBeamButtonActionPerformed + + private void addBeamButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBeamButtonActionPerformed + addBeam(); + }//GEN-LAST:event_addBeamButtonActionPerformed + + private void beamConfigurationPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_beamConfigurationPanelMouseClicked + editBeamButton.setEnabled(true); + deleteBeamButton.setEnabled(true); + }//GEN-LAST:event_beamConfigurationPanelMouseClicked private void inputReceiverListFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputReceiverListFocusGained changeDescription(itsReceiverList); }//GEN-LAST:event_inputReceiverListFocusGained - private void inputBeamletListFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputBeamletListFocusGained - changeDescription(itsBeamletList); - }//GEN-LAST:event_inputBeamletListFocusGained - - private void inputNyquistZoneFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputNyquistZoneFocusGained - changeDescription(itsNyquistZone); - }//GEN-LAST:event_inputNyquistZoneFocusGained - private void inputClockModeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputClockModeFocusGained changeDescription(itsClockMode); }//GEN-LAST:event_inputClockModeFocusGained @@ -1150,23 +1241,17 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ changeDescription(itsStationList); }//GEN-LAST:event_stationsListFocusGained - private void inputAngle2FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputAngle2FocusGained - changeDescription(itsAngle2); - }//GEN-LAST:event_inputAngle2FocusGained - - private void inputDirectionTypesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputDirectionTypesFocusGained - changeDescription(itsDirectionTypes); - }//GEN-LAST:event_inputDirectionTypesFocusGained - - private void inputAngleTimesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputAngleTimesFocusGained - changeDescription(itsAngleTimes); - }//GEN-LAST:event_inputAngleTimesFocusGained - private void buttonPanel1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPanel1ActionPerformed if(evt.getActionCommand() == "Save") { - saveInput(); + if (JOptionPane.showConfirmDialog(this,"This will throw away all old Beams from the database and rewrite the new ones. Are you sure you want to do this ","Write new configurations",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) { + itsMainFrame.setHourglassCursor(); + saveInput(); + itsMainFrame.setNormalCursor(); + } } else if(evt.getActionCommand() == "Restore") { + itsMainFrame.setHourglassCursor(); restore(); + itsMainFrame.setNormalCursor(); } }//GEN-LAST:event_buttonPanel1ActionPerformed @@ -1199,82 +1284,77 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{ this.deleteStationButton.setEnabled(false); } }//GEN-LAST:event_stationsListValueChanged - - private void inputAngle1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputAngle1FocusGained - changeDescription(itsAngle1); - }//GEN-LAST:event_inputAngle1FocusGained - private jOTDBnode itsNode = null; - private MainFrame itsMainFrame; - private OtdbRmi itsOtdbRmi; - private jOTDBparam itsOldDescriptionParam; - private String itsOldTreeDescription; - private String itsTreeType=""; - private JFileChooser fc = null; + private jOTDBnode itsNode = null; + private MainFrame itsMainFrame; + private OtdbRmi itsOtdbRmi; + private jOTDBparam itsOldDescriptionParam; + private String itsDirectionTypeChoices; + private String itsOldTreeDescription; + private String itsTreeType=""; + private BeamConfigurationTableModel itsBeamConfigurationTableModel = null; + private JFileChooser fc = null; + private BeamDialog beamDialog = null; // Observation Specific parameters private jOTDBnode itsMSNameMask; private jOTDBnode itsAntennaArray; private jOTDBnode itsBandFilter; private jOTDBnode itsClockMode; - private jOTDBnode itsNyquistZone; - private jOTDBnode itsBeamletList; private jOTDBnode itsReceiverList; - private jOTDBnode itsSubbandList; + private jOTDBnode itsNrBeams; + // Beams + private Vector<jOTDBnode> itsBeams = new Vector<jOTDBnode>(); // Observation Beam parameters - private jOTDBnode itsAngle1; - private jOTDBnode itsAngle2; - private jOTDBnode itsAngleTimes; - private jOTDBnode itsDirectionTypes; + private Vector<String> itsAngle1 = new Vector<String>(); + private Vector<String> itsAngle2 = new Vector<String>(); + private Vector<String> itsDirectionTypes = new Vector<String>(); + private Vector<String> itsSubbandList = new Vector<String>(); + private Vector<String> itsBeamletList = new Vector<String>(); + // each beamlet has its bit in the bitset + private BitSet itsUsedBeamlets = new BitSet(216); + private boolean editting = false; + private boolean isInitialized=false; + private int itsSelectedRow = -1; + private String itsSavedBeamlets = ""; // Observation Virtual Instrument parameters private jOTDBnode itsStationList; // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton addBeamButton; private javax.swing.JButton addStationButton; + private nl.astron.lofar.sas.otbcomponents.TablePanel beamConfigurationPanel; private nl.astron.lofar.sas.otbcomponents.ButtonPanel buttonPanel1; + private javax.swing.JButton deleteBeamButton; private javax.swing.JButton deleteStationButton; private javax.swing.JScrollPane descriptionScrollPane; - private javax.swing.JTextField inputAngle1; - private javax.swing.JTextField inputAngle2; - private javax.swing.JTextField inputAngleTimes; + private javax.swing.JButton editBeamButton; private javax.swing.JComboBox inputAntennaArray; private javax.swing.JComboBox inputBandFilter; - private javax.swing.JTextField inputBeamletList; private javax.swing.JComboBox inputClockMode; private javax.swing.JTextArea inputDescription; - private javax.swing.JComboBox inputDirectionTypes; private javax.swing.JTextField inputMSNameMask; - private javax.swing.JComboBox inputNyquistZone; private javax.swing.JTextField inputReceiverList; - private javax.swing.JTextField inputSubbandList; private javax.swing.JTextArea inputTreeDescription; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel10; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; - private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel7; private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JLabel labelAngle1; - private javax.swing.JLabel labelAngle2; - private javax.swing.JLabel labelAngleTimes; private javax.swing.JLabel labelAntennaArray; private javax.swing.JLabel labelBandFilter; - private javax.swing.JLabel labelBeamletList; private javax.swing.JLabel labelClockMode; - private javax.swing.JLabel labelDirectionTypes; private javax.swing.JLabel labelMSNameMask; - private javax.swing.JLabel labelNyquistZone; private javax.swing.JLabel labelReceiverList; private javax.swing.JPanel labelStationList; - private javax.swing.JLabel labelSubbandList; private javax.swing.JComboBox modifyStationsCombobox; private javax.swing.JPanel stationsButtonPanel; private javax.swing.JList stationsList; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.form index 12103d4354f1f39140680b9f1ca06edba4b64f79..1c9fa08e330d9639aa456c502a1060d9c297ab56 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.form @@ -29,7 +29,7 @@ <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,-93,0,0,3,-57"/> + <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,-93,0,0,3,-38"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> @@ -91,8 +91,8 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel4" min="-2" pref="932" max="-2" attributes="1"/> - <EmptySpace pref="3462" max="32767" attributes="0"/> + <Component id="jPanel4" min="-2" pref="956" max="-2" attributes="1"/> + <EmptySpace pref="3438" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -117,21 +117,19 @@ <Group type="102" alignment="0" attributes="0"> <Component id="jPanel8" min="-2" max="-2" attributes="1"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel10" min="-2" pref="259" max="-2" attributes="1"/> + <Component id="jPanel10" min="-2" pref="268" max="-2" attributes="1"/> </Group> <Component id="jPanel5" alignment="1" max="32767" attributes="1"/> <Group type="102" alignment="0" attributes="0"> <Component id="jPanel6" min="-2" max="-2" attributes="1"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel11" max="32767" attributes="1"/> - <Component id="jPanel7" alignment="0" max="32767" attributes="1"/> + <Component id="jPanel7" max="32767" attributes="1"/> + <Component id="jPanel11" alignment="0" max="32767" attributes="1"/> </Group> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel3" min="-2" max="-2" attributes="1"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" pref="867" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -139,8 +137,8 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel8" min="-2" max="-2" attributes="1"/> <Component id="jPanel10" max="32767" attributes="1"/> - <Component id="jPanel8" alignment="0" min="-2" max="-2" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" max="-2" attributes="0"> @@ -152,16 +150,8 @@ </Group> <Component id="jPanel6" pref="282" max="32767" attributes="1"/> </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="46" max="-2" attributes="0"/> - <Component id="jPanel3" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel5" min="-2" max="-2" attributes="0"/> - </Group> - </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -384,21 +374,6 @@ </Component> </SubComponents> </Container> - <Container class="javax.swing.JPanel" name="jPanel3"> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="935" max="32767" attributes="0"/> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="42" max="32767" attributes="0"/> - </Group> - </DimensionLayout> - </Layout> - </Container> <Container class="javax.swing.JPanel" name="jPanel10"> <Properties> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> @@ -710,21 +685,21 @@ </Group> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="labelCoresPerPset" alignment="0" pref="119" max="32767" attributes="0"/> - <Component id="labelBGLIntegrationSteps" alignment="0" pref="119" max="32767" attributes="1"/> - <Component id="labelPsetsPerCell" alignment="0" pref="119" max="32767" attributes="1"/> - <Component id="labelNodesPerPset" alignment="0" pref="119" max="32767" attributes="1"/> - <Component id="labelNrPPFTaps" alignment="0" pref="119" max="32767" attributes="1"/> - <Component id="labelMaxConcurrentComm" alignment="0" pref="119" max="32767" attributes="1"/> + <Component id="labelCoresPerPset" alignment="0" pref="124" max="32767" attributes="0"/> + <Component id="labelBGLIntegrationSteps" alignment="0" pref="124" max="32767" attributes="1"/> + <Component id="labelPsetsPerCell" alignment="0" pref="124" max="32767" attributes="1"/> + <Component id="labelNodesPerPset" alignment="0" pref="124" max="32767" attributes="1"/> + <Component id="labelNrPPFTaps" alignment="0" pref="124" max="32767" attributes="1"/> + <Component id="labelMaxConcurrentComm" alignment="0" pref="124" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="inputCoresPerPset" pref="201" max="32767" attributes="0"/> - <Component id="inputBGLIntegrationSteps" pref="201" max="32767" attributes="1"/> - <Component id="inputPsetsPerCell" pref="201" max="32767" attributes="1"/> - <Component id="inputNodesPerPset" pref="201" max="32767" attributes="1"/> - <Component id="inputNrPPFTaps" pref="201" max="32767" attributes="1"/> - <Component id="inputMaxConcurrentComm" alignment="0" pref="201" max="32767" attributes="1"/> + <Component id="inputCoresPerPset" pref="205" max="32767" attributes="0"/> + <Component id="inputBGLIntegrationSteps" pref="205" max="32767" attributes="1"/> + <Component id="inputPsetsPerCell" pref="205" max="32767" attributes="1"/> + <Component id="inputNodesPerPset" pref="205" max="32767" attributes="1"/> + <Component id="inputNrPPFTaps" pref="205" max="32767" attributes="1"/> + <Component id="inputMaxConcurrentComm" alignment="0" pref="205" max="32767" attributes="1"/> </Group> </Group> </Group> @@ -882,7 +857,7 @@ <Component id="inputSubbandsPerMS" max="32767" attributes="1"/> <Component id="inputStorageProcIntegrationSteps" alignment="0" pref="198" max="32767" attributes="1"/> </Group> - <EmptySpace pref="21" max="32767" attributes="0"/> + <EmptySpace pref="30" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -956,7 +931,7 @@ <Component id="inputPositionType" min="-2" pref="122" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace pref="24" max="32767" attributes="0"/> + <EmptySpace pref="33" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java index a12f4d8e1b22f8d4ba60943a3532309255349919..7b2b478e543ea5587f413038ab43c62aa13bf6fb 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/OlapPanel.java @@ -980,7 +980,6 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ inputPsetsPerStorage = new javax.swing.JTextField(); labelMaxNetworkDelay = new javax.swing.JLabel(); inputMaxNetworkDelay = new javax.swing.JTextField(); - jPanel3 = new javax.swing.JPanel(); jPanel10 = new javax.swing.JPanel(); labelIONProcIntegrationSteps = new javax.swing.JLabel(); inputIONProcIntegrationSteps = new javax.swing.JTextField(); @@ -1176,17 +1175,6 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addComponent(inputStorageStationNames, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) ); - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 935, Short.MAX_VALUE) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 42, Short.MAX_VALUE) - ); - jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ION Proc", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(0, 0, 0))); labelIONProcIntegrationSteps.setText("Integration Steps:"); @@ -1368,20 +1356,20 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addComponent(inputUseZoid)) .addGroup(jPanel7Layout.createSequentialGroup() .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(labelCoresPerPset, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) - .addComponent(labelBGLIntegrationSteps, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) - .addComponent(labelPsetsPerCell, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) - .addComponent(labelNodesPerPset, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) - .addComponent(labelNrPPFTaps, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) - .addComponent(labelMaxConcurrentComm, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)) + .addComponent(labelCoresPerPset, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) + .addComponent(labelBGLIntegrationSteps, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) + .addComponent(labelPsetsPerCell, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) + .addComponent(labelNodesPerPset, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) + .addComponent(labelNrPPFTaps, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) + .addComponent(labelMaxConcurrentComm, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(inputCoresPerPset, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE) - .addComponent(inputBGLIntegrationSteps, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE) - .addComponent(inputPsetsPerCell, 0, 201, Short.MAX_VALUE) - .addComponent(inputNodesPerPset, 0, 201, Short.MAX_VALUE) - .addComponent(inputNrPPFTaps, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE) - .addComponent(inputMaxConcurrentComm, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)))) + .addComponent(inputCoresPerPset, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE) + .addComponent(inputBGLIntegrationSteps, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE) + .addComponent(inputPsetsPerCell, 0, 205, Short.MAX_VALUE) + .addComponent(inputNodesPerPset, 0, 205, Short.MAX_VALUE) + .addComponent(inputNrPPFTaps, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE) + .addComponent(inputMaxConcurrentComm, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)))) .addContainerGap()) ); jPanel7Layout.setVerticalGroup( @@ -1434,7 +1422,7 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(inputSubbandsPerMS) .addComponent(inputStorageProcIntegrationSteps, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)) - .addContainerGap(21, Short.MAX_VALUE)) + .addContainerGap(30, Short.MAX_VALUE)) ); jPanel11Layout.setVerticalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1482,7 +1470,7 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addComponent(labelPositionType) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputPositionType, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(24, Short.MAX_VALUE)) + .addContainerGap(33, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1510,24 +1498,22 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) + .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addGap(867, 867, 867)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel4Layout.createSequentialGroup() @@ -1536,13 +1522,8 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(46, 46, 46) - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(jPanel4Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); @@ -1551,8 +1532,8 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 932, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(3462, Short.MAX_VALUE)) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 956, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(3438, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1680,7 +1661,6 @@ public class OlapPanel extends javax.swing.JPanel implements IViewPanel{ private javax.swing.JPanel jPanel10; private javax.swing.JPanel jPanel11; private javax.swing.JPanel jPanel2; - private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form index b709f50e27f60e8ba1e0f39adbff104165b9506b..0d87a6f8400390592bbcb1a792d8263fe6fd3bb5 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.form @@ -117,7 +117,7 @@ <Component id="limitsFilter" alignment="0" max="32767" attributes="1"/> <Component id="limitsC0" alignment="0" max="32767" attributes="1"/> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="33" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <EmptySpace min="-2" pref="246" max="-2" attributes="0"/> @@ -130,7 +130,7 @@ </Group> <EmptySpace min="-2" max="-2" attributes="0"/> </Group> - <Component id="inputRCUs" pref="943" max="32767" attributes="0"/> + <Component id="inputRCUs" pref="939" max="32767" attributes="0"/> </Group> </Group> <Group type="102" alignment="0" attributes="0"> @@ -228,7 +228,7 @@ <Component id="addConfigButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="cancelEditButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="22" max="32767" attributes="0"/> + <EmptySpace pref="33" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -295,11 +295,9 @@ <Component class="javax.swing.JComboBox" name="inputOperatingMode"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="4"> - <StringItem index="0" value="Item 1"/> - <StringItem index="1" value="Item 2"/> - <StringItem index="2" value="Item 3"/> - <StringItem index="3" value="Item 4"/> + <StringArray count="2"> + <StringItem index="0" value="1"/> + <StringItem index="1" value="2"/> </StringArray> </Property> </Properties> @@ -331,10 +329,10 @@ <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="4"> - <StringItem index="0" value="Item 1"/> - <StringItem index="1" value="Item 2"/> - <StringItem index="2" value="Item 3"/> - <StringItem index="3" value="Item 4"/> + <StringItem index="0" value="16B"/> + <StringItem index="1" value="64B"/> + <StringItem index="2" value="256B"/> + <StringItem index="3" value="1K"/> </StringArray> </Property> </Properties> @@ -441,11 +439,6 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addConfigButtonActionPerformed"/> </Events> </Component> - <Component class="nl.astron.lofar.sas.otbcomponents.TablePanel" name="TBBConfigurationPanel"> - <Events> - <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="TBBConfigurationPanelMouseClicked"/> - </Events> - </Component> <Component class="javax.swing.JButton" name="cancelEditButton"> <Properties> <Property name="text" type="java.lang.String" value="Cancel edit Configuration"/> @@ -458,6 +451,11 @@ <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="cancelEditButton.setVisible(false);"/> </AuxValues> </Component> + <Component class="nl.astron.lofar.sas.otbcomponents.TablePanel" name="TBBConfigurationPanel"> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="TBBConfigurationPanelMouseClicked"/> + </Events> + </Component> </SubComponents> </Container> <Component class="nl.astron.lofar.sas.otbcomponents.ButtonPanel" name="buttonPanel1"> diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java index 211d80551755e1da6570a37ebc4300dca3a0a1da..4c6cfa186a698debc414a3871e98b59a544ac4fd 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/TBBConfigPanel.java @@ -124,7 +124,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { // We need to keep all the nodes needed by this panel if (aNode.leaf) { //we need to get all the childs from the following nodes as well. - }else if (parentName.equals("TBBsetting")) { + }else if (parentName.contains("TBBsetting")) { // we also need to set the defaults in the inputfields this.retrieveAndDisplayChildDataForNode(aNode); } @@ -244,6 +244,12 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { * @param enabled true/false enabled/disabled */ public void enableButtons(boolean enabled) { + buttonPanel1.setButtonEnabled("Restore",enabled); + buttonPanel1.setButtonEnabled("Save",enabled); + editConfigButton.setEnabled(enabled); + deleteConfigButton.setEnabled(enabled); + addConfigButton.setEnabled(enabled); + cancelEditButton.setEnabled(enabled); } /** Sets the buttons visible/invisible @@ -251,6 +257,12 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { * @param visible true/false visible/invisible */ public void setButtonsVisible(boolean visible) { + buttonPanel1.setButtonVisible("Restore",visible); + buttonPanel1.setButtonVisible("Save",visible); + editConfigButton.setVisible(visible); + deleteConfigButton.setVisible(visible); + addConfigButton.setVisible(visible); + cancelEditButton.setVisible(visible); } /** Enables/disables the complete form @@ -258,6 +270,17 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { * @param enabled true/false enabled/disabled */ public void setAllEnabled(boolean enabled) { + inputOperatingMode.setEnabled(enabled); + inputBaselevel.setEnabled(enabled); + inputStartlevel.setEnabled(enabled); + inputStoplevel.setEnabled(enabled); + inputFilter.setEnabled(enabled); + inputWindow.setEnabled(enabled); + inputC0.setEnabled(enabled); + inputC1.setEnabled(enabled); + inputC2.setEnabled(enabled); + inputC3.setEnabled(enabled); + inputRCUs.setEnabled(enabled); } private void initialize() { @@ -318,6 +341,12 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { // create initial RCUBitset // create initial table restore(); + + // if VHTree disable buttons, VHTree is view only mode, no changes possible anymore... + if (itsTreeType.equals("VHtree")) { + this.setButtonsVisible(false); + this.setAllEnabled(false); + } } /** @@ -496,14 +525,16 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { /** Restores all settings back to default input screens and the table */ private void restore() { - // set the default input fields back - setDefaultInput(); + if (!itsTreeType.equals("VHtree")) { + // set the default input fields back + setDefaultInput(); - // create original RCU Bitset - fillRCUBitset(); + // create original RCU Bitset + fillRCUBitset(); + } // set table back to initial values - itsTBBConfigurationTableModel.fillTable(itsOperatingModes,itsBaselevels,itsStartlevels,itsStoplevels,itsFilters,itsWindows,itsC0s,itsC1s,itsC2s,itsC3s,itsRCUs); + itsTBBConfigurationTableModel.fillTable(itsTreeType,itsOperatingModes,itsBaselevels,itsStartlevels,itsStoplevels,itsFilters,itsWindows,itsC0s,itsC1s,itsC2s,itsC3s,itsRCUs); buttonPanel1.setButtonEnabled("Restore",false); buttonPanel1.setButtonEnabled("Save",false); @@ -1009,9 +1040,9 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { editConfigButton = new javax.swing.JButton(); deleteConfigButton = new javax.swing.JButton(); addConfigButton = new javax.swing.JButton(); - TBBConfigurationPanel = new nl.astron.lofar.sas.otbcomponents.TablePanel(); cancelEditButton = new javax.swing.JButton(); cancelEditButton.setVisible(false); + TBBConfigurationPanel = new nl.astron.lofar.sas.otbcomponents.TablePanel(); buttonPanel1 = new nl.astron.lofar.sas.otbcomponents.ButtonPanel(); setLayout(new java.awt.BorderLayout()); @@ -1060,7 +1091,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { labelRCUs.setText("RCUs:"); - inputOperatingMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + inputOperatingMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2" })); inputOperatingMode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { inputActionPerformed(evt); @@ -1091,7 +1122,7 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { } }); - inputWindow.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + inputWindow.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "16B", "64B", "256B", "1K" })); inputWindow.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { inputActionPerformed(evt); @@ -1172,12 +1203,6 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { } }); - TBBConfigurationPanel.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - TBBConfigurationPanelMouseClicked(evt); - } - }); - cancelEditButton.setText("Cancel edit Configuration"); cancelEditButton.setToolTipText("sets Configuration entries back to default"); cancelEditButton.addActionListener(new java.awt.event.ActionListener() { @@ -1186,6 +1211,12 @@ public class TBBConfigPanel extends javax.swing.JPanel implements IViewPanel { } }); + TBBConfigurationPanel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + TBBConfigurationPanelMouseClicked(evt); + } + }); + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(