List of usage examples for javax.swing BoxLayout Y_AXIS
int Y_AXIS
To view the source code for javax.swing BoxLayout Y_AXIS.
Click Source Link
From source file:net.sf.maltcms.chromaui.normalization.spi.actions.OpenPeakGroupBoxPlot.java
@Override public void actionPerformed(ActionEvent ev) { IChromAUIProject project = Utilities.actionsGlobalContext().lookup(IChromAUIProject.class); if (project != null && !context.isEmpty()) { IPeakNormalizer normalizer = NormalizationDialog .getPeakNormalizer(context.get(0).getPeakGroupContainer()); if (normalizer == null) { return; }/*from ww w. j av a 2 s . com*/ PeakGroupBoxPlotTopComponent pgbpt = new PeakGroupBoxPlotTopComponent(); PeakGroupBoxPlot pgbp = new PeakGroupBoxPlot(project, context, normalizer); JPanel bg = new JPanel(); BoxLayout bl = new BoxLayout(bg, BoxLayout.Y_AXIS); bg.setLayout(bl); for (JFreeChart chart : pgbp.createChart()) { ChartPanel cp = new ContextAwareChartPanel(chart); bg.add(cp); } JScrollPane jsp = new JScrollPane(bg); pgbpt.add(jsp, BorderLayout.CENTER); IRegistry registry = Lookup.getDefault().lookup(IRegistryFactory.class).getDefault(); for (IPeakGroupDescriptor pgd : context) { registry.registerTopComponentFor(pgd, pgbpt); } pgbpt.open(); pgbpt.requestActive(); } else { Logger.getLogger(getClass().getName()).warning("No IChromAUI project is in lookup!"); } }
From source file:com.mindcognition.mindraider.ui.swing.concept.annotation.renderer.AbstractTextAnnotationRenderer.java
protected void init(AnnotationToHtmlTransformer editorToViewerTransfomer, KeyListener editorKeyListener, KeyListener viewerKeyListener, FocusListener editorFocusListener, FocusListener viewerFocusListener, MouseListener editorMouseListener, MouseListener viewerMouseListener, TextAnnotationToolbar toolbar) { this.editorToViewerTransfomer = editorToViewerTransfomer; this.toolbar = toolbar; setLayout(new BorderLayout()); JPanel editorViewerPanel = new JPanel(); editorViewerPanel.setLayout(new BoxLayout(editorViewerPanel, BoxLayout.Y_AXIS)); // editor/*from w w w . j a v a2s . c o m*/ editor = new JTextArea(30, 100); configureEditor(editor); editor.addKeyListener(editorKeyListener); editor.addFocusListener(editorFocusListener); editor.addMouseListener(editorMouseListener); // TODO bundle editorScroll = encapsulateToScroll(editor, " Editor "); editorViewerPanel.add(editorScroll); editorScroll.setVisible(false); // view viewer = new JTextPane(); configureViewer(viewer); viewer.addKeyListener(viewerKeyListener); viewer.addFocusListener(viewerFocusListener); viewer.addMouseListener(viewerMouseListener); // TODO bundle viewerScroll = encapsulateToScroll(viewer, " Viewer "); editorViewerPanel.add(viewerScroll); add(editorViewerPanel, BorderLayout.CENTER); // toolbar if (toolbar != null) { add(toolbar, BorderLayout.SOUTH); } // let the container to redraw its content (hide/show) validate(); }
From source file:net.pandoragames.far.ui.swing.RenameFilesPanel.java
private void init(SwingConfig config, ComponentRepository componentRepository) { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setBorder( BorderFactory.createEmptyBorder(0, SwingConfig.PADDING, SwingConfig.PADDING, SwingConfig.PADDING)); this.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING))); JLabel patternLabel = new JLabel(localizer.localize("label.find-pattern")); this.add(patternLabel); filenamePattern = new JTextField(); filenamePattern.setPreferredSize(//from ww w. ja v a2 s . co m new Dimension(SwingConfig.COMPONENT_WIDTH_LARGE, config.getStandardComponentHight())); filenamePattern .setMaximumSize(new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, config.getStandardComponentHight())); filenamePattern.setAlignmentX(Component.LEFT_ALIGNMENT); UndoHistory findUndoManager = new UndoHistory(); findUndoManager.registerUndoHistory(filenamePattern); findUndoManager.registerSnapshotHistory(filenamePattern); componentRepository.getReplaceCommand().addResetable(findUndoManager); filenamePattern.getDocument().addDocumentListener(new DocumentChangeListener() { public void documentUpdated(DocumentEvent e, String text) { dataModel.setPatternString(text); updateFileTable(); } }); componentRepository.getResetDispatcher().addToBeCleared(filenamePattern); this.add(filenamePattern); JCheckBox caseBox = new JCheckBox(localizer.localize("label.ignore-case")); caseBox.setSelected(true); caseBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent event) { dataModel.setIgnoreCase((ItemEvent.SELECTED == event.getStateChange())); updateFileTable(); } }); this.add(caseBox); JCheckBox regexBox = new JCheckBox(localizer.localize("label.regular-expression")); regexBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent event) { dataModel.setRegexPattern((ItemEvent.SELECTED == event.getStateChange())); updateFileTable(); } }); this.add(regexBox); JPanel extensionPanel = new JPanel(); extensionPanel.setBorder(BorderFactory.createTitledBorder(localizer.localize("label.modify-extension"))); extensionPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); extensionPanel.setAlignmentX(Component.LEFT_ALIGNMENT); extensionPanel.setPreferredSize(new Dimension(SwingConfig.COMPONENT_WIDTH_LARGE, 60)); extensionPanel.setMaximumSize(new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, 100)); ButtonGroup extensionGroup = new ButtonGroup(); JRadioButton protectButton = new JRadioButton(localizer.localize("label.protect-extension")); protectButton.setSelected(true); protectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { dataModel.setProtectExtension(true); updateFileTable(); } }); extensionGroup.add(protectButton); extensionPanel.add(protectButton); JRadioButton includeButton = new JRadioButton(localizer.localize("label.include-extension")); includeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { dataModel.setExtensionOnly(false); dataModel.setProtectExtension(false); updateFileTable(); } }); extensionGroup.add(includeButton); extensionPanel.add(includeButton); JRadioButton onlyButton = new JRadioButton(localizer.localize("label.only-extension")); onlyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { dataModel.setExtensionOnly(true); updateFileTable(); } }); extensionGroup.add(onlyButton); extensionPanel.add(onlyButton); this.add(extensionPanel); this.add(Box.createVerticalGlue()); this.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING))); // replace JLabel replaceLabel = new JLabel(localizer.localize("label.replacement-pattern")); this.add(replaceLabel); replacePattern = new JTextField(); replacePattern.setPreferredSize( new Dimension(SwingConfig.COMPONENT_WIDTH_LARGE, config.getStandardComponentHight())); replacePattern .setMaximumSize(new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, config.getStandardComponentHight())); replacePattern.setAlignmentX(Component.LEFT_ALIGNMENT); UndoHistory undoManager = new UndoHistory(); undoManager.registerUndoHistory(replacePattern); undoManager.registerSnapshotHistory(replacePattern); componentRepository.getReplaceCommand().addResetable(undoManager); replacePattern.getDocument().addDocumentListener(new DocumentChangeListener() { public void documentUpdated(DocumentEvent e, String text) { dataModel.setReplacementString(text); updateFileTable(); } }); componentRepository.getResetDispatcher().addToBeCleared(replacePattern); this.add(replacePattern); // treat case JPanel modifyCasePanel = new JPanel(); modifyCasePanel.setBorder(BorderFactory.createTitledBorder(localizer.localize("label.modify-case"))); modifyCasePanel.setLayout(new BoxLayout(modifyCasePanel, BoxLayout.Y_AXIS)); modifyCasePanel.setAlignmentX(Component.LEFT_ALIGNMENT); modifyCasePanel.setPreferredSize(new Dimension(SwingConfig.COMPONENT_WIDTH_LARGE, 100)); modifyCasePanel.setMaximumSize(new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, 200)); ButtonGroup modifyCaseGroup = new ButtonGroup(); ActionListener radioButtonListener = new ActionListener() { public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); dataModel.setTreatCase(RenameForm.CASEHANDLING.valueOf(cmd)); updateFileTable(); } }; JRadioButton lowerButton = new JRadioButton(localizer.localize("label.to-lower-case")); lowerButton.setActionCommand(RenameForm.CASEHANDLING.LOWER.name()); lowerButton.addActionListener(radioButtonListener); modifyCaseGroup.add(lowerButton); modifyCasePanel.add(lowerButton); JRadioButton upperButton = new JRadioButton(localizer.localize("label.to-upper-case")); upperButton.setActionCommand(RenameForm.CASEHANDLING.UPPER.name()); upperButton.addActionListener(radioButtonListener); modifyCaseGroup.add(upperButton); modifyCasePanel.add(upperButton); JRadioButton keepButton = new JRadioButton(localizer.localize("label.preserve-case")); keepButton.setActionCommand(RenameForm.CASEHANDLING.PRESERVE.name()); keepButton.setSelected(true); keepButton.addActionListener(radioButtonListener); modifyCaseGroup.add(keepButton); modifyCasePanel.add(keepButton); this.add(modifyCasePanel); // prevent case conflict JCheckBox caseConflictBox = new JCheckBox(localizer.localize("label.prevent-case-conflict")); caseConflictBox.setAlignmentX(Component.LEFT_ALIGNMENT); caseConflictBox.setSelected(true); caseConflictBox.setEnabled(!SwingConfig.isWindows()); // disabled on windows caseConflictBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent event) { dataModel.setPreventCaseConflict((ItemEvent.SELECTED == event.getStateChange())); updateFileTable(); } }); this.add(caseConflictBox); this.add(Box.createVerticalGlue()); }
From source file:es.emergya.ui.plugins.forms.FormGeneric.java
public void generatePanel() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); setBackground(Color.WHITE);//w w w . j ava 2 s. c o m generateTitle(); add(title); generateMiddle(); add(mid); generateButtons(); add(buttons); }
From source file:es.emergya.ui.gis.popups.SummaryDialog.java
public SummaryDialog(Recurso r) { super();//from w w w . ja v a 2 s . c o m r = (r == null) ? null : RecursoConsultas.getByIdentificador(r.getIdentificador()); setAlwaysOnTop(true); setResizable(false); setName(r.getIdentificador()); setBackground(Color.WHITE); setSize(600, 400); setTitle(i18n.getString("Resources.summary.titleWindow") + " " + r.getIdentificador()); try { setIconImage(((BasicWindow) GoClassLoader.getGoClassLoader().load(BasicWindow.class)).getFrame() .getIconImage()); } catch (Throwable e) { LOG.error("There is no icon image", e); } JPanel base = new JPanel(); base.setLayout(new BoxLayout(base, BoxLayout.Y_AXIS)); base.setBackground(Color.WHITE); r = RecursoConsultas.getByIdentificador(r.getIdentificador()); // Icono del titulo JPanel title = new JPanel(new FlowLayout(FlowLayout.LEADING)); final JLabel labelTitle = new JLabel(i18n.getString("Resources.summary.title") + " " + r.getIdentificador(), LogicConstants.getIcon("tittleficha_icon_recurso"), JLabel.LEFT); labelTitle.setFont(LogicConstants.deriveBoldFont(12f)); title.setBackground(Color.WHITE); title.add(labelTitle); base.add(title); // Nombre JPanel mid = new JPanel(new SpringLayout()); mid.setBackground(Color.WHITE); mid.add(new JLabel(i18n.getString("Resources.name"), JLabel.RIGHT)); JTextField name = new JTextField(25); if (r != null) name.setText(r.getIdentificador()); name.setEditable(false); mid.add(name); // Patrulla mid.add(new JLabel(i18n.getString("Resources.squad"), JLabel.RIGHT)); // JComboBox squads = new // JComboBox(PatrullaConsultas.getAll().toArray()); JTextField squads = new JTextField(r.getPatrullas() == null ? null : r.getPatrullas().getNombre()); // squads.setSelectedItem(r.getPatrullas()); squads.setEditable(false); squads.setColumns(21); // squads.setEnabled(false); mid.add(squads); // Tipo mid.add(new JLabel(i18n.getString("Resources.type"), JLabel.RIGHT)); JTextField types = new JTextField(r.getTipo()); types.setEditable(false); mid.add(types); // Estado Eurocop mid.add(new JLabel(i18n.getString("Resources.status"), JLabel.RIGHT)); JTextField status = new JTextField(); if (r.getEstadoEurocop() != null) status.setText(r.getEstadoEurocop().getIdentificador()); status.setEditable(false); mid.add(status); // Subflota mid.add(new JLabel(i18n.getString("Resources.subfleet"), JLabel.RIGHT)); JTextField subfleets = new JTextField(r.getFlotas() == null ? null : r.getFlotas().getNombre()); subfleets.setEditable(false); mid.add(subfleets); // Referencia Humana mid.add(new JLabel(i18n.getString("Resources.incidences"), JLabel.RIGHT)); JTextField rHumana = new JTextField(); // if (r.getIncidencias() != null) // rHumana.setText(r.getIncidencias().getReferenciaHumana()); rHumana.setEditable(false); mid.add(rHumana); // dispositivo mid.add(new JLabel(i18n.getString("Resources.device"), JLabel.RIGHT)); JTextField issi = new JTextField(); issi.setEditable(false); mid.add(issi); mid.add(new JLabel(i18n.getString("Resources.enabled"), JLabel.RIGHT)); JCheckBox enabled = new JCheckBox("", true); enabled.setEnabled(false); enabled.setOpaque(false); if (r.getDispositivo() != null) { final String valueOf = String.valueOf(r.getDispositivo()); try { issi.setText(String.format(FORMAT, r.getDispositivo())); } catch (Throwable t) { issi.setText(valueOf); } enabled.setSelected(r.getHabilitado()); } mid.add(enabled); // Fecha ultimo gps mid.add(new JLabel(i18n.getString("Resources.lastPosition"), JLabel.RIGHT)); JTextField lastGPS = new JTextField(); final Date lastGPSDateForRecurso = HistoricoGPSConsultas.lastGPSDateForRecurso(r); if (lastGPSDateForRecurso != null) { lastGPS.setText(SimpleDateFormat.getDateTimeInstance().format(lastGPSDateForRecurso)); } lastGPS.setEditable(false); mid.add(lastGPS); // Espacio en blanco mid.add(Box.createHorizontalGlue()); mid.add(Box.createHorizontalGlue()); // Espacio en blanco mid.add(Box.createHorizontalGlue()); mid.add(Box.createHorizontalGlue()); SpringUtilities.makeCompactGrid(mid, 5, 4, 6, 6, 6, 18); base.add(mid); // informacion adicional JPanel infoPanel = new JPanel(new SpringLayout()); JTextField info = new JTextField(25); info.setText(r.getInfoAdicional()); info.setEditable(false); infoPanel.setOpaque(false); infoPanel.add(new JLabel(i18n.getString("Resources.info"))); infoPanel.add(info); SpringUtilities.makeCompactGrid(infoPanel, 1, 2, 6, 6, 6, 18); base.add(infoPanel); JPanel buttons = new JPanel(); buttons.setBackground(Color.WHITE); JButton accept = new JButton(i18n.getString("Buttons.ok"), LogicConstants.getIcon("button_accept")); accept.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dispose(); } }); buttons.add(accept); base.add(buttons); getContentPane().add(base); pack(); int x; int y; Container myParent; try { myParent = ((BasicWindow) GoClassLoader.getGoClassLoader().load(BasicWindow.class)).getFrame() .getContentPane(); java.awt.Point topLeft = myParent.getLocationOnScreen(); Dimension parentSize = myParent.getSize(); Dimension mySize = getSize(); if (parentSize.width > mySize.width) x = ((parentSize.width - mySize.width) / 2) + topLeft.x; else x = topLeft.x; if (parentSize.height > mySize.height) y = ((parentSize.height - mySize.height) / 2) + topLeft.y; else y = topLeft.y; setLocation(x, y); } catch (Throwable e1) { LOG.error("There is no basic window!", e1); } }
From source file:gda.util.userOptions.UserOptionsDialog.java
@SuppressWarnings("rawtypes") private JPanel makePane() { JPanel pane = new JPanel(); pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); Iterator<Map.Entry<String, UserOption>> iter = options.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<String, UserOption> entry = iter.next(); UserOption option = entry.getValue(); if (option.defaultValue instanceof Boolean && option.description instanceof String) { JCheckBox box = new JCheckBox((String) option.description); box.setSelected((Boolean) option.value); box.setAlignmentX(Component.LEFT_ALIGNMENT); box.setAlignmentY(Component.LEFT_ALIGNMENT); components.put(entry.getKey(), box); pane.add(box);/*from ww w. j a v a 2s .c o m*/ } } return pane; }
From source file:SimpleSoundCapture.java
public SimpleSoundCapture() { setLayout(new BorderLayout()); EmptyBorder eb = new EmptyBorder(5, 5, 5, 5); SoftBevelBorder sbb = new SoftBevelBorder(SoftBevelBorder.LOWERED); setBorder(new EmptyBorder(5, 5, 5, 5)); JPanel p1 = new JPanel(); p1.setLayout(new BoxLayout(p1, BoxLayout.X_AXIS)); JPanel p2 = new JPanel(); p2.setBorder(sbb);/*from w w w. j av a 2 s.c om*/ p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS)); JPanel buttonsPanel = new JPanel(); buttonsPanel.setBorder(new EmptyBorder(10, 0, 5, 0)); playB = addButton("Play", buttonsPanel, false); captB = addButton("Record", buttonsPanel, true); p2.add(buttonsPanel); p1.add(p2); add(p1); }
From source file:BRHInit.java
public void showLoginPrompt() { if (login_window == null) { login_window = new JFrame("BRH Console"); login_window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel top_panel = new JPanel(); login_window.getContentPane().add(top_panel); top_panel.setLayout(new BoxLayout(top_panel, BoxLayout.Y_AXIS)); top_panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JPanel p = new JPanel(); top_panel.add(p);//from w w w .j a v a 2s. co m p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); JPanel col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(new JLabel("email")); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(new JLabel("password")); p.add(Box.createRigidArea(new Dimension(5, 0))); col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(email = new JTextField(20)); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(password = new JPasswordField()); if (email_arg != null) email.setText(email_arg); if (password_arg != null) password.setText(password_arg); top_panel.add(Box.createRigidArea(new Dimension(0, 10))); p = new JPanel(); top_panel.add(p); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(Box.createHorizontalGlue()); p.add(login_ok = new JButton("OK")); p.add(Box.createRigidArea(new Dimension(5, 0))); p.add(login_cancel = new JButton("Cancel")); p.add(Box.createHorizontalGlue()); login_ok.addActionListener(this); login_cancel.addActionListener(this); login_window.pack(); } cookie = null; login_window.setVisible(true); }
From source file:com.apatar.webdav.ui.JWebDavTreeModePanel.java
private void createPanel() { setLayout(new BorderLayout(5, 5)); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); add(panel, BorderLayout.CENTER); title = new JLabel(""); panel.add(title);// w w w. ja v a 2 s .co m labelPath = new JLabel(WORD_PATH); panel.add(labelPath); panel.add(getFoldersPanel()); }
From source file:org.nees.rpi.vis.ui.XYChartPanelProxy.java
public XYChartPanelProxy(int width, int height) { selectionGroup = new SelectionGroup(); selectionGroup.setSelection(true);/*from ww w .j a v a 2 s . c o m*/ dataSet = new XYSeriesCollection(); chart = ChartFactory.createXYLineChart(null, domainAxisLabel, rangeAxisLabel, dataSet, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(Color.WHITE); chart.getLegend().setPosition(RectangleEdge.RIGHT); chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(width, height)); chartPanel.setFillZoomRectangle(true); chartPanel.setHorizontalAxisTrace(true); chartPanel.setVerticalAxisTrace(true); toolPanel = new JPanel(); toolPanel.setOpaque(false); toolPanel.setLayout(new BoxLayout(toolPanel, BoxLayout.Y_AXIS)); toolPanel.setBorder(BorderFactory.createTitledBorder("Plot Control")); toolPanel.setPreferredSize(new Dimension(155, 100)); chartAreaPanel = new JPanel(); chartAreaPanel.setOpaque(true); chartAreaPanel.setBackground(Color.white); chartAreaPanel.setLayout(new BorderLayout()); chartAreaPanel.add(chartPanel, BorderLayout.CENTER); chartAreaPanel.add(toolPanel, BorderLayout.WEST); initClearSelectionButton(toolPanel); initResetPlotButton(toolPanel); initSaveToImageButton(toolPanel); initShowAsProfilePlotButton(toolPanel); }