List of usage examples for java.awt GridBagConstraints REMAINDER
int REMAINDER
To view the source code for java.awt GridBagConstraints REMAINDER.
Click Source Link
From source file:org.openmicroscopy.shoola.agents.metadata.editor.UserProfile.java
/** * Builds the UI component hosting the UI component used to modify * the password./*from w ww . ja va 2 s. c om*/ * * @return See above. */ private JPanel buildPasswordPanel() { JPanel content = new JPanel(); content.setBackground(UIUtilities.BACKGROUND_COLOR); Registry reg = MetadataViewerAgent.getRegistry(); String ldap = (String) reg.lookup(LookupNames.USER_AUTHENTICATION); if (ldap != null && ldap.length() > 0) { content.setBorder(BorderFactory.createTitledBorder("LDAP Authentication")); content.setLayout(new FlowLayout(FlowLayout.LEFT)); content.add(new JLabel(ldap)); return content; } content.setBorder(BorderFactory.createTitledBorder("Change Password")); content.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; c.insets = new Insets(0, 2, 2, 0); c.gridx = 0; c.gridy = 0; c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; c.weightx = 0.0; if (MetadataViewerAgent.isAdministrator()) { content.add(UIUtilities.setTextFont(PASSWORD_NEW), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(passwordNew, c); } else { content.add(UIUtilities.setTextFont(PASSWORD_OLD), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(oldPassword, c); c.gridy++; c.gridx = 0; c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; c.weightx = 0.0; content.add(UIUtilities.setTextFont(PASSWORD_NEW), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(passwordNew, c); c.gridy++; c.gridx = 0; c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; c.weightx = 0.0; content.add(UIUtilities.setTextFont(PASSWORD_CONFIRMATION), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(passwordConfirm, c); c.gridy++; c.gridx = 0; } JPanel p = new JPanel(); p.setBackground(UIUtilities.BACKGROUND_COLOR); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.add(content); JPanel buttonPanel = UIUtilities.buildComponentPanel(passwordButton); buttonPanel.setBackground(UIUtilities.BACKGROUND_COLOR); p.add(buttonPanel); return p; }
From source file:org.freeplane.view.swing.features.time.mindmapmode.NodeList.java
public void startup() { if (dialog != null) { dialog.toFront();// w w w.j a v a 2 s .c o m return; } NodeList.COLUMN_MODIFIED = TextUtils.getText(PLUGINS_TIME_LIST_XML_MODIFIED); NodeList.COLUMN_CREATED = TextUtils.getText(PLUGINS_TIME_LIST_XML_CREATED); NodeList.COLUMN_ICONS = TextUtils.getText(PLUGINS_TIME_LIST_XML_ICONS); NodeList.COLUMN_TEXT = TextUtils.getText(PLUGINS_TIME_LIST_XML_TEXT); NodeList.COLUMN_DATE = TextUtils.getText(PLUGINS_TIME_LIST_XML_DATE); NodeList.COLUMN_NOTES = TextUtils.getText(PLUGINS_TIME_LIST_XML_NOTES); dialog = new JDialog(Controller.getCurrentController().getViewController().getFrame(), modal /* modal */); String windowTitle; if (showAllNodes) { windowTitle = PLUGINS_TIME_MANAGEMENT_XML_WINDOW_TITLE_ALL_NODES; } else { windowTitle = PLUGINS_TIME_MANAGEMENT_XML_WINDOW_TITLE; } dialog.setTitle(TextUtils.getText(windowTitle)); dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); final WindowAdapter windowListener = new WindowAdapter() { @Override public void windowGainedFocus(WindowEvent e) { mFilterTextSearchField.getEditor().selectAll(); } @Override public void windowClosing(final WindowEvent event) { disposeDialog(); } }; dialog.addWindowListener(windowListener); dialog.addWindowFocusListener(windowListener); UITools.addEscapeActionToDialog(dialog, new AbstractAction() { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { disposeDialog(); } }); final Container contentPane = dialog.getContentPane(); final GridBagLayout gbl = new GridBagLayout(); contentPane.setLayout(gbl); final GridBagConstraints layoutConstraints = new GridBagConstraints(); layoutConstraints.gridx = 0; layoutConstraints.gridy = 0; layoutConstraints.gridwidth = 1; layoutConstraints.gridheight = 1; layoutConstraints.weightx = 0.0; layoutConstraints.weighty = 0.0; layoutConstraints.anchor = GridBagConstraints.WEST; layoutConstraints.fill = GridBagConstraints.HORIZONTAL; contentPane.add(new JLabel(TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_FIND)), layoutConstraints); layoutConstraints.gridwidth = 1; layoutConstraints.gridx++; contentPane.add(Box.createHorizontalStrut(40), layoutConstraints); layoutConstraints.gridx++; contentPane.add(new JLabel(TextUtils.getText("filter_match_case")), layoutConstraints); layoutConstraints.gridx++; contentPane.add(matchCase, layoutConstraints); layoutConstraints.gridx++; contentPane.add(Box.createHorizontalStrut(40), layoutConstraints); layoutConstraints.gridx++; contentPane.add(new JLabel(TextUtils.getText("regular_expressions")), layoutConstraints); layoutConstraints.gridx++; contentPane.add(useRegexInFind, layoutConstraints); layoutConstraints.gridx = 0; layoutConstraints.weightx = 1.0; layoutConstraints.gridwidth = GridBagConstraints.REMAINDER; layoutConstraints.gridy++; contentPane.add(/* new JScrollPane */(mFilterTextSearchField), layoutConstraints); layoutConstraints.gridy++; layoutConstraints.weightx = 0.0; layoutConstraints.gridwidth = 1; contentPane.add(new JLabel(TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_REPLACE)), layoutConstraints); layoutConstraints.gridx = 5; contentPane.add(new JLabel(TextUtils.getText("regular_expressions")), layoutConstraints); layoutConstraints.gridx++; contentPane.add(useRegexInReplace, layoutConstraints); layoutConstraints.gridx = 0; layoutConstraints.weightx = 1.0; layoutConstraints.gridwidth = GridBagConstraints.REMAINDER; layoutConstraints.gridy++; contentPane.add(/* new JScrollPane */(mFilterTextReplaceField), layoutConstraints); dateRenderer = new DateRenderer(); nodeRenderer = new NodeRenderer(); notesRenderer = new NotesRenderer(); iconsRenderer = new IconsRenderer(); timeTable = new FlatNodeTable(); timeTable.addKeyListener(new FlatNodeTableKeyListener()); timeTable.addMouseListener(new FlatNodeTableMouseAdapter()); timeTable.getTableHeader().setReorderingAllowed(false); timeTableModel = updateModel(); mFlatNodeTableFilterModel = new FlatNodeTableFilterModel(timeTableModel, NodeList.NODE_TEXT_COLUMN); sorter = new TableSorter(mFlatNodeTableFilterModel); timeTable.setModel(sorter); sorter.setTableHeader(timeTable.getTableHeader()); sorter.setColumnComparator(Date.class, TableSorter.COMPARABLE_COMPARATOR); sorter.setColumnComparator(NodeModel.class, TableSorter.LEXICAL_COMPARATOR); sorter.setColumnComparator(IconsHolder.class, TableSorter.COMPARABLE_COMPARATOR); sorter.setSortingStatus(NodeList.DATE_COLUMN, TableSorter.ASCENDING); final JScrollPane pane = new JScrollPane(timeTable); UITools.setScrollbarIncrement(pane); layoutConstraints.gridy++; GridBagConstraints tableConstraints = (GridBagConstraints) layoutConstraints.clone(); tableConstraints.weightx = 1; tableConstraints.weighty = 10; tableConstraints.fill = GridBagConstraints.BOTH; contentPane.add(pane, tableConstraints); mTreeLabel = new JLabel(); layoutConstraints.gridy++; GridBagConstraints treeConstraints = (GridBagConstraints) layoutConstraints.clone(); treeConstraints.fill = GridBagConstraints.BOTH; @SuppressWarnings("serial") JScrollPane scrollPane = new JScrollPane(mTreeLabel) { @Override public boolean isValidateRoot() { return false; } }; contentPane.add(scrollPane, treeConstraints); final AbstractAction exportAction = new AbstractAction( TextUtils.getText("plugins/TimeManagement.xml_Export")) { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { exportSelectedRowsAndClose(); } }; final JButton exportButton = new JButton(exportAction); final AbstractAction replaceAllAction = new AbstractAction( TextUtils.getText("plugins/TimeManagement.xml_Replace_All")) { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { replace(new ReplaceAllInfo()); } }; final JButton replaceAllButton = new JButton(replaceAllAction); final AbstractAction replaceSelectedAction = new AbstractAction( TextUtils.getText("plugins/TimeManagement.xml_Replace_Selected")) { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { replace(new ReplaceSelectedInfo()); } }; final JButton replaceSelectedButton = new JButton(replaceSelectedAction); final AbstractAction gotoAction = new AbstractAction(TextUtils.getText("plugins/TimeManagement.xml_Goto")) { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { selectSelectedRows(); } }; final JButton gotoButton = new JButton(gotoAction); final AbstractAction disposeAction = new AbstractAction( TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_CLOSE)) { /** * */ private static final long serialVersionUID = 1L; public void actionPerformed(final ActionEvent arg0) { disposeDialog(); } }; final JButton cancelButton = new JButton(disposeAction); /* Initial State */ gotoAction.setEnabled(false); exportAction.setEnabled(false); replaceSelectedAction.setEnabled(false); final Box bar = Box.createHorizontalBox(); bar.add(Box.createHorizontalGlue()); bar.add(cancelButton); bar.add(exportButton); bar.add(replaceAllButton); bar.add(replaceSelectedButton); bar.add(gotoButton); bar.add(Box.createHorizontalGlue()); layoutConstraints.gridy++; contentPane.add(/* new JScrollPane */(bar), layoutConstraints); final JMenuBar menuBar = new JMenuBar(); final JMenu menu = new JMenu(TextUtils.getText("plugins/TimeManagement.xml_menu_actions")); final AbstractAction[] actionList = new AbstractAction[] { gotoAction, replaceSelectedAction, replaceAllAction, exportAction, disposeAction }; for (int i = 0; i < actionList.length; i++) { final AbstractAction action = actionList[i]; final JMenuItem item = menu.add(action); item.setIcon(new BlindIcon(UIBuilder.ICON_SIZE)); } menuBar.add(menu); dialog.setJMenuBar(menuBar); final ListSelectionModel rowSM = timeTable.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(final ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } final ListSelectionModel lsm = (ListSelectionModel) e.getSource(); final boolean enable = !(lsm.isSelectionEmpty()); replaceSelectedAction.setEnabled(enable); gotoAction.setEnabled(enable); exportAction.setEnabled(enable); } }); rowSM.addListSelectionListener(new ListSelectionListener() { String getNodeText(final NodeModel node) { return TextController.getController().getShortText(node) + ((node.isRoot()) ? "" : (" <- " + getNodeText(node.getParentNode()))); } public void valueChanged(final ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } final ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) { mTreeLabel.setText(""); return; } final int selectedRow = lsm.getLeadSelectionIndex(); final NodeModel mindMapNode = getMindMapNode(selectedRow); mTreeLabel.setText(getNodeText(mindMapNode)); } }); final String marshalled = ResourceController.getResourceController() .getProperty(NodeList.WINDOW_PREFERENCE_STORAGE_PROPERTY); final WindowConfigurationStorage result = TimeWindowConfigurationStorage.decorateDialog(marshalled, dialog); final WindowConfigurationStorage storage = result; if (storage != null) { timeTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); int column = 0; for (final TimeWindowColumnSetting setting : ((TimeWindowConfigurationStorage) storage) .getListTimeWindowColumnSettingList()) { timeTable.getColumnModel().getColumn(column).setPreferredWidth(setting.getColumnWidth()); sorter.setSortingStatus(column, setting.getColumnSorting()); column++; } } mFlatNodeTableFilterModel.setFilter((String) mFilterTextSearchField.getSelectedItem(), matchCase.isSelected(), useRegexInFind.isSelected()); dialog.setVisible(true); }
From source file:be.agiv.security.demo.Main.java
private void ipStsIssueToken() { GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); JPanel contentPanel = new JPanel(gridBagLayout); JLabel urlLabel = new JLabel("URL:"); gridBagConstraints.gridx = 0;//from w ww. j av a 2s .c om gridBagConstraints.gridy = 0; gridBagConstraints.anchor = GridBagConstraints.WEST; gridBagConstraints.ipadx = 5; gridBagLayout.setConstraints(urlLabel, gridBagConstraints); contentPanel.add(urlLabel); JTextField urlTextField = new JTextField( "https://auth.beta.agiv.be/ipsts/Services/DaliSecurityTokenServiceConfiguration.svc/IWSTrust13", 60); gridBagConstraints.gridx++; gridBagLayout.setConstraints(urlTextField, gridBagConstraints); contentPanel.add(urlTextField); JLabel realmLabel = new JLabel("Realm:"); gridBagConstraints.gridx = 0; gridBagConstraints.gridy++; gridBagLayout.setConstraints(realmLabel, gridBagConstraints); contentPanel.add(realmLabel); JTextField realmTextField = new JTextField(AGIVSecurity.BETA_REALM, 30); gridBagConstraints.gridx++; gridBagLayout.setConstraints(realmTextField, gridBagConstraints); contentPanel.add(realmTextField); CredentialPanel credentialPanel = new CredentialPanel(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy++; gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER; gridBagLayout.setConstraints(credentialPanel, gridBagConstraints); contentPanel.add(credentialPanel); int result = JOptionPane.showConfirmDialog(this, contentPanel, "IP-STS Issue Token", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.CANCEL_OPTION) { return; } String location = urlTextField.getText(); String username = credentialPanel.getUsername(); String password = credentialPanel.getPassword(); File pkcs12File = credentialPanel.getPKCS12File(); String realm = realmTextField.getText(); IPSTSClient ipStsClient = new IPSTSClient(location, realm); try { if (null != username) { this.ipStsSecurityToken = ipStsClient.getSecurityToken(username, password); } else { KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(new FileInputStream(pkcs12File), password.toCharArray()); String alias = keyStore.aliases().nextElement(); X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); PrivateKey privateKey = (PrivateKey) keyStore.getKey(alias, password.toCharArray()); this.ipStsSecurityToken = ipStsClient.getSecuritytoken(certificate, privateKey); } this.ipStsViewMenuItem.setEnabled(true); this.rStsIssueMenuItem.setEnabled(true); ipStsViewToken(); } catch (Exception e) { showException(e); } }
From source file:net.sf.taverna.t2.activities.spreadsheet.views.SpreadsheetImportConfigView.java
private void layoutPanel() { setPreferredSize(new Dimension(450, 400)); setLayout(new BorderLayout()); page1 = new JPanel(new GridBagLayout()); page2 = new JPanel(new GridBagLayout()); contentPanel = new JPanel(cardLayout); contentPanel.add(page1, "page1"); contentPanel.add(page2, "page2"); add(contentPanel, BorderLayout.CENTER); // title//from w ww. ja v a 2 s . c o m titlePanel.setBorder(new CompoundBorder(titlePanel.getBorder(), new EmptyBorder(10, 10, 0, 10))); add(titlePanel, BorderLayout.NORTH); titlePanel.add(titleLabel, BorderLayout.NORTH); titlePanel.add(titleIcon, BorderLayout.WEST); titlePanel.add(titleMessage, BorderLayout.CENTER); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.gridx = 0; c.gridwidth = GridBagConstraints.REMAINDER; // column range c.insets = new Insets(10, 10, 0, 10); page1.add(columnLabel, c); c.insets = new Insets(10, 25, 0, 0); c.gridwidth = 1; c.weightx = 0; page1.add(new JLabel(SpreadsheetImportUIText.getString("SpreadsheetImportConfigView.from")), c); c.insets = new Insets(10, 0, 0, 0); c.gridx = 1; page1.add(columnFromValue, c); c.gridx = 2; page1.add(new JLabel(SpreadsheetImportUIText.getString("SpreadsheetImportConfigView.to")), c); c.gridx = 3; page1.add(columnToValue, c); c.gridx = 0; c.weightx = 1; c.insets = new Insets(10, 10, 0, 10); c.gridwidth = GridBagConstraints.REMAINDER; // row range page1.add(rowLabel, c); c.insets = new Insets(10, 25, 0, 0); c.gridwidth = 1; c.gridx = 0; c.weightx = 0; page1.add(new JLabel(SpreadsheetImportUIText.getString("SpreadsheetImportConfigView.from")), c); c.insets = new Insets(10, 0, 0, 0); c.gridx = 1; page1.add(rowFromValue, c); c.gridx = 2; page1.add(new JLabel(SpreadsheetImportUIText.getString("SpreadsheetImportConfigView.to")), c); c.gridx = 3; page1.add(rowToValue, c); c.gridx = 4; page1.add(rowSelectAllOption, c); c.gridx = 5; c.gridwidth = GridBagConstraints.REMAINDER; c.insets = new Insets(10, 0, 0, 10); page1.add(rowExcludeFirstOption, c); c.insets = new Insets(10, 25, 0, 0); c.gridx = 0; page1.add(rowIgnoreBlankRows, c); c.gridx = 0; // empty cells c.insets = new Insets(10, 10, 10, 10); page1.add(emptyCellLabel, c); c.insets = new Insets(0, 25, 0, 10); page1.add(emptyCellEmptyStringOption, c); JPanel userDefinedPanel = new JPanel(new BorderLayout()); userDefinedPanel.add(emptyCellUserDefinedOption, BorderLayout.WEST); userDefinedPanel.add(emptyCellUserDefinedValue, BorderLayout.CENTER); page1.add(userDefinedPanel, c); c.weighty = 1; c.anchor = GridBagConstraints.NORTHWEST; page1.add(emptyCellErrorValueOption, c); // output format c.insets = new Insets(10, 10, 10, 10); c.weighty = 0; c.weightx = 1; page2.add(outputFormatLabel, c); c.insets = new Insets(0, 25, 0, 10); page2.add(outputFormatMultiplePort, c); page2.add(outputFormatSinglePort, c); c.insets = new Insets(0, 50, 0, 10); JPanel outputFormatDelimiterPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); outputFormatDelimiterPanel.add(outputFormatDelimiterLabel); outputFormatDelimiterPanel.add(outputFormatDelimiter); page2.add(outputFormatDelimiterPanel, c); // column mapping c.insets = new Insets(10, 10, 0, 10); page2.add(columnMappingLabel, c); c.insets = new Insets(10, 10, 10, 10); c.fill = GridBagConstraints.BOTH; c.weighty = 1; page2.add(new JScrollPane(columnMappingTable), c); buttonPanel.add(backButton); buttonPanel.add(nextButton); add(buttonPanel, BorderLayout.SOUTH); }
From source file:org.fhcrc.cpl.viewer.quant.gui.QuantitationReviewer.java
/** * Calculate and show theoretical isotopic distribution peaks, with light encroaching on heavy * if necessary/*from w w w .ja va 2s . c o m*/ */ protected void showTheoreticalPeaks() { int horizSlop = 30; int vertSlop = 35; if (System.getProperty("os.name").toLowerCase().contains("mac")) { horizSlop = 40; vertSlop = 45; } int chartWidth = Math.max(200, leftPanelWidth - horizSlop); int chartHeight = Math.max(theoreticalPeaksPanel.getHeight(), theoreticalPeaksPanelHeight) - vertSlop; if (theoreticalPeaksChart != null && theoreticalPeaksChart.getComponentCount() > 0) theoreticalPeaksPanel.remove(0); QuantEvent quantEvent = null; if (quantEvents != null) { quantEvent = quantEvents.get(displayedEventIndex); theoreticalPeaksChart = QuantitationVisualizer.buildTheoreticalPeakChart(quantEvent, chartWidth, chartHeight); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; gbc.gridwidth = GridBagConstraints.REMAINDER; theoreticalPeaksPanel.add(theoreticalPeaksChart, gbc); float lightNeutralMass = (quantEvent.getLightMz() - Spectrum.HYDROGEN_ION_MASS) * quantEvent.getCharge(); float heavyNeutralMass = (quantEvent.getHeavyMz() - Spectrum.HYDROGEN_ION_MASS) * quantEvent.getCharge(); theoreticalPeaksPanel.setToolTipText("LightMass=" + lightNeutralMass + ", HeavyMass=" + heavyNeutralMass + ", Ratio=" + quantEvent.getRatio()); theoreticalPeaksChart.updateUI(); } }
From source file:de.codesourcery.jasm16.ide.ui.views.SourceEditorView.java
protected JPanel createPanel() { // button panel final JToolBar toolbar = new JToolBar(); toolbar.setLayout(new GridBagLayout()); setColors(toolbar);/* w ww . j a va 2s. c o m*/ final JButton showASTButton = new JButton("Show AST"); setColors(showASTButton); showASTButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final boolean currentlyVisible = isASTInspectorVisible(); if (currentlyVisible) { showASTButton.setText("Show AST"); } else { showASTButton.setText("Hide AST"); } if (currentlyVisible) { astInspector.setVisible(false); } else { showASTInspector(); } } }); GridBagConstraints cnstrs = constraints(0, 0, false, true, GridBagConstraints.NONE); toolbar.add(showASTButton, cnstrs); // navigation history back button cnstrs = constraints(1, 0, false, true, GridBagConstraints.NONE); toolbar.add(navigationHistoryBack, cnstrs); navigationHistoryBack.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { navigationHistoryBack(); } }); navigationHistoryBack.setEnabled(false); // navigation history forward button cnstrs = constraints(2, 0, true, true, GridBagConstraints.NONE); toolbar.add(navigationHistoryForward, cnstrs); navigationHistoryForward.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { navigationHistoryForward(); } }); navigationHistoryForward.setEnabled(false); // create status area statusArea.setPreferredSize(new Dimension(400, 100)); statusArea.setModel(statusModel); setColors(statusArea); /** * TOOLBAR * SOURCE * cursor position * status area */ final JPanel topPanel = new JPanel(); topPanel.setLayout(new GridBagLayout()); cnstrs = constraints(0, 0, GridBagConstraints.HORIZONTAL); cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.weighty = 0; topPanel.add(toolbar, cnstrs); cnstrs = constraints(0, 1, GridBagConstraints.BOTH); cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.weighty = 1.0; topPanel.add(super.getPanel(), cnstrs); final JPanel bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); statusArea.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); statusArea.addMouseListener(new MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { final int viewRow = statusArea.rowAtPoint(e.getPoint()); if (viewRow != -1) { final int modelRow = statusArea.convertRowIndexToModel(viewRow); StatusMessage message = statusModel.getMessage(modelRow); if (message.getLocation() != null) { moveCursorTo(message.getLocation(), true); } } } }; }); EditorContainer.addEditorCloseKeyListener(statusArea, this); statusArea.setFillsViewportHeight(true); statusArea.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); final JScrollPane statusPane = new JScrollPane(statusArea); setColors(statusPane); statusPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); statusPane.setPreferredSize(new Dimension(400, 100)); statusPane.setMinimumSize(new Dimension(100, 20)); cnstrs = constraints(0, 0, GridBagConstraints.BOTH); cnstrs.weightx = 1; cnstrs.weighty = 1; cnstrs.gridwidth = GridBagConstraints.REMAINDER; cnstrs.gridheight = GridBagConstraints.REMAINDER; bottomPanel.add(statusPane, cnstrs); // setup result panel final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, bottomPanel); setColors(splitPane); final JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); setColors(panel); cnstrs = constraints(0, 0, true, true, GridBagConstraints.BOTH); panel.add(splitPane, cnstrs); final AncestorListener l = new AncestorListener() { @Override public void ancestorRemoved(AncestorEvent event) { } @Override public void ancestorMoved(AncestorEvent event) { } @Override public void ancestorAdded(AncestorEvent event) { splitPane.setDividerLocation(0.8d); } }; panel.addAncestorListener(l); return panel; }
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//w w w . j a va 2 s . 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:net.jradius.client.gui.JRadiusSimulator.java
private JPanel getRunStatsPanel() { if (runStatsPanel == null) { runStatsPanel = new JPanel(); runStatsPanel.setLayout(new FlowLayout()); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints1.weightx = 1.0; JPanel runStatsPanel1 = new JPanel(); runStatsPanel1.setLayout(new GridBagLayout()); runStatsPanel1.add(new JLabel("Threads:"), gridBagConstraints); runStatsPanel1.add(runStatsThreads = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Sent:"), gridBagConstraints); runStatsPanel1.add(runStatsSent = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Received:"), gridBagConstraints); runStatsPanel1.add(runStatsRecv = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Time:"), gridBagConstraints); runStatsPanel1.add(runStatsTime = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Throughput:"), gridBagConstraints); runStatsPanel1.add(runStatsRPS = new JLabel(), gridBagConstraints1); JPanel runStatsPanel3 = new JPanel(); runStatsPanel3.setLayout(new GridBagLayout()); runStatsPanel3.add(new JLabel("Pkts Received"), gridBagConstraints1); runStatsPanel3.add(new JLabel("Accept:"), gridBagConstraints); runStatsPanel3.add(runStatsPktAccept = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Reject:"), gridBagConstraints); runStatsPanel3.add(runStatsPktReject = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Challenge:"), gridBagConstraints); runStatsPanel3.add(runStatsPktChallenge = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Acct Resp:"), gridBagConstraints); runStatsPanel3.add(runStatsPktAcctResp = new JLabel(), gridBagConstraints1); JPanel runStatsPanel2 = new JPanel(); runStatsPanel2.setLayout(new GridBagLayout()); runStatsPanel2.add(new JLabel("1 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime1 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("10 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime2 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("100 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime3 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("1000 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime4 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("10000 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime5 = new JLabel(), gridBagConstraints1); clearStats();/*from w ww .ja v a 2s.c o m*/ runStatsPanel.add(runStatsPanel1); runStatsPanel.add(runStatsPanel3); runStatsPanel.add(runStatsPanel2); } return runStatsPanel; }
From source file:com.rapidminer.gui.new_plotter.gui.ColorSchemeDialog.java
/** * @return//from w ww. j av a 2s . c o m */ private JPanel createSchemeComboBoxPanel() { JPanel schemeListPanel = new JPanel(new GridBagLayout()); // create categories configuration panel { GridBagConstraints itemConstraint = new GridBagConstraints(); // Add active scheme label JLabel actviceSchemeLabel = new ResourceLabel( "plotter.configuration_dialog.color_scheme_dialog.active_scheme"); { itemConstraint.fill = GridBagConstraints.HORIZONTAL; itemConstraint.anchor = GridBagConstraints.WEST; itemConstraint.gridwidth = GridBagConstraints.RELATIVE; itemConstraint.insets = new Insets(0, 5, 5, 5); itemConstraint.weightx = 1.0; actviceSchemeLabel.setBackground(Color.red); schemeListPanel.add(actviceSchemeLabel, itemConstraint); } // add button panel { JPanel buttonPanel = new JPanel(new GridBagLayout()); // rename scheme button { renameSchemeButton = new JButton(new ResourceAction(true, "plotter.configuration_dialog.color_scheme_dialog.rename_scheme_button") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { String newName = createNameDialog(currentActiveColorSchemeName); if (newName != null && !newName.equals(currentActiveColorSchemeName)) { renameColorSchemeAction(newName); } } }); itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.RELATIVE; itemConstraint.fill = GridBagConstraints.NONE; buttonPanel.add(renameSchemeButton, itemConstraint); } // remove scheme button { removeSchemeButton = new JButton(new ResourceAction(true, "plotter.configuration_dialog.color_scheme_dialog.remove_scheme_button") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { ConfirmDialog dialog = new ConfirmDialog( SwingUtilities.getWindowAncestor((Component) e.getSource()), "plotter.configuration_dialog.confirm_color_scheme_delete", ConfirmDialog.YES_NO_OPTION, false); dialog.setLocationRelativeTo((Component) e.getSource()); dialog.setVisible(true); if (dialog.getReturnOption() == ConfirmDialog.YES_OPTION) { removeColorSchemeAction((ColorScheme) colorSchemeComboBox.getSelectedItem()); } } }); itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.REMAINDER; itemConstraint.fill = GridBagConstraints.NONE; buttonPanel.add(removeSchemeButton, itemConstraint); } itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.REMAINDER; itemConstraint.fill = GridBagConstraints.NONE; itemConstraint.anchor = GridBagConstraints.EAST; itemConstraint.insets = new Insets(0, 5, 5, 5); schemeListPanel.add(buttonPanel, itemConstraint); } { colorSchemeComboBox = new JComboBox(colorSchemeComboBoxModel); actviceSchemeLabel.setLabelFor(colorSchemeComboBox); colorSchemeComboBox.setRenderer(new ColorSchemeComboBoxRenderer()); colorSchemeComboBox.addPopupMenuListener(new PopupMenuListener() { @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { return; } @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { Object selectedValue = colorSchemeComboBox.getSelectedItem(); if (selectedValue instanceof ColorScheme) { ColorScheme selection = (ColorScheme) selectedValue; if (selection != null) { if (!currentActiveColorSchemeName.equals(selection.getName())) { currentActiveColorSchemeName = selection.getName(); adaptModels(); } } } else { String newName = I18N.getGUILabel("plotter.new_color_scheme_name.label"); String suffix = ""; int counter = 1; while (currentColorSchemes.get(newName + suffix) != null) { suffix = "_" + counter; counter++; } newName += suffix; String userSelectedName = createNameDialog(newName); if (userSelectedName == null) { colorSchemeComboBox.setSelectedItem(getCurrentActiveColorScheme()); return; } addNewColorSchemeAction(userSelectedName); } } @Override public void popupMenuCanceled(PopupMenuEvent e) { return; } }); itemConstraint = new GridBagConstraints(); itemConstraint.fill = GridBagConstraints.BOTH; itemConstraint.weightx = 0.0; itemConstraint.weighty = 0.0; itemConstraint.gridwidth = GridBagConstraints.REMAINDER; schemeListPanel.add(colorSchemeComboBox, itemConstraint); } } return schemeListPanel; }
From source file:net.jradius.client.gui.JRadiusSimulator.java
/** * This method initializes sendOptionsPanel * //w w w . ja v a 2 s . c o m * @return javax.swing.JPanel */ private JPanel getSendOptionsPanel() { if (sendOptionsPanel == null) { GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints1.weightx = 1.0; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints2.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints3.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints3.weightx = 1.0; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints4.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints5.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints5.weightx = 1.0; GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints6.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints7.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints7.weightx = 1.0; GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints8.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints9.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints9.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints9.weightx = 1.0; GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); gridBagConstraints10.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints10.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints11.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints11.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints11.weightx = 1.0; GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints12.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); gridBagConstraints13.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints13.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints13.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints13.weightx = 1.0; GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); gridBagConstraints14.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints14.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); gridBagConstraints15.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints15.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints15.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints15.weightx = 1.0; GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints16.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints16.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints16.weightx = 1.0; gridBagConstraints16.gridx = 1; JLabel authenticationProtocolLabel = new JLabel(); authenticationProtocolLabel.setText("Authentication Protocol:"); JLabel sharedSecretLabel = new JLabel(); sharedSecretLabel.setText("Shared Secret:"); radiusServerLabel = new JLabel(); radiusServerLabel.setText("RADIUS Server:"); JLabel simulationTypeLabel = new JLabel(); simulationTypeLabel.setText("Simulation Type:"); JLabel checkStandardLabel = new JLabel(); checkStandardLabel.setText("Verify Standard:"); JLabel radiusAuthPortLabel = new JLabel(); radiusAuthPortLabel.setText("Auth Port:"); JLabel radiusAcctPortLabel = new JLabel(); radiusAcctPortLabel.setText("Acct Port:"); JLabel radiusRetriesLabel = new JLabel(); radiusRetriesLabel.setText("Send Retries:"); JLabel radiusTimeoutLabel = new JLabel(); radiusTimeoutLabel.setText("Send Timeout (sec):"); JLabel radiusInterimIntervalLabel = new JLabel(); radiusInterimIntervalLabel.setText("Interim Interval (sec):"); JLabel sessionTimeLabel = new JLabel(); sessionTimeLabel.setText("Session Duration (sec):"); JLabel requestersLabel = new JLabel(); requestersLabel.setText("Requester Threads:"); JLabel requestsLabel = new JLabel(); requestsLabel.setText("Requests per Thread:"); GridBagLayout gridBagLayout = new GridBagLayout(); sendOptionsPanel = new JPanel(); sendOptionsPanel.setLayout(gridBagLayout); sendOptionsPanel.add(new JLabel("Transport"), gridBagConstraints); sendOptionsPanel.add(getTransportTypeComboBox(), gridBagConstraints1); sendOptionsPanel.add(radiusServerLabel, gridBagConstraints); sendOptionsPanel.add(getRadiusServerTextField(), gridBagConstraints1); sendOptionsPanel.add(sharedSecretLabel, gridBagConstraints2); sendOptionsPanel.add(getSharedSecretTextField(), gridBagConstraints3); sendOptionsPanel.add(radiusAuthPortLabel, gridBagConstraints8); sendOptionsPanel.add(getRadiusAuthPortTextField(), gridBagConstraints9); sendOptionsPanel.add(radiusAcctPortLabel, gridBagConstraints10); sendOptionsPanel.add(getRadiusAcctPortTextField(), gridBagConstraints11); sendOptionsPanel.add(radiusTimeoutLabel, gridBagConstraints12); sendOptionsPanel.add(getRadiusTimeoutTextField(), gridBagConstraints13); sendOptionsPanel.add(radiusRetriesLabel, gridBagConstraints12); sendOptionsPanel.add(getRadiusRetriesTextField(), gridBagConstraints13); sendOptionsPanel.add(requestersLabel, gridBagConstraints12); sendOptionsPanel.add(getRequestersTextField(), gridBagConstraints13); sendOptionsPanel.add(requestsLabel, gridBagConstraints12); sendOptionsPanel.add(getRequestsTextField(), gridBagConstraints13); sendOptionsPanel.add(simulationTypeLabel, gridBagConstraints4); sendOptionsPanel.add(getSimulationTypeComboBox(), gridBagConstraints5); sendOptionsPanel.add(authenticationProtocolLabel, gridBagConstraints6); sendOptionsPanel.add(getAuthTypeComboBox(), gridBagConstraints7); sendOptionsPanel.add(checkStandardLabel, gridBagConstraints6); sendOptionsPanel.add(getCheckStandardComboBox(), gridBagConstraints7); //sendOptionsPanel.add(sessionTimeLabel, gridBagConstraints12); //sendOptionsPanel.add(getSessionTimeTextField(), gridBagConstraints13); //sendOptionsPanel.add(radiusInterimIntervalLabel, gridBagConstraints12); //sendOptionsPanel.add(getRadiusInterimIntervalTextField(), gridBagConstraints13); sendOptionsPanel.add(getOptionsLabel(), gridBagConstraints14); sendOptionsPanel.add(getGenerateAcctSessionIdCheckBox(), gridBagConstraints15); sendOptionsPanel.add(getNotStopOnRejectCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getSendClassAttributeCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getDoLogCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getFloodCheckBox(), gridBagConstraints16); } return sendOptionsPanel; }