List of usage examples for javax.swing SwingConstants CENTER
int CENTER
To view the source code for javax.swing SwingConstants CENTER.
Click Source Link
From source file:edu.ku.brc.af.ui.forms.TableViewObj.java
/** * Sets all the Columns to be center justified this COULD be set up in the table info. * *//* ww w .j av a 2 s . c o m*/ protected void configColumns() { ((DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer()) .setHorizontalAlignment(SwingConstants.CENTER); //DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); //renderer.setHorizontalAlignment(SwingConstants.CENTER); DefaultTableCellRenderer renderer = new BiColorTableCellRenderer(true); // Centered TableColumnModel tableColModel = table.getColumnModel(); for (int i = 0; i < tableColModel.getColumnCount(); i++) { tableColModel.getColumn(i).setCellRenderer(renderer); } }
From source file:com.sshtools.sshterm.SshTerminalPanel.java
public void actionPerformed(ActionEvent event) { // Get the name of the action command String command = event.getActionCommand(); if (sessionActions.containsKey(event.getActionCommand())) { SessionProviderAction action = (SessionProviderAction) sessionActions.get(event.getActionCommand()); SessionProviderFrame frame;//ww w.j a va 2 s .co m // Do we have an existing frame? for (Iterator it = sessionFrames.iterator(); it.hasNext();) { frame = (SessionProviderFrame) it.next(); if (action.getProvider().getProviderClass().isInstance(frame.getSessionPanel()) && frame.getSessionPanel().singleFrame()) { frame.show(); return; } } try { frame = new SessionProviderFrame(getCurrentConnectionProfile(), ssh, action.getProvider()); if (frame.initFrame(getApplication())) { frame.show(); sessionFrames.add(frame); } } catch (Throwable ex) { ex.printStackTrace(); } } /*if ((shiftAction != null) && command.equals(shiftAction.getActionCommand())) { //boolean error = false; try { SessionProviderFrame browserFrame = new SessionProviderFrame( getCurrentConnectionProfile(), ssh, SessionProviderFactory.getInstance().getProvider("shift")); if (PreferencesStore.preferenceExists(PREF_SHIFT_GEOMETRY)) { browserFrame.setBounds(PreferencesStore.getRectangle( PREF_SHIFT_GEOMETRY, browserFrame.getBounds())); } else { browserFrame.setLocation(40, 40); } browserFrame.init(getApplication()); browserFrame.show(); browserFrames.add(browserFrame); } catch (Exception e) { showExceptionMessage("Error", e.getMessage()); } } /*if (browserFrame != null) { // We need to go back to windowed mode if in full screen mode if (!browserFrame.isVisible()) { setFullScreenMode(false); } browserFrame.setVisible(!browserFrame.isVisible()); }*/ /* if ( (tunnelingAction != null) && command.equals(tunnelingAction.getActionCommand())) { try { if(tunnelingFrame==null) { tunnelingFrame = new SessionProviderFrame( getCurrentConnectionProfile(), ssh, SessionProviderFactory.getInstance().getProvider("tunneling")); /*if (PreferencesStore.preferenceExists(PREF_SHIFT_GEOMETRY)) { tunnelingFrame.setBounds(PreferencesStore.getRectangle( PREF_SHIFT_GEOMETRY, tunnelingFrame.getBounds())); } else { tunnelingFrame.setLocation(40, 40); }*/ /* } tunnelingFrame.init(getApplication()); tunnelingFrame.show(); } catch (Exception e) { showExceptionMessage("Error", e.getMessage()); }*/ /*if (portForwardingDialog == null) { Window parent = (Window) SwingUtilities.getAncestorOfClass(Window.class, this); if (parent instanceof JFrame) { portForwardingDialog = new JDialog( (JFrame) parent, "Port Forwarding", false); } else if (parent instanceof JDialog) { portForwardingDialog = new JDialog( (JDialog) parent, "Port Forwarding", false); } else { portForwardingDialog = new JDialog( (JFrame)null, "Port Forwarding", false); } portForwardingDialog.getContentPane().setLayout(new BorderLayout()); portForwardingDialog.getContentPane().add(portForwardingPane, BorderLayout.CENTER); portForwardingDialog.pack(); if (PreferencesStore.preferenceExists( PREF_PORT_FORWARDING_GEOMETRY)) { portForwardingDialog.setBounds(PreferencesStore .getRectangle( PREF_PORT_FORWARDING_GEOMETRY, portForwardingDialog.getBounds())); } else { portForwardingDialog.setLocation(40, 40); portForwardingDialog.setSize(new Dimension(260, 420)); } PreferencesStore.restoreTableMetrics(portForwardingPane .getPortForwardingTable(), PREF_PORT_FORWARDING_FORWARDS_TABLE_METRICS, new int[] {68, 62, 44, 54, 98, 78}); PreferencesStore.restoreTableMetrics(portForwardingPane. getActiveChannelPane() .getActiveChannelTable(), PREF_PORT_FORWARDING_ACTIVE_TABLE_METRICS, new int[] {22, 22, 92, 264}); if (PreferencesStore.preferenceExists( PREF_PORT_FORWARDING_DIVIDER_LOCATION)) { portForwardingPane.setDividerLocation(PreferencesStore .getInt( PREF_PORT_FORWARDING_DIVIDER_LOCATION, 100)); } else { portForwardingPane.setDividerLocation(0.75d); } } // We need to go back to windowed mode if in full screen mode if (!portForwardingDialog.isVisible()) { setFullScreenMode(false); } portForwardingDialog.setVisible(!portForwardingDialog.isVisible());*/ //} if ((stopAction != null) && command.equals(stopAction.getActionCommand())) { stopRecording(); } if ((recordAction != null) && command.equals(recordAction.getActionCommand())) { // We need to go back to windowed mode if in full screen mode setFullScreenMode(false); // Select the file to record to JFileChooser fileDialog = new JFileChooser(System.getProperty("user.home")); int ret = fileDialog.showSaveDialog(this); if (ret == fileDialog.APPROVE_OPTION) { recordingFile = fileDialog.getSelectedFile(); if (recordingFile.exists() && (JOptionPane.showConfirmDialog(this, "File exists. Are you sure?", "File exists", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION)) { return; } try { recordingOutputStream = new FileOutputStream(recordingFile); statusBar.setStatusText("Recording to " + recordingFile.getName()); setAvailableActions(); } catch (IOException ioe) { showExceptionMessage("Error", "Could not open file for recording\n\n" + ioe.getMessage()); } } } if ((playAction != null) && command.equals(playAction.getActionCommand())) { // We need to go back to windowed mode if in full screen mode setFullScreenMode(false); // Select the file to record to JFileChooser fileDialog = new JFileChooser(System.getProperty("user.home")); int ret = fileDialog.showOpenDialog(this); if (ret == fileDialog.APPROVE_OPTION) { File playingFile = fileDialog.getSelectedFile(); InputStream in = null; try { statusBar.setStatusText("Playing from " + playingFile.getName()); in = new FileInputStream(playingFile); byte[] b = null; int a = 0; while (true) { a = in.available(); if (a == -1) { break; } if (a == 0) { a = 1; } b = new byte[a]; a = in.read(b); if (a == -1) { break; } //emulation.write(b); emulation.getOutputStream().write(b); } statusBar.setStatusText("Finished playing " + playingFile.getName()); setAvailableActions(); } catch (IOException ioe) { statusBar.setStatusText("Error playing " + playingFile.getName()); showExceptionMessage("Error", "Could not open file for playback\n\n" + ioe.getMessage()); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { log.error(ioe); } } } } } if ((newAction != null) && command.equals(newAction.getActionCommand())) { setFullScreenMode(false); // Clear the screen emulation.clearScreen(); emulation.setCursorPosition(0, 0); // Force a repaint terminal.refresh(); SshToolsConnectionProfile p = SshToolsConnectionPanel.showConnectionDialog(this, getCurrentConnectionProfile(), getAdditionalConnectionTabs()); if (p != null) { currentConnectionProfile = p; setContainerTitle(null); setNeedSave(true); connect(p, true); } else { log.info("New connection cancelled"); } return; } if ((closeAction != null) && command.equals(closeAction.getActionCommand())) { if (ssh != null) { if (performVerifiedDisconnect(true)) { disconnecting = true; ssh.disconnect(); } } } if ((openAction != null) && command.equals(openAction.getActionCommand())) { open(); } if ((saveAction != null) && command.equals(saveAction.getActionCommand())) { // Make sure we dont have a null connection object saveConnection(false); } if ((saveAsAction != null) && command.equals(saveAsAction.getActionCommand())) { saveConnection(true); } // Keygen if ((keygenAction != null) && event.getActionCommand().equals(keygenAction.getActionCommand())) { if (keygenFrame == null) { keygenFrame = new com.sshtools.common.keygen.Main(); keygenFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); keygenFrame.pack(); UIUtil.positionComponent(SwingConstants.CENTER, keygenFrame); } if (!keygenFrame.isVisible()) { setFullScreenMode(false); } keygenFrame.setVisible(!keygenFrame.isVisible()); } //GSI options if ((proxyInfoAction != null) && command.equals(proxyInfoAction.getActionCommand())) { ProxyHelper.showProxyInfo(getContainer().getWindow()); } if ((proxyDestroyAction != null) && command.equals(proxyDestroyAction.getActionCommand())) { ProxyHelper.destroyProxy(); setAvailableActions(); } }
From source file:de.tor.tribes.ui.views.DSWorkbenchReportFrame.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 .ja va 2s. co m @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jCreateStatsFrame = new javax.swing.JFrame(); jPanel2 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jReportSetsForStatsList = new javax.swing.JList(); jButton10 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList(); jResultTabbedPane = new javax.swing.JTabbedPane(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jOverallStatsArea = new javax.swing.JTextPane(); jPanel5 = new javax.swing.JPanel(); jScrollPane5 = new javax.swing.JScrollPane(); jAllyStatsArea = new javax.swing.JTextPane(); jPanel6 = new javax.swing.JPanel(); jScrollPane6 = new javax.swing.JScrollPane(); jTribeStatsArea = new javax.swing.JTextPane(); capabilityInfoPanel2 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jXReportsPanel = new org.jdesktop.swingx.JXPanel(); jReportsTabbedPane = new javax.swing.JTabbedPane(); jNewPlanPanel = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); jxSearchPane = new org.jdesktop.swingx.JXPanel(); jXPanel2 = new org.jdesktop.swingx.JXPanel(); jButton15 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jLabel21 = new javax.swing.JLabel(); jFilterRows = new javax.swing.JCheckBox(); jFilterCaseSensitive = new javax.swing.JCheckBox(); jScrollPane8 = new javax.swing.JScrollPane(); jXColumnList = new org.jdesktop.swingx.JXList(); jLabel22 = new javax.swing.JLabel(); jPanel7 = new javax.swing.JPanel(); jGuessUnknownLosses = new javax.swing.JCheckBox(); jUseSilentKillsBox = new javax.swing.JCheckBox(); jCheckBox3 = new javax.swing.JCheckBox(); jShowPercentsBox = new javax.swing.JCheckBox(); jAlwaysOnTopBox = new javax.swing.JCheckBox(); jReportsPanel = new javax.swing.JPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jCreateStatsFrame.setTitle("Kampfstatistiken"); jPanel2.setBackground(new java.awt.Color(239, 235, 223)); jLabel6.setText("Verwendete Berichtsets"); jScrollPane2.setPreferredSize(new java.awt.Dimension(258, 100)); jScrollPane2.setViewportView(jReportSetsForStatsList); jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/select.png"))); // NOI18N jButton10.setText("Auswerten"); jButton10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { fireDoCreateStatsEvent(evt); } }); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Ergebnisse")); jPanel3.setOpaque(false); jLabel7.setText("Angezeigte Stmme"); jScrollPane3.setMaximumSize(new java.awt.Dimension(140, 130)); jScrollPane3.setMinimumSize(new java.awt.Dimension(140, 130)); jScrollPane3.setPreferredSize(new java.awt.Dimension(140, 130)); jScrollPane3.setViewportView(jList1); jResultTabbedPane.setBackground(new java.awt.Color(239, 235, 223)); jPanel4.setOpaque(false); jPanel4.setLayout(new java.awt.BorderLayout()); jOverallStatsArea.setContentType("text/html"); // NOI18N jOverallStatsArea.setEditable(false); jScrollPane1.setViewportView(jOverallStatsArea); jPanel4.add(jScrollPane1, java.awt.BorderLayout.CENTER); jResultTabbedPane.addTab("Gesamtbersicht", new javax.swing.ImageIcon(getClass().getResource("/res/ui/chart.png")), jPanel4); // NOI18N jPanel5.setBackground(new java.awt.Color(239, 235, 223)); jPanel5.setLayout(new java.awt.BorderLayout()); jAllyStatsArea.setContentType("text/html"); // NOI18N jAllyStatsArea.setEditable(false); jScrollPane5.setViewportView(jAllyStatsArea); jPanel5.add(jScrollPane5, java.awt.BorderLayout.CENTER); jResultTabbedPane.addTab("Stmme", new javax.swing.ImageIcon(getClass().getResource("/res/ally.png")), jPanel5); // NOI18N jPanel6.setBackground(new java.awt.Color(239, 235, 223)); jPanel6.setLayout(new java.awt.BorderLayout()); jTribeStatsArea.setContentType("text/html"); // NOI18N jTribeStatsArea.setEditable(false); jScrollPane6.setViewportView(jTribeStatsArea); jPanel6.add(jScrollPane6, java.awt.BorderLayout.CENTER); jResultTabbedPane.addTab("Spieler", new javax.swing.ImageIcon(getClass().getResource("/res/face.png")), jPanel6); // NOI18N javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jResultTabbedPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 570, Short.MAX_VALUE) .addGroup(jPanel3Layout.createSequentialGroup().addComponent(jLabel7) .addGap(18, 18, 18).addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 457, Short.MAX_VALUE))) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7).addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jResultTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addContainerGap())); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup().addComponent(jLabel6) .addGap(18, 18, 18).addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE)) .addComponent(jButton10)) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6).addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); capabilityInfoPanel2.setCopyable(false); capabilityInfoPanel2.setDeletable(false); capabilityInfoPanel2.setPastable(false); capabilityInfoPanel2.setSearchable(false); javax.swing.GroupLayout jCreateStatsFrameLayout = new javax.swing.GroupLayout( jCreateStatsFrame.getContentPane()); jCreateStatsFrame.getContentPane().setLayout(jCreateStatsFrameLayout); jCreateStatsFrameLayout.setHorizontalGroup( jCreateStatsFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jCreateStatsFrameLayout.createSequentialGroup().addContainerGap() .addGroup(jCreateStatsFrameLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(capabilityInfoPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jCreateStatsFrameLayout.setVerticalGroup(jCreateStatsFrameLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jCreateStatsFrameLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(capabilityInfoPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jXReportsPanel.setLayout(new java.awt.BorderLayout()); jXReportsPanel.add(jReportsTabbedPane, java.awt.BorderLayout.CENTER); jNewPlanPanel.setOpaque(false); jNewPlanPanel.setLayout(new java.awt.BorderLayout()); jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/document_new_24x24.png"))); // NOI18N jLabel10.setToolTipText("Leeres Berichtset erstellen"); jLabel10.setEnabled(false); jLabel10.setMaximumSize(new java.awt.Dimension(40, 40)); jLabel10.setMinimumSize(new java.awt.Dimension(40, 40)); jLabel10.setPreferredSize(new java.awt.Dimension(40, 40)); jLabel10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { fireEnterEvent(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { fireExitEvent(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { fireCreateAttackPlanEvent(evt); } }); jNewPlanPanel.add(jLabel10, java.awt.BorderLayout.CENTER); jxSearchPane.setOpaque(false); jxSearchPane.setLayout(new java.awt.GridBagLayout()); jXPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jXPanel2.setInheritAlpha(false); jButton15.setText("Anwenden"); jButton15.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jButton15fireHideGlassPaneEvent(evt); } }); jTextField1.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTextField1fireHighlightEvent(evt); } }); jLabel21.setText("Suchbegriff"); jFilterRows.setText("Nur gefilterte Zeilen anzeigen"); jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterRowsfireUpdateFilterEvent(evt); } }); jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten"); jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterCaseSensitivefireUpdateFilterEvent(evt); } }); jXColumnList.setModel(new javax.swing.AbstractListModel() { String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; public int getSize() { return strings.length; } public Object getElementAt(int i) { return strings[i]; } }); jXColumnList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jScrollPane8.setViewportView(jXColumnList); jLabel22.setText("Spalten"); javax.swing.GroupLayout jXPanel2Layout = new javax.swing.GroupLayout(jXPanel2); jXPanel2.setLayout(jXPanel2Layout); jXPanel2Layout .setHorizontalGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel2Layout.createSequentialGroup() .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jXPanel2Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jXPanel2Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jFilterRows, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jFilterCaseSensitive, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jButton15))) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jXPanel2Layout.setVerticalGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel21) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jXPanel2Layout .createSequentialGroup().addComponent(jFilterCaseSensitive) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFilterRows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton15)) .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel22)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jxSearchPane.add(jXPanel2, new java.awt.GridBagConstraints()); jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Optionen")); jPanel7.setOpaque(false); jGuessUnknownLosses.setSelected(true); jGuessUnknownLosses.setText("Gegnerische Verluste schtzen, falls unbekannt"); jGuessUnknownLosses.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireStatOptionsChangedEvent(evt); } }); jUseSilentKillsBox.setSelected(true); jUseSilentKillsBox.setText("Auswrtige Einheiten bei Adelung als Verlust werten"); jUseSilentKillsBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireStatOptionsChangedEvent(evt); } }); jCheckBox3.setSelected(true); jCheckBox3.setText("Verluste pro Angreifer/Verteidiger anzeigen"); jCheckBox3.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireStatOptionsChangedEvent(evt); } }); jShowPercentsBox.setText("Prozentuale Anteile anzeigen"); jShowPercentsBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireStatOptionsChangedEvent(evt); } }); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jGuessUnknownLosses).addComponent(jUseSilentKillsBox) .addComponent(jCheckBox3).addComponent(jShowPercentsBox)))); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jGuessUnknownLosses) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jUseSilentKillsBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jShowPercentsBox).addContainerGap(23, Short.MAX_VALUE))); setTitle("Berichtsdatenbank"); getContentPane().setLayout(new java.awt.GridBagLayout()); jAlwaysOnTopBox.setText("Immer im Vordergrund"); jAlwaysOnTopBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireAlwaysOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jAlwaysOnTopBox, gridBagConstraints); jReportsPanel.setBackground(new java.awt.Color(239, 235, 223)); jReportsPanel.setPreferredSize(new java.awt.Dimension(500, 400)); jReportsPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 500; gridBagConstraints.ipady = 400; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jReportsPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:simMPLS.ui.simulator.JVentanaHija.java
/** Este mtodo es llamado desde el constructor para actualizar la mayor parte de * los atributos de la clase que tienen que ver con la interfaz de usuario. Es un * mtodo creado por NetBeans automaticamente. * @since 1.0/*from w w w . ja va2s . c o m*/ */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; diseElementoPopUp = new javax.swing.JPopupMenu(); dEliminarMenuItem = new javax.swing.JMenuItem(); dVerNombreMenuItem = new javax.swing.JCheckBoxMenuItem(); jSeparator1 = new javax.swing.JSeparator(); dPropiedadesMenuItem = new javax.swing.JMenuItem(); diseFondoPopUp = new javax.swing.JPopupMenu(); dVerNombresNodosMenuItem = new javax.swing.JMenuItem(); dOcultarNombresNodosMenuItem = new javax.swing.JMenuItem(); dVerNombresEnlacesMenuItem = new javax.swing.JMenuItem(); dOcultarNombresEnlacesMenuItem = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); dEliminarTodoMenuItem = new javax.swing.JMenuItem(); jTabbedPane1 = new javax.swing.JTabbedPane(); panelDisenioSuperior = new javax.swing.JPanel(); panelBotonesDisenio = new javax.swing.JPanel(); iconoEmisor = new javax.swing.JLabel(); iconoReceptor = new javax.swing.JLabel(); iconoLER = new javax.swing.JLabel(); iconoLERA = new javax.swing.JLabel(); iconoLSR = new javax.swing.JLabel(); iconoLSRA = new javax.swing.JLabel(); iconoEnlace = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); panelDisenio = new simMPLS.ui.simulator.JPanelDisenio(); panelSimulacionSuperior = new javax.swing.JPanel(); panelBotonesSimulacion = new javax.swing.JPanel(); iconoComenzar = new javax.swing.JLabel(); iconoFinalizar = new javax.swing.JLabel(); iconoReanudar = new javax.swing.JLabel(); iconoPausar = new javax.swing.JLabel(); barraDeProgreso = new javax.swing.JProgressBar(); mlsPorTic = new javax.swing.JSlider(); etiquetaMlsPorTic = new javax.swing.JLabel(); crearTraza = new javax.swing.JCheckBox(); jScrollPane2 = new javax.swing.JScrollPane(); panelSimulacion = new simMPLS.ui.simulator.JSimulationPanel(); panelAnalisisSuperior = new javax.swing.JPanel(); panelSeleccionElemento = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); selectorElementoEstadisticas = new javax.swing.JComboBox(); jScrollPane4 = new javax.swing.JScrollPane(); panelAnalisis = new javax.swing.JPanel(); panelFijo = new javax.swing.JPanel(); etiquetaEstadisticasTituloEscenario = new javax.swing.JLabel(); etiquetaEstadisticasNombreAutor = new javax.swing.JLabel(); areaEstadisticasDescripcion = new javax.swing.JTextArea(); etiquetaNombreElementoEstadistica = new javax.swing.JLabel(); panelOpcionesSuperior = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); panelOpciones = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); nombreEscenario = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); nombreAutor = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); descripcionEscenario = new javax.swing.JTextField(); jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); duracionMs = new javax.swing.JSlider(); etiquetaDuracionMs = new javax.swing.JLabel(); duracionNs = new javax.swing.JSlider(); etiquetaDuracionNs = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); pasoNs = new javax.swing.JSlider(); etiquetaPasoNs = new javax.swing.JLabel(); diseElementoPopUp.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.Delete").charAt(0)); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes"); // NOI18N dEliminarMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.Delete")); // NOI18N dEliminarMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioEliminar(evt); } }); diseElementoPopUp.add(dEliminarMenuItem); dVerNombreMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombreMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.verNombre").charAt(0)); dVerNombreMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.verNombre")); // NOI18N dVerNombreMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioVerNombre(evt); } }); diseElementoPopUp.add(dVerNombreMenuItem); diseElementoPopUp.add(jSeparator1); dPropiedadesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dPropiedadesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.Propiedades").charAt(0)); dPropiedadesMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.Propiedades")); // NOI18N dPropiedadesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPropiedadesPopUpDisenioElemento(evt); } }); diseElementoPopUp.add(dPropiedadesMenuItem); diseFondoPopUp.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresNodosMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresNodosMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.verTodosNodos").charAt(0)); dVerNombresNodosMenuItem.setText(bundle.getString("popUpDisenioFondo.verTodosNodos")); // NOI18N dVerNombresNodosMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoVerNombreNodos(evt); } }); diseFondoPopUp.add(dVerNombresNodosMenuItem); dOcultarNombresNodosMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dOcultarNombresNodosMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.ocultarTodosNodos").charAt(0)); dOcultarNombresNodosMenuItem.setText(bundle.getString("popUpDisenioFondo.ocultarTodosNodos")); // NOI18N dOcultarNombresNodosMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoOcultarNombreNodos(evt); } }); diseFondoPopUp.add(dOcultarNombresNodosMenuItem); dVerNombresEnlacesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresEnlacesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.verTodosEnlaces").charAt(0)); dVerNombresEnlacesMenuItem.setText(bundle.getString("popUpDisenioFondo.verTodosEnlaces")); // NOI18N dVerNombresEnlacesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoVerNombreEnlaces(evt); } }); diseFondoPopUp.add(dVerNombresEnlacesMenuItem); dOcultarNombresEnlacesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dOcultarNombresEnlacesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.ocultarTodosEnlaces").charAt(0)); dOcultarNombresEnlacesMenuItem.setText(bundle.getString("popUpDisenioFondo.ocultarTodosEnlaces")); // NOI18N dOcultarNombresEnlacesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoOcultarNombreEnlaces(evt); } }); diseFondoPopUp.add(dOcultarNombresEnlacesMenuItem); diseFondoPopUp.add(jSeparator2); dEliminarTodoMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarTodoMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.eliminarTodo").charAt(0)); dEliminarTodoMenuItem.setText(bundle.getString("popUpDisenioFondo.borrarTodo")); // NOI18N dEliminarTodoMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoEliminar(evt); } }); diseFondoPopUp.add(dEliminarTodoMenuItem); setIconifiable(true); setMaximizable(true); setResizable(true); setTitle(bundle.getString("VentanaHija.Titulo")); // NOI18N setAutoscrolls(true); setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N setFrameIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ICONO_VENTANA_INTERNA_MENU)); setNormalBounds(new java.awt.Rectangle(10, 10, 100, 100)); setPreferredSize(new java.awt.Dimension(100, 100)); setVisible(true); jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); jTabbedPane1.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N panelDisenioSuperior.setLayout(new java.awt.BorderLayout()); panelBotonesDisenio.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelBotonesDisenio.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); iconoEmisor.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.EMISOR_MENU)); iconoEmisor.setToolTipText(bundle.getString("VentanaHija.Topic.Emisor")); // NOI18N iconoEmisor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoEmisor(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoEmisor(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirEmisorDeTrafico(evt); } }); panelBotonesDisenio.add(iconoEmisor); iconoReceptor.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.RECEPTOR_MENU)); iconoReceptor.setToolTipText(bundle.getString("VentanaHija.Topic.Receptor")); // NOI18N iconoReceptor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoReceptor(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoReceptor(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirReceptor(evt); } }); panelBotonesDisenio.add(iconoReceptor); iconoLER.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LER_MENU)); iconoLER.setToolTipText(bundle.getString("VentanaHija.Topic.LER")); // NOI18N iconoLER.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLER(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLER(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLER(evt); } }); panelBotonesDisenio.add(iconoLER); iconoLERA.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LERA_MENU)); iconoLERA.setToolTipText(bundle.getString("VentanaHija.Topic.LERActivo")); // NOI18N iconoLERA.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLERA(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLERA(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLERA(evt); } }); panelBotonesDisenio.add(iconoLERA); iconoLSR.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LSR_MENU)); iconoLSR.setToolTipText(bundle.getString("VentanaHija.Topic.LSR")); // NOI18N iconoLSR.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLSR(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLSR(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLSR(evt); } }); panelBotonesDisenio.add(iconoLSR); iconoLSRA.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LSRA_MENU)); iconoLSRA.setToolTipText(bundle.getString("VentanaHija.Topic.LSRActivo")); // NOI18N iconoLSRA.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLSRA(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLSRA(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLSRA(evt); } }); panelBotonesDisenio.add(iconoLSRA); iconoEnlace.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ENLACE_MENU)); iconoEnlace.setToolTipText(bundle.getString("VentanaHija.Topic.Enlace")); // NOI18N iconoEnlace.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { clicEnAniadirEnlace(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoEnlace(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoEnlace(evt); } }); panelBotonesDisenio.add(iconoEnlace); panelDisenioSuperior.add(panelBotonesDisenio, java.awt.BorderLayout.NORTH); jScrollPane1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelDisenio.setBackground(java.awt.Color.white); panelDisenio.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelDisenio.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { clicDerechoEnPanelDisenio(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnPanelDisenio(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { clicSoltadoEnPanelDisenio(evt); } }); panelDisenio.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { arrastrandoEnPanelDisenio(evt); } public void mouseMoved(java.awt.event.MouseEvent evt) { ratonSobrePanelDisenio(evt); } }); panelDisenio.setLayout(null); jScrollPane1.setViewportView(panelDisenio); panelDisenioSuperior.add(jScrollPane1, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("VentanaHija.Tab.Disenio"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.DISENIO), panelDisenioSuperior, bundle.getString("VentanaHija.A_panel_to_design_network_topology")); // NOI18N panelSimulacionSuperior.setLayout(new java.awt.BorderLayout()); panelBotonesSimulacion.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelBotonesSimulacion.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); iconoComenzar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_GENERAR)); iconoComenzar.setToolTipText(bundle.getString("VentanaHija.Topic.Generar")); // NOI18N iconoComenzar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoComenzar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoComenzar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnComenzar(evt); } }); panelBotonesSimulacion.add(iconoComenzar); iconoFinalizar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_PARAR)); iconoFinalizar.setToolTipText(bundle.getString("VentanaHija.Topic.Finalizar")); // NOI18N iconoFinalizar.setEnabled(false); iconoFinalizar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoFinalizar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoFinalizar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnFinalizar(evt); } }); panelBotonesSimulacion.add(iconoFinalizar); iconoReanudar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_COMENZAR)); iconoReanudar.setToolTipText(bundle.getString("VentanaHija.Topic.Simulacion")); // NOI18N iconoReanudar.setEnabled(false); iconoReanudar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoReanudar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoReanudar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnReanudar(evt); } }); panelBotonesSimulacion.add(iconoReanudar); iconoPausar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_PAUSA)); iconoPausar.setToolTipText(bundle.getString("VentanaHija.Topic.Detener")); // NOI18N iconoPausar.setEnabled(false); iconoPausar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoPausar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoPausar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicAlPausar(evt); } }); panelBotonesSimulacion.add(iconoPausar); barraDeProgreso.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N barraDeProgreso.setToolTipText(bundle.getString("VentanaHija.BarraProgreso.tooltip")); // NOI18N barraDeProgreso.setStringPainted(true); panelBotonesSimulacion.add(barraDeProgreso); mlsPorTic.setMajorTickSpacing(10); mlsPorTic.setMaximum(500); mlsPorTic.setMinimum(1); mlsPorTic.setMinorTickSpacing(1); mlsPorTic.setSnapToTicks(true); mlsPorTic.setToolTipText(bundle.getString("VentanaHija.Simulacion.SelectorDeVelocidad.tooltip")); // NOI18N mlsPorTic.setPreferredSize(new java.awt.Dimension(100, 20)); mlsPorTic.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { mlsPorTicCambiado(evt); } }); panelBotonesSimulacion.add(mlsPorTic); etiquetaMlsPorTic.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaMlsPorTic.setForeground(new java.awt.Color(102, 102, 102)); panelBotonesSimulacion.add(etiquetaMlsPorTic); crearTraza.setText(bundle.getString("JVentanaHija.Create_trace_file")); // NOI18N panelBotonesSimulacion.add(crearTraza); panelSimulacionSuperior.add(panelBotonesSimulacion, java.awt.BorderLayout.NORTH); jScrollPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelSimulacion.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelSimulacion.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { ratonPulsadoYSoltadoEnPanelSimulacion(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnPanelSimulacion(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { ratonSoltadoEnPanelSimulacion(evt); } }); panelSimulacion.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { ratonArrastradoEnPanelSimulacion(evt); } public void mouseMoved(java.awt.event.MouseEvent evt) { ratonSobrePanelSimulacion(evt); } }); jScrollPane2.setViewportView(panelSimulacion); panelSimulacionSuperior.add(jScrollPane2, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("VentanaHija.Tab.Simulacion"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.SIMULACION), panelSimulacionSuperior, bundle.getString("VentanaHija.A_panel_to_generate_and_play_simulation.")); // NOI18N panelAnalisisSuperior.setLayout(new java.awt.BorderLayout()); panelSeleccionElemento.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelSeleccionElemento.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); jLabel1.setText(bundle.getString("JVentanaHija.SelcUnElemParaVerDatos")); // NOI18N panelSeleccionElemento.add(jLabel1); selectorElementoEstadisticas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" })); selectorElementoEstadisticas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnSeleccionalElementoEstadistica(evt); } }); panelSeleccionElemento.add(selectorElementoEstadisticas); panelAnalisisSuperior.add(panelSeleccionElemento, java.awt.BorderLayout.NORTH); jScrollPane4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelAnalisis.setBackground(new java.awt.Color(252, 246, 226)); panelAnalisis.setLayout(new java.awt.GridBagLayout()); panelFijo.setBackground(new java.awt.Color(252, 246, 226)); panelFijo.setLayout(new java.awt.GridBagLayout()); etiquetaEstadisticasTituloEscenario.setBackground(new java.awt.Color(252, 246, 226)); etiquetaEstadisticasTituloEscenario.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N etiquetaEstadisticasTituloEscenario.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaEstadisticasTituloEscenario.setText(bundle.getString("JVentanaHija.TituloDelEscenario")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(etiquetaEstadisticasTituloEscenario, gridBagConstraints); etiquetaEstadisticasNombreAutor.setBackground(new java.awt.Color(252, 246, 226)); etiquetaEstadisticasNombreAutor.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N etiquetaEstadisticasNombreAutor.setForeground(new java.awt.Color(102, 0, 51)); etiquetaEstadisticasNombreAutor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaEstadisticasNombreAutor.setText(bundle.getString("JVentanaHija.AutorDelEscenario")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(etiquetaEstadisticasNombreAutor, gridBagConstraints); areaEstadisticasDescripcion.setBackground(new java.awt.Color(252, 246, 226)); areaEstadisticasDescripcion.setEditable(false); areaEstadisticasDescripcion.setFont(new java.awt.Font("MonoSpaced", 0, 11)); // NOI18N areaEstadisticasDescripcion.setLineWrap(true); areaEstadisticasDescripcion.setRows(3); areaEstadisticasDescripcion.setText(bundle.getString("JVentanaHija.DescripcionDelEscenario")); // NOI18N areaEstadisticasDescripcion.setWrapStyleWord(true); areaEstadisticasDescripcion.setMinimumSize(new java.awt.Dimension(500, 16)); areaEstadisticasDescripcion.setPreferredSize(new java.awt.Dimension(500, 48)); areaEstadisticasDescripcion.setAutoscrolls(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(areaEstadisticasDescripcion, gridBagConstraints); etiquetaNombreElementoEstadistica.setBackground(new java.awt.Color(252, 246, 226)); etiquetaNombreElementoEstadistica.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N etiquetaNombreElementoEstadistica.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaNombreElementoEstadistica.setText(bundle.getString("JVentanaHija.SeleccioneNodoAInspeccionar")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; panelFijo.add(etiquetaNombreElementoEstadistica, gridBagConstraints); panelAnalisis.add(panelFijo, new java.awt.GridBagConstraints()); jScrollPane4.setViewportView(panelAnalisis); panelAnalisisSuperior.add(jScrollPane4, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("JVentanaHija.Analisis"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ANALISIS), panelAnalisisSuperior, bundle.getString("JVentanaHija.Analisis.Tooltip")); // NOI18N panelOpcionesSuperior.setLayout(new java.awt.BorderLayout()); jScrollPane3.setBorder(null); panelOpciones.setPreferredSize(new java.awt.Dimension(380, 230)); panelOpciones.setLayout(new java.awt.GridBagLayout()); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, bundle.getString("VentanaHija.GParameters"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 12))); // NOI18N jPanel3.setLayout(new java.awt.GridBagLayout()); jLabel5.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel5.setText(bundle.getString("VentanaHija.Scene_title")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel5, gridBagConstraints); nombreEscenario.setToolTipText(bundle.getString("VentanaHija.Type_a__title_of_the_scene")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(nombreEscenario, gridBagConstraints); jLabel6.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel6.setText(bundle.getString("VentanaHija.Scene_author")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel6, gridBagConstraints); nombreAutor.setToolTipText(bundle.getString("VentanaHija.Type_de_name_of_the_author")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(nombreAutor, gridBagConstraints); jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel7.setText(bundle.getString("VentanaHija.Description")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel7, gridBagConstraints); descripcionEscenario.setToolTipText(bundle.getString("VentanaHija.Enter_a_short_description.")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(descripcionEscenario, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 350.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); panelOpciones.add(jPanel3, gridBagConstraints); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, bundle.getString("VentanaHija.TParameters"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 12))); // NOI18N jPanel2.setLayout(new java.awt.GridBagLayout()); jLabel3.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel3.setText(bundle.getString("VentanaHija.Duration")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(jLabel3, gridBagConstraints); duracionMs.setMajorTickSpacing(10); duracionMs.setMaximum(10); duracionMs.setMinorTickSpacing(1); duracionMs.setToolTipText( bundle.getString("VentanaHija.Slide_it_to_change_the_ms._component_of_simulation_duration.")); // NOI18N duracionMs.setValue(0); duracionMs.setMaximumSize(new java.awt.Dimension(30, 20)); duracionMs.setMinimumSize(new java.awt.Dimension(30, 24)); duracionMs.setPreferredSize(new java.awt.Dimension(30, 20)); duracionMs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnDuracionMs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 150.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(duracionMs, gridBagConstraints); etiquetaDuracionMs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaDuracionMs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaDuracionMs.setText(bundle.getString("VentanaHija.ms.")); // NOI18N etiquetaDuracionMs.setMaximumSize(new java.awt.Dimension(30, 14)); etiquetaDuracionMs.setMinimumSize(new java.awt.Dimension(30, 14)); etiquetaDuracionMs.setPreferredSize(new java.awt.Dimension(30, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 40.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaDuracionMs, gridBagConstraints); duracionNs.setMajorTickSpacing(1000); duracionNs.setMaximum(999999); duracionNs.setMinorTickSpacing(100); duracionNs.setToolTipText( bundle.getString("VentanaHija.Slide_it_to_change_the_ns._component_of_simulation_duration.")); // NOI18N duracionNs.setValue(100000); duracionNs.setMaximumSize(new java.awt.Dimension(32767, 20)); duracionNs.setMinimumSize(new java.awt.Dimension(36, 20)); duracionNs.setPreferredSize(new java.awt.Dimension(200, 20)); duracionNs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnDuracionNs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 150.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(duracionNs, gridBagConstraints); etiquetaDuracionNs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaDuracionNs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaDuracionNs.setText(bundle.getString("VentanaHija.ns.")); // NOI18N etiquetaDuracionNs.setMaximumSize(new java.awt.Dimension(40, 14)); etiquetaDuracionNs.setMinimumSize(new java.awt.Dimension(40, 14)); etiquetaDuracionNs.setPreferredSize(new java.awt.Dimension(40, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaDuracionNs, gridBagConstraints); jLabel4.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel4.setText(bundle.getString("VentanaHija.Step")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(jLabel4, gridBagConstraints); pasoNs.setMajorTickSpacing(1000); pasoNs.setMaximum(999999); pasoNs.setMinimum(1); pasoNs.setMinorTickSpacing(100); pasoNs.setToolTipText(bundle.getString("VentanaHija.Slide_it_to_change_the_step_duration_(ns)..")); // NOI18N pasoNs.setValue(10000); pasoNs.setMaximumSize(new java.awt.Dimension(32767, 20)); pasoNs.setPreferredSize(new java.awt.Dimension(100, 20)); pasoNs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnPasoNs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(pasoNs, gridBagConstraints); etiquetaPasoNs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaPasoNs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaPasoNs.setText(bundle.getString("VentanaHija.ns.")); // NOI18N etiquetaPasoNs.setMaximumSize(new java.awt.Dimension(40, 14)); etiquetaPasoNs.setMinimumSize(new java.awt.Dimension(40, 14)); etiquetaPasoNs.setPreferredSize(new java.awt.Dimension(40, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaPasoNs, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 350.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); panelOpciones.add(jPanel2, gridBagConstraints); jScrollPane3.setViewportView(panelOpciones); panelOpcionesSuperior.add(jScrollPane3, java.awt.BorderLayout.NORTH); jTabbedPane1.addTab(bundle.getString("VentanaHija.Options"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.OPCIONES), panelOpcionesSuperior, bundle.getString("VentanaHija.Options_about_the_scene")); // NOI18N getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER); pack(); }
From source file:convcao.com.agent.ConvcaoNeptusInteraction.java
@Override public void initSubPanel() { jPanelMain = new JPanel(); jPanel1 = new JPanel(); jPanel2 = new JPanel(); jLabel2 = new JLabel(); jScrollPane1 = new JScrollPane(); jTextPane1 = new JTextPane(); renewButton = new JButton(); jLabel4 = new JLabel(); jTextField1 = new JTextField(); jLabel5 = new JLabel(); jPasswordField1 = new JPasswordField(); connectButton = new JButton(); jScrollPane2 = new JScrollPane(); jTextArea1 = new JTextArea(); jLabel7 = new JLabel(); jLabel8 = new JLabel(); jButton1 = new JButton(); jButton2 = new JButton(); jLabel1 = new JLabel(); jLabel9 = new JLabel(); jLabel10 = new JLabel(); jLabel11 = new JLabel(); jLabel12 = new JLabel(); jLabel6 = new JLabel(); jLabel3 = new JLabel(); jLabel11.setIcon(noptilusLogo);//from ww w .j av a 2 s . c o m jLabel12.setHorizontalAlignment(SwingConstants.LEFT); jLabel12.setText("<html>www.convcao.com<br>version 0.01</html>"); jLabel12.setToolTipText(""); jLabel12.setHorizontalTextPosition(SwingConstants.RIGHT); GroupLayout jPanel1Layout = new GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel11, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGap(0, 19, Short.MAX_VALUE).addComponent(jLabel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel11, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); jLabel2.setFont(new Font("Tahoma", 0, 10)); // NOI18N jLabel2.setText("Unique ID"); jTextPane1.setEditable(true); jScrollPane1.setViewportView(jTextPane1); //jTextPane1.getAccessibleContext().setAccessibleName(""); renewButton.setText("RENEW"); renewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { renewButtonActionPerformed(evt); } }); jLabel4.setFont(new Font("Tahoma", 0, 12)); // NOI18N jLabel4.setText("Username"); jTextField1.setText("FTPUser"); jLabel5.setFont(new Font("Tahoma", 0, 12)); // NOI18N jLabel5.setText("Password"); jPasswordField1.setText("FTPUser123"); connectButton.setText("Connect"); connectButton.setEnabled(false); connectButton.setActionCommand("connect"); connectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { connectButtonActionPerformed(evt); } catch (FileNotFoundException | UnsupportedEncodingException e) { e.printStackTrace(); } catch (SocketException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }); jTextArea1.setEditable(false); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane2.setViewportView(jTextArea1); jLabel7.setFont(new Font("Tahoma", 0, 12)); // NOI18N jLabel7.setText("Command Monitor"); jButton1.setFont(new Font("Tahoma", 1, 12)); // NOI18N jButton1.setText("START"); jButton1.setEnabled(false); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { startButtonActionPerformed(evt); } }); jButton2.setFont(new Font("Tahoma", 1, 12)); // NOI18N jButton2.setText("STOP"); jButton2.setEnabled(false); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { stopButtonActionPerformed(evt); } }); jLabel1.setForeground(new Color(255, 0, 0)); jLabel1.setHorizontalAlignment(SwingConstants.CENTER); jLabel1.setText( "<html>Click HERE to activate the web service using your ID<br>When the web application is ready, press Start </html>"); jLabel1.setCursor(new Cursor(Cursor.HAND_CURSOR)); jLabel1.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { try { jLabel1MouseClicked(evt); } catch (URISyntaxException | IOException e) { e.printStackTrace(); } } }); //jLabel9.setText("Working..."); jLabel9.setIcon(runIcon); jLabel9.setVisible(false); jLabel10.setText("---"); jLabel6.setForeground(new Color(0, 204, 0)); jLabel6.setHorizontalAlignment(SwingConstants.CENTER); jLabel6.setText("---"); GroupLayout jPanel2Layout = new GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup( GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(jLabel6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(126, 126, 126) .addComponent(jLabel7, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup().addGap(23, 23, 23) .addGroup(jPanel2Layout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout .createParallelGroup(GroupLayout.Alignment.LEADING, false) .addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jLabel9, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addPreferredGap( LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(jButton2, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane2, GroupLayout.Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 308, GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel10, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 299, GroupLayout.PREFERRED_SIZE)))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup( GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(renewButton)) .addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout .createParallelGroup(GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel4, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jTextField1, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel5, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jPasswordField1))) .addGap(14, 14, 14).addComponent(connectButton))))) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(renewButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1) .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPasswordField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(connectButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel1) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel7, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(jButton2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel9, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5))); jLabel1.getAccessibleContext().setAccessibleName("jLabel1"); jLabel3.setFont(new Font("Tahoma", 1, 22)); // NOI18N jLabel3.setText("Real Time Navigation"); jLabel8.setIcon(appLogo); GroupLayout layout = new GroupLayout(jPanelMain); jPanelMain.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel3) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, GroupLayout.PREFERRED_SIZE, 331, GroupLayout.PREFERRED_SIZE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addComponent(jLabel3) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel8, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanel2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); addMenuItem("Settings>Noptilus>Coordinate Settings", ImageUtils.getIcon(PluginUtils.getPluginIcon(getClass())), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { PluginUtils.editPluginProperties(coords, true); coords.saveProps(); } }); addMenuItem("Settings>Noptilus>ConvCAO Settings", ImageUtils.getIcon(PluginUtils.getPluginIcon(getClass())), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { PluginUtils.editPluginProperties(ConvcaoNeptusInteraction.this, true); } }); addMenuItem("Settings>Noptilus>Force vehicle depth", ImageUtils.getIcon(PluginUtils.getPluginIcon(getClass())), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (positions.isEmpty()) { GuiUtils.errorMessage(getConsole(), "Force vehicle depth", "ConvCAO control is not active"); return; } String[] choices = nameTable.values().toArray(new String[0]); String vehicle = (String) JOptionPane.showInputDialog(getConsole(), "Force vehicle depth", "Choose vehicle", JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]); if (vehicle != null) { double depth = depths.get(vehicle); String newDepth = JOptionPane.showInputDialog(getConsole(), "New depth", "" + depth); try { double dd = Double.parseDouble(newDepth); depths.put(vehicle, dd); } catch (Exception ex) { GuiUtils.errorMessage(getConsole(), ex); } } } }); add(jPanelMain); renewButtonActionPerformed(null); }
From source file:edu.ku.brc.af.ui.forms.TableViewObj.java
/** * Build the table now that we have all the information we need for the columns. */// www . j av a 2 s . c o m protected void buildTable() { // Now Build the JTable model = new ColTableModel(); table = new JTable(model); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); table.setFocusable(false); //table.setPreferredScrollableViewportSize(new Dimension(200,table.getRowHeight()*6)); configColumns(); //table.setCellSelectionEnabled(false); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); updateUI(!lsm.isSelectionEmpty()); } } }); table.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent e) { if (e.getClickCount() == 2) { int index = table.getSelectedRow(); editRow(index, false); } } }); DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.setHorizontalAlignment(SwingConstants.CENTER); /* // This is BROKEN! table.setCellSelectionEnabled(true); for (int i=0;i<model.getColumnCount();i++) { TableColumn column = table.getColumn(model.getColumnName(i)); //log.info(model.getColumnName(i)); //column.setCellRenderer(renderer); ColumnInfo columnInfo = columnList.get(i); Component comp = columnInfo.getComp(); //column.setCellEditor(new DefaultCellEditor(new JTextField())); if (comp instanceof GetSetValueIFace) { column.setCellEditor(new MyTableCellEditor(columnInfo)); } else if (comp instanceof JTextField) { column.setCellEditor(new DefaultCellEditor((JTextField)comp)); } else { log.error("Couldn't figure out DefaultCellEditor for comp ["+comp.getClass().getSimpleName()+"]"); } } */ tableScroller = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); orderablePanel = new JPanel(new BorderLayout()); orderablePanel.add(tableScroller, BorderLayout.CENTER); mainComp.add(orderablePanel, BorderLayout.CENTER); initColumnSizes(table); }
From source file:com.sshtools.sshterm.SshTerminalPanel.java
public void open(File f) { if (log.isDebugEnabled()) { log.debug("Opening connection file " + f); }/*from www . j ava 2 s . co m*/ // Make sure a connection is not already open if (isConnected()) { Option optNew = new Option("New", "New create a new terminal", 'n'); Option optClose = new Option("Close", "Close current connection", 'l'); Option optCancel = new Option("Cancel", "Cancel the opening of this connection", 'c'); OptionsDialog dialog = OptionsDialog.createOptionDialog(this, new Option[] { optNew, optClose, optCancel }, "You already have a connection open. Select\n" + "Close to close the current connection, New\n" + "to create a new terminal or Cancel to abort.", "Existing connection", optNew, null, UIManager.getIcon("OptionPane.warningIcon")); UIUtil.positionComponent(SwingConstants.CENTER, dialog); dialog.setVisible(true); Option opt = dialog.getSelectedOption(); if ((opt == null) || (opt == optCancel)) { return; } else if (opt == optNew) { try { SshToolsApplicationContainer c = (SshToolsApplicationContainer) application.newContainer(); SshTerminalPanel term = (SshTerminalPanel) c.getApplicationPanel(); term.open(f); return; } catch (SshToolsApplicationException stae) { log.error(stae); } } else { closeConnection(true); } } // Save to MRU if (getApplication() instanceof SshTerm && (((SshTerm) getApplication()).getMRUModel() != null)) { ((SshTerm) getApplication()).getMRUModel().add(f); } // Make sure its not invalid if (f != null) { // Create a new connection properties object SshToolsConnectionProfile profile = new SshToolsConnectionProfile(); try { // Open the file profile.open(f.getAbsolutePath()); setNeedSave(false); setCurrentConnectionFile(f); //setContainerTitle(f); // Connect with the new details. connect(profile, false); } catch (InvalidProfileFileException fnfe) { showExceptionMessage("Open Connection", fnfe.getMessage()); } catch (SshException e) { e.printStackTrace(); showExceptionMessage("Open Connection", "An unexpected error occured!"); } } else { showExceptionMessage("Open Connection", "Invalid file specified"); } }
From source file:edu.ku.brc.specify.tasks.subpane.qb.QueryBldrPane.java
/** * create the query builder UI.//from w w w .ja v a 2s . co m */ protected void createUI() { removeAll(); JMenuItem saveItem = new JMenuItem(UIRegistry.getResourceString("QB_SAVE")); Action saveActionListener = new AbstractAction() { public void actionPerformed(ActionEvent e) { if (saveQuery(false)) { try { String selId = null; if (selectedQFP != null && selectedQFP.getQueryField() != null) { selId = selectedQFP.getQueryField().getStringId(); } final String selectedFldId = selId; setupUI(true); SwingUtilities.invokeLater(new Runnable() { /* (non-Javadoc) * @see java.lang.Runnable#run() */ @Override public void run() { if (selectedFldId != null) { for (QueryFieldPanel qfp : queryFieldItems) { if (qfp.getQueryField() != null && selectedFldId.equals(qfp.getQueryField().getStringId())) { selectQFP(qfp); return; } } selectQFP(queryFieldItems.get(0)); } } }); } catch (Exception ex) { } setSaveBtnEnabled(false); } } }; saveItem.addActionListener(saveActionListener); JMenuItem saveAsItem = new JMenuItem(UIRegistry.getResourceString("QB_SAVE_AS")); Action saveAsActionListener = new AbstractAction() { public void actionPerformed(ActionEvent e) { if (saveQuery(true)) { setSaveBtnEnabled(false); } } }; saveAsItem.addActionListener(saveAsActionListener); JComponent[] itemSample = { saveItem, saveAsItem }; saveBtn = new DropDownButton(UIRegistry.getResourceString("QB_SAVE"), null, 1, java.util.Arrays.asList(itemSample)); saveBtn.addActionListener(saveActionListener); String ACTION_KEY = "SAVE"; KeyStroke ctrlS = KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); InputMap inputMap = saveBtn.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(ctrlS, ACTION_KEY); ActionMap actionMap = saveBtn.getActionMap(); actionMap.put(ACTION_KEY, saveActionListener); ACTION_KEY = "SAVE_AS"; KeyStroke ctrlA = KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); inputMap.put(ctrlA, ACTION_KEY); actionMap.put(ACTION_KEY, saveAsActionListener); saveBtn.setActionMap(actionMap); UIHelper.setControlSize(saveBtn); //saveBtn.setOverrideBorder(true, BasicBorders.getButtonBorder()); listBoxPanel = new JPanel(new HorzLayoutManager(2, 2)); Vector<TableQRI> list = new Vector<TableQRI>(); for (int k = 0; k < tableTree.getKids(); k++) { list.add(tableTree.getKid(k).getTableQRI()); } Collections.sort(list); DefaultListModel model = new DefaultListModel(); for (TableQRI qri : list) { model.addElement(qri); } tableList = new JList(model); QryListRenderer qr = new QryListRenderer(IconManager.IconSize.Std16); qr.setDisplayKidIndicator(false); tableList.setCellRenderer(qr); JScrollPane spt = new JScrollPane(tableList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); Dimension pSize = spt.getPreferredSize(); pSize.height = 200; spt.setPreferredSize(pSize); JPanel topPanel = new JPanel(new BorderLayout()); scrollPane = new JScrollPane(listBoxPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); tableList.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { int inx = tableList.getSelectedIndex(); if (inx > -1) { fillNextList(tableList); } else { listBoxPanel.removeAll(); } } } }); addBtn = new JButton(IconManager.getImage("PlusSign", IconManager.IconSize.Std16)); addBtn.setEnabled(false); addBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { BaseQRI qri = (BaseQRI) listBoxList.get(currentInx).getSelectedValue(); if (qri.isInUse) { return; } try { FieldQRI fieldQRI = buildFieldQRI(qri); if (fieldQRI == null) { throw new Exception("null FieldQRI"); } SpQueryField qf = new SpQueryField(); qf.initialize(); qf.setFieldName(fieldQRI.getFieldName()); qf.setStringId(fieldQRI.getStringId()); query.addReference(qf, "fields"); if (!isExportMapping) { addQueryFieldItem(fieldQRI, qf, false); } else { addNewMapping(fieldQRI, qf, null, false); } } catch (Exception ex) { log.error(ex); UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(QueryBldrPane.class, ex); return; } } }); contextPanel = new JPanel(new BorderLayout()); contextPanel.add(createLabel("Search Context", SwingConstants.CENTER), BorderLayout.NORTH); // I18N contextPanel.add(spt, BorderLayout.CENTER); contextPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); JPanel schemaPanel = new JPanel(new BorderLayout()); schemaPanel.add(scrollPane, BorderLayout.CENTER); topPanel.add(contextPanel, BorderLayout.WEST); topPanel.add(schemaPanel, BorderLayout.CENTER); add(topPanel, BorderLayout.NORTH); queryFieldsPanel = new JPanel(); queryFieldsPanel.setLayout(new NavBoxLayoutManager(0, 2)); queryFieldsScroll = new JScrollPane(queryFieldsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); queryFieldsScroll.setBorder(null); add(queryFieldsScroll); //if (!isExportMapping) //{ final JPanel mover = buildMoverPanel(false); add(mover, BorderLayout.EAST); // } String searchLbl = schemaMapping == null ? getResourceString("QB_SEARCH") : getResourceString("QB_EXPORT_PREVIEW"); searchBtn = createButton(searchLbl); searchBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { // int m = ae.getModifiers(); // boolean ors = (m & ActionEvent.ALT_MASK) > 0 && (m & ActionEvent.CTRL_MASK) > 0 && (m & ActionEvent.SHIFT_MASK) > 0; // if (ors) // { // System.out.println("Disjunctional conjoinment desire gesture detected"); // } // doSearch(ors); doSearch(false); } }); distinctChk = createCheckBox(UIRegistry.getResourceString("QB_DISTINCT")); distinctChk.setVisible(schemaMapping == null); if (schemaMapping == null) { distinctChk.setSelected(false); distinctChk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { new SwingWorker() { /* (non-Javadoc) * @see edu.ku.brc.helpers.SwingWorker#construct() */ @Override public Object construct() { if (distinctChk.isSelected()) { UsageTracker.incrUsageCount("QB.DistinctOn"); } else { UsageTracker.incrUsageCount("QB.DistinctOff"); } if ((isTreeLevelSelected() || isAggFieldSelected()) && countOnly && distinctChk.isSelected()) { countOnlyChk.setSelected(false); countOnly = false; } query.setCountOnly(countOnly); query.setSelectDistinct(distinctChk.isSelected()); setSaveBtnEnabled(thereAreItems()); return null; } }.start(); } }); } countOnlyChk = createCheckBox(UIRegistry.getResourceString("QB_COUNT_ONLY")); countOnlyChk.setSelected(false); countOnlyChk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { new SwingWorker() { /* (non-Javadoc) * @see edu.ku.brc.helpers.SwingWorker#construct() */ @Override public Object construct() { //Don't allow change while query is running. if (runningResults.get() == null) { countOnly = !countOnly; if (countOnly) { UsageTracker.incrUsageCount("QB.CountOnlyOn"); } else { UsageTracker.incrUsageCount("QB.CountOnlyOff"); } if ((isTreeLevelSelected() || isAggFieldSelected()) && countOnly && (distinctChk.isSelected() || searchSynonymyChk.isSelected())) { distinctChk.setSelected(false); searchSynonymyChk.setSelected(false); } } else { //This might be awkward and/or klunky... countOnlyChk.setSelected(countOnly); } query.setCountOnly(countOnly); query.setSelectDistinct(distinctChk.isSelected()); setSaveBtnEnabled(thereAreItems()); return null; } }.start(); } }); searchSynonymyChk = createCheckBox(UIRegistry.getResourceString("QB_SRCH_SYNONYMS")); searchSynonymyChk.setSelected(searchSynonymy); searchSynonymyChk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { new SwingWorker() { /* (non-Javadoc) * @see edu.ku.brc.helpers.SwingWorker#construct() */ @Override public Object construct() { searchSynonymy = !searchSynonymy; if (!searchSynonymy) { UsageTracker.incrUsageCount("QB.SearchSynonymyOff"); } else { UsageTracker.incrUsageCount("QB.SearchSynonymyOn"); } if (isTreeLevelSelected() && countOnly && searchSynonymyChk.isSelected()) { countOnlyChk.setSelected(false); countOnly = false; } query.setSearchSynonymy(searchSynonymy); setSaveBtnEnabled(thereAreItems()); return null; } }.start(); } }); smushedChk = createCheckBox(UIRegistry.getResourceString("QB_SMUSH_RESULTS")); smushedChk.setVisible(isSmushableContext()); if (isSmushableContext()) { smushedChk.setSelected(smushed); smushedChk.setToolTipText( String.format(UIRegistry.getResourceString("QB_SMUSH_RESULTS_HINT"), getCatalogNumberTitle())); smushedChk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { new SwingWorker() { /* * (non-Javadoc) * * @see edu.ku.brc.helpers.SwingWorker#construct() */ @Override public Object construct() { smushed = !smushed; if (!smushed) { UsageTracker.incrUsageCount("QB.SmushedOff"); } else { UsageTracker.incrUsageCount("QB.SmushedOn"); } query.setSmushed(smushed); setSaveBtnEnabled(thereAreItems()); return null; } }.start(); } }); } PanelBuilder outer = new PanelBuilder( new FormLayout("p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 6dlu, p", "p")); CellConstraints cc = new CellConstraints(); outer.add(smushedChk, cc.xy(1, 1)); outer.add(searchSynonymyChk, cc.xy(3, 1)); outer.add(distinctChk, cc.xy(5, 1)); outer.add(countOnlyChk, cc.xy(7, 1)); outer.add(searchBtn, cc.xy(9, 1)); outer.add(saveBtn, cc.xy(11, 1)); JPanel bottom = new JPanel(new BorderLayout()); bottom.add(outer.getPanel(), BorderLayout.EAST); JButton helpBtn = UIHelper.createHelpIconButton(getHelpBtnContext()); bottom.add(helpBtn, BorderLayout.WEST); add(bottom, BorderLayout.SOUTH); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); }
From source file:edu.ku.brc.af.ui.db.TextFieldWithQuery.java
/** * * @param advanceFocus//from w w w . ja v a 2 s . co m */ protected void showDialog(final int advanceFocus) { final Vector<Integer> idListLocal = (Vector<Integer>) idList.clone(); final Vector<String> listLocal = (Vector<String>) list.clone(); final String enteredText = StringUtils.isEmpty(prevEnteredText) ? cachedPrevText : prevEnteredText; DefaultListModel<String> model = new DefaultListModel<String>(); if (doAddAddItem) { model.addElement(UIRegistry.getResourceString("TFWQ_ADD_LABEL")); //$NON-NLS-1$ } for (String val : list) { model.addElement(val); } final JList<String> listBox = new JList<String>(model); JPanel panel = new JPanel(new BorderLayout()); panel.add(createLabel(UIRegistry.getResourceString("TFWQ_CHOOSE_LABEL"), SwingConstants.CENTER), //$NON-NLS-1$ BorderLayout.NORTH); panel.add(UIHelper.createScrollPane(listBox, true), BorderLayout.CENTER); panel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); // Had to do inner class in order to get it to select an item // before being shown class PopUpDialog extends CustomDialog { protected JList<String> pListBox; public PopUpDialog(final Frame frame, final boolean isModal, final Component contentPanel, JList<String> pListBoxArg) throws HeadlessException { super(frame, UIRegistry.getResourceString("TFWQ_CHOOSE_TITLE"), isModal, contentPanel); //$NON-NLS-1$ this.pListBox = pListBoxArg; initialize(); } public PopUpDialog(final Dialog dialog, final boolean isModal, final Component contentPanel, JList<String> pListBoxArg) throws HeadlessException { super(dialog, UIRegistry.getResourceString("TFWQ_CHOOSE_TITLE"), isModal, OK_BTN | CANCEL_BTN, //$NON-NLS-1$ contentPanel); this.pListBox = pListBoxArg; initialize(); } /** * */ protected void initialize() { pListBox.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (okBtn != null && pListBox != null) { okBtn.setEnabled(listBox.getSelectedIndex() != -1); } } } }); pListBox.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); if (e.getClickCount() == 2) { okBtn.setEnabled(true); okBtn.doClick(); } } }); } @Override public void setVisible(final boolean visible) { if (visible) { listBox.setSelectedIndex(doAddAddItem ? 1 : 0); } super.setVisible(visible); } } hasNewText = false; Window mostRecent = UIRegistry.getMostRecentWindow(); CustomDialog dlg; if (mostRecent instanceof Dialog) { dlg = new PopUpDialog((Dialog) UIRegistry.getMostRecentWindow(), true, panel, listBox); } else { dlg = new PopUpDialog((Frame) UIRegistry.getMostRecentWindow(), true, panel, listBox); } dlg.setVisible(true); if (!dlg.isCancelled()) { int inx = listBox.getSelectedIndex(); boolean isDoingAdd = inx == 0 && doAddAddItem; inx = doAddAddItem ? inx - 1 : inx; if (!isDoingAdd && inx < idListLocal.size()) { selectedId = idListLocal.get(inx); setText(listLocal.get(inx)); } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { transferFocus(advanceFocus); notifyListenersOfChange(isDoingAdd ? new AddItemEvent(enteredText) : listBox); } }); } else { setText(""); //$NON-NLS-1$ } }
From source file:edu.ku.brc.specify.tasks.subpane.security.SecurityAdminPane.java
/** * Creates one panel for each kind of form that may be used and stores them for later *///from w w w . java 2s.c om private void createInitialInfoSubPanels() { //boolean editing = hasPermissionToModify; infoSubPanels = new Hashtable<String, AdminInfoSubPanelWrapper>(); JPanel blankPanel = new JPanel(); createBlankInfoSubPanel(Institution.class, blankPanel); createBlankInfoSubPanel(Discipline.class, blankPanel); createBlankInfoSubPanel(Collection.class, blankPanel); JPanel allPermissions = new JPanel(new BorderLayout()); JLabel lbl = UIHelper.createI18NLabel("SEC_ALL_PERMISSIONS", SwingConstants.CENTER); lbl.setFont(lbl.getFont().deriveFont(18.0f)); allPermissions.add(lbl, BorderLayout.CENTER); createBlankInfoSubPanel(AdminPrincipal.class, allPermissions); createUserPanel(); createGroupPanel(); }