List of usage examples for javax.swing BorderFactory createEtchedBorder
public static Border createEtchedBorder()
From source file:org.executequery.gui.ExecuteProcedurePanel.java
private void init() throws Exception { tableModel = new ParameterTableModel(); table = new DefaultTable(tableModel); table.getTableHeader().setReorderingAllowed(false); table.setCellSelectionEnabled(true); table.setColumnSelectionAllowed(false); table.setRowSelectionAllowed(false); connectionsCombo = WidgetFactory.createComboBox(); schemaCombo = WidgetFactory.createComboBox(); combosGroup = new TableSelectionCombosGroup(connectionsCombo, schemaCombo, null); combosGroup.addItemSelectionListener(this); objectTypeCombo = WidgetFactory.createComboBox(createAvailableObjectTypes()); objectTypeCombo.setToolTipText("Select the database object type"); objectTypeCombo.addItemListener(this); proceduresModel = new DynamicComboBoxModel(); procedureCombo = WidgetFactory.createComboBox(proceduresModel); procedureCombo.setActionCommand("procedureSelectionChanged"); procedureCombo.setToolTipText("Select the database object name"); procedureCombo.addActionListener(this); JPanel base = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(5, 7, 5, 8); gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; gbc.gridy++;/*from w w w .j a v a2s . co m*/ base.add(new JLabel("Connection:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.left = 0; base.add(connectionsCombo, gbc); gbc.gridx = 0; gbc.weightx = 0; gbc.gridy++; gbc.insets.left = 7; gbc.insets.top = 0; base.add(new JLabel("Schema:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.left = 0; base.add(schemaCombo, gbc); gbc.gridx = 0; gbc.weightx = 0; gbc.gridy++; gbc.insets.left = 7; gbc.insets.top = 0; base.add(new JLabel("Object Type:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.left = 0; base.add(objectTypeCombo, gbc); gbc.gridx = 0; gbc.weightx = 0; gbc.gridy++; gbc.insets.left = 7; base.add(new JLabel("Object Name:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.left = 0; base.add(procedureCombo, gbc); resultsPanel = new QueryEditorResultsPanel(); JPanel resultsBase = new JPanel(new BorderLayout()); resultsBase.add(resultsPanel, BorderLayout.CENTER); JSplitPane splitPane = new SplitPaneFactory().create(JSplitPane.VERTICAL_SPLIT, new JScrollPane(table), resultsBase); splitPane.setResizeWeight(0.5); splitPane.setDividerLocation(0.75); splitPane.setDividerSize(5); gbc.gridy++; gbc.gridx = 0; gbc.weighty = 1.0; gbc.insets.left = 7; gbc.gridwidth = GridBagConstraints.REMAINDER; base.add(splitPane, gbc); JButton executeButton = ActionUtilities.createButton(this, "Execute", "execute"); gbc.gridy++; gbc.weighty = 0; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.EAST; gbc.insets.top = 0; gbc.insets.bottom = 20; base.add(executeButton, gbc); base.setBorder(BorderFactory.createEtchedBorder()); setBorder(BorderFactory.createEmptyBorder(5, 5, 7, 5)); add(base, BorderLayout.CENTER); EventMediator.registerListener(this); connectionSelectionMade(); }
From source file:org.executequery.gui.ExecuteSqlScriptPanel.java
private void init() throws Exception { fileNameField = WidgetFactory.createTextField(); connectionsCombo = WidgetFactory.createComboBox(); combosGroup = new TableSelectionCombosGroup(connectionsCombo); actionOnErrorCombo = WidgetFactory.createComboBox(); ActionOnError[] actionsOnError = { ActionOnError.HALT, ActionOnError.CONTINUE }; actionOnErrorCombo.setModel(new DefaultComboBoxModel(actionsOnError)); outputPanel = new LoggingOutputPanel(); statusBar = new SqlTextPaneStatusBar(); statusBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 1)); JButton button = WidgetFactory.createInlineFieldButton("Browse"); button.setActionCommand("browse"); button.addActionListener(this); button.setMnemonic('r'); logOutputCheckBox = new JCheckBox( "<html> <i>Note:</i> This will slow down the process significantly </html>"); JPanel mainPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridy = 0;//from ww w.j av a 2s. c om gbc.gridx = 0; gbc.gridheight = 1; gbc.insets.top = 7; gbc.insets.bottom = 5; gbc.insets.right = 5; gbc.insets.left = 5; gbc.anchor = GridBagConstraints.NORTHWEST; mainPanel.add(new JLabel("Connection:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.top = 5; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(connectionsCombo, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weightx = 0; gbc.gridwidth = 1; gbc.insets.top = 5; mainPanel.add(new JLabel("Action on Error:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets.top = 0; mainPanel.add(actionOnErrorCombo, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weightx = 0; gbc.gridwidth = 1; gbc.insets.top = 5; mainPanel.add(new JLabel("Input File:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.insets.top = 0; mainPanel.add(fileNameField, gbc); gbc.gridx = 2; gbc.weightx = 0; gbc.insets.left = 0; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(button, gbc); gbc.gridy++; gbc.gridx = 0; gbc.insets.top = 5; gbc.insets.left = 5; mainPanel.add(new JLabel("Log output:"), gbc); gbc.gridx = 1; gbc.insets.top = 2; gbc.insets.left = 0; mainPanel.add(logOutputCheckBox, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weighty = 1.0; gbc.weightx = 1.0; gbc.insets.top = 5; gbc.insets.left = 5; gbc.insets.bottom = 0; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.BOTH; mainPanel.add(outputPanel, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weighty = 0; gbc.insets.bottom = 5; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(statusBar, gbc); mainPanel.setBorder(BorderFactory.createEtchedBorder()); int minimumButtonWidth = 85; startButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Start", "start"); rollbackButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Commit", "commit"); commitButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Rollback", "rollback"); stopButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Stop", "stop"); rollbackButton.setEnabled(false); commitButton.setEnabled(false); stopButton.setEnabled(false); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 2, 5)); buttonPanel.add(startButton); buttonPanel.add(rollbackButton); buttonPanel.add(commitButton); buttonPanel.add(stopButton); add(mainPanel, BorderLayout.CENTER); add(buttonPanel, BorderLayout.SOUTH); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); EventMediator.registerListener(this); }
From source file:org.executequery.gui.ExportResultSetPanel.java
private void init() throws Exception { fileNameField = WidgetFactory.createTextField(); connectionsCombo = WidgetFactory.createComboBox(); String[] delims = { "|", ",", ";", "#" }; delimiterCombo = WidgetFactory.createComboBox(delims); delimiterCombo.setEditable(true);//w w w. j av a 2 s . c o m combosGroup = new TableSelectionCombosGroup(connectionsCombo); includeColumNamesCheck = new JCheckBox("Include column names as first row"); sqlText = new SimpleSqlTextPanel(); // sqlText.getTextPane().setBackground(Color.WHITE); sqlText.setBorder(null); sqlText.setScrollPaneBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, UIUtils.getDefaultBorderColour())); statusBar = new SqlTextPaneStatusBar(); JPanel sqlPanel = new JPanel(new BorderLayout()); sqlPanel.add(sqlText, BorderLayout.CENTER); sqlPanel.add(statusBar, BorderLayout.SOUTH); statusBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); outputPanel = new LoggingOutputPanel(); FlatSplitPane splitPane = new FlatSplitPane(JSplitPane.VERTICAL_SPLIT, sqlPanel, outputPanel); splitPane.setResizeWeight(0.5); splitPane.setDividerLocation(0.8); splitPane.setDividerSize(5); JButton button = WidgetFactory.createInlineFieldButton("Browse"); button.setActionCommand("browse"); button.addActionListener(this); button.setMnemonic('r'); JPanel mainPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridy = 0; gbc.gridx = 0; gbc.gridheight = 1; gbc.insets.top = 5; gbc.insets.bottom = 5; gbc.insets.right = 5; gbc.insets.left = 5; gbc.anchor = GridBagConstraints.NORTHWEST; mainPanel.add(new JLabel("Connection:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(connectionsCombo, gbc); gbc.insets.left = 5; gbc.gridy++; gbc.gridx = 0; gbc.weightx = 0; gbc.gridwidth = 1; gbc.insets.top = 0; mainPanel.add(new JLabel("Data Delimiter:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(delimiterCombo, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weightx = 0; gbc.gridwidth = 1; gbc.insets.top = 2; mainPanel.add(new JLabel("Output File:"), gbc); gbc.gridx = 1; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(fileNameField, gbc); gbc.gridx = 2; gbc.weightx = 0; gbc.insets.left = 0; gbc.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(button, gbc); gbc.gridy++; gbc.gridx = 0; gbc.weightx = 0; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets.top = 2; gbc.insets.left = 5; mainPanel.add(includeColumNamesCheck, gbc); gbc.gridy++; gbc.insets.bottom = 10; mainPanel.add(new JLabel(instructionNote()), gbc); gbc.gridy++; gbc.gridx = 0; gbc.weighty = 1.0; gbc.weightx = 1.0; gbc.insets.top = 0; gbc.insets.left = 5; gbc.insets.bottom = 5; gbc.fill = GridBagConstraints.BOTH; mainPanel.add(splitPane, gbc); mainPanel.setBorder(BorderFactory.createEtchedBorder()); int minimumButtonWidth = 85; executeButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Execute", "executeAndExport"); stopButton = new MinimumWidthActionButton(minimumButtonWidth, this, "Stop", "stop"); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 2, 5)); buttonPanel.add(executeButton); buttonPanel.add(stopButton); stopButton.setEnabled(false); add(mainPanel, BorderLayout.CENTER); add(buttonPanel, BorderLayout.SOUTH); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); // register as a keyword and connection listener EventMediator.registerListener(this); JTextPane textPane = sqlText.getTextPane(); ActionMap actionMap = textPane.getActionMap(); String actionKey = "executeQueryAction"; actionMap.put(actionKey, executeQueryAction); InputMap inputMap = textPane.getInputMap(); inputMap.put(EXECUTE_KEYSTROKE, actionKey); JPopupMenu popupMenu = sqlText.getPopup(); popupMenu.addSeparator(); popupMenu.add(executeQueryAction); }
From source file:org.jajuk.ui.views.CoverView.java
/** * Inits the ui./*www . j a v a 2 s.c om*/ * * @param includeControls */ @SuppressWarnings({ "unchecked", "rawtypes" }) public void initUI(boolean includeControls) { this.includeControls = includeControls; // Control panel jpControl = new JPanel(); if (includeControls) { jpControl.setBorder(BorderFactory.createEtchedBorder()); } final JToolBar jtb = new JajukJToolbar(); jbPrevious = new JajukButton(IconLoader.getIcon(JajukIcons.PLAYER_PREVIOUS_SMALL)); jbPrevious.addActionListener(this); jbPrevious.setToolTipText(Messages.getString("CoverView.4")); jbNext = new JajukButton(IconLoader.getIcon(JajukIcons.PLAYER_NEXT_SMALL)); jbNext.addActionListener(this); jbNext.setToolTipText(Messages.getString("CoverView.5")); jbDelete = new JajukButton(IconLoader.getIcon(JajukIcons.DELETE)); jbDelete.addActionListener(this); jbDelete.setToolTipText(Messages.getString("CoverView.2")); jbSave = new JajukButton(IconLoader.getIcon(JajukIcons.SAVE)); jbSave.addActionListener(this); jbSave.setToolTipText(Messages.getString("CoverView.6")); jbDefault = new JajukButton(IconLoader.getIcon(JajukIcons.DEFAULT_COVER)); jbDefault.addActionListener(this); jbDefault.setToolTipText(Messages.getString("CoverView.8")); jlSize = new JLabel(""); jlFound = new JLabel(""); jcbAccuracy = new JComboBox(); // Add tooltips on combo items jcbAccuracy.setRenderer(new BasicComboBoxRenderer() { private static final long serialVersionUID = -6943363556191659895L; @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); switch (index) { case 0: setToolTipText(Messages.getString("ParameterView.156")); break; case 1: setToolTipText(Messages.getString("ParameterView.157")); break; case 2: setToolTipText(Messages.getString("ParameterView.158")); break; case 3: setToolTipText(Messages.getString("ParameterView.216")); break; case 4: setToolTipText(Messages.getString("ParameterView.217")); break; case 5: setToolTipText(Messages.getString("ParameterView.218")); break; } setBorder(new EmptyBorder(0, 3, 0, 3)); return this; } }); jcbAccuracy.setToolTipText(Messages.getString("ParameterView.155")); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.ACCURACY_LOW)); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.ACCURACY_MEDIUM)); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.ACCURACY_HIGH)); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.ARTIST)); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.ALBUM)); jcbAccuracy.addItem(IconLoader.getIcon(JajukIcons.TRACK)); int accuracy = getCurrentAccuracy(); jcbAccuracy.setSelectedIndex(accuracy); jcbAccuracy.addActionListener(this); jtb.add(jbPrevious); jtb.add(jbNext); jtb.addSeparator(); jtb.add(jbDelete); jtb.add(jbSave); jtb.add(jbDefault); if (includeControls) { jpControl.setLayout(new MigLayout("insets 5 2 5 2", "[][grow][grow][]")); jpControl.add(jtb); jpControl.add(jlSize, "center,gapright 5::"); jpControl.add(jlFound, "center,gapright 5::"); jpControl.add(jcbAccuracy, "grow,width 47!,gapright 5"); } // Cover view used in catalog view should not listen events if (fileReference == null) { ObservationManager.register(this); } // global layout MigLayout globalLayout = null; if (includeControls) { globalLayout = new MigLayout("ins 0,gapy 10", "[grow]", "[30!][grow]"); } else { globalLayout = new MigLayout("ins 0,gapy 10", "[grow]", "[grow]"); } setLayout(globalLayout); add(jpControl, "grow,wrap"); //Force initial resizing (required after a perspective reset as the component event is not thrown in this case) componentResized(null); // Attach the listener for initial cover display and further manual actions against the view when resizing. addComponentListener(CoverView.this); }
From source file:org.n52.ifgicopter.spf.gui.FrameworkCorePanel.java
/** * default constructor to create the framework core panel. *///from www . jav a 2s .c o m public FrameworkCorePanel() { /* * INPUT PLUGIN LIST */ this.pluginsPanel = new JPanel(); this.pluginsPanel.setLayout(new GridBagLayout()); this.pluginsPanel.setBackground(DEFAULT_COLOR); this.globalGBC = new GridBagConstraints(); this.globalGBC.gridx = 0; this.globalGBC.gridy = 0; this.globalGBC.weightx = 0.0; this.globalGBC.weighty = 0.0; this.globalGBC.anchor = GridBagConstraints.NORTHWEST; this.globalGBC.fill = GridBagConstraints.HORIZONTAL; this.pluginsPanel.add( new JLabel("<html><body><div><strong>" + "Active Plugins</strong></div></body></html>"), this.globalGBC); this.globalGBC.gridy++; this.globalGBC.gridwidth = GridBagConstraints.REMAINDER; this.globalGBC.insets = new Insets(0, 0, 5, 0); this.pluginsPanel.add(new JSeparator(), this.globalGBC); this.globalGBC.insets = new Insets(0, 0, 0, 0); this.globalGBC.weightx = 1.0; this.globalGBC.gridy = 0; this.globalGBC.gridx = 1; this.pluginsPanel.add(Box.createHorizontalGlue(), this.globalGBC); this.globalGBC.weightx = 0.0; this.globalGBC.gridx = 0; this.globalGBC.gridy = 1; /* * the contentpanel */ this.contentPanel = new JPanel(); this.contentPanel.setLayout(new CardLayout()); this.contentPanel.setBorder(BorderFactory.createEtchedBorder()); this.contentPanel.add(WelcomePanel.getInstance(), WELCOME_PANEL); // ((CardLayout) contentPanel.getLayout()).show(contentPanel, WELCOME_PANEL); JScrollPane startupS = new JScrollPane(this.contentPanel); startupS.setViewportBorder(null); /* * wrap the plugins to ensure top alignment */ JPanel pluginsPanelWrapper = new JPanel(new BorderLayout()); pluginsPanelWrapper.add(this.pluginsPanel, BorderLayout.NORTH); pluginsPanelWrapper.add(Box.createVerticalGlue(), BorderLayout.CENTER); pluginsPanelWrapper.setBorder(BorderFactory.createEtchedBorder()); pluginsPanelWrapper.setBackground(this.pluginsPanel.getBackground()); JScrollPane wrapperS = new JScrollPane(pluginsPanelWrapper); wrapperS.setViewportBorder(null); /* * add both scroll panes to the split pane */ JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, wrapperS, startupS); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(250); splitPane.setContinuousLayout(true); Dimension minimumSize = new Dimension(100, 100); startupS.setMinimumSize(minimumSize); this.setLayout(new BorderLayout()); this.add(splitPane); }
From source file:org.openmicroscopy.shoola.env.ui.TaskBarView.java
/** * Helper method to create an empty, floatable toolbar with rollover * effect for the icon buttons and an etched border. * * @return See above./* w w w. j a v a2s .c om*/ */ private JToolBar createToolBar() { JToolBar bar = new JToolBar(); bar.setBorder(BorderFactory.createEtchedBorder()); bar.setFloatable(false); bar.putClientProperty("JToolBar.isRollover", Boolean.valueOf(true)); return bar; }
From source file:org.openscience.jmol.app.Jmol.java
Jmol(Splash splash, JFrame frame, Jmol parent, int startupWidth, int startupHeight, String commandOptions, Point loc) {//from w ww.java 2 s . com super(true); this.frame = frame; this.startupWidth = startupWidth; this.startupHeight = startupHeight; numWindows++; try { say("history file is " + historyFile.getFile().getAbsolutePath()); } catch (Exception e) { } frame.setTitle("Jmol"); frame.getContentPane().setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); this.splash = splash; setBorder(BorderFactory.createEtchedBorder()); setLayout(new BorderLayout()); language = GT.getLanguage(); status = (StatusBar) createStatusBar(); say(GT._("Initializing 3D display...")); // display = new DisplayPanel(status, guimap, haveDisplay.booleanValue(), startupWidth, startupHeight); String adapter = System.getProperty("model"); if (adapter == null || adapter.length() == 0) adapter = "smarter"; if (adapter.equals("smarter")) { report("using Smarter Model Adapter"); modelAdapter = new SmarterJmolAdapter(); } else if (adapter.equals("cdk")) { report("the CDK Model Adapter is currently no longer supported. Check out http://bioclipse.net/. -- using Smarter"); // modelAdapter = new CdkJmolAdapter(null); modelAdapter = new SmarterJmolAdapter(); } else { report("unrecognized model adapter:" + adapter + " -- using Smarter"); modelAdapter = new SmarterJmolAdapter(); } appletContext = commandOptions; viewer = JmolViewer.allocateViewer(display, modelAdapter); viewer.setAppletContext("", null, null, commandOptions); if (display != null) display.setViewer(viewer); say(GT._("Initializing Preferences...")); preferencesDialog = new PreferencesDialog(frame, guimap, viewer); say(GT._("Initializing Recent Files...")); recentFiles = new RecentFilesDialog(frame); if (haveDisplay.booleanValue()) { say(GT._("Initializing Script Window...")); scriptWindow = new ScriptWindow(viewer, frame); } MyStatusListener myStatusListener; myStatusListener = new MyStatusListener(); viewer.setJmolStatusListener(myStatusListener); say(GT._("Initializing Measurements...")); measurementTable = new MeasurementTable(viewer, frame); // Setup Plugin system // say(GT._("Loading plugins...")); // pluginManager = new CDKPluginManager( // System.getProperty("user.home") + System.getProperty("file.separator") // + ".jmol", new JmolEditBus(viewer) // ); // pluginManager.loadPlugin("org.openscience.cdkplugin.dirbrowser.DirBrowserPlugin"); // pluginManager.loadPlugin("org.openscience.cdkplugin.dirbrowser.DadmlBrowserPlugin"); // pluginManager.loadPlugins( // System.getProperty("user.home") + System.getProperty("file.separator") // + ".jmol/plugins" // ); // feature to allow for globally installed plugins // if (System.getProperty("plugin.dir") != null) { // pluginManager.loadPlugins(System.getProperty("plugin.dir")); // } if (haveDisplay.booleanValue()) { // install the command table say(GT._("Building Command Hooks...")); commands = new Hashtable(); if (display != null) { Action[] actions = getActions(); for (int i = 0; i < actions.length; i++) { Action a = actions[i]; commands.put(a.getValue(Action.NAME), a); } } menuItems = new Hashtable(); say(GT._("Building Menubar...")); executeScriptAction = new ExecuteScriptAction(); menubar = createMenubar(); add("North", menubar); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add("North", createToolbar()); JPanel ip = new JPanel(); ip.setLayout(new BorderLayout()); ip.add("Center", display); panel.add("Center", ip); add("Center", panel); add("South", status); say(GT._("Starting display...")); display.start(); //say(GT._("Setting up File Choosers...")); /* pcs.addPropertyChangeListener(chemFileProperty, exportAction); pcs.addPropertyChangeListener(chemFileProperty, povrayAction); pcs.addPropertyChangeListener(chemFileProperty, writeAction); pcs.addPropertyChangeListener(chemFileProperty, toWebAction); pcs.addPropertyChangeListener(chemFileProperty, printAction); pcs.addPropertyChangeListener(chemFileProperty, viewMeasurementTableAction); */ if (menuFile != null) { menuStructure = viewer.getFileAsString(menuFile); } jmolpopup = JmolPopup.newJmolPopup(viewer, true, menuStructure, true); } // prevent new Jmol from covering old Jmol if (loc != null) { frame.setLocation(loc); } else if (parent != null) { Point location = parent.frame.getLocationOnScreen(); int maxX = screenSize.width - 50; int maxY = screenSize.height - 50; location.x += 40; location.y += 40; if ((location.x > maxX) || (location.y > maxY)) { location.setLocation(0, 0); } frame.setLocation(location); } frame.getContentPane().add("Center", this); frame.addWindowListener(new Jmol.AppCloser()); frame.pack(); frame.setSize(startupWidth, startupHeight); ImageIcon jmolIcon = JmolResourceHandler.getIconX("icon"); Image iconImage = jmolIcon.getImage(); frame.setIconImage(iconImage); // Repositionning windows if (scriptWindow != null) historyFile.repositionWindow(SCRIPT_WINDOW_NAME, scriptWindow, 200, 100); say(GT._("Setting up Drag-and-Drop...")); FileDropper dropper = new FileDropper(); final JFrame f = frame; dropper.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { //System.out.println("Drop triggered..."); f.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (evt.getPropertyName().equals(FileDropper.FD_PROPERTY_FILENAME)) { final String filename = evt.getNewValue().toString(); viewer.openFile(filename); } else if (evt.getPropertyName().equals(FileDropper.FD_PROPERTY_INLINE)) { final String inline = evt.getNewValue().toString(); viewer.openStringInline(inline); } f.setCursor(Cursor.getDefaultCursor()); } }); this.setDropTarget(new DropTarget(this, dropper)); this.setEnabled(true); say(GT._("Launching main frame...")); }
From source file:org.parosproxy.paros.extension.manualrequest.http.impl.ManualHttpRequestEditorDialog.java
/** * Return the footer status bar object// w w w .j a v a 2 s . c o m * @return */ protected JToolBar getFooterStatusBar() { if (footerToolbar == null) { footerToolbar = new JToolBar(); footerToolbar.setEnabled(true); footerToolbar.setFloatable(false); footerToolbar.setRollover(true); footerToolbar.setName("Footer Toolbar Left"); footerToolbar.setBorder(BorderFactory.createEtchedBorder()); } return footerToolbar; }
From source file:org.processmining.analysis.performance.dottedchart.ui.MetricsPanel.java
/** * Displays the performance metrics of each pattern on the east side of the * plug-in window./* w w w . ja v a2s . co m*/ * * @param sortedArray * int[] */ public void displayPerformanceMetrics() { String type = dcPanel.getTimeOption(); ArrayList<DescriptiveStatistics> aList = dcModel.getTimeStatistics(); ArrayList<String> aTitles = dcModel.getDescriptiveStatisticsTitles(); ArrayList<String> sortedTitleList = dcModel.getSortedKeySetList(); this.removeAll(); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // add time option menu this.add(Box.createRigidArea(new Dimension(5, 10))); JPanel menuPanel = new JPanel(new BorderLayout()); menuPanel.setPreferredSize(new Dimension(160, 45)); menuPanel.setMaximumSize(new Dimension(180, 45)); timeSortLabel.setAlignmentX(LEFT_ALIGNMENT); menuPanel.add(timeSortLabel, BorderLayout.NORTH); timeBox.setMaximumSize(new Dimension(160, 20)); timeBox.setAlignmentX(LEFT_ALIGNMENT); menuPanel.add(Box.createRigidArea(new Dimension(5, 0))); menuPanel.add(timeBox, BorderLayout.CENTER); this.add(menuPanel); this.add(Box.createRigidArea(new Dimension(5, 10))); // for each frequency get the set of patterns that have that frequency // (run from high frequency to low) int size = 0; for (int i = 0; i < aList.size(); i++) { try { String key; DescriptiveStatistics currentDS = null; if (i != 0) key = sortedTitleList.get(i - 1); else { key = aTitles.get(0); currentDS = aList.get(i); } if (i > 0 && dcModel.getTypeHashMap().equals(DottedChartPanel.ST_INST) && !dcModel.getInstanceTypeToKeep().contains(key)) continue; size++; if (i > 0) { for (int j = 1; j < aTitles.size(); j++) { if (aTitles.get(j).equals(key)) currentDS = aList.get(j); } } AbstractTableModel otm; // create labels that contains information about the pattern if (i == 0) otm = new OverallMetricTableModel(); else otm = new OneMetricTableModel(); DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); dtcr.setBackground(new Color(235, 235, 235)); JTable table = new JTable(otm); table.setPreferredSize(new Dimension(200, 55)); table.setMaximumSize(new Dimension(200, 55)); table.getColumnModel().getColumn(0).setPreferredWidth(70); table.getColumnModel().getColumn(0).setMaxWidth(100); table.getTableHeader().setFont(new Font("SansSerif", Font.PLAIN, 12)); table.getColumnModel().getColumn(0).setCellRenderer(dtcr); table.setBorder(BorderFactory.createEtchedBorder()); // place throughput times in table if (type.equals(DottedChartPanel.TIME_ACTUAL)) { if (i == 0) { table.setValueAt(DateFormat.getInstance().format(dcModel.getLogBoundaryLeft()), 0, 1); table.setValueAt(DateFormat.getInstance().format(dcModel.getLogBoundaryRight()), 1, 1); } else { table.setValueAt(DateFormat.getInstance().format(dcModel.getStartDateofLogUniList(key)), 0, 1); table.setValueAt(DateFormat.getInstance().format(dcModel.getEndDateofLogUniList(key)), 1, 1); } table.setValueAt(formatString(currentDS.getMean() / timeDivider, 5), 2, 1); table.setValueAt(formatString(currentDS.getMin() / timeDivider, 5), 3, 1); table.setValueAt(formatString(currentDS.getMax() / timeDivider, 5), 4, 1); } else if (type.equals(DottedChartPanel.TIME_RELATIVE_TIME)) { if (i == 0) { table.setValueAt(formatDate(dcModel.getLogBoundaryLeft()), 0, 1); table.setValueAt(formatDate(dcModel.getLogBoundaryRight()), 1, 1); } else { table.setValueAt(formatDate(dcModel.getStartDateofLogUniList(key)), 0, 1); table.setValueAt(formatDate(dcModel.getEndDateofLogUniList(key)), 1, 1); } table.setValueAt(formatString(currentDS.getMean() / timeDivider, 5), 2, 1); table.setValueAt(formatString(currentDS.getMin() / timeDivider, 5), 3, 1); table.setValueAt(formatString(currentDS.getMax() / timeDivider, 5), 4, 1); } else if (type.equals(DottedChartPanel.TIME_RELATIVE_RATIO)) { if (i == 0) { table.setValueAt(formatRatio(dcModel.getLogBoundaryLeft()), 0, 1); table.setValueAt(formatRatio(dcModel.getLogBoundaryRight()), 1, 1); } else { table.setValueAt(formatRatio(dcModel.getStartDateofLogUniList(key)), 0, 1); table.setValueAt(formatRatio(dcModel.getEndDateofLogUniList(key)), 1, 1); } table.setValueAt(formatString(currentDS.getMean() / 100, 5), 2, 1); table.setValueAt(formatString(currentDS.getMin() / 100, 5), 3, 1); table.setValueAt(formatString(currentDS.getMax() / 100, 5), 4, 1); } else if (type.equals(DottedChartPanel.TIME_LOGICAL) || type.equals(DottedChartPanel.TIME_LOGICAL_RELATIVE)) { if (i == 0) { table.setValueAt(formatString(dcModel.getLogBoundaryLeft().getTime(), 5), 0, 1); table.setValueAt(formatString(dcModel.getLogBoundaryRight().getTime(), 5), 1, 1); } else { table.setValueAt(formatString((dcModel.getStartDateofLogUniList(key)).getTime(), 5), 0, 1); table.setValueAt(formatString((dcModel.getEndDateofLogUniList(key)).getTime(), 5), 1, 1); } table.setValueAt(formatString(currentDS.getMean(), 5), 2, 1); table.setValueAt(formatString(currentDS.getMin(), 5), 3, 1); table.setValueAt(formatString(currentDS.getMax(), 5), 4, 1); } JPanel tempPanel = new JPanel(new BorderLayout()); table.setAlignmentX(CENTER_ALIGNMENT); tempPanel.setPreferredSize(new Dimension(160, 98)); tempPanel.setMaximumSize(new Dimension(180, 98)); tempPanel.add(table.getTableHeader(), BorderLayout.NORTH); tempPanel.add(table, BorderLayout.CENTER); JPanel tempPanel2 = new JPanel(new BorderLayout()); JLabel patternLabel = new JLabel("Component " + key + ":"); patternLabel.setAlignmentX(LEFT_ALIGNMENT); JLabel frequencyLabel = null; if (i == 0) frequencyLabel = new JLabel("# of components: " + currentDS.getN()); else frequencyLabel = new JLabel("# of dots: " + dcModel.getNumberOfLogUnits(key)); frequencyLabel.setAlignmentX(LEFT_ALIGNMENT); frequencyLabel.setFont(new Font("SansSerif", Font.PLAIN, 12)); tempPanel2.add(patternLabel, BorderLayout.NORTH); tempPanel2.add(frequencyLabel, BorderLayout.CENTER); tempPanel2.add(tempPanel, BorderLayout.SOUTH); this.add(tempPanel2); this.add(Box.createRigidArea(new Dimension(5, 10))); } catch (NullPointerException ex) { // can occur when patternMap does not contain a pattern with // this frequency size--; } } // make sure the pattern performance information is displayed properly this.setPreferredSize(new Dimension(200, 140 * (size + 1))); this.revalidate(); this.repaint(); }
From source file:org.processmining.analysis.performance.PerformanceAnalysisGUI.java
/** * Actually builds the UI/* w w w . j av a2 s .c om*/ * * @throws Exception */ private void jbInit() throws Exception { // Initialize the table which contains the log traces processInstanceIDsTable = new DoubleClickTable(new ExtendedLogTable(), updateButton); // select all rows as at the beginning the results count for the whole // log processInstanceIDsTable.getSelectionModel().addSelectionInterval(0, extendedLog.getSizeOfLog() - 1); tableContainer = new JScrollPane(processInstanceIDsTable); // initialize the westPanel (which contains the processInstanceIDsTable) westPanel.setPreferredSize(new Dimension(100, 300)); westPanel.setLayout(new BorderLayout()); westPanel.add(tableContainer, BorderLayout.CENTER); updateButton.setToolTipText("Update metrics to the selected process instances"); westPanel.add(piButtonsPanel, BorderLayout.SOUTH); piButtonsPanel.setLayout(new BorderLayout()); piButtonsPanel.add(updateButton, BorderLayout.CENTER); piButtonsPanel.add(invertButton, BorderLayout.SOUTH); // initialize the eastpanel (which contains the process-metrics) eastPanel.setPreferredSize(new Dimension(240, 390)); eastPanel.setMinimumSize(new Dimension(240, 390)); eastPanel.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagConstraints(); cons.gridx = 0; cons.gridy = 0; cons.insets = new Insets(0, 5, 5, 0); cons.anchor = GridBagConstraints.WEST; processLabel.setFont(new Font("SansSerif", Font.BOLD, 16)); eastPanel.add(processLabel, cons); cons.gridx = 0; cons.gridy = 1; cons.insets = new Insets(8, 8, 0, 0); eastPanel.add(numberProcessLabel, cons); casesProcessLabel.setText(extendedLog.getSizeOfLog() + " cases"); casesProcessLabel.setFont(new Font("SansSerif", Font.PLAIN, 11)); cons.gridx = 0; cons.gridy = 2; eastPanel.add(casesProcessLabel, cons); cons.gridx = 0; cons.gridy = 3; eastPanel.add(properLabel, cons); completedLabel.setFont(new Font("SansSerif", Font.PLAIN, 11)); cons.gridx = 0; cons.gridy = 4; eastPanel.add(completedLabel, cons); cons.gridx = 0; cons.gridy = 5; eastPanel.add(arrivalProcessLabel, cons); rateProcessLabel.setFont(new Font("SansSerif", Font.PLAIN, 11)); cons.gridx = 0; cons.gridy = 6; eastPanel.add(rateProcessLabel, cons); cons.gridx = 0; cons.gridy = 7; cons.gridwidth = 2; cons.insets = new Insets(15, 5, 0, 2); cons.ipadx = 300; eastPanel.add(processTablePanel, cons); cons.gridx = 0; cons.gridy = 8; cons.gridwidth = 1; cons.insets = new Insets(0, 5, 0, 0); cons.weightx = 1; cons.ipadx = 0; exportProcessButton.setPreferredSize(new Dimension(110, 42)); exportProcessButton.setMaximumSize(new Dimension(110, 42)); changeProcessPercButton.setPreferredSize(new Dimension(110, 42)); changeProcessPercButton.setMaximumSize(new Dimension(110, 42)); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS)); buttonPanel.setPreferredSize(new Dimension(240, 42)); buttonPanel.add(changeProcessPercButton); buttonPanel.add(exportProcessButton); eastPanel.add(buttonPanel, cons); processContainer = new JScrollPane(eastPanel); processContainer.setPreferredSize(new Dimension(240, 390)); // initialize the processTablePanel (which contains the table with // throughput times) processTablePanel.setLayout(new BorderLayout()); processTablePanel.setMinimumSize(new Dimension(240, 130)); processTablePanel.setPreferredSize(new Dimension(240, 130)); processTable.setRowSelectionAllowed(false); processTablePanel.add(processTable.getTableHeader(), BorderLayout.PAGE_START); processTablePanel.add(processTable, BorderLayout.CENTER); // initialize the grappaPanel (which contains the Petri net UI) and // place // it on the centerPanel grappaPanel = replayResult.getVisualization(extendedLog.getLogTraceIDs()); grappaPanel.addGrappaListener(new ExtendedGrappaAdapter()); mapping = new HashMap(); buildGraphMapping(mapping, grappaPanel.getSubgraph()); modelContainer = new JScrollPane(grappaPanel); centerPanel.setLayout(new BorderLayout()); centerPanel.add(modelContainer, BorderLayout.CENTER); // initialize the colored panels Color tCol = (Color) levelColors.get(0); lowPanel.setBackground(tCol); lowPanel.setBorder(BorderFactory.createEtchedBorder()); lowPanel.setPreferredSize(new Dimension(25, 12)); tCol = (Color) levelColors.get(1); mediumPanel.setBackground(tCol); mediumPanel.setBorder(BorderFactory.createEtchedBorder()); mediumPanel.setPreferredSize(new Dimension(25, 12)); tCol = (Color) levelColors.get(2); highPanel.setBackground(tCol); highPanel.setBorder(BorderFactory.createEtchedBorder()); highPanel.setPreferredSize(new Dimension(25, 12)); // initialize the levelPanel (which contains the waiting time settings) levelPanel.setBorder(BorderFactory.createRaisedBevelBorder()); levelPanel.setLayout(new GridBagLayout()); cons.gridx = 0; cons.gridy = 0; cons.gridwidth = 2; cons.insets = new Insets(2, 2, 0, 5); cons.weightx = 0; levelPanel.add(waitingLabel, cons); cons.gridx = 0; cons.gridy = 1; cons.anchor = GridBagConstraints.WEST; cons.insets = new Insets(2, 2, 0, 5); cons.gridwidth = 1; levelPanel.add(highPanel, cons); cons.gridx = 1; cons.gridy = 1; levelPanel.add(highLabel, cons); cons.gridx = 0; cons.gridy = 2; cons.insets = new Insets(1, 2, 0, 5); levelPanel.add(mediumPanel, cons); cons.gridx = 1; cons.gridy = 2; levelPanel.add(mediumLabel, cons); cons.gridx = 0; cons.gridy = 3; cons.insets = new Insets(2, 2, 2, 5); levelPanel.add(lowPanel, cons); cons.gridx = 1; cons.gridy = 3; levelPanel.add(lowLabel, cons); cons.gridx = 0; cons.gridy = 4; cons.gridwidth = 2; cons.insets = new Insets(2, 2, 2, 2); changeSettingsButton.setMnemonic(KeyEvent.VK_S); levelPanel.add(changeSettingsButton, cons); levelPanel.setBackground(new Color(220, 220, 220)); // initialize the selectionPanel (which contains the selected // transitions/place) initializeSelection(); // initialize the metricsBottomPanel metricsBottomPanel.setLayout(new GridBagLayout()); cons = new GridBagConstraints(); cons.gridx = 0; cons.gridy = 0; cons.gridwidth = 5; cons.anchor = GridBagConstraints.WEST; cons.insets = new Insets(1, 2, 5, 0); titleLabel.setFont(new Font("SansSerif", Font.BOLD, 14)); metricsBottomPanel.add(titleLabel, cons); cons.gridx = 0; cons.gridy = 1; cons.gridwidth = 1; cons.insets = new Insets(1, 2, 2, 0); metricsBottomPanel.add(numberObjectLabel, cons); cons.gridx = 1; cons.gridy = 1; cons.gridwidth = 1; freqObjectLabel.setFont(new Font("SansSerif", Font.PLAIN, 12)); metricsBottomPanel.add(freqObjectLabel, cons); cons.gridx = 0; cons.gridy = 2; cons.gridwidth = 1; metricsBottomPanel.add(arrivalPlaceLabel, cons); cons.gridx = 1; cons.gridy = 2; cons.gridwidth = 1; ratePlaceLabel.setFont(new Font("SansSerif", Font.PLAIN, 12)); metricsBottomPanel.add(ratePlaceLabel, cons); cons.gridx = 0; cons.gridy = 3; cons.gridwidth = 5; metricsBottomPanel.add(tablePanel, cons); cons.gridx = 0; cons.gridy = 4; cons.gridwidth = 2; changePercentagesButton.setPreferredSize(new Dimension(170, 25)); metricsBottomPanel.add(changePercentagesButton, cons); cons.gridx = 2; cons.gridy = 4; cons.gridwidth = 2; metricsBottomPanel.add(exportButton, cons); // hide all place/transition metrics hideAllMetrics(); metricsBottomContainer = new JScrollPane(metricsBottomPanel); metricsBottomContainer.setPreferredSize(new Dimension(550, 140)); metricsBottomContainer.setMinimumSize(new Dimension(550, 140)); metricsBottomContainer.setMaximumSize(new Dimension(550, 800)); metricsBottomContainer.setBorder(BorderFactory.createEmptyBorder()); // initialize the bottomPanel bottomPanel.setBorder(BorderFactory.createEtchedBorder()); bottomPanel.setPreferredSize(new Dimension(650, 143)); bottomPanel.setMinimumSize(new Dimension(650, 143)); bottomPanel.setLayout(new GridBagLayout()); GridBagConstraints con = new GridBagConstraints(); con.gridx = 0; con.gridy = 0; con.gridwidth = 4; con.weightx = 2; bottomPanel.add(metricsBottomContainer, con); con.gridx = 4; con.gridy = 0; con.gridwidth = 1; con.weightx = 1; con.anchor = GridBagConstraints.EAST; bottomPanel.add(levelPanel, con); con.gridx = 5; con.gridy = 0; // con.gridwidth = 2; con.weightx = 1; con.anchor = GridBagConstraints.EAST; bottomPanel.add(selectionPanel, con); // Divide the upper panels by using splitPanes leftSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, westPanel, centerPanel); leftSplitPane.setDividerLocation(130); leftSplitPane.setOneTouchExpandable(true); rightSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSplitPane, processContainer); rightSplitPane.setDividerLocation(rightSplitPane.getSize().width - rightSplitPane.getInsets().right - rightSplitPane.getDividerSize() - 240); // processContainer.getWidth()); rightSplitPane.setOneTouchExpandable(true); rightSplitPane.setResizeWeight(1.0); rightSplitPane.setDividerSize(3); // set tooltips processTable.setToolTipText("Throughput time of the process, based on" + " the selected cases"); rateProcessLabel.setToolTipText("Arrival rate of the selected cases"); arrivalProcessLabel.setToolTipText("Arrival rate of the selected cases"); completedLabel.setToolTipText( "Total number of the selected cases that" + " have completed properly and successfully"); properLabel.setToolTipText( "Total number of the selected cases that" + " have completed properly and successfully"); casesProcessLabel.setToolTipText("Total number of cases selected in" + " the table on the left"); numberProcessLabel.setToolTipText("Total number of cases selected in" + " the table on the left"); changeSettingsButton.setToolTipText("Adjust the current waiting time" + " classifications"); placeTable.setToolTipText("Time-metrics of the selected place, based on" + " the selected cases"); transitionTable.setToolTipText( "Time cases spend in between the" + " selected transitions, based on the selected cases"); activityTable.setToolTipText( "Time-metrics of activity related to the" + " selected transition, based on the selected cases"); processInstanceIDsTable.setToolTipText("Selected cases"); changePercentagesButton.setToolTipText("Change percentages of slow," + " fast and normal"); changeProcessPercButton.setToolTipText("Change percentages of slow," + " fast and normal"); exportButton.setToolTipText("Export the values of all measurements of" + " the metrics in the table above to a comma-seperated" + " text-file"); exportProcessButton.setToolTipText("Export the value of the throughput" + " time of all selected process instances to a comma-seperated" + " text-file"); // initialize the performanceAnalysisGUI this.setLayout(new BorderLayout()); this.add(bottomPanel, BorderLayout.SOUTH); this.add(rightSplitPane, BorderLayout.CENTER); this.validate(); this.repaint(); }