List of usage examples for javax.swing GroupLayout PREFERRED_SIZE
int PREFERRED_SIZE
To view the source code for javax.swing GroupLayout PREFERRED_SIZE.
Click Source Link
From source file:com.dfki.av.sudplan.ui.MainFrame.java
/** * 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./*www .j a v a 2 s.c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { dGoTo = new javax.swing.JDialog(); pGoTo = new javax.swing.JPanel(); lLatitude = new javax.swing.JLabel(); lLongitude = new javax.swing.JLabel(); txtLatitude = new javax.swing.JTextField(); txtLongitude = new javax.swing.JTextField(); btnCancelGoToDialoag = new javax.swing.JButton(); btnGo = new javax.swing.JButton(); dWMSHeight = new javax.swing.JDialog(); lMaxEle = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); lServerURL = new javax.swing.JLabel(); rbCbServerUrl = new javax.swing.JRadioButton(); rbTxtServerUrl = new javax.swing.JRadioButton(); txtServerURL = new javax.swing.JTextField(); cbServerURL = new javax.swing.JComboBox(); bGoWMSHeight = new javax.swing.JButton(); pbWMS = new javax.swing.JProgressBar(); jPanel4 = new javax.swing.JPanel(); bCancelWMSHeight = new javax.swing.JButton(); bAddWMSHeight = new javax.swing.JButton(); cLayerList = new javax.swing.JComboBox(); txtHeight = new javax.swing.JTextField(); lHeight = new javax.swing.JLabel(); lOpacity = new javax.swing.JLabel(); txtOpacity = new javax.swing.JTextField(); bgWMS = new javax.swing.ButtonGroup(); pMain = new javax.swing.JPanel(); jSplitPane1 = new javax.swing.JSplitPane(); pLeftPanel = new javax.swing.JPanel(); pVisualization = new javax.swing.JPanel(); mbMain = new javax.swing.JMenuBar(); mFile = new javax.swing.JMenu(); miOpenKMLFile = new javax.swing.JMenuItem(); miAddGeoTiff = new javax.swing.JMenuItem(); miAddShape = new javax.swing.JMenuItem(); miAddShapeZip = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JPopupMenu.Separator(); miExit = new javax.swing.JMenuItem(); mEdit = new javax.swing.JMenu(); miRemoveAllLayer = new javax.swing.JMenuItem(); mNavi = new javax.swing.JMenu(); miGotoLinz = new javax.swing.JMenuItem(); miGotoPraque = new javax.swing.JMenuItem(); miGoToStockhom = new javax.swing.JMenuItem(); miGotoWuppertal = new javax.swing.JMenuItem(); miGotoKaiserslautern = new javax.swing.JMenuItem(); jSeparator5 = new javax.swing.JPopupMenu.Separator(); miFullSphere = new javax.swing.JMenuItem(); miGoto = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JPopupMenu.Separator(); miSaveView = new javax.swing.JMenuItem(); mCustomViewPoints = new javax.swing.JMenu(); mWMS = new javax.swing.JMenu(); miAddWMS = new javax.swing.JMenuItem(); miAddWMSHeight = new javax.swing.JMenuItem(); mTools = new javax.swing.JMenu(); miWizard = new javax.swing.JMenuItem(); mView = new javax.swing.JMenu(); miSideBySide = new javax.swing.JMenuItem(); mHelp = new javax.swing.JMenu(); miAbout = new javax.swing.JMenuItem(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("com/dfki/av/sudplan/ui/Bundle"); // NOI18N dGoTo.setTitle(bundle.getString("MainFrame.dGoTo.title")); // NOI18N dGoTo.setAlwaysOnTop(true); dGoTo.setMinimumSize(new java.awt.Dimension(230, 150)); dGoTo.setResizable(false); pGoTo.setMaximumSize(new java.awt.Dimension(200, 100)); lLatitude.setLabelFor(txtLatitude); lLatitude.setText(bundle.getString("MainFrame.lLatitude.text")); // NOI18N lLongitude.setLabelFor(txtLongitude); lLongitude.setText(bundle.getString("MainFrame.lLongitude.text")); // NOI18N txtLatitude.setText(bundle.getString("MainFrame.txtLatitude.text")); // NOI18N txtLongitude.setText(bundle.getString("MainFrame.txtLongitude.text")); // NOI18N javax.swing.GroupLayout pGoToLayout = new javax.swing.GroupLayout(pGoTo); pGoTo.setLayout(pGoToLayout); pGoToLayout.setHorizontalGroup(pGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pGoToLayout.createSequentialGroup().addContainerGap() .addGroup(pGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lLongitude).addComponent(lLatitude)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE) .addGroup(pGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtLatitude, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtLongitude)) .addContainerGap())); pGoToLayout.setVerticalGroup(pGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pGoToLayout.createSequentialGroup().addContainerGap().addGroup(pGoToLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(lLatitude) .addComponent(txtLatitude, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lLongitude).addComponent(txtLongitude, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); btnCancelGoToDialoag.setText(bundle.getString("MainFrame.btnCancelGoToDialoag.text")); // NOI18N btnCancelGoToDialoag.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelGoToDialoagActionPerformed(evt); } }); btnGo.setText(bundle.getString("MainFrame.btnGo.text")); // NOI18N btnGo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnGoActionPerformed(evt); } }); javax.swing.GroupLayout dGoToLayout = new javax.swing.GroupLayout(dGoTo.getContentPane()); dGoTo.getContentPane().setLayout(dGoToLayout); dGoToLayout.setHorizontalGroup(dGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dGoToLayout.createSequentialGroup().addContainerGap() .addGroup(dGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dGoToLayout.createSequentialGroup().addComponent(btnGo) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCancelGoToDialoag)) .addComponent(pGoTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); dGoToLayout.setVerticalGroup(dGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dGoToLayout.createSequentialGroup().addContainerGap() .addComponent(pGoTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dGoToLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnCancelGoToDialoag).addComponent(btnGo)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); dWMSHeight.setTitle(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.dWMSHeight.title")); // NOI18N dWMSHeight.setIconImage(com.dfki.av.sudplan.Configuration.SUDPLAN_3D_IMAGE); dWMSHeight.setLocationByPlatform(true); dWMSHeight.setMinimumSize(new java.awt.Dimension(800, 360)); dWMSHeight.setResizable(false); lMaxEle.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.lMaxEle.text")); // NOI18N jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder( org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.jPanel1.border.title"))); // NOI18N jPanel1.setToolTipText( org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.jPanel1.toolTipText")); // NOI18N jPanel1.setName(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.jPanel1.name")); // NOI18N lServerURL.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.lServerURL.text")); // NOI18N bgWMS.add(rbCbServerUrl); rbCbServerUrl.setSelected(true); rbCbServerUrl .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.rbCbServerUrl.text")); // NOI18N rbCbServerUrl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbCbServerUrlActionPerformed(evt); } }); bgWMS.add(rbTxtServerUrl); rbTxtServerUrl .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.rbTxtServerUrl.text")); // NOI18N rbTxtServerUrl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbTxtServerUrlActionPerformed(evt); } }); txtServerURL.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.txtServerURL.text")); // NOI18N txtServerURL.setToolTipText( org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.txtServerURL.toolTipText")); // NOI18N txtServerURL.setEnabled(false); cbServerURL.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "http://aniara.smhi.se/cap_SERVICE=WMS.xml", "http://geoportal.wuppertal.de:8083/deegree/wms?", "http://serv-2118.kl.dfki.de:8888/geoserver/wms?service=WMS&version=1.1.0", "http://www2.demis.nl/worldmap/wms.asp?Service=WMS&Version=1.1.0&Request=GetCapabilities", "http://www.wms.nrw.de/geobasis/DOP", "http://mapbender.wheregroup.com/cgi-bin/mapserv?map=/data/umn/osm/osm_basic.map&VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS", "http://kartor.stockholm.se/bios/wms/app/baggis/web/WMS_STHLM_ORTOFOTO_2009?", "http://kartor.stockholm.se/bios/wms/app/baggis/web/WMS_STHLM_TATORTSKARTA_RASTER?", "http://85.24.165.10/cap_SERVICE=WMS.xml" })); bGoWMSHeight.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.bGoWMSHeight.text")); // NOI18N bGoWMSHeight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bGoWMSHeightActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(lServerURL).addGap(0, 0, Short.MAX_VALUE)) .addGroup( jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rbCbServerUrl) .addComponent(rbTxtServerUrl)) .addGap(10, 10, 10) .addGroup(jPanel1Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtServerURL) .addComponent(cbServerURL, 0, 1, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout .createSequentialGroup() .addComponent(pbWMS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(bGoWMSHeight))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(lServerURL) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbServerURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rbCbServerUrl)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtServerURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rbTxtServerUrl)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(bGoWMSHeight).addComponent(pbWMS, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder( org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.jPanel4.border.title"))); // NOI18N bCancelWMSHeight .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.bCancelWMSHeight.text")); // NOI18N bCancelWMSHeight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bCancelWMSHeightActionPerformed(evt); } }); bAddWMSHeight .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.bAddWMSHeight.text")); // NOI18N bAddWMSHeight.setEnabled(false); bAddWMSHeight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bAddWMSHeightActionPerformed(evt); } }); cLayerList.setEnabled(false); txtHeight.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.txtHeight.text")); // NOI18N lHeight.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.lHeight.text")); // NOI18N lOpacity.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.lOpacity.text")); // NOI18N txtOpacity.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.txtOpacity.text")); // NOI18N javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(lHeight) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtHeight, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(lOpacity) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtOpacity, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 194, Short.MAX_VALUE) .addComponent(bAddWMSHeight) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bCancelWMSHeight)) .addComponent(cLayerList, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addContainerGap() .addComponent(cLayerList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(bCancelWMSHeight) .addComponent(bAddWMSHeight, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lHeight).addComponent(lOpacity).addComponent(txtOpacity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); javax.swing.GroupLayout dWMSHeightLayout = new javax.swing.GroupLayout(dWMSHeight.getContentPane()); dWMSHeight.getContentPane().setLayout(dWMSHeightLayout); dWMSHeightLayout.setHorizontalGroup(dWMSHeightLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dWMSHeightLayout.createSequentialGroup().addContainerGap() .addGroup(dWMSHeightLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dWMSHeightLayout.createSequentialGroup().addGap(732, 732, 732) .addComponent(lMaxEle, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(dWMSHeightLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); dWMSHeightLayout.setVerticalGroup(dWMSHeightLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dWMSHeightLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(296, 296, 296) .addComponent(lMaxEle, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle(bundle.getString("MainFrame.title")); // NOI18N pMain.setPreferredSize(new java.awt.Dimension(1200, 1024)); jSplitPane1.setContinuousLayout(true); jSplitPane1.setLastDividerLocation(1); jSplitPane1.setPreferredSize(new java.awt.Dimension(1024, 768)); pLeftPanel.setLayout(new java.awt.BorderLayout()); jSplitPane1.setLeftComponent(pLeftPanel); pVisualization.setLayout(new java.awt.BorderLayout()); pVisualization.add(wwPanel, java.awt.BorderLayout.CENTER); jSplitPane1.setRightComponent(pVisualization); javax.swing.GroupLayout pMainLayout = new javax.swing.GroupLayout(pMain); pMain.setLayout(pMainLayout); pMainLayout.setHorizontalGroup(pMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 804, Short.MAX_VALUE)); pMainLayout.setVerticalGroup(pMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 610, Short.MAX_VALUE)); mFile.setText(bundle.getString("MainFrame.mFile.text")); // NOI18N miOpenKMLFile .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miOpenKMLFile.text")); // NOI18N miOpenKMLFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miOpenDataActionPerformed(evt); } }); mFile.add(miOpenKMLFile); miAddGeoTiff.setText(bundle.getString("MainFrame.miAddGeoTiff.text")); // NOI18N miAddGeoTiff.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miOpenDataActionPerformed(evt); } }); mFile.add(miAddGeoTiff); miAddShape.setText(bundle.getString("MainFrame.miAddShape.text")); // NOI18N miAddShape.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miOpenDataActionPerformed(evt); } }); mFile.add(miAddShape); miAddShapeZip .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miAddShapeZip.text")); // NOI18N miAddShapeZip.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miOpenDataActionPerformed(evt); } }); mFile.add(miAddShapeZip); mFile.add(jSeparator2); miExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.ALT_MASK)); miExit.setText(bundle.getString("MainFrame.miExit.text")); // NOI18N miExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miExitActionPerformed(evt); } }); mFile.add(miExit); mbMain.add(mFile); mEdit.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mEdit.text")); // NOI18N miRemoveAllLayer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK)); miRemoveAllLayer.setText(bundle.getString("MainFrame.miRemoveAllLayer.text")); // NOI18N miRemoveAllLayer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miRemoveAllLayerActionPerformed(evt); } }); mEdit.add(miRemoveAllLayer); mbMain.add(mEdit); mNavi.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mNavi.text")); // NOI18N miGotoLinz.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK)); miGotoLinz.setText(bundle.getString("MainFrame.miGotoLinz.text")); // NOI18N miGotoLinz.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGotoLinzActionPerformed(evt); } }); mNavi.add(miGotoLinz); miGotoPraque.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); miGotoPraque.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miGotoPraque.text")); // NOI18N miGotoPraque.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGotoPraqueActionPerformed(evt); } }); mNavi.add(miGotoPraque); miGoToStockhom.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); miGoToStockhom.setText(bundle.getString("MainFrame.miGoToStockhom.text")); // NOI18N miGoToStockhom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGoToStockhomActionPerformed(evt); } }); mNavi.add(miGoToStockhom); miGotoWuppertal.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK)); miGotoWuppertal.setText(bundle.getString("MainFrame.miGotoWuppertal.text")); // NOI18N miGotoWuppertal.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGotoWuppertalActionPerformed(evt); } }); mNavi.add(miGotoWuppertal); miGotoKaiserslautern.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK)); miGotoKaiserslautern.setText( org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miGotoKaiserslautern.text")); // NOI18N miGotoKaiserslautern.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGotoKaiserslauternActionPerformed(evt); } }); mNavi.add(miGotoKaiserslautern); mNavi.add(jSeparator5); miFullSphere.setText(bundle.getString("MainFrame.miFullSphere.text")); // NOI18N miFullSphere.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miFullSphereActionPerformed(evt); } }); mNavi.add(miFullSphere); miGoto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK)); miGoto.setText(bundle.getString("MainFrame.miGoto.text")); // NOI18N miGoto.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miGotoActionPerformed(evt); } }); mNavi.add(miGoto); mNavi.add(jSeparator3); miSaveView.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SPACE, java.awt.event.InputEvent.CTRL_MASK)); miSaveView.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miSaveView.text")); // NOI18N miSaveView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miSaveViewActionPerformed(evt); } }); mNavi.add(miSaveView); mCustomViewPoints .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mCustomViewPoints.text")); // NOI18N mNavi.add(mCustomViewPoints); mbMain.add(mNavi); mWMS.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mWMS.text")); // NOI18N miAddWMS.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miAddWMS.text")); // NOI18N miAddWMS.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miAddWMSActionPerformed(evt); } }); mWMS.add(miAddWMS); miAddWMSHeight .setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miAddWMSHeight.text")); // NOI18N miAddWMSHeight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miAddWMSHeightActionPerformed(evt); } }); mWMS.add(miAddWMSHeight); mbMain.add(mWMS); mTools.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mTools.text")); // NOI18N miWizard.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.ALT_MASK)); miWizard.setText(bundle.getString("MainFrame.miWizard.text")); // NOI18N miWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miWizardActionPerformed(evt); } }); mTools.add(miWizard); mbMain.add(mTools); mView.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.mView.text")); // NOI18N miSideBySide.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); miSideBySide.setText(org.openide.util.NbBundle.getMessage(MainFrame.class, "MainFrame.miSideBySide.text")); // NOI18N miSideBySide.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miSideBySideActionPerformed(evt); } }); mView.add(miSideBySide); mbMain.add(mView); mHelp.setText(bundle.getString("MainFrame.mHelp.text")); // NOI18N miAbout.setText(bundle.getString("MainFrame.miAbout.text")); // NOI18N miAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { miAboutActionPerformed(evt); } }); mHelp.add(miAbout); mbMain.add(mHelp); setJMenuBar(mbMain); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 804, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( pMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 610, Short.MAX_VALUE)); pack(); }
From source file:com.igormaznitsa.zxpspritecorrector.files.FileNameDialog.java
/** * 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.//w ww. j a va 2s . co m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonCancel = new javax.swing.JButton(); buttonOk = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); textFileName0 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); textZxFileName0 = new javax.swing.JFormattedTextField(); textZxFileType0 = new javax.swing.JFormattedTextField(); jPanel2 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); textFileName1 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); textZxFileName1 = new javax.swing.JFormattedTextField(); textZxFileType1 = new javax.swing.JFormattedTextField(); jPanel3 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); textFileName3 = new javax.swing.JTextField(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); textZxFileName3 = new javax.swing.JFormattedTextField(); textZxFileType3 = new javax.swing.JFormattedTextField(); jPanel4 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); textFileName2 = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); textZxFileName2 = new javax.swing.JFormattedTextField(); textZxFileType2 = new javax.swing.JFormattedTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); buttonCancel.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpspritecorrector/icons/cross.png"))); // NOI18N buttonCancel.setText("Cancel"); buttonCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCancelActionPerformed(evt); } }); buttonOk.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpspritecorrector/icons/tick.png"))); // NOI18N buttonOk.setText("Ok"); buttonOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonOkActionPerformed(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Block CPU0")); jLabel1.setText("File name:"); jLabel2.setText("ZX File name:"); jLabel3.setText("ZX File type:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(6, 6, 6).addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textZxFileType0, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2).addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(textFileName0).addComponent(textZxFileName0)))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(textFileName0, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(textZxFileName0, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3).addComponent(textZxFileType0, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE))); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jLabel1, jLabel2, jLabel3, textFileName0, textZxFileName0, textZxFileType0 }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Block CPU1")); jLabel4.setText("File name:"); jLabel5.setText("ZX File name:"); jLabel6.setText("ZX File type:"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(6, 6, 6).addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textZxFileType1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5).addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(textFileName1, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) .addComponent(textZxFileName1)))) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(textFileName1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent(textZxFileName1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6).addComponent(textZxFileType1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE))); jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jLabel4, jLabel5, jLabel6, textFileName1, textZxFileName1, textZxFileType1 }); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Block CPU3")); jLabel10.setText("File name:"); jLabel11.setText("ZX File name:"); jLabel12.setText("ZX File type:"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGap(6, 6, 6).addComponent(jLabel12) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textZxFileType3, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel11).addComponent(jLabel10)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(textFileName3, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) .addComponent(textZxFileName3)))) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(textFileName3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11).addComponent(textZxFileName3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12).addComponent(textZxFileType3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE))); jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jLabel10, jLabel11, jLabel12, textFileName3, textZxFileName3, textZxFileType3 }); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Block CPU2")); jLabel7.setText("File name:"); jLabel8.setText("ZX File name:"); jLabel9.setText("ZX File type:"); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(6, 6, 6).addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textZxFileType2, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel8).addComponent(jLabel7)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(textFileName2, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) .addComponent(textZxFileName2)))) .addContainerGap())); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(textFileName2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(textZxFileName2, 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.BASELINE) .addComponent(jLabel9).addComponent(textZxFileType2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE))); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jLabel7, jLabel8, jLabel9, textFileName2, textZxFileName2, textZxFileType2 }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(buttonOk) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonCancel))) .addContainerGap())); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { buttonCancel, buttonOk }); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonOk).addComponent(buttonCancel)) .addContainerGap())); layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jPanel1, jPanel2, jPanel3, jPanel4 }); pack(); }
From source file:it.isislab.dmason.tools.batch.BatchWizard.java
/** * Create the frame./*from w ww .j a va2 s . c om*/ */ public BatchWizard() { setPreferredSize(new Dimension(800, 600)); setTitle("Batch wizard"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 849, 620); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new GridLayout(1, 0, 0, 0)); JPanel panel = new JPanel(); panel.setToolTipText(""); contentPane.add(panel); panel_1 = new JPanel(); panel_1.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Param Option", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); JPanel panel_2 = new JPanel(); panel_2.setBorder( new TitledBorder(null, "Params List", TitledBorder.LEADING, TitledBorder.TOP, null, null)); JPanel panel_3 = new JPanel(); JPanel panel_4 = new JPanel(); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGroup(gl_panel .createSequentialGroup().addContainerGap() .addComponent( panel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel.createSequentialGroup() .addComponent(panel_4, GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE).addGap(20)) .addGroup(gl_panel.createSequentialGroup() .addComponent(panel_2, GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE).addGap(4)))) .addComponent(panel_3, GroupLayout.DEFAULT_SIZE, 823, Short.MAX_VALUE)); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.TRAILING).addGroup(gl_panel .createSequentialGroup() .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel.createSequentialGroup() .addComponent(panel_2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(25) .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE)) .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); final JButton btnSave = new JButton("Save"); btnSave.setEnabled(false); btnSave.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { File saveFile = SaveFileChooser(); createXML(saveFile.getAbsoluteFile().getPath()); } }); lblTotTests = new JLabel(totTestsMessage); GroupLayout gl_panel_4 = new GroupLayout(panel_4); gl_panel_4.setHorizontalGroup(gl_panel_4.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_4.createSequentialGroup().addGap(21).addComponent(lblTotTests) .addPreferredGap(ComponentPlacement.RELATED, 515, Short.MAX_VALUE).addComponent(btnSave) .addGap(21))); gl_panel_4.setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_4.createSequentialGroup().addContainerGap() .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE).addComponent(btnSave) .addComponent(lblTotTests)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_4.setLayout(gl_panel_4); top = new DefaultMutableTreeNode("Parameters"); JScrollPane scrollPaneTree = new JScrollPane(); JLabel lblNumberOfWorkers = new JLabel("Number of Workers:"); textFieldNumberOfWorkers = new JTextField(); textFieldNumberOfWorkers.setText("1"); textFieldNumberOfWorkers.setColumns(10); textFieldNumberOfWorkers.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { if (textFieldNumberOfWorkers.isVisible()) { boolean checkNumberOfWorkers = true; while (checkNumberOfWorkers) { String dist = textFieldNumberOfWorkers.getText(); boolean validateDist = dist.matches("(\\d)+"); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldNumberOfWorkers.setText(newDist); } else { checkNumberOfWorkers = false; } } } } }); checkBoxLoadBalancing = new JCheckBox("Load Balancing", false); checkBoxLoadBalancing.setEnabled(true); GroupLayout gl_panel_2 = new GroupLayout(panel_2); gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_2 .createSequentialGroup().addContainerGap() .addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING) .addComponent(scrollPaneTree, GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE) .addGroup(gl_panel_2.createSequentialGroup().addComponent(lblNumberOfWorkers) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(textFieldNumberOfWorkers, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)) .addComponent(checkBoxLoadBalancing, GroupLayout.PREFERRED_SIZE, 114, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_2 .createSequentialGroup().addContainerGap() .addComponent(scrollPaneTree, GroupLayout.PREFERRED_SIZE, 271, GroupLayout.PREFERRED_SIZE) .addGap(33) .addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE).addComponent(lblNumberOfWorkers) .addComponent(textFieldNumberOfWorkers, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(checkBoxLoadBalancing, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addContainerGap(56, Short.MAX_VALUE))); final JTree treeParams = new JTree(top); scrollPaneTree.setViewportView(treeParams); treeParams.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent selected) { // DefaultMutableTreeNode parent = // selected.getPath().getParentPath() DefaultMutableTreeNode node = (DefaultMutableTreeNode) treeParams.getLastSelectedPathComponent(); if (node.getParent() != null) { if (node.getParent() == simParams || node.getParent().equals(generalParams)) { selectedParam = (Param) node.getUserObject(); if (node.getParent() == simParams) { selectedParamIndex = simParams.getIndex(node); paramType = "simParam"; } else { selectedParamIndex = generalParams.getIndex(node); paramType = "generalParam"; } if (selectedParam instanceof ParamFixed) { ParamFixed pf = (ParamFixed) selectedParam; lblParamType.setText(pf.getName() + ": " + pf.getType()); if (suggestion.get(pf.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pf.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pf.getName()).getSuggestedValue()); } textFieldRuns.setText("" + pf.getRuns()); textFieldValue.setText(pf.getValue()); rdbtnFixed.doClick(); lblMessage.setVisible(false); setModifyControlEnable(true); } if (selectedParam instanceof ParamRange) { ParamRange pf = (ParamRange) selectedParam; lblParamType.setText(pf.getName() + ": " + pf.getType()); if (suggestion.get(pf.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pf.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pf.getName()).getSuggestedValue()); } textFieldRuns.setText("" + pf.getRuns()); textFieldStartValue.setText(pf.getStart()); textFieldEndValue.setText(pf.getEnd()); textFieldIncrement.setText(pf.getIncrement()); rdbtnRange.doClick(); lblMessage.setVisible(false); setModifyControlEnable(true); } if (selectedParam instanceof ParamList) { ParamList pl = (ParamList) selectedParam; if (suggestion.get(pl.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pl.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pl.getName()).getSuggestedValue()); } lblParamType.setText(pl.getName() + ": " + pl.getType()); textFieldRuns.setText("" + pl.getRuns()); StringBuilder b = new StringBuilder(); boolean isFirst = true; for (String element : pl.getValues()) { if (isFirst) { b.append(element); isFirst = false; } else b.append("," + element); } textFieldList.setText(b.toString()); rdbtnByvalues.doClick(); setListControlvisibility(true); lblMessage.setVisible(false); setModifyControlEnable(true); } if (selectedParam instanceof ParamDistribution) { DistributionType distType = DistributionType.none; if (selectedParam instanceof ParamDistributionUniform) { ParamDistributionUniform pu = (ParamDistributionUniform) selectedParam; lblParamType.setText(pu.getName() + ": " + pu.getType()); if (suggestion.get(pu.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pu.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pu.getName()).getSuggestedValue()); } textFieldRuns.setText("" + pu.getRuns()); textFieldA.setText(pu.getA()); textFieldB.setText(pu.getB()); textFieldNumberOfValues.setText("" + pu.getNumberOfValues()); distType = DistributionType.uniform; } if (selectedParam instanceof ParamDistributionExponential) { ParamDistributionExponential pe = (ParamDistributionExponential) selectedParam; lblParamType.setText(pe.getName() + ": " + pe.getType()); if (suggestion.get(pe.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pe.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pe.getName()).getSuggestedValue()); } textFieldRuns.setText("" + pe.getRuns()); textFieldA.setText(pe.getLambda()); textFieldNumberOfValues.setText("" + pe.getNumberOfValues()); distType = DistributionType.exponential; } if (selectedParam instanceof ParamDistributionNormal) { ParamDistributionNormal pn = (ParamDistributionNormal) selectedParam; lblParamType.setText(pn.getName() + ": " + pn.getType()); if (suggestion.get(pn.getName()) != null) { lblDomain.setText("Domain: " + suggestion.get(pn.getName()).getDomain()); lblSuggested.setText( "Suggested Value: " + suggestion.get(pn.getName()).getSuggestedValue()); } textFieldRuns.setText("" + pn.getRuns()); textFieldA.setText(pn.getMean()); textFieldB.setText(pn.getStdDev()); textFieldNumberOfValues.setText("" + pn.getNumberOfValues()); distType = DistributionType.normal; } rdbtnByDistribution.doClick(); setDistributionControlVisibility(distType); setDistributionComboBoxVisibility(true); lblMessage.setVisible(false); setModifyControlEnable(true); } } } } }); panel_2.setLayout(gl_panel_2); JLabel lblSelectSimulationJar = new JLabel("Select simulation jar:"); textFieldSimJarPath = new JTextField(); textFieldSimJarPath.setColumns(10); btnLoadParams = new JButton("Load Params"); btnLoadParams.setEnabled(false); btnLoadParams.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ArrayList<Param> params = loadParams(); if (params != null) { top.removeAllChildren(); createNodes(top, params); treeParams.expandPath(new TreePath(top.getPath())); treeParams.expandPath(new TreePath(simParams.getPath())); treeParams.expandPath(new TreePath(generalParams.getPath())); } lblTotTests.setText(totTestsMessage + " " + getTotTests()); btnSave.setEnabled(true); } }); JButton bntChooseSimulation = new JButton(); bntChooseSimulation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { simulationFile = showFileChooser(); if (simulationFile != null) { textFieldSimJarPath.setText(simulationFile.getAbsolutePath()); btnLoadParams.setEnabled(true); isThin = isThinSimulation(simulationFile); checkBoxLoadBalancing.setEnabled(!isThin); } } }); bntChooseSimulation.setIcon( new ImageIcon(BatchWizard.class.getResource("/it.isislab.dmason/resource/image/openFolder.png"))); GroupLayout gl_panel_3 = new GroupLayout(panel_3); gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_3 .createSequentialGroup().addContainerGap().addComponent(lblSelectSimulationJar) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textFieldSimJarPath, GroupLayout.PREFERRED_SIZE, 250, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(bntChooseSimulation, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE) .addGap(26).addComponent(btnLoadParams).addContainerGap(172, Short.MAX_VALUE))); gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_3 .createSequentialGroup().addContainerGap() .addGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_3 .createParallelGroup(Alignment.BASELINE).addComponent(lblSelectSimulationJar) .addComponent(textFieldSimJarPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(bntChooseSimulation, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addComponent(btnLoadParams)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_3.setLayout(gl_panel_3); lblParamType = new JLabel("Param : type"); lblParamType.setFont(new Font("Tahoma", Font.BOLD, 11)); JLabel lblRuns = new JLabel("Runs:"); textFieldRuns = new JTextField(); textFieldRuns.setColumns(10); textFieldRuns.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { if (textFieldRuns.isVisible()) { boolean checkRuns = true; while (checkRuns) { String dist = textFieldRuns.getText(); boolean validateDist = dist.matches("(\\d)+"); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldRuns.setText(newDist); } else { checkRuns = false; } } } } }); JLabel lblParameterSpace = new JLabel("Parameter Space"); lblParameterSpace.setFont(new Font("Tahoma", Font.BOLD, 11)); lblValue = new JLabel("Value:"); textFieldValue = new JTextField(); textFieldValue.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldValue.isVisible()) { boolean checkValue = true; while (checkValue) { String dist = textFieldValue.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldValue.setText(newDist); } else { checkValue = false; } } } } }); textFieldValue.setColumns(10); /*textFieldValue.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent arg0) {} @Override public void keyReleased(KeyEvent arg0) { checkError(); } @Override public void keyPressed(KeyEvent arg0) {} }); */ lblStartValue = new JLabel("Start value:"); textFieldStartValue = new JTextField(); textFieldStartValue.setText("1"); textFieldStartValue.setColumns(10); textFieldStartValue.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldStartValue.isVisible()) { boolean checkStartValue = true; while (checkStartValue) { String dist = textFieldStartValue.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldStartValue.setText(newDist); } else { checkStartValue = false; } } } } }); lblEndValue = new JLabel("End value:"); textFieldEndValue = new JTextField(); textFieldEndValue.setText("1"); textFieldEndValue.setColumns(10); textFieldEndValue.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldEndValue.isVisible()) { boolean checkEndValue = true; while (checkEndValue) { String dist = textFieldEndValue.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldEndValue.setText(newDist); } else { checkEndValue = false; } } } } }); lblIncrement = new JLabel("Increment:"); textFieldIncrement = new JTextField(); textFieldIncrement.setText("1"); textFieldIncrement.setColumns(10); textFieldIncrement.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldIncrement.isVisible()) { boolean checkIncrement = true; while (checkIncrement) { String dist = textFieldIncrement.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldIncrement.setText(newDist); } else { checkIncrement = false; } } } } }); rdbtnFixed = new JRadioButton("Fixed"); rdbtnFixed.setSelected(true); rdbtnFixed.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { setListControlvisibility(false); setDistributionComboBoxVisibility(false); setRangeControlVisibility(false); setFixedControlVisibility(true); setDistributionControlVisibility(DistributionType.none); } }); rdbtnRange = new JRadioButton("Range"); rdbtnRange.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setRangeControlVisibility(true); setFixedControlVisibility(false); setListControlvisibility(false); setDistributionComboBoxVisibility(false); setDistributionControlVisibility(DistributionType.none); } }); rdbtnByvalues = new JRadioButton("By Values"); rdbtnByvalues.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setRangeControlVisibility(false); setFixedControlVisibility(false); setListControlvisibility(true); setDistributionComboBoxVisibility(false); setDistributionControlVisibility(DistributionType.none); } }); rdbtnByDistribution = new JRadioButton("By Distribution"); rdbtnByDistribution.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setRangeControlVisibility(false); setFixedControlVisibility(false); setListControlvisibility(false); setDistributionComboBoxVisibility(true); setDistributionControlVisibility(DistributionType.none); } }); // Group the radio buttons. ButtonGroup group = new ButtonGroup(); group.add(rdbtnFixed); group.add(rdbtnRange); group.add(rdbtnByvalues); group.add(rdbtnByDistribution); setRangeControlVisibility(false); setFixedControlVisibility(false); lblMessage = new JLabel(message); btnModify = new JButton("Modify"); btnModify.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (rdbtnFixed.isSelected()) { ParamFixed param = new ParamFixed(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), textFieldValue.getText()); DefaultMutableTreeNode p = new DefaultMutableTreeNode(param); if (paramType.equals("simParam")) { simParams.remove(selectedParamIndex); simParams.insert(p, selectedParamIndex); } else { generalParams.remove(selectedParamIndex); generalParams.insert(p, selectedParamIndex); } treeParams.updateUI(); /* * ((ParamFixed) * selectedParam).setValue(textFieldValue.getText()); * selectedParam * .setRuns(Integer.parseInt(textFieldRuns.getText())); * treeParams.repaint(); */ } if (rdbtnRange.isSelected()) { ParamRange param = new ParamRange(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), textFieldStartValue.getText(), textFieldEndValue.getText(), textFieldIncrement.getText()); DefaultMutableTreeNode p = new DefaultMutableTreeNode(param); if (paramType.equals("simParam")) { simParams.remove(selectedParamIndex); simParams.insert(p, selectedParamIndex); } else { generalParams.remove(selectedParamIndex); generalParams.insert(p, selectedParamIndex); } treeParams.updateUI(); // treeParams.repaint(); } if (rdbtnByvalues.isSelected()) { StringTokenizer st = new StringTokenizer(textFieldList.getText(), ","); ArrayList<String> values = new ArrayList<String>(); while (st.hasMoreTokens()) values.add(st.nextToken()); ParamList param = new ParamList(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), values); DefaultMutableTreeNode p = new DefaultMutableTreeNode(param); if (paramType.equals("simParam")) { simParams.remove(selectedParamIndex); simParams.insert(p, selectedParamIndex); } else { generalParams.remove(selectedParamIndex); generalParams.insert(p, selectedParamIndex); } treeParams.updateUI(); // treeParams.repaint(); } if (rdbtnByDistribution.isSelected()) { DefaultMutableTreeNode p; switch (selectedDistribution) { case uniform: p = new DefaultMutableTreeNode( new ParamDistributionUniform(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), textFieldA.getText(), textFieldB.getText(), Integer.parseInt(textFieldNumberOfValues.getText()))); break; case exponential: p = new DefaultMutableTreeNode(new ParamDistributionExponential(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), textFieldA.getText(), Integer.parseInt(textFieldNumberOfValues.getText()))); break; case normal: p = new DefaultMutableTreeNode( new ParamDistributionNormal(selectedParam.getName(), selectedParam.getType(), Integer.parseInt(textFieldRuns.getText()), textFieldA.getText(), textFieldA.getText(), Integer.parseInt(textFieldNumberOfValues.getText()))); break; default: p = new DefaultMutableTreeNode(); break; } if (paramType.equals("simParam")) { simParams.remove(selectedParamIndex); simParams.insert(p, selectedParamIndex); } else { generalParams.remove(selectedParamIndex); generalParams.insert(p, selectedParamIndex); } treeParams.updateUI(); // treeParams.repaint(); } lblMessage.setVisible(true); setModifyControlEnable(false); setDistributionControlVisibility(DistributionType.none); setDistributionComboBoxVisibility(false); setListControlvisibility(false); int tot = getTotTests(); if (tot >= testAlertThreshold) lblTotTests.setForeground(Color.RED); else lblTotTests.setForeground(Color.BLACK); lblTotTests.setText(totTestsMessage + " " + tot); } }); btnCancel = new JButton("Cancel"); btnCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { lblMessage.setVisible(true); setModifyControlEnable(false); } }); lblCommaSeparatedList = new JLabel("List:"); lblCommaSeparatedList.setVisible(false); textFieldList = new JTextField(); textFieldList.setVisible(false); textFieldList.setToolTipText("Comma separated"); textFieldList.setColumns(10); textFieldList.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { /*if(textFieldList.isVisible()) { boolean checkList=true; while(checkList){ String dist=textFieldList.getText(); boolean validateDist=dist.matches("(\\d)+|((\\d)+\\.(\\d)+)(,(\\d)+|((\\d)+\\.(\\d)+))*"); if(!validateDist){ String newDist= JOptionPane.showInputDialog(null,"Insert comma separate number list","Number Format Error", 0); textFieldList.setText(newDist); } else{ checkList=false; } } }*/ } }); lblDistribution = new JLabel("Distribution"); lblDistribution.setVisible(false); lblA = new JLabel("a:"); lblA.setVisible(false); textFieldA = new JTextField(); textFieldA.setText("1"); textFieldA.setVisible(false); textFieldA.setColumns(10); textFieldA.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldA.isVisible()) { boolean checkA = true; while (checkA) { String dist = textFieldA.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldA.setText(newDist); } else { checkA = false; } } } } }); lblB = new JLabel("b:"); lblB.setVisible(false); textFieldB = new JTextField(); textFieldB.setText("1"); textFieldB.setVisible(false); textFieldB.setColumns(10); textFieldB.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { String regex = "(\\d)+|((\\d)+\\.(\\d)+)"; if (textFieldB.isVisible()) { boolean checkB = true; while (checkB) { String dist = textFieldB.getText(); boolean validateDist = dist.matches(regex); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldB.setText(newDist); } else { checkB = false; } } } } }); jComboBoxDistribution = new JComboBox(); jComboBoxDistribution.setVisible(false); jComboBoxDistribution.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { // Prevent executing listener's actions two times if (e.getStateChange() != ItemEvent.SELECTED) return; selectedDistribution = ((DistributionType) jComboBoxDistribution.getSelectedItem()); setDistributionControlVisibility(DistributionType.none); setDistributionControlVisibility(selectedDistribution); } }); lblOfValues = new JLabel("# of values:"); lblOfValues.setVisible(false); textFieldNumberOfValues = new JTextField(); textFieldNumberOfValues.setText("1"); textFieldNumberOfValues.setVisible(false); textFieldNumberOfValues.setColumns(10); textFieldNumberOfValues.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent arg0) { if (textFieldNumberOfValues.isVisible()) { boolean checkNumberOfValues = true; while (checkNumberOfValues) { String dist = textFieldNumberOfValues.getText(); boolean validateDist = dist.matches("(\\d)+"); if (!validateDist) { String newDist = JOptionPane.showInputDialog(null, "Insert a number", "Number Format Error", 0); textFieldNumberOfValues.setText(newDist); } else { checkNumberOfValues = false; } } } } }); lblSuggested = new JLabel("Suggested Value:"); lblDomain = new JLabel("Domain:"); GroupLayout gl_panel_1 = new GroupLayout(panel_1); gl_panel_1.setHorizontalGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING).addGroup(gl_panel_1 .createSequentialGroup().addContainerGap() .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING).addGroup(gl_panel_1 .createSequentialGroup() .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING).addComponent(lblParamType) .addComponent(lblMessage).addComponent(lblSuggested)) .addContainerGap(77, Short.MAX_VALUE)) .addGroup(gl_panel_1.createSequentialGroup().addComponent(btnModify) .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnCancel) .addContainerGap()) .addGroup(gl_panel_1.createSequentialGroup().addGroup(gl_panel_1 .createParallelGroup(Alignment.LEADING).addComponent(lblParameterSpace) .addGroup(gl_panel_1.createSequentialGroup() .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) .addComponent(rdbtnFixed).addComponent(rdbtnRange)) .addGap(31) .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) .addComponent(rdbtnByDistribution).addComponent(rdbtnByvalues))) .addGroup(gl_panel_1.createSequentialGroup().addGroup(gl_panel_1 .createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_1.createSequentialGroup().addComponent(lblValue) .addPreferredGap(ComponentPlacement.RELATED, 59, Short.MAX_VALUE) .addComponent(textFieldValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(Alignment.LEADING, gl_panel_1.createSequentialGroup().addComponent(lblStartValue) .addPreferredGap(ComponentPlacement.RELATED, 46, Short.MAX_VALUE) .addComponent(textFieldStartValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panel_1.createSequentialGroup() .addComponent(lblCommaSeparatedList) .addPreferredGap(ComponentPlacement.RELATED, 69, Short.MAX_VALUE) .addComponent(textFieldList, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panel_1.createSequentialGroup() .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) .addComponent(lblEndValue).addComponent(lblIncrement) .addComponent(lblDistribution)) .addGap(45) .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_1 .createParallelGroup(Alignment.LEADING, false) .addComponent(jComboBoxDistribution, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(textFieldA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldNumberOfValues, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(textFieldIncrement, 89, 89, 89)) .addComponent(textFieldEndValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(ComponentPlacement.RELATED, 8, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panel_1.createSequentialGroup().addComponent(lblA).addPreferredGap( ComponentPlacement.RELATED, 173, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panel_1.createSequentialGroup().addComponent(lblB).addPreferredGap( ComponentPlacement.RELATED, 173, GroupLayout.PREFERRED_SIZE)) .addComponent(lblOfValues) .addGroup(gl_panel_1.createSequentialGroup().addComponent(lblRuns) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textFieldRuns, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, 65, GroupLayout.PREFERRED_SIZE))) .addGap(35)) .addGroup(gl_panel_1.createSequentialGroup().addComponent(lblDomain).addContainerGap(186, Short.MAX_VALUE))))); gl_panel_1.setVerticalGroup(gl_panel_1.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_1 .createSequentialGroup().addGap(4).addComponent(lblMessage).addGap(18).addComponent(lblParamType) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblSuggested) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblDomain).addGap(7) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(lblRuns).addComponent( textFieldRuns, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblParameterSpace) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(rdbtnFixed) .addComponent(rdbtnByvalues)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(rdbtnRange) .addComponent(rdbtnByDistribution)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) .addComponent(textFieldValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblValue)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) .addComponent(textFieldList, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblCommaSeparatedList)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(lblStartValue) .addComponent(textFieldStartValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(lblEndValue).addComponent( textFieldEndValue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) .addComponent(textFieldIncrement, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblIncrement)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE) .addComponent(jComboBoxDistribution, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblDistribution)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel_1 .createParallelGroup(Alignment.BASELINE).addComponent(lblA).addComponent(textFieldA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_1 .createParallelGroup(Alignment.BASELINE).addComponent(lblB).addComponent(textFieldB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE).addComponent(lblOfValues).addComponent( textFieldNumberOfValues, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED, 18, Short.MAX_VALUE).addGroup(gl_panel_1 .createParallelGroup(Alignment.BASELINE).addComponent(btnModify).addComponent(btnCancel)))); panel_1.setLayout(gl_panel_1); panel.setLayout(gl_panel); setModifyControlEnable(false); loadDistribution(); }
From source file:ca.sfu.federation.viewer.propertysheet.CoordinateSystemPropertySheet.java
/** * CoordinateSystemPropertySheet constructor *//*from w w w. jav a 2 s .c om*/ public CoordinateSystemPropertySheet() { lblINamedObject = new JLabel(); lblName = new JLabel(); lblDescription = new JLabel(); jtfClass = new JTextField(); jtfName = new JTextField(); jtfCanonicalName = new JTextField(); lblCanonicalName = new JLabel(); lblClass = new JLabel(); jtfDescription = new JTextField(); lblParentContext = new JLabel(); jtfParentContext = new JTextField(); lblX = new JLabel(); lblY = new JLabel(); lblZ = new JLabel(); jtfX = new JTextField(); jtfY = new JTextField(); jtfZ = new JTextField(); lblUpdateMethod = new JLabel(); jcbUpdateMethod = new JComboBox(); jScrollPane1 = new JScrollPane(); lblINamedObject.setFont(new java.awt.Font("Tahoma", 0, 14)); lblINamedObject.setText("jLabel1"); lblName.setText("Name"); lblDescription.setText("Description"); lblCanonicalName.setText("Canonical Name"); lblClass.setText("Class"); lblParentContext.setText("Parent Context"); lblX.setText("X Coordinate"); lblY.setText("Y Coordinate"); lblZ.setText("Z Coordinate"); lblUpdateMethod.setText("Update Method"); jtfParentContext.setEditable(false); jtfClass.setEditable(false); jtfCanonicalName.setEditable(false); jScrollPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, lblINamedObject) .add(org.jdesktop.layout.GroupLayout.LEADING, layout .createSequentialGroup().add(layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(lblCanonicalName).add(lblClass).add( lblName) .add(lblDescription).add(lblX).add(lblZ).add(lblY) .add(lblUpdateMethod).add(lblParentContext)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(jcbUpdateMethod, 0, 221, Short.MAX_VALUE) .add(jtfName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfClass, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(jtfCanonicalName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)) .add(jtfParentContext, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfX, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfY, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfZ, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup().addContainerGap().add(lblINamedObject) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfClass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblClass)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblName)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lblCanonicalName) .add(jtfCanonicalName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lblDescription).add(jtfDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfParentContext, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblParentContext)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(lblX).add( jtfX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblY)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfZ, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblZ)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jcbUpdateMethod, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblUpdateMethod)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE) .addContainerGap())); // disable non editable fields this.jtfCanonicalName.setEditable(false); this.jtfClass.setEditable(false); this.jtfParentContext.setEditable(false); // set field values this.setValues(); // add action listener jtfName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfNameActionListener(evt); } }); jtfDescription.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfDescriptionActionListener(evt); } }); jtfX.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfXActionListener(evt); } }); jtfY.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfYActionListener(evt); } }); jtfZ.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfZActionListener(evt); } }); jcbUpdateMethod.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcbUpdateMethodActionListener(evt); } }); }
From source file:com.igormaznitsa.jhexed.swing.editor.ui.dialogs.hexeditors.DialogEditSVGImageValue.java
/** * 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.// w w w. ja v a 2 s.c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); textName = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); textComments = new javax.swing.JTextArea(); buttonCancel = new javax.swing.JButton(); buttonOk = new javax.swing.JButton(); panelPreview = new javax.swing.JPanel(); buttonLoad = new javax.swing.JButton(); buttonSaveAs = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setLocationByPlatform(true); jLabel1.setText("Name:"); jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Commentary")); textComments.setColumns(20); textComments.setRows(5); jScrollPane1.setViewportView(textComments); buttonCancel.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/cross.png"))); // NOI18N buttonCancel.setText("Cancel"); buttonCancel.setToolTipText("Reject changes"); buttonCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCancelActionPerformed(evt); } }); buttonOk.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/tick.png"))); // NOI18N buttonOk.setText("Ok"); buttonOk.setToolTipText("Save the changes"); buttonOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonOkActionPerformed(evt); } }); panelPreview.setBorder(javax.swing.BorderFactory.createTitledBorder("Preview")); panelPreview.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { panelPreviewMouseClicked(evt); } }); panelPreview.setLayout(new java.awt.BorderLayout()); buttonLoad.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/drive-upload.png"))); // NOI18N buttonLoad.setText("Load from file"); buttonLoad.setToolTipText("Load the image from a file"); buttonLoad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonLoadActionPerformed(evt); } }); buttonSaveAs.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/jhexed/swing/editor/icons/drive-download.png"))); // NOI18N buttonSaveAs.setText("Save as file"); buttonSaveAs.setToolTipText("Save the image as a file"); buttonSaveAs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSaveAsActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelPreview, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textName)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(buttonOk) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonCancel)) .addGroup(layout.createSequentialGroup().addComponent(buttonLoad) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonSaveAs).addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { buttonCancel, buttonOk }); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { buttonLoad, buttonSaveAs }); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(textName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(panelPreview, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonLoad).addComponent(buttonSaveAs)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonCancel).addComponent(buttonOk)) .addContainerGap())); pack(); }
From source file:cz.muni.fi.fresneleditor.common.reposconf.NamespacesConfigurationJPanel.java
/** * 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.// w ww. j a v a 2 s. c o m */ private void initComponents() { namespaceJPanel = new javax.swing.JPanel(); prefixTxtField = new javax.swing.JTextField(); prefixLbl = new javax.swing.JLabel(); nameLbl = new javax.swing.JLabel(); nameTextField = new javax.swing.JTextField(); namespacesScrollPane = new javax.swing.JScrollPane(); namespacesTable = new javax.swing.JTable(); definedNamespacesLbl = new javax.swing.JLabel(); addNewNamespaceBtn = new javax.swing.JButton(); availableRepositoriesLbl = new javax.swing.JLabel(); repositoriesCombo = new javax.swing.JComboBox(); setName("Form"); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application .getInstance(cz.muni.fi.fresneleditor.common.FresnelApplication.class).getContext() .getResourceMap(NamespacesConfigurationJPanel.class); namespaceJPanel.setBorder(javax.swing.BorderFactory .createTitledBorder(resourceMap.getString("namespaceJPanel.border.title"))); // NOI18N namespaceJPanel.setName("namespaceJPanel"); // NOI18N prefixTxtField.setFont(resourceMap.getFont("prefixTxtField.font")); // NOI18N prefixTxtField.setText(resourceMap.getString("prefixTxtField.text")); // NOI18N prefixTxtField.setName("prefixTxtField"); // NOI18N prefixLbl.setFont(resourceMap.getFont("prefixTxtField.font")); // NOI18N prefixLbl.setText(resourceMap.getString("prefixLbl.text")); // NOI18N prefixLbl.setName("prefixLbl"); // NOI18N nameLbl.setFont(resourceMap.getFont("prefixTxtField.font")); // NOI18N nameLbl.setText(resourceMap.getString("nameLbl.text")); // NOI18N nameLbl.setName("nameLbl"); // NOI18N nameTextField.setFont(resourceMap.getFont("prefixTxtField.font")); // NOI18N nameTextField.setText(resourceMap.getString("nameTextField.text")); // NOI18N nameTextField.setName("nameTextField"); // NOI18N namespacesScrollPane.setName("namespacesScrollPane"); // NOI18N namespacesTable.setModel(new NamespacesTableModel()); namespacesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS); namespacesTable.setName("namespacesTable"); // NOI18N namespacesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); namespacesTable.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { namespacesTableMouseClicked(evt); } }); namespacesScrollPane.setViewportView(namespacesTable); namespacesTable.getColumnModel().getColumn(0).setPreferredWidth(100); namespacesTable.getColumnModel().getColumn(0) .setHeaderValue(resourceMap.getString("namespacesTable.columnModel.title0")); // NOI18N namespacesTable.getColumnModel().getColumn(1) .setHeaderValue(resourceMap.getString("namespacesTable.columnModel.title1")); // NOI18N definedNamespacesLbl.setText(resourceMap.getString("definedNamespacesLbl.text")); // NOI18N definedNamespacesLbl.setName("definedNamespacesLbl"); // NOI18N addNewNamespaceBtn.setText(resourceMap.getString("addNewNamespaceBtn.text")); // NOI18N addNewNamespaceBtn.setName("addNewNamespaceBtn"); // NOI18N addNewNamespaceBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addNewNamespaceBtnActionPerformed(evt); } }); javax.swing.GroupLayout namespaceJPanelLayout = new javax.swing.GroupLayout(namespaceJPanel); namespaceJPanel.setLayout(namespaceJPanelLayout); namespaceJPanelLayout.setHorizontalGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(namespaceJPanelLayout.createSequentialGroup().addContainerGap() .addGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(namespacesScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 551, Short.MAX_VALUE) .addGroup(namespaceJPanelLayout.createSequentialGroup() .addGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, namespaceJPanelLayout.createSequentialGroup() .addComponent(nameLbl) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(nameTextField)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, namespaceJPanelLayout.createSequentialGroup() .addComponent(prefixLbl) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prefixTxtField, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) .addComponent(addNewNamespaceBtn)) .addComponent(definedNamespacesLbl)) .addContainerGap())); namespaceJPanelLayout.setVerticalGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(namespaceJPanelLayout.createSequentialGroup().addGap(6, 6, 6) .addComponent(definedNamespacesLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(namespacesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(prefixTxtField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(prefixLbl)) .addGap(9, 9, 9) .addGroup(namespaceJPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(nameLbl) .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(addNewNamespaceBtn)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); availableRepositoriesLbl.setText(resourceMap.getString("availableRepositoriesLbl.text")); // NOI18N availableRepositoriesLbl.setName("availableRepositoriesLbl"); // NOI18N repositoriesCombo.setName("repositoriesCombo"); // NOI18N repositoriesCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { repositoriesComboActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setVerticalGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(repositoriesCombo, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(availableRepositoriesLbl, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(namespaceJPanel, GroupLayout.PREFERRED_SIZE, 256, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setHorizontalGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup() .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(availableRepositoriesLbl, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(repositoriesCombo, GroupLayout.PREFERRED_SIZE, 296, GroupLayout.PREFERRED_SIZE) .addGap(0, 77, Short.MAX_VALUE)) .addComponent(namespaceJPanel, GroupLayout.Alignment.LEADING, 0, 586, Short.MAX_VALUE)) .addContainerGap()); Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this); }
From source file:misc.TablePrintDemo1.java
/** * Adds to and lays out all GUI components on the {@code contentPane} panel. * <p>//w w w . j a v a 2 s.c om * It is recommended that you <b>NOT</b> try to understand this code. It was * automatically generated by the NetBeans GUI builder. * */ private void addComponentsToContentPane() { JPanel bottomPanel = new JPanel(); bottomPanel.setBorder(BorderFactory.createTitledBorder("Printing")); GroupLayout bottomPanelLayout = new GroupLayout(bottomPanel); bottomPanel.setLayout(bottomPanelLayout); bottomPanelLayout.setHorizontalGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout.createSequentialGroup().addContainerGap() .addGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(headerBox).addComponent(footerBox)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(footerField) .addComponent(headerField, GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addGroup(bottomPanelLayout.createSequentialGroup().addComponent(fitWidthBox) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(printButton)) .addGroup(bottomPanelLayout.createSequentialGroup().addComponent(showPrintDialogBox) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(interactiveBox))) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); bottomPanelLayout.setVerticalGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout.createSequentialGroup() .addGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(headerBox) .addComponent(headerField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(interactiveBox).addComponent(showPrintDialogBox)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(bottomPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(footerBox) .addComponent(footerField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(fitWidthBox).addComponent(printButton)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); GroupLayout layout = new GroupLayout(contentPane); contentPane.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(scroll, GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE) .addComponent(gradesLabel).addComponent(bottomPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(gradesLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(scroll, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(bottomPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); }
From source file:gtu._work.ui.TextScanUI.java
private void initGUI() { try {/*w w w . j av a 2 s. c o m*/ BorderLayout thisLayout = new BorderLayout(); getContentPane().setLayout(thisLayout); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { thisComponentResized(evt); } }); this.addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent evt) { System.out.println("this.windowStateChanged, event=" + evt); // TODO add your code for this.windowStateChanged } }); this.addWindowListener(new WindowAdapter() { public void windowIconified(WindowEvent evt) { System.out.println("this.windowIconified, event=" + evt); // TODO add your code for this.windowIconified } }); this.setTitle(TITLE); { jPanel1 = new JPanel(); getContentPane().add(jPanel1, BorderLayout.NORTH); GroupLayout jPanel1Layout = new GroupLayout((JComponent) jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1.setPreferredSize(new java.awt.Dimension(521, 89)); jPanel1.setBounds(0, 0, 521, 89); { jButton1 = new JButton(); jButton1.setText("File"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButton1ActionPerformed(evt); } }); } { jButton2 = new JButton(); jButton2.setText("Clipboard"); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButton2ActionPerformed(evt); } }); } { contentFilter = new JTextField(); contentFilter.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent paramDocumentEvent) { jTextField2filterAgain(); } public void removeUpdate(DocumentEvent paramDocumentEvent) { jTextField2filterAgain(); } public void changedUpdate(DocumentEvent paramDocumentEvent) { jTextField2filterAgain(); } }); } { fileFilter = new JTextField(); fileFilter.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent paramDocumentEvent) { jTextField1DocumentListener(paramDocumentEvent); } public void removeUpdate(DocumentEvent paramDocumentEvent) { jTextField1DocumentListener(paramDocumentEvent); } public void changedUpdate(DocumentEvent paramDocumentEvent) { jTextField1DocumentListener(paramDocumentEvent); } }); } { totalLabel = new JLabel(); } { matchLabel = new JLabel(); } { jLabel4 = new JLabel(); jLabel4.setText("Match : "); } { jLabel2 = new JLabel(); jLabel2.setText("Total : "); } { ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(new String[] { "All", "Match" }); contextFilter = new JComboBox(); contextFilter.setModel(jComboBox1Model); contextFilter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jTextField2filterAgain(); } }); } { ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(new String[] { "Regex", "find" }); fileChk = new JComboBox(); fileChk.setModel(jComboBox1Model); fileChk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { fileChkActionPerformed(evt); } }); } { jScrollPane2 = new JScrollPane(); { ListModel groupListModel = new DefaultComboBoxModel(); groupList = new JList(); jScrollPane2.setViewportView(groupList); groupList.setModel(groupListModel); groupList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { groupListKeyPressed(evt); } }); } } jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup().addContainerGap(16, 16) .addGroup(jPanel1Layout.createParallelGroup() .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jButton1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(fileFilter, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addComponent(fileChk, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup().addGroup(jPanel1Layout .createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jButton2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(contentFilter, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addComponent(contextFilter, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(matchLabel, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(totalLabel, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE))) .addContainerGap(12, 12)); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createSequentialGroup().addContainerGap(12, 12) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(contextFilter, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE) .addComponent(fileChk, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(jLabel4, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(matchLabel, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE) .addComponent(totalLabel, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(contentFilter, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 266, GroupLayout.PREFERRED_SIZE) .addComponent(fileFilter, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 266, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup() .addComponent(jButton1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE) .addComponent(jButton2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)) .addGap(19) .addComponent(jScrollPane2, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE) .addContainerGap(16, 16)); } { jScrollPane1 = new JScrollPane(); getContentPane().add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(581, 235)); { ListModel jList1Model = new DefaultComboBoxModel(); matchList = new JList(); jScrollPane1.setViewportView(matchList); // matchList.setPreferredSize(new java.awt.Dimension(575, // 232));// ??? // ?? // XXX // TODO // IMPORT // !!!! matchList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { jList1MouseClicked(evt); } }); matchList.setModel(jList1Model); } } this.setSize(697, 440); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.pos.spatobiz.app.view.karyawan.HapusKaryawan.java
/** This method is called from within the constructor to * initialize the form./* w w w . j ava 2 s . co m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jeniskelamin = new ButtonGroup(); labelKode = new WhiteLabel(); labelNama = new WhiteLabel(); labelTanggalLahir = new WhiteLabel(); labelAlamat = new WhiteLabel(); textKode = new TextBoxTransfer(); textNama = new TextBoxTransfer(); textTanggalLahir = new DateBox(); textAlamat = new WhiteTextArea(); textTelepon = new TextBoxTransfer(); labelTelepon = new WhiteLabel(); labelEmail = new WhiteLabel(); labelJenisKelamin = new WhiteLabel(); labelPhoto = new WhiteLabel(); textEmail = new TextBoxTransfer(); radioPria = new JRadioButton(); radioWanita = new JRadioButton(); imageChooser = new ImageChooser(); buttonBatal = new Button(); buttonHapus = new Button(); buttonCari = new Button(); setBackground(new Color(0, 0, 0)); labelKode.setHorizontalAlignment(SwingConstants.RIGHT); labelKode.setText("Kode :"); labelNama.setHorizontalAlignment(SwingConstants.RIGHT); labelNama.setText("Nama :"); labelTanggalLahir.setHorizontalAlignment(SwingConstants.RIGHT); labelTanggalLahir.setText("Tanggal Lahir :"); labelAlamat.setHorizontalAlignment(SwingConstants.RIGHT); labelAlamat.setText("Alamat :"); textNama.setEnabled(false); textTanggalLahir.setEnabled(false); textTanggalLahir.setFormatterFactory( new DefaultFormatterFactory(new DateFormatter(DateFormat.getDateInstance(DateFormat.LONG)))); textTanggalLahir.setPreferredSize(new Dimension(120, 24)); textTanggalLahir.setValue(new Date()); textAlamat.setEnabled(false); textTelepon.setEnabled(false); labelTelepon.setHorizontalAlignment(SwingConstants.RIGHT); labelTelepon.setText("Telepon :"); labelEmail.setHorizontalAlignment(SwingConstants.RIGHT); labelEmail.setText("Email :"); labelJenisKelamin.setHorizontalAlignment(SwingConstants.RIGHT); labelJenisKelamin.setText("Jenis Kelamin :"); labelPhoto.setHorizontalAlignment(SwingConstants.RIGHT); labelPhoto.setText("Photo :"); textEmail.setEnabled(false); jeniskelamin.add(radioPria); radioPria.setFont(new Font("Tahoma", 1, 11)); radioPria.setForeground(new Color(255, 255, 255)); radioPria.setSelected(true); radioPria.setText("Pria"); radioPria.setEnabled(false); radioPria.setOpaque(false); jeniskelamin.add(radioWanita); radioWanita.setFont(new Font("Tahoma", 1, 11)); radioWanita.setForeground(new Color(255, 255, 255)); radioWanita.setText("Wanita"); radioWanita.setEnabled(false); radioWanita.setOpaque(false); imageChooser.setEnabled(false); buttonBatal.setMnemonic('B'); buttonBatal.setText("Batal"); buttonHapus.setMnemonic('H'); buttonHapus.setText("Hapus"); buttonCari.setText("Cari"); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup( Alignment.TRAILING, layout .createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(Alignment.TRAILING).addGroup(layout .createSequentialGroup().addComponent( buttonHapus, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent( buttonBatal, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(Alignment.LEADING).addGroup(layout .createParallelGroup(Alignment.TRAILING, false) .addComponent(labelPhoto, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelJenisKelamin, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( labelEmail, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout .createParallelGroup(Alignment.TRAILING, false) .addComponent(labelTelepon, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelTanggalLahir, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelAlamat, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelNama, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( labelKode, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(Alignment.TRAILING) .addComponent(textAlamat, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(textNama, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addComponent(textTanggalLahir, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addComponent(textTelepon, GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addGroup(Alignment.LEADING, layout .createSequentialGroup() .addComponent(radioPria) .addPreferredGap( ComponentPlacement.UNRELATED) .addComponent(radioWanita)) .addComponent( imageChooser, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 253, GroupLayout.PREFERRED_SIZE) .addComponent(textEmail, GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(textKode, GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE) .addPreferredGap( ComponentPlacement.UNRELATED) .addComponent(buttonCari, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(labelKode, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textKode, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonCari, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(labelNama, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textNama, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(labelTanggalLahir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textTanggalLahir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(labelAlamat, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textAlamat, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(textTelepon, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(labelTelepon, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(labelEmail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textEmail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(labelJenisKelamin, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(radioPria).addComponent(radioWanita)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(labelPhoto, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(imageChooser, GroupLayout.PREFERRED_SIZE, 189, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(buttonBatal, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonHapus, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); }
From source file:client.InterfaceJeu.java
/** * 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.//from w w w. j a v a 2s.c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); txtAreaChatLect = new javax.swing.JTextArea(); btnChat = new javax.swing.JButton(); txtFieldChatEcr = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); labelMsg = new javax.swing.JLabel(); labelInfosJoueurs = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jButton2 = new javax.swing.JButton(); labelInfosPerso1 = new javax.swing.JLabel(); labelInfosPerso2 = new javax.swing.JLabel(); labelInfosPerso3 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("2IDENT"); setMinimumSize(new java.awt.Dimension(900, 600)); setPreferredSize(new java.awt.Dimension(700, 500)); setResizable(false); addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { formKeyPressed(evt); } }); txtAreaChatLect.setEditable(false); txtAreaChatLect.setColumns(15); txtAreaChatLect.setLineWrap(true); txtAreaChatLect.setRows(15); txtAreaChatLect.setWrapStyleWord(true); txtAreaChatLect.setMinimumSize(new java.awt.Dimension(1000, 1000)); jScrollPane1.setViewportView(txtAreaChatLect); btnChat.setText("Envoyer"); btnChat.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnChat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChatActionPerformed(evt); } }); txtFieldChatEcr.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { txtFieldChatEcrKeyPressed(evt); } }); jPanel1.setBackground(new java.awt.Color(51, 102, 0)); jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true)); jPanel1.setName(""); // NOI18N jPanel1.setPreferredSize(new java.awt.Dimension(480, 180)); labelMsg.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N labelMsg.setForeground(java.awt.Color.white); labelMsg.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelInfosJoueurs.setForeground(java.awt.Color.white); labelInfosJoueurs.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jButton1.setText("Jouer"); jButton1.setEnabled(false); jPanel2.setBackground(new java.awt.Color(51, 102, 0)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE)); jButton2.setText("Passer"); jButton2.setEnabled(false); labelInfosPerso1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N labelInfosPerso1.setForeground(java.awt.Color.white); labelInfosPerso1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelInfosPerso2.setForeground(java.awt.Color.white); labelInfosPerso2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelInfosPerso3.setForeground(java.awt.Color.white); labelInfosPerso3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(labelMsg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGap(0, 446, Short.MAX_VALUE) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(labelInfosJoueurs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(labelInfosPerso3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE) .addComponent(labelInfosPerso1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelInfosPerso2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(labelInfosJoueurs, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(66, 66, 66) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelMsg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1).addComponent(jButton2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelInfosPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelInfosPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelInfosPerso3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jButton3.setText("Quitter Salon"); jButton3.setToolTipText(""); jButton3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane1) .addComponent(btnChat, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE) .addComponent(txtFieldChatEcr, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtFieldChatEcr, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChat, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE) .addComponent(jButton3)) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 556, Short.MAX_VALUE)) .addContainerGap())); pack(); }