List of usage examples for java.awt BorderLayout WEST
String WEST
To view the source code for java.awt BorderLayout WEST.
Click Source Link
From source file:op.controlling.PnlControlling.java
private JPanel createContentPanel4Hygiene() { JPanel pnlContent = new JPanel(new VerticalLayout()); JPanel pnlPrevalence = new JPanel(new BorderLayout()); final JButton btnPrevalence = GUITools.createHyperlinkButton("opde.controlling.hygiene.prevalence", null, null);/*from w ww . j a v a2 s . c o m*/ final JDateChooser jdc = new JDateChooser(new Date()); final JCheckBox cbAnonymous = new JCheckBox(SYSTools.xx("misc.msg.anon")); cbAnonymous.setSelected(true); jdc.setMaxSelectableDate(new Date()); btnPrevalence.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OPDE.getMainframe().setBlocked(true); SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { MREPrevalenceSheets mre = new MREPrevalenceSheets(new LocalDate(), cbAnonymous.isSelected(), progressClosure); return mre.createSheet(); } @Override protected void done() { try { File source = (File) get(); Object[] options = { SYSTools.xx("prevalence.optiondialog.option1"), SYSTools.xx("prevalence.optiondialog.option2"), SYSTools.xx("opde.wizards.buttontext.cancel") }; int n = JOptionPane.showOptionDialog(OPDE.getMainframe(), SYSTools.xx("prevalence.optiondialog.question"), SYSTools.xx("prevalence.optiondialog.title"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]); File copyTargetDirectory = null; if (n == 1) { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("title"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setMultiSelectionEnabled(false); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(pnlPrevalence) == JFileChooser.APPROVE_OPTION) { copyTargetDirectory = chooser.getSelectedFile(); } } if (copyTargetDirectory != null) { FileUtils.copyFile(source, copyTargetDirectory); } else { if (n == 0) { SYSFilesTools.handleFile((File) get(), Desktop.Action.OPEN); } } } catch (Exception e) { OPDE.fatal(e); } OPDE.getDisplayManager().setProgressBarMessage(null); OPDE.getMainframe().setBlocked(false); } }; worker.execute(); } }); pnlPrevalence.add(btnPrevalence, BorderLayout.WEST); JPanel optionPanel = new JPanel(); optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.LINE_AXIS)); optionPanel.add(cbAnonymous); optionPanel.add(jdc); pnlPrevalence.add(optionPanel, BorderLayout.EAST); pnlContent.add(pnlPrevalence); return pnlContent; }
From source file:com.employee.scheduler.common.swingui.SolverAndPersistenceFrame.java
private JPanel createScorePanel() { JPanel scorePanel = new JPanel(new BorderLayout()); scorePanel.setBorder(BorderFactory.createEtchedBorder()); showConstraintMatchesDialogAction = new ShowConstraintMatchesDialogAction(); showConstraintMatchesDialogAction.setEnabled(false); scorePanel.add(new JButton(showConstraintMatchesDialogAction), BorderLayout.WEST); scoreField = new JTextField("Score:"); scoreField.setEditable(false);// w w w. j av a 2 s. c om scoreField.setForeground(Color.BLACK); scoreField.setBorder(BorderFactory.createLoweredBevelBorder()); scorePanel.add(scoreField, BorderLayout.CENTER); refreshScreenDuringSolvingCheckBox = new JCheckBox("Refresh screen during solving", solutionPanel.isRefreshScreenDuringSolving()); scorePanel.add(refreshScreenDuringSolvingCheckBox, BorderLayout.EAST); return scorePanel; }
From source file:sim.graph.MyPluggableRendererDemo.java
/** * @param jp panel to which controls will be added *//*from w w w . jav a 2 s .co m*/ protected void addBottomControls(/*final JPanel jp*/) { /*final JPanel*/ control_panel = new JPanel(); // jp.add(control_panel, BorderLayout.SOUTH); // control_panel.setLayout(new BorderLayout()); control_panel.setLayout(new FlowLayout()); final Box vertex_panel = Box.createVerticalBox(); vertex_panel.setBorder(BorderFactory.createTitledBorder("Vertices")); final Box edge_panel = Box.createVerticalBox(); edge_panel.setBorder(BorderFactory.createTitledBorder("Edges")); final Box both_panel = Box.createVerticalBox(); control_panel.add(vertex_panel, BorderLayout.WEST); control_panel.add(edge_panel, BorderLayout.EAST); control_panel.add(both_panel, BorderLayout.CENTER); // set up vertex controls v_color = new JCheckBox("dimer coloring"); v_color.addActionListener(this); v_stroke = new JCheckBox("<html>vertex selection<p>stroke highlighting</html>"); v_stroke.addActionListener(this); v_labels = new JCheckBox("show vertex ranks (voltages)"); v_labels.addActionListener(this); v_shape = new JCheckBox("vertex degree shapes"); v_shape.addActionListener(this); v_size = new JCheckBox("vertex voltage size"); v_size.addActionListener(this); v_size.setSelected(true); v_aspect = new JCheckBox("vertex degree ratio stretch"); v_aspect.addActionListener(this); v_small = new JCheckBox("filter vertices of degree < " + VertexDisplayPredicate.MIN_DEGREE); v_small.addActionListener(this); vertex_panel.add(v_color); vertex_panel.add(v_stroke); vertex_panel.add(v_labels); vertex_panel.add(v_shape); vertex_panel.add(v_size); vertex_panel.add(v_aspect); vertex_panel.add(v_small); // set up edge controls JPanel gradient_panel = new JPanel(new GridLayout(1, 0)); gradient_panel.setBorder(BorderFactory.createTitledBorder("Edge paint")); no_gradient = new JRadioButton("Solid color"); no_gradient.addActionListener(this); no_gradient.setSelected(true); // gradient_absolute = new JRadioButton("Absolute gradient"); // gradient_absolute.addActionListener(this); gradient_relative = new JRadioButton("Gradient"); gradient_relative.addActionListener(this); ButtonGroup bg_grad = new ButtonGroup(); bg_grad.add(no_gradient); bg_grad.add(gradient_relative); //bg_grad.add(gradient_absolute); gradient_panel.add(no_gradient); //gradientGrid.add(gradient_absolute); gradient_panel.add(gradient_relative); JPanel shape_panel = new JPanel(new GridLayout(3, 2)); shape_panel.setBorder(BorderFactory.createTitledBorder("Edge shape")); e_line = new JRadioButton("line"); e_line.addActionListener(this); e_line.setSelected(true); // e_bent = new JRadioButton("bent line"); // e_bent.addActionListener(this); e_wedge = new JRadioButton("wedge"); e_wedge.addActionListener(this); e_quad = new JRadioButton("quad curve"); e_quad.addActionListener(this); e_cubic = new JRadioButton("cubic curve"); e_cubic.addActionListener(this); ButtonGroup bg_shape = new ButtonGroup(); bg_shape.add(e_line); // bg.add(e_bent); bg_shape.add(e_wedge); bg_shape.add(e_quad); bg_shape.add(e_cubic); shape_panel.add(e_line); // shape_panel.add(e_bent); shape_panel.add(e_wedge); shape_panel.add(e_quad); shape_panel.add(e_cubic); fill_edges = new JCheckBox("fill edge shapes"); fill_edges.setSelected(false); fill_edges.addActionListener(this); shape_panel.add(fill_edges); shape_panel.setOpaque(true); e_color = new JCheckBox("edge weight highlighting"); e_color.addActionListener(this); e_labels = new JCheckBox("show edge weights"); e_labels.addActionListener(this); e_uarrow_pred = new JCheckBox("undirected"); e_uarrow_pred.addActionListener(this); e_darrow_pred = new JCheckBox("directed"); e_darrow_pred.addActionListener(this); e_darrow_pred.setSelected(true); JPanel arrow_panel = new JPanel(new GridLayout(1, 0)); arrow_panel.setBorder(BorderFactory.createTitledBorder("Show arrows")); arrow_panel.add(e_uarrow_pred); arrow_panel.add(e_darrow_pred); e_show_d = new JCheckBox("directed"); e_show_d.addActionListener(this); e_show_d.setSelected(true); e_show_u = new JCheckBox("undirected"); e_show_u.addActionListener(this); e_show_u.setSelected(true); JPanel show_edge_panel = new JPanel(new GridLayout(1, 0)); show_edge_panel.setBorder(BorderFactory.createTitledBorder("Show edges")); show_edge_panel.add(e_show_u); show_edge_panel.add(e_show_d); shape_panel.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(shape_panel); gradient_panel.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(gradient_panel); show_edge_panel.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(show_edge_panel); arrow_panel.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(arrow_panel); e_color.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(e_color); e_labels.setAlignmentX(Component.LEFT_ALIGNMENT); edge_panel.add(e_labels); // set up zoom controls zoom_at_mouse = new JCheckBox("<html><center>zoom at mouse<p>(wheel only)</center></html>"); zoom_at_mouse.addActionListener(this); final ScalingControl scaler = new CrossoverScalingControl(); JButton plus = new JButton("+"); plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(visViewer, 1.1f, visViewer.getCenter()); } }); JButton minus = new JButton("-"); minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(visViewer, 1 / 1.1f, visViewer.getCenter()); } }); Box zoomPanel = Box.createVerticalBox(); zoomPanel.setBorder(BorderFactory.createTitledBorder("Zoom")); plus.setAlignmentX(Component.CENTER_ALIGNMENT); zoomPanel.add(plus); minus.setAlignmentX(Component.CENTER_ALIGNMENT); zoomPanel.add(minus); zoom_at_mouse.setAlignmentX(Component.CENTER_ALIGNMENT); zoomPanel.add(zoom_at_mouse); // add font and zoom controls to center panel font = new JCheckBox("bold text"); font.addActionListener(this); font.setAlignmentX(Component.CENTER_ALIGNMENT); both_panel.add(zoomPanel); both_panel.add(font); JComboBox modeBox = gm.getModeComboBox(); modeBox.setAlignmentX(Component.CENTER_ALIGNMENT); JPanel modePanel = new JPanel(new BorderLayout()) { public Dimension getMaximumSize() { return getPreferredSize(); } }; modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode")); modePanel.add(modeBox); both_panel.add(modePanel); }
From source file:org.apache.jmeter.protocol.http.config.gui.UrlConfigGuiClassifier.java
private JPanel getProxyHostPanel() { proxyHost = new JTextField(20); JLabel label = new JLabel(JMeterUtils.getResString("web_server_domain")); // $NON-NLS-1$ label.setLabelFor(proxyHost);/*w ww. jav a 2 s . c o m*/ JPanel panel = new JPanel(new BorderLayout(5, 0)); panel.add(label, BorderLayout.WEST); panel.add(proxyHost, BorderLayout.CENTER); return panel; }
From source file:org.rdv.viz.image.ImageViz.java
private void initPanControls() { panControls = new JPanel(); panControls.setLayout(new BorderLayout()); JButton panLeftButton = new JButton(DataViewer.getIcon("icons/ptz/robotic_control-left.gif")); panLeftButton.setBorder(null);// ww w .j a v a 2 s. c om panLeftButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { panLeft(); } }); panControls.add(panLeftButton, BorderLayout.WEST); JButton panControlButton = new StrechIconButton( DataViewer.getIcon("icons/ptz/robotic_control-panbar-medium.gif")); panControlButton.setBorder(null); panControlButton.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { JButton button = (JButton) e.getComponent(); int pan = Math.round(100f * e.getPoint().x / button.getWidth()); pan(pan); } }); panControls.add(panControlButton, BorderLayout.CENTER); JPanel bottomRightControls = new JPanel(); bottomRightControls.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); JButton panRightButton = new JButton(DataViewer.getIcon("icons/ptz/robotic_control-right.gif")); panRightButton.setBorder(null); panRightButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { panRight(); } }); bottomRightControls.add(panRightButton); JButton bottomHomeButton = new JButton(DataViewer.getIcon("icons/ptz/robotic_control-home.gif")); bottomHomeButton.setBorder(null); bottomHomeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { home(); } }); bottomRightControls.add(bottomHomeButton); panControls.add(bottomRightControls, BorderLayout.EAST); }
From source file:org.apache.jmeter.protocol.http.config.gui.UrlConfigGui.java
private JPanel getResponseTimeOutPanel() { responseTimeOut = new JTextField(10); JLabel label = new JLabel(JMeterUtils.getResString("web_server_timeout_response")); // $NON-NLS-1$ label.setLabelFor(responseTimeOut);// w ww.ja v a 2 s .c om JPanel panel = new JPanel(new BorderLayout(5, 0)); panel.add(label, BorderLayout.WEST); panel.add(responseTimeOut, BorderLayout.CENTER); return panel; }
From source file:edu.ucla.stat.SOCR.chart.SuperXYZChart.java
protected void setMixPanel() { /*super.setMixPanel(); return;*/// w w w. j av a 2s. c om dataPanel2.removeAll(); graphPanel2.removeAll(); chartPanel.setPreferredSize(new Dimension(CHART_SIZE_X * 2 / 3, CHART_SIZE_Y * 2 / 3)); graphPanel2.add(chartPanel); sliderPanel.removeAll(); /* sliderPanel.add(new JLabel("Bin Size")); sliderPanel.add(this.binSlider); sliderPanel.add(new JLabel(":"+this.binSlider.getValue()));*/ zSlider.setPreferredSize(new Dimension(CHART_SIZE_X * 2 / 3, 100)); sliderPanel.add(this.zSlider); sliderPanel.setPreferredSize(new Dimension(CHART_SIZE_X * 2 / 3, 100)); graphPanel2.add(sliderPanel); // the slider graphPanel2.validate(); dataPanel2.add(new JLabel(" ")); dataPanel2.add(new JLabel("Data")); JScrollPane dt = new JScrollPane(dataTable); dt.setRowHeaderView(headerTable); dt.setPreferredSize(new Dimension(CHART_SIZE_X / 3, CHART_SIZE_Y * 3 / 8)); dataPanel2.add(dt); JScrollPane st = new JScrollPane(summaryPanel); st.setPreferredSize(new Dimension(CHART_SIZE_X / 3, CHART_SIZE_Y / 6)); dataPanel2.add(st); st.validate(); dataPanel2.add(new JLabel(" ")); dataPanel2.add(new JLabel("Mapping")); mapPanel.setPreferredSize(new Dimension(CHART_SIZE_X / 3, CHART_SIZE_Y / 2)); dataPanel2.add(mapPanel); dataPanel2.validate(); mixPanel.removeAll(); mixPanel.add(graphPanel2, BorderLayout.WEST); mixPanel.add(new JScrollPane(dataPanel2), BorderLayout.CENTER); mixPanel.validate(); }
From source file:org.esa.snap.rcp.statistics.StatisticsPanel.java
private JPanel createStatPanel(Stx stx, final Mask mask) { final Histogram histogram = stx.getHistogram(); XIntervalSeries histogramSeries = new XIntervalSeries("Histogram"); int[] bins = histogram.getBins(0); for (int j = 0; j < bins.length; j++) { histogramSeries.add(histogram.getBinLowValue(0, j), histogram.getBinLowValue(0, j), j < bins.length - 1 ? histogram.getBinLowValue(0, j + 1) : histogram.getHighValue(0), bins[j]); }/*from ww w. j a va2 s .co m*/ ChartPanel histogramPanel = createChartPanel(histogramSeries, "Value", "#Pixels", new Color(0, 0, 127)); XIntervalSeries percentileSeries = new XIntervalSeries("Percentile"); percentileSeries.add(0, 0, 1, histogram.getLowValue(0)); for (int j = 1; j < 99; j++) { percentileSeries.add(j, j, j + 1, histogram.getPTileThreshold(j / 100.0)[0]); } percentileSeries.add(99, 99, 100, histogram.getHighValue(0)); ChartPanel percentilePanel = createChartPanel(percentileSeries, "Percentile (%)", "Value Threshold", new Color(127, 0, 0)); Object[][] tableData = new Object[][] { new Object[] { "#Pixels total:", histogram.getTotals()[0] }, new Object[] { "Minimum:", stx.getMinimum() }, new Object[] { "Maximum:", stx.getMaximum() }, new Object[] { "Mean:", stx.getMean() }, new Object[] { "Sigma:", stx.getStandardDeviation() }, new Object[] { "Median:", stx.getMedian() }, new Object[] { "Coef Variation:", stx.getCoefficientOfVariation() }, new Object[] { "ENL:", stx.getEquivalentNumberOfLooks() }, new Object[] { "P75 threshold:", histogram.getPTileThreshold(0.75)[0] }, new Object[] { "P80 threshold:", histogram.getPTileThreshold(0.80)[0] }, new Object[] { "P85 threshold:", histogram.getPTileThreshold(0.85)[0] }, new Object[] { "P90 threshold:", histogram.getPTileThreshold(0.90)[0] }, new Object[] { "Max error:", getBinSize(histogram) }, }; JPanel plotContainerPanel = new JPanel(new GridLayout(1, 2)); plotContainerPanel.add(histogramPanel); plotContainerPanel.add(percentilePanel); TableModel tableModel = new DefaultTableModel(tableData, new String[] { "Name", "Value" }) { @Override public Class<?> getColumnClass(int columnIndex) { return columnIndex == 0 ? String.class : Number.class; } @Override public boolean isCellEditable(int row, int column) { return false; } }; final JTable table = new JTable(tableModel); table.setDefaultRenderer(Number.class, new DefaultTableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component label = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Float || value instanceof Double) { setHorizontalTextPosition(RIGHT); setText(getFormattedValue((Number) value)); } return label; } private String getFormattedValue(Number value) { if (value.doubleValue() < 0.001 && value.doubleValue() > -0.001 && value.doubleValue() != 0.0) { return new DecimalFormat("0.####E0").format(value.doubleValue()); } return String.format("%.4f", value.doubleValue()); } }); table.addMouseListener(popupHandler); JPanel textContainerPanel = new JPanel(new BorderLayout(2, 2)); textContainerPanel.setBackground(Color.WHITE); textContainerPanel.add(table, BorderLayout.CENTER); JPanel statPanel = new JPanel(new BorderLayout(4, 4)); statPanel.setBorder(new EmptyBorder(10, 2, 10, 2)); statPanel.setBackground(Color.WHITE); statPanel.add(new JLabel(getSubPanelTitle(mask)), BorderLayout.NORTH); statPanel.add(textContainerPanel, BorderLayout.WEST); statPanel.add(plotContainerPanel, BorderLayout.CENTER); return statPanel; }
From source file:org.apache.jmeter.protocol.http.config.gui.UrlConfigGui.java
private JPanel getDomainPanel() { domain = new JTextField(20); JLabel label = new JLabel(JMeterUtils.getResString("web_server_domain")); // $NON-NLS-1$ label.setLabelFor(domain);/*from ww w. j a va2s . c om*/ JPanel panel = new JPanel(new BorderLayout(5, 0)); panel.add(label, BorderLayout.WEST); panel.add(domain, BorderLayout.CENTER); return panel; }
From source file:org.openmicroscopy.shoola.agents.fsimporter.view.ImporterUIElement.java
/** * Builds and lays out the header./* w ww.j a va2 s. c o m*/ * * @return See above. */ private JPanel buildHeader() { sizeLabel = UIUtilities.createComponent(null); sizeLabel.setText(FileUtils.byteCountToDisplaySize(sizeImport)); reportLabel = UIUtilities.setTextFont("Report:", Font.BOLD); importSizeLabel = UIUtilities.setTextFont("Import Size:", Font.BOLD); double[][] design = new double[][] { { TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.PREFERRED } }; TableLayout layout = new TableLayout(design); JPanel detailsPanel = new JPanel(layout); detailsPanel.setBackground(UIUtilities.BACKGROUND_COLOR); JPanel p = createRow(); p.add(reportLabel); p.add(numberOfImportLabel); detailsPanel.add(p, "0, 0"); p = createRow(); p.add(importSizeLabel); p.add(sizeLabel); detailsPanel.add(p, "0, 1"); JPanel middlePanel = new JPanel(); middlePanel.setBackground(UIUtilities.BACKGROUND_COLOR); middlePanel.add(filterButton); JTextArea description = new JTextArea(MESSAGE); makeLabelStyle(description); description.setBackground(UIUtilities.BACKGROUND_COLOR); JPanel descriptionPanel = new JPanel(); descriptionPanel.setBackground(UIUtilities.BACKGROUND_COLOR); descriptionPanel.add(description); JPanel header = new JPanel(); header.setBackground(UIUtilities.BACKGROUND_COLOR); header.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); header.setLayout(new BorderLayout()); header.add(Box.createVerticalStrut(10), BorderLayout.NORTH); header.add(detailsPanel, BorderLayout.WEST); header.add(middlePanel, BorderLayout.CENTER); header.add(descriptionPanel, BorderLayout.EAST); header.add(Box.createVerticalStrut(10), BorderLayout.SOUTH); return header; }