List of usage examples for javax.swing JSeparator JSeparator
public JSeparator()
From source file:it.cnr.icar.eric.client.ui.swing.RegistryBrowser.java
/** * Creates a new RegistryBrowser object. */// w ww. j av a 2 s. c o m @SuppressWarnings("unchecked") private RegistryBrowser() { instance = this; classLoader = getClass().getClassLoader(); // new // JAXRBrowserClassLoader(getClass().getClassLoader()); Thread.currentThread().setContextClassLoader(classLoader); /* * try { classLoader.loadClass("javax.xml.soap.SOAPMessage"); } catch * (ClassNotFoundException e) { * log.error("Could not find class javax.xml.soap.SOAPMessage", e); } */ UIManager.addPropertyChangeListener(new UISwitchListener(getRootPane())); // add listener for 'locale' bound property addPropertyChangeListener(PROPERTY_LOCALE, this); menuBar = new JMenuBar(); fileMenu = new JMenu(); editMenu = new JMenu(); viewMenu = new JMenu(); helpMenu = new JMenu(); JSeparator JSeparator1 = new JSeparator(); newItem = new JMenuItem(); importItem = new JMenuItem(); saveItem = new JMenuItem(); saveAsItem = new JMenuItem(); exitItem = new JMenuItem(); cutItem = new JMenuItem(); copyItem = new JMenuItem(); pasteItem = new JMenuItem(); aboutItem = new JMenuItem(); setJMenuBar(menuBar); setTitle(resourceBundle.getString("title.registryBrowser.java")); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); getContentPane().setLayout(new BorderLayout(0, 0)); // Scale window to be centered using 70% of screen Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); setBounds((int) (dim.getWidth() * .15), (int) (dim.getHeight() * .1), (int) (dim.getWidth() * .7), (int) (dim.getHeight() * .75)); setVisible(false); saveFileDialog.setMode(FileDialog.SAVE); saveFileDialog.setTitle(resourceBundle.getString("dialog.save.title")); GridBagLayout gb = new GridBagLayout(); topPanel.setLayout(gb); getContentPane().add("North", topPanel); GridBagConstraints c = new GridBagConstraints(); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); toolbarPanel.setBounds(0, 0, 488, 29); discoveryToolBar = createDiscoveryToolBar(); toolbarPanel.add(discoveryToolBar); // c.gridx = 0; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.5; c.weighty = 0.5; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 0); gb.setConstraints(toolbarPanel, c); topPanel.add(toolbarPanel); // Panel containing context info like registry location and user context JPanel contextPanel = new JPanel(); GridBagLayout gb1 = new GridBagLayout(); contextPanel.setLayout(gb1); locationLabel = new JLabel(resourceBundle.getString("label.registryLocation")); // locationLabel.setPreferredSize(new Dimension(80, 23)); // c.gridx = 0; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.0; c.weighty = 0.5; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 5, 0, 0); gb1.setConstraints(locationLabel, c); // contextPanel.setBackground(Color.green); contextPanel.add(locationLabel); selectAnItemText = new ItemText(selectAnItem); registryCombo.addItem(selectAnItemText.toString()); ConfigurationType uiConfigurationType = UIUtility.getInstance().getConfigurationType(); RegistryURIListType urlList = uiConfigurationType.getRegistryURIList(); List<String> urls = urlList.getRegistryURI(); Iterator<String> urlsIter = urls.iterator(); while (urlsIter.hasNext()) { ItemText url = new ItemText(urlsIter.next()); registryCombo.addItem(url.toString()); } registryCombo.setEditable(true); registryCombo.setEnabled(true); registryCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final String url = (String) registryCombo.getSelectedItem(); if ((url == null) || (url.equals(selectAnItem))) { return; } // Clean tabbedPaneParent. Will create new content tabbedPaneParent.removeAll(); conceptsTreeDialog = null; ConceptsTreeDialog.clearCache(); // design: // 1. connect and construct tabbedPane in a now swing thread // 2. add tabbedPane in swing thread // 3. call reloadModel that should use WingWorkers final SwingWorker worker1 = new SwingWorker(RegistryBrowser.this) { public Object doNonUILogic() { try { // Try to connect if (connectToRegistry(url)) { return new JBTabbedPane(); } } catch (JAXRException e1) { displayError(e1); } return null; } public void doUIUpdateLogic() { tabbedPane = (JBTabbedPane) get(); if (tabbedPane != null) { tabbedPaneParent.add(tabbedPane, BorderLayout.CENTER); tabbedPane.reloadModel(); try { // DBH 1/30/04 - Add the submissions panel if // the user is authenticated. ConnectionImpl connection = RegistryBrowser.client.connection; boolean newValue = connection.isAuthenticated(); firePropertyChange(PROPERTY_AUTHENTICATED, false, newValue); getRootPane().updateUI(); } catch (JAXRException e1) { displayError(e1); } } } }; worker1.start(); } }); // c.gridx = 1; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.9; c.weighty = 0.5; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(0, 0, 5, 0); gb1.setConstraints(registryCombo, c); contextPanel.add(registryCombo); JLabel currentUserLabel = new JLabel(resourceBundle.getString("label.currentUser"), SwingConstants.TRAILING); c.gridx = 2; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.0; c.weighty = 0.0; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 5, 5, 0); gb1.setConstraints(currentUserLabel, c); // contextPanel.add(currentUserLabel); currentUserText.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { @SuppressWarnings("unused") String text = currentUserText.getText(); } }); currentUserText.setEditable(false); c.gridx = 3; c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.9; c.weighty = 0.5; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 5, 5); gb1.setConstraints(currentUserText, c); // contextPanel.add(currentUserText); c.gridx = 0; c.gridy = 1; c.gridwidth = 1; c.gridheight = 1; c.weightx = 0.9; c.weighty = 0.5; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(0, 0, 0, 0); gb.setConstraints(contextPanel, c); topPanel.add(contextPanel, c); tabbedPaneParent.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); tabbedPaneParent.setLayout(new BorderLayout()); tabbedPaneParent.setToolTipText(resourceBundle.getString("tabbedPane.tip")); getContentPane().add("Center", tabbedPaneParent); fileMenu.setText(resourceBundle.getString("menu.file")); fileMenu.setActionCommand("File"); fileMenu.setMnemonic((int) 'F'); menuBar.add(fileMenu); saveItem.setHorizontalTextPosition(SwingConstants.TRAILING); saveItem.setText(resourceBundle.getString("menu.save")); saveItem.setActionCommand("Save"); saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK)); saveItem.setMnemonic((int) 'S'); // fileMenu.add(saveItem); fileMenu.add(JSeparator1); importItem.setText(resourceBundle.getString("menu.import")); importItem.setActionCommand("Import"); importItem.setMnemonic((int) 'I'); importItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RegistryBrowser.setWaitCursor(); importFromFile(); RegistryBrowser.setDefaultCursor(); } }); fileMenu.add(importItem); exitItem.setText(resourceBundle.getString("menu.exit")); exitItem.setActionCommand("Exit"); exitItem.setMnemonic((int) 'X'); fileMenu.add(exitItem); editMenu.setText(resourceBundle.getString("menu.edit")); editMenu.setActionCommand("Edit"); editMenu.setMnemonic((int) 'E'); // menuBar.add(editMenu); cutItem.setHorizontalTextPosition(SwingConstants.TRAILING); cutItem.setText(resourceBundle.getString("menu.cut")); cutItem.setActionCommand("Cut"); cutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK)); cutItem.setMnemonic((int) 'T'); editMenu.add(cutItem); copyItem.setHorizontalTextPosition(SwingConstants.TRAILING); copyItem.setText(resourceBundle.getString("menu.copy")); copyItem.setActionCommand("Copy"); copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK)); copyItem.setMnemonic((int) 'C'); editMenu.add(copyItem); pasteItem.setHorizontalTextPosition(SwingConstants.TRAILING); pasteItem.setText(resourceBundle.getString("menu.paste")); pasteItem.setActionCommand("Paste"); pasteItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK)); pasteItem.setMnemonic((int) 'P'); editMenu.add(pasteItem); viewMenu.setText(resourceBundle.getString("menu.view")); viewMenu.setActionCommand("view"); viewMenu.setMnemonic((int) 'V'); themeMenu = new MetalThemeMenu(resourceBundle.getString("menu.theme"), themes); viewMenu.add(themeMenu); menuBar.add(viewMenu); helpMenu.setText(resourceBundle.getString("menu.help")); helpMenu.setActionCommand("Help"); helpMenu.setMnemonic((int) 'H'); menuBar.add(helpMenu); aboutItem.setHorizontalTextPosition(SwingConstants.TRAILING); aboutItem.setText(resourceBundle.getString("menu.about")); aboutItem.setActionCommand("About..."); aboutItem.setMnemonic((int) 'A'); aboutItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Object[] aboutArgs = { BROWSER_VERSION }; MessageFormat form = new MessageFormat(resourceBundle.getString("dialog.about.text")); JOptionPane.showMessageDialog(RegistryBrowser.this, form.format(aboutArgs), resourceBundle.getString("dialog.about.title"), JOptionPane.INFORMATION_MESSAGE); } }); helpMenu.add(aboutItem); // REGISTER_LISTENERS SymWindow aSymWindow = new SymWindow(); this.addWindowListener(aSymWindow); SymAction lSymAction = new SymAction(); saveItem.addActionListener(lSymAction); exitItem.addActionListener(lSymAction); SwingUtilities.updateComponentTreeUI(getContentPane()); SwingUtilities.updateComponentTreeUI(menuBar); SwingUtilities.updateComponentTreeUI(fileChooser); // Auto select the registry that is configured to connect to by default String selectedIndexStr = ProviderProperties.getInstance() .getProperty("jaxr-ebxml.registryBrowser.registryLocationCombo.initialSelectionIndex", "0"); int index = Integer.parseInt(selectedIndexStr); try { registryCombo.setSelectedIndex(index); } catch (IllegalArgumentException e) { Object[] invalidIndexArguments = { new Integer(index) }; MessageFormat form = new MessageFormat(resourceBundle.getString("message.error.invalidIndex")); displayError(form.format(invalidIndexArguments), e); } }
From source file:medsavant.uhn.cancer.UserCommentApp.java
private JPanel getCommentBlock(UserCommentGroup lcg, UserComment lc/*, UserComment oldComment*/) { JPanel innerPanel = new JPanel(); innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS)); JPanel headerPanel = getHeaderPanel(lc); JPanel commentPanel = getCommentPanel(lc); if (lc.getOriginalComment() == null) { //root level comment. innerPanel.add(headerPanel);//from www . j a va 2 s . com innerPanel.add(getStatusIconPanel(lcg, lc)); innerPanel.add(commentPanel); innerPanel.add(getCommentSeparator()); return innerPanel; } else { //status comment. JPanel outerPanel = new JPanel(); outerPanel.setLayout(new BoxLayout(outerPanel, BoxLayout.X_AXIS)); JSeparator js = new JSeparator(); js.setPreferredSize(new Dimension(STATUS_COMMENT_INDENT_WIDTH, 1)); outerPanel.add(js); innerPanel.add(headerPanel); //System.out.println("Constructing statusIconPanel with "+lc.isApproved()+","+lc.isIncluded()+","+lc.isPendingReview()); JPanel statusIconPanel = new StatusIconPanel(ICON_WIDTH, ICON_HEIGHT, false, lc.isApproved(), lc.isIncluded(), lc.isDeleted()); JPanel centeredLabel = new JPanel(); centeredLabel.setLayout(new BoxLayout(centeredLabel, BoxLayout.X_AXIS)); centeredLabel.add(Box.createHorizontalGlue()); centeredLabel.add(new JLabel("Status Change:")); centeredLabel.add(Box.createHorizontalGlue()); innerPanel.add(centeredLabel); oldStatusPanel = new JPanel(); oldStatusPanel.setLayout(new BoxLayout(oldStatusPanel, BoxLayout.X_AXIS)); oldStatusPanel.add(Box.createHorizontalGlue()); oldStatusPanel.add(statusIconPanel); innerPanel.add(oldStatusPanel); innerPanel.add(commentPanel); innerPanel.add(getCommentSeparator()); outerPanel.add(innerPanel); return outerPanel; } }
From source file:com.rapidminer.gui.new_plotter.gui.dialog.ManageZoomDialog.java
/** * Setup the GUI.//from w ww. j a v a 2 s .co m */ private void setupGUI() { JPanel mainPanel = new JPanel(); this.setContentPane(mainPanel); // start layout mainPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 2, 5); JPanel radioPanel = new JPanel(); radioPanel.setLayout(new BorderLayout()); zoomRadiobutton = new JRadioButton( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.zoom.label")); zoomRadiobutton.setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.zoom.tip")); zoomRadiobutton.setSelected(true); radioPanel.add(zoomRadiobutton, BorderLayout.LINE_START); gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 1; selectionRadiobutton = new JRadioButton( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.selection.label")); selectionRadiobutton .setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.selection.tip")); selectionRadiobutton.setHorizontalAlignment(SwingConstants.CENTER); radioPanel.add(selectionRadiobutton, BorderLayout.LINE_END); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 3; this.add(radioPanel, gbc); ButtonGroup group = new ButtonGroup(); group.add(zoomRadiobutton); group.add(selectionRadiobutton); gbc.gridx = 0; gbc.gridy = 1; gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.CENTER; rangeAxisSelectionCombobox = new JComboBox(); rangeAxisSelectionCombobox.setToolTipText( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.range_axis_combobox.tip")); rangeAxisSelectionCombobox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateValueRange(); } }); this.add(rangeAxisSelectionCombobox, gbc); gbc.gridx = 0; gbc.gridy = 2; gbc.fill = GridBagConstraints.NONE; gbc.weightx = 1; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 2, 5); JLabel domainRangeLowerBoundLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.domain_lower_bound.label")); this.add(domainRangeLowerBoundLabel, gbc); gbc.gridx = 1; gbc.gridy = 2; gbc.insets = new Insets(2, 5, 2, 5); gbc.fill = GridBagConstraints.HORIZONTAL; domainRangeLowerBoundField = new JTextField(); domainRangeLowerBoundField.setText(String.valueOf(domainRangeLowerBound)); domainRangeLowerBoundField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyDomainRangeLowerBoundInput(input); } }); domainRangeLowerBoundField.setToolTipText( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.domain_lower_bound.tip")); this.add(domainRangeLowerBoundField, gbc); gbc.gridx = 0; gbc.gridy = 3; gbc.fill = GridBagConstraints.NONE; JLabel domainRangeUpperBoundLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.domain_upper_bound.label")); this.add(domainRangeUpperBoundLabel, gbc); gbc.gridx = 1; gbc.gridy = 3; gbc.fill = GridBagConstraints.HORIZONTAL; domainRangeUpperBoundField = new JTextField(); domainRangeUpperBoundField.setToolTipText( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.domain_upper_bound.tip")); domainRangeUpperBoundField.setText(String.valueOf(domainRangeUpperBound)); domainRangeUpperBoundField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyDomainRangeUpperBoundInput(input); } }); this.add(domainRangeUpperBoundField, gbc); gbc.gridx = 0; gbc.gridy = 4; gbc.fill = GridBagConstraints.NONE; JLabel valueRangeLowerBoundLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.value_lower_bound.label")); this.add(valueRangeLowerBoundLabel, gbc); gbc.gridx = 1; gbc.gridy = 4; gbc.fill = GridBagConstraints.HORIZONTAL; valueRangeLowerBoundField = new JTextField(); valueRangeLowerBoundField.setToolTipText( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.value_lower_bound.tip")); valueRangeLowerBoundField.setText(String.valueOf(valueRangeLowerBound)); valueRangeLowerBoundField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyValueRangeLowerBoundInput(input); } }); this.add(valueRangeLowerBoundField, gbc); gbc.gridx = 0; gbc.gridy = 5; gbc.fill = GridBagConstraints.NONE; JLabel valueRangeUpperBoundLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.value_upper_bound.label")); this.add(valueRangeUpperBoundLabel, gbc); gbc.gridx = 1; gbc.gridy = 5; gbc.fill = GridBagConstraints.HORIZONTAL; valueRangeUpperBoundField = new JTextField(); valueRangeUpperBoundField.setToolTipText( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.value_upper_bound.tip")); valueRangeUpperBoundField.setText(String.valueOf(valueRangeUpperBound)); valueRangeUpperBoundField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyValueRangeUpperBoundInput(input); } }); this.add(valueRangeUpperBoundField, gbc); gbc.gridx = 0; gbc.gridy = 6; gbc.gridwidth = 3; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.CENTER; this.add(new JSeparator(), gbc); gbc.gridx = 0; gbc.gridy = 7; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.WEST; JLabel colorMinValueLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.color_min_value.label")); this.add(colorMinValueLabel, gbc); gbc.gridx = 1; gbc.gridy = 7; gbc.fill = GridBagConstraints.HORIZONTAL; colorMinValueField = new JTextField(); colorMinValueField .setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.color_min_value.tip")); colorMinValueField.setText(String.valueOf(colorMinValue)); colorMinValueField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyColorInput(input); } }); colorMinValueField.setEnabled(false); this.add(colorMinValueField, gbc); gbc.gridx = 0; gbc.gridy = 8; gbc.fill = GridBagConstraints.NONE; JLabel colorMaxValueLabel = new JLabel( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.color_max_value.label")); this.add(colorMaxValueLabel, gbc); gbc.gridx = 1; gbc.gridy = 8; gbc.fill = GridBagConstraints.HORIZONTAL; colorMaxValueField = new JTextField(); colorMaxValueField .setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.color_max_value.tip")); colorMaxValueField.setText(String.valueOf(colorMaxValue)); colorMaxValueField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { return verifyColorInput(input); } }); colorMaxValueField.setEnabled(false); this.add(colorMaxValueField, gbc); gbc.gridx = 1; gbc.gridy = 9; gbc.fill = GridBagConstraints.NONE; restoreColorButton = new JButton( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.restore_color.label")); restoreColorButton .setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.restore_color.tip")); restoreColorButton.setIcon(SwingTools.createIcon( "16/" + I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.restore_color.icon"))); restoreColorButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { LinkAndBrushSelection linkAndBrushSelection = new LinkAndBrushSelection(SelectionType.RESTORE_COLOR, new LinkedList<Pair<Integer, Range>>(), new LinkedList<Pair<Integer, Range>>(), null, null, engine.getPlotInstance()); engine.getChartPanel().informLinkAndBrushSelectionListeners(linkAndBrushSelection); updateColorValues(); } }); restoreColorButton.setEnabled(false); this.add(restoreColorButton, gbc); gbc.gridx = 0; gbc.gridy = 10; gbc.gridwidth = 3; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(2, 5, 5, 5); this.add(new JSeparator(), gbc); gbc.gridx = 0; gbc.gridy = 11; gbc.gridwidth = 1; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); okButton = new JButton(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.ok.label")); okButton.setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.ok.tip")); okButton.setIcon(SwingTools .createIcon("24/" + I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.ok.icon"))); okButton.setMnemonic( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.ok.mne").toCharArray()[0]); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // make sure fields have correct values boolean fieldsPassedChecks = checkFields(); if (!fieldsPassedChecks) { return; } Object selectedItem = rangeAxisSelectionCombobox.getSelectedItem(); if (selectedItem != null && selectedItem instanceof RangeAxisConfig) { RangeAxisConfig config = (RangeAxisConfig) selectedItem; boolean zoomOnLinkAndBrushSelection = engine.getChartPanel().getZoomOnLinkAndBrushSelection(); Range domainRange = new Range(Double.parseDouble(domainRangeLowerBoundField.getText()), Double.parseDouble(domainRangeUpperBoundField.getText())); Range valueRange = new Range(Double.parseDouble(valueRangeLowerBoundField.getText()), Double.parseDouble(valueRangeUpperBoundField.getText())); LinkedList<Pair<Integer, Range>> domainRangeList = new LinkedList<Pair<Integer, Range>>(); // only add domain zoom if != 0 if (domainRange.getUpperBound() != 0) { domainRangeList.add(new Pair<Integer, Range>(0, domainRange)); } LinkedList<Pair<Integer, Range>> valueRangeList = new LinkedList<Pair<Integer, Range>>(); // only add range zoom if at least one RangeAxisConfig exists if (engine.getPlotInstance().getMasterPlotConfiguration().getRangeAxisConfigs().size() > 0) { if (valueRange.getUpperBound() != 0) { // only add value zoom if != 0 valueRangeList.add( new Pair<Integer, Range>(engine.getPlotInstance().getMasterPlotConfiguration() .getIndexOfRangeAxisConfigById(config.getId()), valueRange)); } } // zoom or select or color LinkAndBrushSelection linkAndBrushSelection = null; if (zoomRadiobutton.isSelected()) { linkAndBrushSelection = new LinkAndBrushSelection(SelectionType.ZOOM_IN, domainRangeList, valueRangeList); if (isColorChanged(Double.parseDouble(colorMinValueField.getText()), Double.parseDouble(colorMaxValueField.getText()))) { linkAndBrushSelection = new LinkAndBrushSelection(SelectionType.COLOR_ZOOM, domainRangeList, valueRangeList, Double.parseDouble(colorMinValueField.getText()), Double.parseDouble(colorMaxValueField.getText()), engine.getPlotInstance()); } } else if (selectionRadiobutton.isSelected()) { linkAndBrushSelection = new LinkAndBrushSelection(SelectionType.SELECTION, domainRangeList, valueRangeList); if (isColorChanged(Double.parseDouble(colorMinValueField.getText()), Double.parseDouble(colorMaxValueField.getText()))) { linkAndBrushSelection = new LinkAndBrushSelection(SelectionType.COLOR_SELECTION, domainRangeList, valueRangeList, Double.parseDouble(colorMinValueField.getText()), Double.parseDouble(colorMaxValueField.getText()), engine.getPlotInstance()); } } engine.getChartPanel().informLinkAndBrushSelectionListeners(linkAndBrushSelection); engine.getChartPanel().setZoomOnLinkAndBrushSelection(zoomOnLinkAndBrushSelection); } else { return; } ManageZoomDialog.this.dispose(); } }); okButton.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { okButton.doClick(); } } }); this.add(okButton, gbc); gbc.gridx = 2; gbc.gridy = 11; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.EAST; cancelButton = new JButton(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.cancel.label")); cancelButton.setToolTipText(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.cancel.tip")); cancelButton.setIcon(SwingTools .createIcon("24/" + I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.cancel.icon"))); cancelButton.setMnemonic( I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.cancel.mne").toCharArray()[0]); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // cancel requested, close dialog ManageZoomDialog.this.dispose(); } }); this.add(cancelButton, gbc); // misc settings this.setMinimumSize(new Dimension(375, 360)); // center dialog this.setLocationRelativeTo(null); this.setTitle(I18N.getMessage(I18N.getGUIBundle(), "gui.action.manage_zoom.title.label")); this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setModal(true); this.addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { okButton.requestFocusInWindow(); } }); }
From source file:com.mirth.connect.client.ui.attachments.RegexAttachmentDialog.java
private void initComponents() { regularExpressionPanel = new JPanel(new MigLayout("novisualpadding, hidemode 3, fill, insets 0")); regularExpressionPanel.setBackground(UIConstants.BACKGROUND_COLOR); regularExpressionPanel.setBorder(BorderFactory.createTitledBorder("Regular Expressions")); regexExampleTextField = new JTextField(); regexExampleTextField.setText("(?:OBX\\|(?:[^|]*\\|){4}(?:[^|^]*\\^){4})([^|^\\r\\n]*)(?:[|^\\r\\n]|$)"); regexExampleTextField.setEditable(false); regexExampleTextField.setBorder(null); regexExampleTextField.setOpaque(false); regexTable = new MirthTable(); regexTable.setModel(new RefreshTableModel(new Object[] { "Regular Expression", "MIME Type" }, 0)); regexTable.setDragEnabled(false);//from w w w. j a v a 2 s . c om regexTable.setRowSelectionAllowed(true); regexTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); regexTable.setRowHeight(UIConstants.ROW_HEIGHT); regexTable.setFocusable(true); regexTable.setOpaque(true); regexTable.getTableHeader().setReorderingAllowed(false); regexTable.setEditable(true); regexTable.setSortable(false); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { regexTable.setHighlighters(HighlighterFactory.createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } regexTable.getColumnExt(0).setMinWidth(105); regexTable.getColumnExt(0).setPreferredWidth(350); regexTable.getColumnExt(0).setToolTipText( "<html>The regular expression that will be used to match and extract attachments.<br>If capturing groups are used, only the last group will be extracted.</html>"); regexTable.getColumnExt(1).setMinWidth(63); regexTable.getColumnExt(1).setToolTipText( "The MIME type of the extracted attachment data. Source map variables may be used here."); regexTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent evt) { regexDeleteButton.setEnabled(regexTable.getSelectedRow() >= 0); } }); regexTableScrollPane = new JScrollPane(regexTable); regexNewButton = new JButton("New"); regexNewButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { regexNewButtonActionPerformed(); } }); regexDeleteButton = new JButton("Delete"); regexDeleteButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { regexDeleteButtonActionPerformed(); } }); regexDeleteButton.setEnabled(false); stringReplacementPanel = new JPanel(new MigLayout("novisualpadding, hidemode 3, insets 0")); stringReplacementPanel.setBackground(UIConstants.BACKGROUND_COLOR); stringReplacementPanel.setBorder(BorderFactory.createTitledBorder("String Replacement")); stringReplacementLabel = new JLabel(); stringReplacementLabel.setText( "<html>Replace strings on the matched data before storing. Do not use regular expressions in these fields or surround with quotes.<br>\nExample: Use <b>\\\\X0D0A\\\\</b> and <b>\\r\\n</b> to replace \\X0D0A\\ with actual CRLF characters. </html>"); inboundReplacementTable = new MirthTable(); inboundScrollPane = new JScrollPane(); inboundScrollPane.setViewportView(inboundReplacementTable); outboundReplacementTable = new MirthTable(); outboundScrollPane = new JScrollPane(); outboundScrollPane.setViewportView(outboundReplacementTable); inboundButtonPanel = new JPanel(new MigLayout("novisualpadding, hidemode 3, insets 0", "", "")); inboundButtonPanel.setBackground(UIConstants.BACKGROUND_COLOR); inboundNewButton = new JButton("New"); inboundNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { inboundNewButtonActionPerformed(evt); } }); inboundDeleteButton = new JButton("Delete"); inboundDeleteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { inboundDeleteButtonActionPerformed(evt); } }); outboundButtonPanel = new JPanel(new MigLayout("novisualpadding, hidemode 3, insets 0", "", "")); outboundButtonPanel.setBackground(UIConstants.BACKGROUND_COLOR); outboundNewButton = new JButton("New"); outboundNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { outboundNewButtonActionPerformed(evt); } }); outboundDeleteButton = new JButton("Delete"); outboundDeleteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { outboundDeleteButtonActionPerformed(evt); } }); separator = new JSeparator(); closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { closeButtonActionPerformed(evt); } }); }
From source file:com.mirth.connect.client.ui.NotificationDialog.java
private void initLayout() { headerListPanel.add(newNotificationsLabel, "alignx left"); headerListPanel.add(archiveAll, "alignx right"); headerContentPanel.add(notificationNameTextField, "alignx left, growx, push"); headerContentPanel.add(archiveLabel, "alignx right"); notificationPanel.add(headerListPanel, "grow"); notificationPanel.add(headerContentPanel, "wrap, grow"); notificationPanel.add(listScrollPane, "grow"); notificationPanel.add(contentScrollPane, "grow"); add(notificationPanel, "grow, push, span"); add(new JSeparator(), "grow, gaptop 4, span"); add(notificationCheckBox, "alignx left"); add(closeButton, "alignx right, width 60, spany 2"); }
From source file:org.esa.beam.visat.toolviews.stat.DensityPlotPanel.java
private JPanel createOptionsPanel() { toggleColorCheckBox = new JCheckBox("Invert plot colors"); toggleColorCheckBox.addActionListener(new ActionListener() { @Override/*from www. j a va2s. co m*/ public void actionPerformed(ActionEvent e) { toggleColor(); } }); toggleColorCheckBox.setEnabled(false); final JPanel optionsPanel = GridBagUtils.createPanel(); final GridBagConstraints gbc = GridBagUtils .createConstraints("anchor=NORTHWEST,fill=HORIZONTAL,insets.top=0,weightx=1,gridx=0"); GridBagUtils.addToPanel(optionsPanel, axisRangeControls[X_VAR].getPanel(), gbc, "gridy=0"); GridBagUtils.addToPanel(optionsPanel, xBandList, gbc, "gridy=1,insets.left=4,insets.right=2"); GridBagUtils.addToPanel(optionsPanel, axisRangeControls[Y_VAR].getPanel(), gbc, "gridy=2,insets.left=0,insets.right=0"); GridBagUtils.addToPanel(optionsPanel, yBandList, gbc, "gridy=3,insets.left=4,insets.right=2"); GridBagUtils.addToPanel(optionsPanel, new JPanel(), gbc, "gridy=4"); GridBagUtils.addToPanel(optionsPanel, new JSeparator(), gbc, "gridy=5,insets.left=4,insets.right=2"); GridBagUtils.addToPanel(optionsPanel, toggleColorCheckBox, gbc, "gridy=6,insets.left=0,insets.right=0"); return optionsPanel; }
From source file:grisu.frontend.view.swing.jobmonitoring.single.appSpecific.Gold.java
private JSeparator getSeparator() { if (separator == null) { separator = new JSeparator(); } return separator; }
From source file:grisu.frontend.view.swing.jobmonitoring.single.appSpecific.Gold.java
private JSeparator getSeparator_1() { if (separator_1 == null) { separator_1 = new JSeparator(); } return separator_1; }
From source file:gmgen.GMGenSystem.java
private void createToolsMenu() { toolsMenu = new JMenu(); toolsSeparator1 = new JSeparator(); versionToolsItem = new JMenuItem(); CommonMenuText.name(toolsMenu, PCGenActionMap.MNU_TOOLS); toolsMenu.addMenuListener(this); CommonMenuText.name(versionToolsItem, "mnuGetNew"); //$NON-NLS-1$ toolsMenu.add(versionToolsItem);//from w ww . j a v a 2 s.c o m toolsMenu.add(toolsSeparator1); systemMenuBar.add(toolsMenu); }
From source file:com.mirth.connect.client.ui.LibraryResourcesDialog.java
private void initComponents(Channel channel) { setLayout(new MigLayout("insets 12, novisualpadding, hidemode 3, fill", "", "[][]8[]8[]")); setBackground(UIConstants.BACKGROUND_COLOR); getContentPane().setBackground(getBackground()); AbstractMutableTreeTableNode channelNode = new DefaultMutableTreeTableNode( new ConnectorEntry("Channel", -1, null)); AbstractMutableTreeTableNode channelScriptsNode = new DefaultMutableTreeTableNode( new ConnectorEntry("Channel Scripts", null, null)); channelScriptsNode//from w w w. jav a 2 s . c o m .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Deploy Script", null, null, false))); channelScriptsNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Undeploy Script", null, null, false))); channelScriptsNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Preprocessor Script", null, null, false))); channelScriptsNode.add( new DefaultMutableTreeTableNode(new ConnectorEntry("Postprocessor Script", null, null, false))); channelScriptsNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Attachment Script", null, null, false))); channelScriptsNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Batch Script", null, null, false))); channelNode.add(channelScriptsNode); AbstractMutableTreeTableNode sourceConnectorNode = new DefaultMutableTreeTableNode( new ConnectorEntry("Source Connector", 0, channel.getSourceConnector().getTransportName())); sourceConnectorNode.add(new DefaultMutableTreeTableNode( new ConnectorEntry("Receiver", channel.getSourceConnector().getMetaDataId(), channel.getSourceConnector().getTransportName(), false))); sourceConnectorNode.add(new DefaultMutableTreeTableNode( new ConnectorEntry("Filter / Transformer Script", channel.getSourceConnector().getMetaDataId(), channel.getSourceConnector().getTransportName(), false))); channelNode.add(sourceConnectorNode); for (Connector destinationConnector : channel.getDestinationConnectors()) { AbstractMutableTreeTableNode destinationConnectorNode = new DefaultMutableTreeTableNode( new ConnectorEntry(destinationConnector.getName(), destinationConnector.getMetaDataId(), destinationConnector.getTransportName())); destinationConnectorNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Filter / Transformer Script", destinationConnector.getMetaDataId(), destinationConnector.getTransportName(), false))); destinationConnectorNode.add(new DefaultMutableTreeTableNode(new ConnectorEntry("Dispatcher", destinationConnector.getMetaDataId(), destinationConnector.getTransportName(), false))); destinationConnectorNode .add(new DefaultMutableTreeTableNode(new ConnectorEntry("Response Transformer Script", destinationConnector.getMetaDataId(), destinationConnector.getTransportName(), false))); channelNode.add(destinationConnectorNode); } treeTable = new MirthTreeTable(); DefaultTreeTableModel model = new SortableTreeTableModel(channelNode); model.setColumnIdentifiers(Arrays.asList(new String[] { "Library Context" })); treeTable.setTreeTableModel(model); treeTable.setRootVisible(true); treeTable.setDragEnabled(false); treeTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); treeTable.getTreeSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); treeTable.setRowHeight(UIConstants.ROW_HEIGHT); treeTable.setFocusable(true); treeTable.setOpaque(true); treeTable.getTableHeader().setReorderingAllowed(false); treeTable.setEditable(false); treeTable.setSortable(false); treeTable.addTreeSelectionListener(this); treeTable.getSelectionModel().addListSelectionListener(this); treeTable.putClientProperty("JTree.lineStyle", "Horizontal"); treeTable.setShowGrid(true, true); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { treeTable.setHighlighters(HighlighterFactory.createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } final String toolTipText = "<html>Select which context(s) to include library resources in.<br/>Libraries can be included everywhere (the Channel node),<br/>on channel-level scripts (the Channel Scripts node), and<br/>on specific source or destination connectors.</html>"; treeTable.setTreeCellRenderer(new DefaultTreeCellRenderer() { @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); setToolTipText(toolTipText); setEnabled(((ConnectorEntry) ((AbstractMutableTreeTableNode) value).getUserObject()).enabled); return this; } }); treeTable.setOpenIcon(null); treeTable.setClosedIcon(null); treeTable.setLeafIcon(null); treeTable.getColumnExt(0).setToolTipText(toolTipText); add(new JScrollPane(treeTable), "grow, h 60%"); resourceTable = new MirthTable(); resourceTable.setModel(new RefreshTableModel(new Object[] { "", "Name", "Type" }, 0) { @Override public boolean isCellEditable(int row, int column) { return column == SELECTED_COLUMN; } }); resourceTable.setDragEnabled(false); resourceTable.setRowSelectionAllowed(false); resourceTable.setRowHeight(UIConstants.ROW_HEIGHT); resourceTable.setFocusable(false); resourceTable.setOpaque(true); resourceTable.getTableHeader().setReorderingAllowed(false); resourceTable.setEditable(true); resourceTable.setSortable(false); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { resourceTable.setHighlighters(HighlighterFactory.createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } resourceTable.getColumnModel().getColumn(SELECTED_COLUMN).setMinWidth(20); resourceTable.getColumnModel().getColumn(SELECTED_COLUMN).setMaxWidth(20); resourceTable.getColumnModel().getColumn(SELECTED_COLUMN).setCellRenderer(new CheckBoxRenderer()); resourceTable.getColumnModel().getColumn(SELECTED_COLUMN).setCellEditor(new CheckBoxEditor()); resourceTable.getColumnModel().getColumn(TYPE_COLUMN).setMinWidth(75); resourceTable.getColumnModel().getColumn(TYPE_COLUMN).setMaxWidth(200); add(new JScrollPane(resourceTable), "newline, grow, h 40%"); add(new JSeparator(), "newline, grow"); JPanel buttonPanel = new JPanel(new MigLayout("insets 0, novisualpadding, hidemode 3")); buttonPanel.setBackground(getBackground()); okButton = new JButton("OK"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { okButtonActionPerformed(); } }); buttonPanel.add(okButton, "w 48!"); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cancelButtonActionPerformed(); } }); buttonPanel.add(cancelButton, "w 48!"); add(buttonPanel, "newline, right"); }