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:com.ethercamp.harmony.desktop.HarmonyDesktop.java
private void showErrorWindow(String title, String body) { try {//from ww w . ja va2 s. c o m UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); // System.setProperty("apple.awt.UIElement", "false"); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); JTextArea textArea = new JTextArea(body); JScrollPane scrollPane = new JScrollPane(textArea); textArea.setLineWrap(true); textArea.setFont(Font.getFont(Font.MONOSPACED)); textArea.setEditable(false); textArea.setWrapStyleWord(true); scrollPane.setPreferredSize(new Dimension(500, 500)); JTextPane titleLabel = new JTextPane(); titleLabel.setContentType("text/html"); // let the text pane know this is what you want titleLabel.setText("<html>" + "<b>" + title + "</b>" + "</html>"); // showing off titleLabel.setEditable(false); titleLabel.setBackground(null); titleLabel.setBorder(null); panel.add(titleLabel); panel.add(scrollPane); final JFrame frame = new JFrame(); frame.setAlwaysOnTop(true); moveCenter(frame); frame.setVisible(true); JOptionPane.showMessageDialog(frame, panel, "Oops. Ethereum Harmony stopped with error.", JOptionPane.CLOSED_OPTION); System.exit(1); } catch (Exception e) { log.error("Problem showing error window", e); } }
From source file:com.googlecode.gmail4j.util.LoginDialog.java
/** * Shows the dialog/* w w w .j a va 2 s . c o m*/ */ private void showDialog() { final BoxLayout layout = new BoxLayout(dialog.getContentPane(), BoxLayout.Y_AXIS); dialog.getContentPane().setLayout(layout); dialog.getContentPane().add(labelUser); dialog.getContentPane().add(user); dialog.getContentPane().add(labelPass); dialog.getContentPane().add(pass); dialog.getContentPane().add(ok); dialog.pack(); dialog.setSize(200, dialog.getSize().height); dialog.setResizable(false); dialog.setAlwaysOnTop(true); center(dialog); dialog.setVisible(true); user.requestFocusInWindow(); }
From source file:net.mitnet.tools.pdf.book.publisher.ui.gui.BookPublisherGUI2.java
/** * Initialise widgets.//from w w w .j a v a 2 s .co m */ protected void initComponents() { // frame this.frame = new JFrame(); this.frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.frame.setTitle(FRAME_TITLE); // input dir panel inputDirLabel = new JLabel(); inputDirLabel.setText("Input Folder:"); inputDirField = new JTextField(); inputDirField.setColumns(FILE_TEXTFIELD_WIDTH); inputDirButton = new JButton(); inputDirButton.setText("Browse ..."); inputDirButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { inputDirButtonActionHandler(event); } }); JPanel inputDirPanel = new JPanel(); // inputDirPanel.setLayout( new BoxLayout( inputDirPanel, BoxLayout.X_AXIS ) ); inputDirPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); inputDirPanel.add(inputDirLabel); inputDirPanel.add(inputDirField); inputDirPanel.add(inputDirButton); // output dir panel outputDirLabel = new JLabel(); outputDirLabel.setText("Output Folder:"); outputDirField = new JTextField(); outputDirField.setColumns(FILE_TEXTFIELD_WIDTH); outputDirButton = new JButton(); outputDirButton.setText("Browse ..."); outputDirButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { outputDirButtonActionHandler(event); } }); JPanel outputDirPanel = new JPanel(); // outputDirPanel.setLayout( new BoxLayout( outputDirPanel, BoxLayout.X_AXIS ) ); outputDirPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); outputDirPanel.add(outputDirLabel); outputDirPanel.add(outputDirField); outputDirPanel.add(outputDirButton); // document control panel docControlPanel = new JPanel(); docControlPanel.setLayout(new BoxLayout(docControlPanel, BoxLayout.Y_AXIS)); docControlPanel.add(inputDirPanel); docControlPanel.add(outputDirPanel); // Border docControlPanelBorder = BorderFactory.createTitledBorder("Documents"); Border docControlPanelBorder = BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("Documents"), BorderFactory.createEmptyBorder(5, 5, 5, 5)); docControlPanel.setBorder(docControlPanelBorder); // publish button publishButton = new JButton(); publishButton.setText("Publish"); publishButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { publishButtonActionHandler(event); } }); // status message label statusMessageLabel = new JLabel(); // String statusMessageText = "Press " + publishButton.getText() + " to start."; String statusMessageText = ""; statusMessageLabel.setText(statusMessageText); // statusMessageLabel.setVisible(false); // progress bar progressBar = new JProgressBar(); // exit button exitButton = new JButton(); exitButton.setText("Exit"); exitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { exitButtonActionHandler(event); } }); // build main panel JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(docControlPanel); // mainPanel.add(new Spacer()); mainPanel.add(publishButton); // mainPanel.add(new Spacer()); mainPanel.add(progressBar); // mainPanel.add(new Spacer()); mainPanel.add(statusMessageLabel); // mainPanel.add(new Spacer()); mainPanel.add(exitButton); // add main panel to frame this.frame.getContentPane().setLayout(new BoxLayout(this.frame.getContentPane(), BoxLayout.Y_AXIS)); this.frame.getContentPane().add(mainPanel); // this.frame.setSize(800,600); this.frame.pack(); }
From source file:edu.ucla.stat.SOCR.chart.SuperXYChart.java
protected void setChart() { // update graph // System.out.println("setChart called"); graphPanel.removeAll();/*from w ww . j a v a2 s . c o m*/ graphPanel.setLayout(new BoxLayout(graphPanel, BoxLayout.Y_AXIS)); chartPanel.setPreferredSize(new Dimension(CHART_SIZE_X, CHART_SIZE_Y)); if (legendPanelOn) { JFreeChart chart2 = createLegendChart(createLegend(dataset)); legendPanel = new ChartPanel(chart2, false); //legendPanel.setPreferredSize(new Dimension(CHART_SIZE_X,CHART_SIZE_Y*2/3)); } graphPanel.add(chartPanel); JScrollPane legendPane = new JScrollPane(legendPanel); if (legendPanelOn) { legendPane.setPreferredSize(new Dimension(CHART_SIZE_X, CHART_SIZE_Y / 5)); graphPanel.add(legendPane); } graphPanel.validate(); // get the GRAPH panel to the front if (tabbedPanelContainer.getTitleAt(tabbedPanelContainer.getSelectedIndex()) != ALL) { tabbedPanelContainer.setSelectedIndex(tabbedPanelContainer.indexOfComponent(graphPanel)); graphPanel.removeAll(); graphPanel.setLayout(new BoxLayout(graphPanel, BoxLayout.Y_AXIS)); graphPanel.add(chartPanel); if (legendPanelOn) { legendPane = new JScrollPane(legendPanel); legendPane.setPreferredSize(new Dimension(CHART_SIZE_X, CHART_SIZE_Y / 5)); graphPanel.add(legendPane); } graphPanel.validate(); } else { graphPanel2.removeAll(); chartPanel.setPreferredSize(new Dimension(CHART_SIZE_X * 2 / 3, CHART_SIZE_Y * 2 / 3)); //legendPanel.setPreferredSize(new Dimension(CHART_SIZE_X*2/5,CHART_SIZE_Y*2/5)); graphPanel2.add(chartPanel); if (legendPanelOn) { legendPane = new JScrollPane(legendPanel); legendPane.setPreferredSize(new Dimension(CHART_SIZE_X * 2 / 5, CHART_SIZE_Y * 2 / 5)); graphPanel2.add(legendPane); } graphPanel2.validate(); summaryPanel.validate(); } }
From source file:es.emergya.ui.gis.popups.RouteDialog.java
private RouteDialog() { super();/*from ww w . j a v a 2 s . c o m*/ setAlwaysOnTop(true); setResizable(false); iconTransparente = LogicConstants.getIcon("48x48_transparente"); iconEnviando = LogicConstants.getIcon("anim_calculando"); try { route = new OsmDataLayer(new DataSet(), "route", File.createTempFile("route", "route")); } catch (IOException e) { log.error(e.getMessage(), e); } setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { clear.doClick(); setVisible(false); } }); setTitle(i18n.getString("window.route.titleBar")); setMinimumSize(new Dimension(400, 200)); 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.setBackground(Color.WHITE); base.setLayout(new BoxLayout(base, BoxLayout.Y_AXIS)); // Icono del titulo JPanel title = new JPanel(new FlowLayout(FlowLayout.LEADING)); title.setOpaque(false); final JLabel labelTitle = new JLabel(i18n.getString("window.route.title"), LogicConstants.getIcon("tittleventana_icon_calcularruta"), JLabel.LEFT); labelTitle.setFont(LogicConstants.deriveBoldFont(12.0f)); title.add(labelTitle); base.add(title); JPanel content = new JPanel(new SpringLayout()); content.setOpaque(false); // Coordenadas content.add(new JLabel(i18n.getString("window.route.origen"), JLabel.LEFT)); JPanel coords = new JPanel(new GridLayout(1, 2)); coords.setOpaque(false); fx = new JTextField(8); fx.setEditable(false); fy = new JTextField(8); fy.setEditable(false); coords.add(fy); coords.add(fx); content.add(coords); content.add(new JLabel(i18n.getString("window.route.destino"), JLabel.LEFT)); JPanel coords2 = new JPanel(new GridLayout(1, 2)); coords2.setOpaque(false); tx = new JTextField(8); tx.setEditable(false); ty = new JTextField(8); ty.setEditable(false); coords2.add(ty); coords2.add(tx); content.add(coords2); SpringUtilities.makeCompactGrid(content, 2, 2, 6, 6, 6, 6); base.add(content); // Area para mensajes JPanel notificationArea = new JPanel(); notificationArea.setOpaque(false); notification = new JLabel("PLACEHOLDER"); notification.setForeground(Color.WHITE); notificationArea.add(notification); base.add(notificationArea); JPanel buttons = new JPanel(); buttons.setOpaque(false); buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS)); search = new JButton(i18n.getString("window.route.calcular"), LogicConstants.getIcon("ventanacontextual_button_calcularruta")); search.addActionListener(this); buttons.add(search); clear = new JButton(i18n.getString("window.route.limpiar"), LogicConstants.getIcon("button_limpiar")); clear.addActionListener(this); buttons.add(clear); buttons.add(Box.createHorizontalGlue()); progressIcon = new JLabel(iconTransparente); buttons.add(progressIcon); buttons.add(Box.createHorizontalGlue()); JButton cancel = new JButton(i18n.getString("Buttons.cancel"), LogicConstants.getIcon("button_cancel")); cancel.addActionListener(this); buttons.add(cancel); 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:it.iit.genomics.cru.igb.bundles.mi.view.MIResultPanel.java
public MIResultPanel(IgbService service, String summary, List<MIResult> results, String label, MIQuery query) { setLayout(new BorderLayout()); this.label = label; igbLogger = IGBLogger.getInstance(label); colorer = TaxonColorer.getColorer(query.getTaxid()); Box menuBox = new Box(BoxLayout.X_AXIS); Box buttonBox = new Box(BoxLayout.Y_AXIS); Box buttonBox1 = new Box(BoxLayout.X_AXIS); Box buttonBox3 = new Box(BoxLayout.X_AXIS); buttonBox.add(buttonBox1);/*from ww w. ja v a2s . com*/ buttonBox.add(buttonBox3); JTextPane querySummary = new JTextPane(); querySummary.setContentType("text/html"); querySummary.setEditable(false); querySummary.setText(summary); menuBox.add(querySummary); menuBox.add(buttonBox); final JFrame logFrame = new JFrame("MI Bundle Log"); logFrame.setVisible(false); Dimension preferredSize = new Dimension(800, 500); logFrame.setPreferredSize(preferredSize); logFrame.setMinimumSize(preferredSize); logFrame.add(new LogPanel(igbLogger)); JButton log = new JButton(); if (igbLogger.hasError()) { log.setBackground(Color.red); } log.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/console.png")); log.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logFrame.setVisible(true); } }); buttonBox1.add(log); JButton networkButton = new JButton(""); networkButton.setIcon(new ImageIcon(getClass().getResource("/network.jpg"))); networkButton.addActionListener(new DisplayNetworkActionListener()); buttonBox1.add(networkButton); buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("Save: ")); JButton exportButton = new JButton("text"); exportButton.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/save.png")); exportButton.addActionListener(new ExportActionListener()); if (false == MICommons.testVersion) { buttonBox1.add(exportButton); } JButton exportXgmmlButton = new JButton("xgmml"); exportXgmmlButton.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/save.png")); exportXgmmlButton.addActionListener(new ExportXgmmlActionListener()); if (false == MICommons.testVersion) { buttonBox1.add(exportXgmmlButton); } buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("View structure: ")); structures = new StructuresPanel(service, label); buttonBox1.add(structures.getJmolButton()); buttonBox1.add(structures.getLinkButton()); // Filters ButtonGroup scoreGroup = new ButtonGroup(); JRadioButton scoreButton0 = new JRadioButton("<html>" + HTML_SCORE_0 + "</html>"); JRadioButton scoreButton1 = new JRadioButton("<html>" + HTML_SCORE_1 + "</html>"); JRadioButton scoreButton2 = new JRadioButton("<html>" + HTML_SCORE_2 + "</html>"); JRadioButton scoreButton3 = new JRadioButton("<html>" + HTML_SCORE_3 + "</html>"); scoreButton0.setSelected(true); ScoreListener scoreListener = new ScoreListener(); scoreButton0.addActionListener(scoreListener); scoreButton1.addActionListener(scoreListener); scoreButton2.addActionListener(scoreListener); scoreButton3.addActionListener(scoreListener); scoreGroup.add(scoreButton0); scoreGroup.add(scoreButton1); scoreGroup.add(scoreButton2); scoreGroup.add(scoreButton3); buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("Score: ")); buttonBox1.add(scoreButton0); buttonBox1.add(scoreButton1); buttonBox1.add(scoreButton2); buttonBox1.add(scoreButton3); buttonBox3.add(new JLabel("Interaction type: ")); JCheckBox EvidencePhysicalButton = new JCheckBox(HTML_CHECKBOX_PHYSICAL); JCheckBox EvidenceAssociationButton = new JCheckBox(HTML_CHECKBOX_ASSOCIATION); JCheckBox EvidenceEnzymaticButton = new JCheckBox(HTML_CHECKBOX_ENZYMATIC); JCheckBox EvidenceOtherButton = new JCheckBox(HTML_CHECKBOX_OTHER); JCheckBox EvidenceUnspecifiedButton = new JCheckBox(HTML_CHECKBOX_UNSPECIFIED); JCheckBox EvidenceStructureButton = new JCheckBox(HTML_CHECKBOX_STRUCTURE); EvidencePhysicalButton.setSelected(true); EvidenceAssociationButton.setSelected(true); EvidenceEnzymaticButton.setSelected(true); EvidenceOtherButton.setSelected(true); EvidenceUnspecifiedButton.setSelected(true); EvidenceStructureButton.setSelected(true); buttonBox3.add(EvidencePhysicalButton); buttonBox3.add(EvidenceAssociationButton); buttonBox3.add(EvidenceEnzymaticButton); buttonBox3.add(EvidenceOtherButton); buttonBox3.add(EvidenceUnspecifiedButton); buttonBox3.add(EvidenceStructureButton); EvidenceTypeListener evidenceListener = new EvidenceTypeListener(); EvidencePhysicalButton.addActionListener(evidenceListener); EvidenceAssociationButton.addActionListener(evidenceListener); EvidenceEnzymaticButton.addActionListener(evidenceListener); EvidenceOtherButton.addActionListener(evidenceListener); EvidenceUnspecifiedButton.addActionListener(evidenceListener); EvidenceStructureButton.addActionListener(evidenceListener); Box tableBox = new Box(BoxLayout.Y_AXIS); MITableModel model = new MITableModel(results); miTable = new MITable(model, service, query); miTable.setFillsViewportHeight(true); miTable.setStructuresPanel(structures); tableBox.add(miTable.getTableHeader()); tableBox.add(miTable); JScrollPane tableScroll = new JScrollPane(tableBox); tableScroll.setMinimumSize(new Dimension(800, 50)); tableScroll.setPreferredSize(new Dimension(800, 50)); tableScroll.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)); structures.setMinimumSize(new Dimension(200, 500)); structures.setPreferredSize(new Dimension(200, 500)); structures.setMaximumSize(new Dimension(200, Short.MAX_VALUE)); resultBox = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tableScroll, structures); resultBox.setOneTouchExpandable(true); add(menuBox, BorderLayout.NORTH); add(resultBox, BorderLayout.CENTER); }
From source file:net.sf.mzmine.modules.peaklistmethods.peakpicking.adap3decompositionV2.ADAP3DecompositionV2SetupDialog.java
/** Creates the interface elements */ @Override//from w w w.ja va2s . co m protected void addDialogComponents() { super.addDialogComponents(); comboClustersModel = new DefaultComboBoxModel<>(); PeakList[] peakLists = MZmineCore.getDesktop().getSelectedPeakLists(); // ----------------------------- // Panel with preview UI elements // ----------------------------- // Preview CheckBox chkPreview = new JCheckBox("Show preview"); chkPreview.addActionListener(this); chkPreview.setHorizontalAlignment(SwingConstants.CENTER); chkPreview.setEnabled(peakLists != null && peakLists.length > 0); // Preview panel that will contain ComboBoxes final JPanel panel = new JPanel(new BorderLayout()); panel.add(new JSeparator(), BorderLayout.NORTH); panel.add(chkPreview, BorderLayout.CENTER); panel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH); pnlUIElements = new JPanel(new BorderLayout()); pnlUIElements.add(panel, BorderLayout.NORTH); // ComboBox with Clusters cboClusters = new JComboBox<>(comboClustersModel); cboClusters.setFont(COMBO_FONT); cboClusters.addActionListener(this); pnlComboBoxes = GUIUtils.makeTablePanel(1, 2, new JComponent[] { new JLabel("Clusters"), cboClusters }); // -------------------------------------------------------------------- // ----- Panel with plots -------------------------------------- // -------------------------------------------------------------------- pnlPlots = new JPanel(); pnlPlots.setLayout(new BoxLayout(pnlPlots, BoxLayout.Y_AXIS)); // Plot with retention-time clusters retTimeMZPlot = new SimpleScatterPlot("Retention time", "m/z"); retTimeMZPlot.setMinimumSize(MIN_DIMENSIONS); final JPanel pnlPlotRetTimeClusters = new JPanel(new BorderLayout()); pnlPlotRetTimeClusters.setBackground(Color.white); pnlPlotRetTimeClusters.add(retTimeMZPlot, BorderLayout.CENTER); GUIUtils.addMarginAndBorder(pnlPlotRetTimeClusters, 10); // Plot with chromatograms retTimeIntensityPlot = new EICPlot(); retTimeIntensityPlot.setMinimumSize(MIN_DIMENSIONS); JPanel pnlPlotShapeClusters = new JPanel(new BorderLayout()); pnlPlotShapeClusters.setBackground(Color.white); pnlPlotShapeClusters.add(retTimeIntensityPlot, BorderLayout.CENTER); GUIUtils.addMarginAndBorder(pnlPlotShapeClusters, 10); pnlPlots.add(pnlPlotRetTimeClusters); pnlPlots.add(pnlPlotShapeClusters); super.mainPanel.add(pnlUIElements, 0, super.getNumberOfParameters() + 3, 2, 1, 0, 0, GridBagConstraints.HORIZONTAL); }
From source file:es.emergya.ui.plugins.LayerSelectionDialog.java
private void initOptions(final JPanel list) { SwingWorker<Object, Object> sw = new SwingWorker<Object, Object>() { @Override/* ww w .ja v a 2s .c o m*/ protected Object doInBackground() throws Exception { publish(new Object[0]); for (CapaInformacion ci : CapaConsultas.getAllOrderedByOrden()) { if (ci.getOpcional() && ci.getHabilitada()) { layers.add(new LayerElement(ci.getNombre(), ci.getUrl(), wasVisible(ci))); } } return null; } @Override protected void process(List<Object> chunks) { actualizando.setIcon(es.emergya.cliente.constants.LogicConstants.getIcon("anim_actualizando")); } @Override protected void done() { super.done(); actualizando.setIcon(null); list.setLayout(new BoxLayout(list, BoxLayout.Y_AXIS)); for (LayerElement le : layers) { JCheckBox cb = new JCheckBox(le.name, le.active); cb.setBackground(Color.WHITE); cb.addActionListener(LayerSelectionDialog.this); list.add(cb); list.revalidate(); } // self.pack(); } }; sw.execute(); }
From source file:it.unifi.rcl.chess.traceanalysis.gui.TracePanel.java
private void initialize() { this.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JPanel pnlInfo = new JPanel(); JPanel pnlBound = new JPanel(); JPanel pnlPlot = new JPanel(); JPanel pnlPhases = new JPanel(); pnlInfo.setLayout(new BoxLayout(pnlInfo, BoxLayout.Y_AXIS)); pnlBound.setLayout(new BoxLayout(pnlBound, BoxLayout.Y_AXIS)); pnlPlot.setLayout(new BoxLayout(pnlPlot, BoxLayout.Y_AXIS)); pnlPhases.setLayout(new BoxLayout(pnlPhases, BoxLayout.Y_AXIS)); // pnlInfo.setBorder(BorderFactory.createLineBorder(Color.black)); // pnlBound.setBorder(BorderFactory.createLineBorder(Color.black)); // pnlPlot.setBorder(BorderFactory.createLineBorder(Color.black)); // pnlPhases.setBorder(BorderFactory.createLineBorder(Color.black)); pnlInfo.setPreferredSize(new Dimension(300, 250)); pnlBound.setPreferredSize(new Dimension(400, 250)); pnlPlot.setPreferredSize(new Dimension(300, 250)); pnlPhases.setPreferredSize(new Dimension(400, 250)); pnlInfo.setBorder(new EmptyBorder(6, 6, 6, 6)); pnlBound.setBorder(new EmptyBorder(6, 6, 6, 6)); pnlPlot.setBorder(new EmptyBorder(6, 6, 6, 6)); pnlPhases.setBorder(new EmptyBorder(6, 6, 6, 6)); this.add(pnlInfo); this.add(pnlBound); this.add(pnlPlot); this.add(pnlPhases); lblInfo = new JPlainLabel("<html><b>TRACE SUMMARY</b><br/>" + "<em>Information about the loaded trace.</em><br/><br/></html>"); pnlInfo.add(lblInfo);// w ww .jav a 2 s . c o m lblPoints = new JPlainLabel("#Points"); pnlInfo.add(lblPoints); lblTraceName = new JPlainLabel(); pnlInfo.add(lblTraceName); lblStat = new JPlainLabel(); pnlInfo.add(lblStat); btnReload = new JButton("Reload"); btnReload.addActionListener(new ButtonAction("Reload", KeyEvent.VK_L)); pnlInfo.add(btnReload); btnClose = new JButton("Close"); btnClose.addActionListener(new ButtonAction("Close", KeyEvent.VK_U)); pnlInfo.add(btnClose); /* Bound evaluation */ lblSectionBounds = new JPlainLabel("<html><b>BOUND EVALUATION</b><br/>" + "<em>Compute probabilistic bounds on manually selected portions of the trace.</em></html>"); lblSectionBounds.setToolTipText("Compute probabilistic bounds on manually selected portions of the trace"); lblSectionBounds.setFont(new Font("Dialog", Font.PLAIN, 12)); // lblSectionBounds.setBorder(BorderFactory.createLineBorder(Color.black)); pnlBound.add(lblSectionBounds); scrollTabBounds = new JScrollPane(); scrollTabBounds.setPreferredSize(new Dimension(400, 100)); pnlBound.add(scrollTabBounds); tableBounds = new BoundsTable(); scrollTabBounds.setViewportView(tableBounds); btnUpdateBoundsTable = new JButton("Update"); btnUpdateBoundsTable.addActionListener(new ButtonAction("Update", KeyEvent.VK_U)); pnlBound.add(btnUpdateBoundsTable); btnClearBoundsTable = new JButton("Clear Table"); btnClearBoundsTable.addActionListener(new ButtonAction("Clear Table", KeyEvent.VK_C)); pnlBound.add(btnClearBoundsTable); /* Plotting */ lblSectionPlot = new JPlainLabel("<html><b>PLOTTING</b><br/>" + "<em>Plot the trace, together with \"dynamic\" probabilistic bounds, i.e., bounds obtained dynamically as if they were evaluated at runtime with a fixed window size.</em></html>"); lblSectionPlot.setToolTipText("Plot the trace and dynamic bounds"); pnlPlot.add(lblSectionPlot); scrollTabWSize = new JScrollPane(); scrollTabWSize.setPreferredSize(new Dimension(400, 200)); pnlPlot.add(scrollTabWSize); tableWindowSize = new JDynamicTable(); tableWindowSize.setModel(new DefaultTableModel(new Object[][] { { 100, 0.99 }, { null, null } }, new String[] { "WindowSize", "Confidence" }) { Class[] columnTypes = new Class[] { Integer.class, Double.class }; public Class getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } }); tableWindowSize.setMonitoredColumn(0); tableWindowSize.setMonitoredColumn(1); tableWindowSize.getColumnModel().getColumn(0).setPreferredWidth(10); tableWindowSize.getColumnModel().getColumn(1).setPreferredWidth(10); scrollTabWSize.setViewportView(tableWindowSize); btnPlot = new JButton("Plot"); btnPlot.addActionListener(new ButtonAction("Plot", KeyEvent.VK_P)); pnlPlot.add(btnPlot); btnBoundExport = new JButton("Export"); btnBoundExport.addActionListener(new ButtonAction("Export", KeyEvent.VK_E)); pnlPlot.add(btnBoundExport); btnCompareAll = new JButton("Compare All Traces"); btnCompareAll.addActionListener(new ButtonAction("Compare All Traces", KeyEvent.VK_A)); pnlPlot.add(btnCompareAll); btnClearWSizeTable = new JButton("Clear Table"); btnClearWSizeTable.addActionListener(new ButtonAction("Clear Table", KeyEvent.VK_C)); pnlPlot.add(btnClearWSizeTable); /* Phases analysis */ lblSectionPhases = new JPlainLabel("<html><b>PHASES ANALYSIS</b><br/>" + "<em>Detect phases in the trace having different probabilistic properties.</em></html>."); lblSectionPhases.setToolTipText("Detect phases in the trace having different probabilistic properties"); pnlPhases.add(lblSectionPhases); scrollTabPhases = new JScrollPane(); scrollTabPhases.setPreferredSize(new Dimension(200, 150)); pnlPhases.add(scrollTabPhases); tablePhases = new JTable(); tablePhases.setModel(new DefaultTableModel(new Object[][] { { null, null, null, null } }, new String[] { "Start", "End", "Distribution*", "Bound*" }) { Class[] columnTypes = new Class[] { Integer.class, Integer.class, String.class, String.class }; public Class getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } @Override public boolean isCellEditable(int row, int column) { return false; } }); tablePhases.getColumnModel().getColumn(0).setPreferredWidth(10); tablePhases.getColumnModel().getColumn(1).setPreferredWidth(10); tablePhases.getColumnModel().getColumn(2).setPreferredWidth(100); tablePhases.getColumnModel().getColumn(3).setPreferredWidth(100); scrollTabPhases.setViewportView(tablePhases); lblPhasesCoverage = new JPlainLabel("Coverage: "); pnlPhases.add(lblPhasesCoverage); txtPhasesCoverage = new JTextField("0.99"); pnlPhases.add(txtPhasesCoverage); lblPhasesWSize = new JPlainLabel("Window Size: "); pnlPhases.add(lblPhasesWSize); txtPhasesWSize = new JTextField("20"); pnlPhases.add(txtPhasesWSize); btnPhaseDetection = new JButton("Phases Analysis"); ; btnPhaseDetection.addActionListener(new ButtonAction("PhasesAnalysis", KeyEvent.VK_P)); pnlPhases.add(btnPhaseDetection); }
From source file:edu.virginia.speclab.juxta.author.view.export.WebServiceExportDialog.java
/** * Create a UI panel to show export progress *///from w w w . ja va2 s. c o m private void createStatusPane() { this.statusPanel = new JPanel(); this.statusPanel.setBackground(Color.white); this.statusPanel.setLayout(new BorderLayout(5, 5)); this.statusPanel.setBorder(BorderFactory.createEmptyBorder(15, 0, 0, 0)); JPanel content = new JPanel(); content.setBackground(Color.white); content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS)); content.add(Box.createVerticalStrut(30)); JLabel l = new JLabel("Status", SwingConstants.CENTER); l.setAlignmentX(CENTER_ALIGNMENT); l.setFont(JuxtaUserInterfaceStyle.LARGE_FONT); content.add(l); content.add(Box.createVerticalStrut(10)); this.statusLabel = new JLabel("", SwingConstants.CENTER); this.statusLabel.setAlignmentX(CENTER_ALIGNMENT); this.setFont(JuxtaUserInterfaceStyle.NORMAL_FONT); content.add(this.statusLabel); this.statusPanel.add(content, BorderLayout.CENTER); JPanel p = new JPanel(); p.setBackground(Color.white); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(Box.createHorizontalGlue()); this.workAnimation = new JLabel(); this.workAnimation.setIcon(JuxtaUserInterfaceStyle.WORKING_ANIMATION); p.add(this.workAnimation); p.add(Box.createHorizontalGlue()); this.statusPanel.add(p, BorderLayout.NORTH); }