List of usage examples for java.awt BorderLayout EAST
String EAST
To view the source code for java.awt BorderLayout EAST.
Click Source Link
From source file:org.orbisgis.view.sqlconsole.ui.SQLConsolePanel.java
/** * Creates a console for sql.// w w w. j av a 2 s . co m */ public SQLConsolePanel() { super(new BorderLayout()); sqlFunctionsPanel = new SQLFunctionsPanel(); initActions(); JPanel split = new JPanel(); split.setLayout(new BorderLayout()); split.add(sqlFunctionsPanel, BorderLayout.EAST); split.add(getCenterPanel(), BorderLayout.CENTER); add(split, BorderLayout.CENTER); add(getStatusToolBar(), BorderLayout.SOUTH); }
From source file:org.jannocessor.ui.RenderPreviewDialog.java
private void initialize() { logger.debug("Initializing UI..."); DefaultSyntaxKit.initKit();// w w w .j a va 2s .c o m JEditorPane.registerEditorKitForContentType("text/java_template", "org.jannocessor.syntax.JavaTemplateKit", getClass().getClassLoader()); JEditorPane.registerEditorKitForContentType("text/java_output", "org.jannocessor.syntax.JavaOutputKit", getClass().getClassLoader()); setTitle("JAnnocessor - Java Annotation Processor"); setLayout(new BorderLayout(5, 5)); listFiles(); Toolkit tk = Toolkit.getDefaultToolkit(); Dimension screenSize = tk.getScreenSize(); double width = screenSize.getWidth() * 0.9; double height = screenSize.getHeight() * 0.8; // Font font = new Font("Courier New", Font.PLAIN, 14); input = createInput(); JScrollPane scroll1 = new JScrollPane(input, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); input.setContentType("text/java_template"); input.setText(""); scroll1.setMinimumSize(new Dimension(200, 200)); scroll1.setPreferredSize(new Dimension((int) (width * 0.5), (int) height)); add(scroll1, BorderLayout.CENTER); output = Box.createVerticalBox(); scroll2 = new JScrollPane(output, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scroll2.setMinimumSize(new Dimension(200, 200)); scroll2.setPreferredSize(new Dimension((int) (width * 0.5), (int) height)); add(scroll2, BorderLayout.EAST); combo = createCombo(); combo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { load((File) combo.getSelectedItem()); } }); add(combo, BorderLayout.NORTH); JLabel help = new JLabel( " Choose a template from the drop-down box to edit it. Navigation: Alt + Left & Alt + Right; Refresh = F5, Close = Esc", JLabel.CENTER); help.setForeground(Color.WHITE); help.setBackground(Color.BLACK); help.setOpaque(true); help.setFont(new Font("Courier New", Font.BOLD, 14)); add(help, BorderLayout.SOUTH); keyListener = new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F5) { e.consume(); processElements(); refresh(); } else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { e.consume(); dispose(); } else if (e.getKeyCode() == KeyEvent.VK_LEFT && e.isAltDown()) { e.consume(); moveBackward(); } else if (e.getKeyCode() == KeyEvent.VK_RIGHT && e.isAltDown()) { e.consume(); moveForward(); } else if (e.getKeyCode() == KeyEvent.VK_S && e.isControlDown()) { e.consume(); save(); } else if (e.getKeyCode() == KeyEvent.VK_I && e.isControlDown()) { e.consume(); increase(); } else if (e.getKeyCode() == KeyEvent.VK_D && e.isControlDown()) { e.consume(); decrease(); } } }; input.addKeyListener(keyListener); combo.addKeyListener(keyListener); setActive(0); pack(); setModal(true); setLocationRelativeTo(null); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); input.requestFocus(); logger.debug("Initialized UI."); }
From source file:org.codinjutsu.tools.nosql.couchbase.view.CouchbasePanel.java
private void initToolbar() { toolBarPanel.setLayout(new BorderLayout()); rowLimitField.setColumns(5);// www.j a v a2s.co m rowLimitField.setDocument(new NumberDocument()); rowLimitField.setText("100"); JPanel rowLimitPanel = new NonOpaquePanel(); rowLimitPanel.add(new JLabel("Row limit:"), BorderLayout.WEST); rowLimitPanel.add(rowLimitField, BorderLayout.CENTER); rowLimitPanel.add(Box.createHorizontalStrut(5), BorderLayout.EAST); toolBarPanel.add(rowLimitPanel, BorderLayout.WEST); addCommonsActions(); }
From source file:org.ut.biolab.medsavant.client.view.genetics.variantinfo.GeneManiaSubInspector.java
private void buildPanel() { kvp = new KeyValuePairPanel(2); kvp.setKeysVisible(false);/*ww w .j av a 2 s .c om*/ kvpPanel = new JPanel(); kvpPanel.setLayout(new BorderLayout()); kvpPanel.add(kvp, BorderLayout.CENTER); JPanel currGenePanel = ViewUtil.getClearPanel(); JPanel pMessagePanel = ViewUtil.getClearPanel(); settingsPanel = ViewUtil.getClearPanel(); progressBar = new ProgressWheel(); progressBar.setVisible(false); progressMessage = new JLabel(); progressMessage.setVisible(false); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); settingsButton = new JButton("Settings"); settingsButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { genemaniaSettings.showSettings(); if (genemaniaSettings.getUpdateQueryNeeded()) { rankByVarFreq = genemaniaSettings.getRankByVarFreq(); updateRelatedGenesPanel(genes); } } }); pMessagePanel.add(progressMessage); settingsPanel.setLayout(new BorderLayout()); settingsPanel.add(settingsButton, BorderLayout.EAST); graph = ViewUtil.getClearPanel(); panel.add(kvpPanel); panel.add(currGenePanel); panel.add(pMessagePanel); panel.add(progressBar); panel.add(settingsPanel); panel.add(graph); }
From source file:Visuals.PieChart.java
public JPanel addCharts() { ChartPanel piePanel = drawPieChart(); piePanel.setDomainZoomable(true);//from ww w. j a v a 2s. co m JPanel thisPiePanel = new JPanel(); String[][] finalRisks = new String[riskCount][4]; for (int i = 0; i < riskCount; i++) { finalRisks[i][0] = risks[i][0]; finalRisks[i][1] = risks[i][1]; finalRisks[i][2] = risks[i][2]; finalRisks[i][3] = risks[i][3]; } JTable table = new JTable(finalRisks, columns); //table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); TableRowSorter<TableModel> sorter = new TableRowSorter<>(table.getModel()); table.setRowSorter(sorter); List<RowSorter.SortKey> sortKeys = new ArrayList<>(); int columnIndexToSort = 2; sortKeys.add(new RowSorter.SortKey(columnIndexToSort, SortOrder.ASCENDING)); sorter.setSortKeys(sortKeys); sorter.sort(); TableColumn tcol = table.getColumnModel().getColumn(2); table.removeColumn(tcol); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.getColumnModel().getColumn(1).setPreferredWidth(600); table.getColumnModel().getColumn(2).setPreferredWidth(600); JLabel right = new JLabel( " "); thisPiePanel.add(right, BorderLayout.EAST); table.setShowHorizontalLines(true); table.setRowHeight(40); JScrollPane tableScrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); Dimension d = table.getPreferredSize(); tableScrollPane .setPreferredSize(new Dimension((d.width - 400), (table.getRowHeight() + 1) * (riskCount + 1))); table.setEnabled(false); thisPiePanel.setLayout(new BorderLayout()); if (riskCount == 0) { thisPiePanel.add(piePanel, BorderLayout.CENTER); } else { thisPiePanel.add(right, BorderLayout.EAST); thisPiePanel.add(piePanel, BorderLayout.CENTER); thisPiePanel.add(tableScrollPane, BorderLayout.SOUTH); } thisPiePanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1)); return thisPiePanel; }
From source file:net.sf.mzmine.modules.visualization.intensityplot.IntensityPlotFrame.java
public IntensityPlotFrame(ParameterSet parameters) { PeakList peakList = parameters.getParameter(IntensityPlotParameters.peakList).getValue()[0]; String title = "Intensity plot [" + peakList + "]"; String xAxisLabel = parameters.getParameter(IntensityPlotParameters.xAxisValueSource).getValue().toString(); String yAxisLabel = parameters.getParameter(IntensityPlotParameters.yAxisValueSource).getValue().toString(); // create dataset dataset = new IntensityPlotDataset(parameters); // create new JFreeChart logger.finest("Creating new chart instance"); Object xAxisValueSource = parameters.getParameter(IntensityPlotParameters.xAxisValueSource).getValue(); boolean isCombo = (xAxisValueSource instanceof ParameterWrapper) && (((ParameterWrapper) xAxisValueSource).getParameter() instanceof ComboParameter); if ((xAxisValueSource == IntensityPlotParameters.rawDataFilesOption) || isCombo) { chart = ChartFactory.createLineChart(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false);//from w w w . ja v a2 s . co m CategoryPlot plot = (CategoryPlot) chart.getPlot(); // set renderer StatisticalLineAndShapeRenderer renderer = new StatisticalLineAndShapeRenderer(false, true); renderer.setBaseStroke(new BasicStroke(2)); plot.setRenderer(renderer); plot.setBackgroundPaint(Color.white); // set tooltip generator CategoryToolTipGenerator toolTipGenerator = new IntensityPlotTooltipGenerator(); renderer.setBaseToolTipGenerator(toolTipGenerator); CategoryAxis xAxis = (CategoryAxis) plot.getDomainAxis(); xAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); } else { chart = ChartFactory.createXYLineChart(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); XYErrorRenderer renderer = new XYErrorRenderer(); renderer.setBaseStroke(new BasicStroke(2)); plot.setRenderer(renderer); plot.setBackgroundPaint(Color.white); // set tooltip generator XYToolTipGenerator toolTipGenerator = new IntensityPlotTooltipGenerator(); renderer.setBaseToolTipGenerator(toolTipGenerator); } chart.setBackgroundPaint(Color.white); // create chart JPanel ChartPanel chartPanel = new ChartPanel(chart); add(chartPanel, BorderLayout.CENTER); IntensityPlotToolBar toolBar = new IntensityPlotToolBar(this); add(toolBar, BorderLayout.EAST); // disable maximum size (we don't want scaling) chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE); chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE); // set title properties TextTitle chartTitle = chart.getTitle(); chartTitle.setMargin(5, 0, 0, 0); chartTitle.setFont(titleFont); LegendTitle legend = chart.getLegend(); legend.setItemFont(legendFont); legend.setBorder(0, 0, 0, 0); Plot plot = chart.getPlot(); // set shape provider IntensityPlotDrawingSupplier shapeSupplier = new IntensityPlotDrawingSupplier(); plot.setDrawingSupplier(shapeSupplier); // set y axis properties NumberAxis yAxis; if (plot instanceof CategoryPlot) yAxis = (NumberAxis) ((CategoryPlot) plot).getRangeAxis(); else yAxis = (NumberAxis) ((XYPlot) plot).getRangeAxis(); NumberFormat yAxisFormat = MZmineCore.getConfiguration().getIntensityFormat(); if (parameters.getParameter(IntensityPlotParameters.yAxisValueSource).getValue() == YAxisValueSource.RT) yAxisFormat = MZmineCore.getConfiguration().getRTFormat(); yAxis.setNumberFormatOverride(yAxisFormat); setTitle(title); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBackground(Color.white); pack(); }
From source file:com.github.cric.app.ui.SettingPanel.java
private JPanel getSubmitPanel() { JPanel mainPanel = new JPanel(new BorderLayout()); JPanel submitPanel = new JPanel(); submitPanel.add(submitButton);//w w w .j a va 2 s . c o m JPanel helpPanel = new JPanel(); helpPanel.add(helpLabel()); mainPanel.add(submitPanel, BorderLayout.CENTER); mainPanel.add(helpPanel, BorderLayout.EAST); return mainPanel; }
From source file:es.uvigo.ei.sing.adops.views.TextFileViewer.java
public TextFileViewer(final File file) { super(new BorderLayout()); this.file = file; // TEXT AREA//from w ww.j av a2 s .c om this.textArea = new JTextArea(TextFileViewer.loadFile(file)); this.textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, this.textArea.getFont().getSize())); this.textArea.setLineWrap(true); this.textArea.setWrapStyleWord(true); this.textArea.setEditable(false); this.highlightPatiner = new DefaultHighlighter.DefaultHighlightPainter(Color.YELLOW); // OPTIONS PANEL final JPanel panelOptions = new JPanel(new BorderLayout()); final JPanel panelOptionsEast = new JPanel(new FlowLayout()); final JPanel panelOptionsWest = new JPanel(new FlowLayout()); final JCheckBox chkLineWrap = new JCheckBox("Line wrap", true); final JButton btnChangeFont = new JButton("Change Font"); final JLabel lblSearch = new JLabel("Search"); this.txtSearch = new JTextField(); this.chkRegularExpression = new JCheckBox("Reg. exp.", true); final JButton btnSearch = new JButton("Search"); final JButton btnClear = new JButton("Clear"); this.txtSearch.setColumns(12); // this.txtSearch.setOpaque(true); panelOptionsEast.add(btnChangeFont); panelOptionsEast.add(chkLineWrap); panelOptionsWest.add(lblSearch); panelOptionsWest.add(this.txtSearch); panelOptionsWest.add(this.chkRegularExpression); panelOptionsWest.add(btnSearch); panelOptionsWest.add(btnClear); if (FastaUtils.isFasta(file)) { panelOptionsWest.add(new JSeparator()); final JButton btnExport = new JButton("Export..."); panelOptionsWest.add(btnExport); btnExport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { new ExportDialog(file).setVisible(true); } catch (Exception e1) { JOptionPane.showMessageDialog(Workbench.getInstance().getMainFrame(), "Error reading fasta file: " + e1.getMessage(), "Export Error", JOptionPane.ERROR_MESSAGE); } } }); } panelOptions.add(panelOptionsWest, BorderLayout.WEST); panelOptions.add(panelOptionsEast, BorderLayout.EAST); this.fontChooser = new JFontChooser(); this.add(new JScrollPane(this.textArea), BorderLayout.CENTER); this.add(panelOptions, BorderLayout.NORTH); chkLineWrap.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textArea.setLineWrap(chkLineWrap.isSelected()); } }); btnChangeFont.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { changeFont(); } }); this.textArea.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { TextFileViewer.this.wasModified = true; } @Override public void insertUpdate(DocumentEvent e) { TextFileViewer.this.wasModified = true; } @Override public void changedUpdate(DocumentEvent e) { TextFileViewer.this.wasModified = true; } }); this.textArea.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { if (TextFileViewer.this.wasModified) { try { FileUtils.write(TextFileViewer.this.file, TextFileViewer.this.textArea.getText()); TextFileViewer.this.wasModified = false; } catch (IOException e1) { e1.printStackTrace(); } } } }); final ActionListener alSearch = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateSearch(); } }; txtSearch.addActionListener(alSearch); btnSearch.addActionListener(alSearch); btnClear.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearSearch(); } }); }
From source file:customprogressindicator.CustomProgress.java
private JPanel createComponents() { JPanel top = new JPanel(); top.setBackground(Color.WHITE); top.setLayout(new BorderLayout(20, 20)); // get applet parameter using an instance of the AppletStub class // "tagLine" parameter specified in applet's JNLP file String tagLine = ""; if (appletStub != null) { tagLine = appletStub.getParameter("tagLine"); }//from w w w . j ava2 s .co m String lblText = "<html><font color=red size=+2>JDK Documentation</font><br/>" + tagLine + " <br/></html>"; JLabel lbl = new JLabel(lblText); top.add(lbl, BorderLayout.NORTH); // use JSObject.getWindow(null) method to retrieve a reference to // the web page and make JavaScript calls. Duke logo displayed if // displayLogo variable set to "true" in the web page String displayLogo = "false"; JSObject window = JSObject.getWindow(null); if (window != null) { displayLogo = (String) window.getMember("displayLogo"); } if (displayLogo.equals("true")) { lbl = new JLabel(); ImageIcon logo = createImageIcon("images/DukeWave.gif", "logo"); lbl.setIcon(logo); top.add(lbl, BorderLayout.EAST); } statusLabel = new JLabel("<html><font color=green size=-2>Loading applet...</font></html>"); top.add(statusLabel, BorderLayout.CENTER); progressBar = new JProgressBar(0, 100); progressBar.setValue(0); progressBar.setStringPainted(true); top.add(progressBar, BorderLayout.SOUTH); return top; }
From source file:edu.purdue.cc.bionet.ui.CorrelationDetailPanel.java
/** * Constructs a new CorrelationDetailPanel * //from www . j av a 2 s.c o m * @param correlation The Correlation to display information about. * @param range The valid range for correlations displayed in this window. * @param detailWindow The parent window of this panel. */ public CorrelationDetailPanel(Correlation correlation, Range range, DetailWindow detailWindow, int correlationMethod) { super(new BorderLayout()); this.correlation = correlation; this.correlationRange = range.clone(); this.detailWindow = detailWindow; this.correlationMethod = correlationMethod; this.correlations = this.detailWindow.getCorrelations(); String buttonText = Settings.getLanguage().get("Show Correlated"); this.firstMoleculeButton = new JButton(buttonText); this.secondMoleculeButton = new JButton(buttonText); this.firstMoleculeTable = DataTable.getMoleculeTable(correlations, correlation.getFirst()); this.secondMoleculeTable = DataTable.getMoleculeTable(correlations, correlation.getSecond()); JPanel topMoleculePanel = new JPanel(new BorderLayout()); JPanel bottomMoleculePanel = new JPanel(new BorderLayout()); JScrollPane firstMoleculeScrollPane = new JScrollPane(this.firstMoleculeTable); JScrollPane secondMoleculeScrollPane = new JScrollPane(this.secondMoleculeTable); topMoleculePanel.add(firstMoleculeScrollPane, BorderLayout.CENTER); topMoleculePanel.add(this.firstMoleculeButton, BorderLayout.SOUTH); bottomMoleculePanel.add(secondMoleculeScrollPane, BorderLayout.CENTER); bottomMoleculePanel.add(this.secondMoleculeButton, BorderLayout.SOUTH); this.firstMoleculeButton.addActionListener(this); this.secondMoleculeButton.addActionListener(this); JPanel moleculePane = new JPanel(new GridLayout(2, 1)); moleculePane.add(topMoleculePanel); moleculePane.add(bottomMoleculePanel); JPanel moleculePanel = new JPanel(new BorderLayout()); moleculePanel.add(moleculePane, BorderLayout.CENTER); JPanel graphPanel = new ScatterPlot(correlation, correlations); JPanel infoPanel = new InfoPanel(this.correlation.getValue(this.correlationMethod), ((ScatterPlot) graphPanel).getSamples().size()); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(moleculePanel, BorderLayout.WEST); mainPanel.add(graphPanel, BorderLayout.CENTER); mainPanel.add(infoPanel, BorderLayout.EAST); moleculePanel.setPreferredSize(new Dimension(200, 400)); infoPanel.setPreferredSize(new Dimension(300, 400)); this.add(mainPanel, BorderLayout.CENTER); }