Skip to content
Snippets Groups Projects
Commit 53bff219 authored by pompert's avatar pompert
Browse files

701

Removed Plotter files from jParmFacade project. moved to OTB.
parent d9e6d072
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.0" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" value="LOFAR | JAVA Plotter Test Application"/>
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection component="Form" name="getIconImage" type="method"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-122,0,0,2,-42"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="plotModPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="North"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="lparameterConstraint">
<Properties>
<Property name="text" type="java.lang.String" value="Parameter"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tparameterConstraint">
<Properties>
<Property name="columns" type="int" value="10"/>
<Property name="text" type="java.lang.String" value="parm*"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lstartX">
<Properties>
<Property name="text" type="java.lang.String" value="startx"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tstartX">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lendX">
<Properties>
<Property name="text" type="java.lang.String" value="endx"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tendX">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="5"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lnumX">
<Properties>
<Property name="text" type="java.lang.String" value="numx"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tnumX">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="5"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lstartY">
<Properties>
<Property name="text" type="java.lang.String" value="starty"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tstartY">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lendY">
<Properties>
<Property name="text" type="java.lang.String" value="endy"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tendY">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="5"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lnumY">
<Properties>
<Property name="text" type="java.lang.String" value="numy"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="tnumY">
<Properties>
<Property name="columns" type="int" value="3"/>
<Property name="text" type="java.lang.String" value="5"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="15" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="cLegend">
<Properties>
<Property name="text" type="java.lang.String" value="Legend"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="0" left="0" right="0" top="0"/>
</Border>
</Property>
<Property name="horizontalTextPosition" type="int" value="10"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
<Properties>
<Property name="orientation" type="int" value="1"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 10]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="bplotButton">
<Properties>
<Property name="text" type="java.lang.String" value="Plot"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="handlePlotButton"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
/*
* PlotTestFrame.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.java.cep.jparmfacade;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import nl.astron.lofar.java.gui.plotter.PlotConstants;
import nl.astron.lofar.java.gui.plotter.PlotPanel;
import nl.astron.lofar.java.gui.plotter.exceptions.PlotterException;
/**
* Test Application for jParmFacade-SGT combination of plotting. You MUST have a working
* jParmFacade JNI interface towards ParmDB in order to fully use this Test Application
* <br><br>
* Please check that, in the plotter_config.properties file, the variable DATA_ACCESS_CLASS
* is set to nl.astron.lofar.java.gui.plotter.PlotDataAccessParmDBImpl
*
* @created 13-04-2006, 13:00
* @author pompert
* @version $Id$
* @see nl.astron.lofar.java.gui.plotter.PlotDataAccessParmDBImpl
* @see plotter_config.properties
*/
public class PlotTestFrame extends javax.swing.JFrame {
private PlotPanel testPanel;
JScrollPane legendPane;
private JLabel exceptionLabel;
private boolean plotPresent;
/** Creates new form PlotTestFrame */
public PlotTestFrame() {
plotPresent = false;
//For use with PlotDataAccessTestImpl
//testPanel.createPlot(PlotConstants.PLOT_XYLINE,"line");
//testPanel2.createPlot(PlotConstants.PLOT_GRID,"grid");
//For use with PlotDataAccessParmDBImpl class
//testPanel.createPlot(PlotConstants.PLOT_XYLINE,"parm*");
//testPanel2.createPlot(PlotConstants.PLOT_GRID,"parm2");
//this.getContentPane().add(testPanel2.getPlot(),new GridBagConstraints(1,0,1,1,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),1,1));
//this.getContentPane().add(testPanel2.getLegendForPlot(),new GridBagConstraints(1,1,1,1,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),1,1));
this.setSize(new Dimension(640,480));
initComponents();
}
/** 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() {
java.awt.GridBagConstraints gridBagConstraints;
plotModPanel = new javax.swing.JPanel();
lparameterConstraint = new javax.swing.JLabel();
tparameterConstraint = new javax.swing.JTextField();
lstartX = new javax.swing.JLabel();
tstartX = new javax.swing.JTextField();
lendX = new javax.swing.JLabel();
tendX = new javax.swing.JTextField();
lnumX = new javax.swing.JLabel();
tnumX = new javax.swing.JTextField();
lstartY = new javax.swing.JLabel();
tstartY = new javax.swing.JTextField();
lendY = new javax.swing.JLabel();
tendY = new javax.swing.JTextField();
lnumY = new javax.swing.JLabel();
tnumY = new javax.swing.JTextField();
cLegend = new javax.swing.JCheckBox();
jSeparator1 = new javax.swing.JSeparator();
bplotButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("LOFAR | JAVA Plotter Test Application");
setIconImage(getIconImage());
plotModPanel.setLayout(new java.awt.GridBagLayout());
lparameterConstraint.setText("Parameter");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lparameterConstraint, gridBagConstraints);
tparameterConstraint.setColumns(10);
tparameterConstraint.setText("parm*");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tparameterConstraint, gridBagConstraints);
lstartX.setText("startx");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lstartX, gridBagConstraints);
tstartX.setColumns(3);
tstartX.setText("0");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tstartX, gridBagConstraints);
lendX.setText("endx");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lendX, gridBagConstraints);
tendX.setColumns(3);
tendX.setText("5");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tendX, gridBagConstraints);
lnumX.setText("numx");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lnumX, gridBagConstraints);
tnumX.setColumns(3);
tnumX.setText("5");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tnumX, gridBagConstraints);
lstartY.setText("starty");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lstartY, gridBagConstraints);
tstartY.setColumns(3);
tstartY.setText("0");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tstartY, gridBagConstraints);
lendY.setText("endy");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lendY, gridBagConstraints);
tendY.setColumns(3);
tendY.setText("5");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tendY, gridBagConstraints);
lnumY.setText("numy");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(lnumY, gridBagConstraints);
tnumY.setColumns(3);
tnumY.setText("5");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = 15;
plotModPanel.add(tnumY, gridBagConstraints);
cLegend.setText("Legend");
cLegend.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
cLegend.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
cLegend.setMargin(new java.awt.Insets(0, 0, 0, 0));
plotModPanel.add(cLegend, new java.awt.GridBagConstraints());
jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
jSeparator1.setMinimumSize(new java.awt.Dimension(50, 10));
plotModPanel.add(jSeparator1, new java.awt.GridBagConstraints());
bplotButton.setText("Plot");
bplotButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
handlePlotButton(evt);
}
});
plotModPanel.add(bplotButton, new java.awt.GridBagConstraints());
getContentPane().add(plotModPanel, java.awt.BorderLayout.NORTH);
pack();
}// </editor-fold>//GEN-END:initComponents
private void handlePlotButton(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_handlePlotButton
JButton source = (JButton)evt.getSource();
if(source == bplotButton){
if(checkBoxes() == true){
String[] argsForController = new String[7];
argsForController[0] = tparameterConstraint.getText();
argsForController[1] = tstartX.getText();
argsForController[2] = tendX.getText();
argsForController[3] = tnumX.getText();
argsForController[4] = tstartY.getText();
argsForController[5] = tendY.getText();
argsForController[6] = tnumY.getText();
//plotPane.add(testPanel.getPlot(),new GridBagConstraints(0,0,1,1,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),1,1));
//plotPane.add(testPanel.getLegendForPlot(),new GridBagConstraints(0,1,1,1,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),1,1));
if(plotPresent){
try {
this.getContentPane().remove(testPanel);
this.getContentPane().remove(legendPane);
}catch(Exception e){
}
}
try {
if(exceptionLabel !=null){
//this.getContentPane().remove(exceptionLabel);
exceptionLabel = null;
}
testPanel = new PlotPanel();
testPanel.createPlot(PlotConstants.PLOT_XYLINE,true,argsForController);
this.add(testPanel,BorderLayout.CENTER);
if(cLegend.isSelected()){
int legendWidth = (int)testPanel.getPreferredSize().getWidth()+10;
int legendHeight = 100;
legendPane = new JScrollPane(testPanel.getLegendForPlot());
legendPane.setPreferredSize(new Dimension(legendWidth,legendHeight));
legendPane.setBackground(Color.WHITE);
legendPane.getViewport().setBackground(Color.WHITE);
this.add(legendPane,BorderLayout.SOUTH);
}
plotPresent = true;
} catch (PlotterException ex) {
JOptionPane.showMessageDialog(this, ex.getMessage(),
"Error detected",
JOptionPane.ERROR_MESSAGE);
exceptionLabel = new JLabel(ex.getMessage());
exceptionLabel.setForeground(Color.RED);
//this.add(exceptionLabel,BorderLayout.CENTER);
plotPresent = false;
ex.printStackTrace();
}
this.pack();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(d.width/2 - this.getWidth()/2, d.height /2 - this.getHeight() /2);
}
}
}//GEN-LAST:event_handlePlotButton
/**
* Checks if all input boxes are numerical
* @return boolean Result of input validation
*/
private boolean checkBoxes(){
boolean numbersOK = true;
double startx = 0;
double endx = 0;
int numx = 0;
double starty = 0;
double endy = 0;
int numy = 0;
try {
startx = Double.parseDouble(tstartX.getText());
tstartX.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tstartX.setForeground(Color.RED);
numbersOK = false;
}
try {
endx = Double.parseDouble(tendX.getText());
tendX.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tendX.setForeground(Color.RED);
numbersOK = false;
}
try {
numx = Integer.parseInt(tnumX.getText());
tnumX.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tnumX.setForeground(Color.RED);
numbersOK = false;
}
try {
starty = Double.parseDouble(tstartY.getText());
tstartY.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tstartY.setForeground(Color.RED);
numbersOK = false;
}
try {
endy = Double.parseDouble(tendY.getText());
tendY.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tendY.setForeground(Color.RED);
numbersOK = false;
}
try {
numy = Integer.parseInt(tnumY.getText());
tnumY.setForeground(Color.BLACK);
} catch (NumberFormatException ex) {
tnumY.setForeground(Color.RED);
numbersOK = false;
}
return numbersOK;
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
PlotTestFrame af = new PlotTestFrame();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
af.setLocation(d.width/2 - af.getWidth()/2, d.height /2 - af.getHeight() /2);
af.setVisible(true);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bplotButton;
private javax.swing.JCheckBox cLegend;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JLabel lendX;
private javax.swing.JLabel lendY;
private javax.swing.JLabel lnumX;
private javax.swing.JLabel lnumY;
private javax.swing.JLabel lparameterConstraint;
private javax.swing.JLabel lstartX;
private javax.swing.JLabel lstartY;
private javax.swing.JPanel plotModPanel;
private javax.swing.JTextField tendX;
private javax.swing.JTextField tendY;
private javax.swing.JTextField tnumX;
private javax.swing.JTextField tnumY;
private javax.swing.JTextField tparameterConstraint;
private javax.swing.JTextField tstartX;
private javax.swing.JTextField tstartY;
// End of variables declaration//GEN-END:variables
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment