java.awt.BorderLayout Java Examples
The following examples show how to use
java.awt.BorderLayout.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CTracesPanel.java From binnavi with Apache License 2.0 | 6 votes |
/** * Creates a new panel object. * * @param model Provides the active debugger. * @param graph Graph to trace. * @param traceProvider Provides the previously recorded traces. * @param graphPanel Panel for which the traces panel is shown. */ public CTracesPanel(final CDebugPerspectiveModel model, final ZyGraph graph, final ITraceListProvider traceProvider, final CGraphPanel graphPanel) { super(new BorderLayout()); m_model = model; m_graph = graph; m_traceProvider = traceProvider; m_graphPanel = graphPanel; m_innerPanel = new CDebugEventListPanel(traceProvider); add(m_innerPanel); m_traceTable = m_innerPanel.getTracesTable(); m_eventTable = m_innerPanel.getEventsTable(); m_traceTable.addMouseListener(new InternalTraceTableListener()); m_eventTable.addMouseListener(new InternalEventsTableListener()); }
Example #2
Source File: DebuggingViewComponent.java From netbeans with Apache License 2.0 | 6 votes |
private void createTreeView() { synchronized (lock) { releaseTreeView(); treeView = new DebugTreeView(); treeView.setRootVisible(false); treeView.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); treeView.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(DebuggingViewComponent.class, "DebuggingViewComponent.treeView.AccessibleContext.accessibleName")); // NOI18N treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DebuggingViewComponent.class, "DebuggingViewComponent.treeView.AccessibleContext.accessibleDescription")); // NOI18N treeView.getTree().addMouseWheelListener(this); treeView.addTreeExpansionListener(this); TreeModel model = treeView.getTree().getModel(); model.addTreeModelListener(this); treeView.getViewport().addChangeListener(this); treeView.getTree().setScrollsOnExpand(false); mainPanel.add(treeView, BorderLayout.CENTER); } }
Example #3
Source File: AqlViewer.java From CQL with GNU Affero General Public License v3.0 | 6 votes |
private <X, Y> void viewAlgebraHelper(JComponent top, Algebra<Ty, En, Sym, Fk, Att, Gen, Sk, X, Y> algebra, JPanel out, JCheckBox simp, JSlider sl, Map<Pair<Boolean, Integer>, JScrollPane> cache) { boolean b = simp.isSelected(); int l = sl.getValue(); Pair<Boolean, Integer> p = new Pair<>(b, l); JScrollPane jsp = cache.get(p); if (jsp == null) { jsp = makeList2(algebra, b, l); cache.put(p, jsp); } out.removeAll(); out.add(jsp, BorderLayout.CENTER); out.add(top, BorderLayout.SOUTH); out.revalidate(); out.repaint(); }
Example #4
Source File: MetaData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); BorderLayout oldLayout = (BorderLayout) oldInstance; BorderLayout newLayout = (BorderLayout) newInstance; for (String constraints : CONSTRAINTS) { Object oldC = oldLayout.getLayoutComponent(constraints); Object newC = newLayout.getLayoutComponent(constraints); // Pending, assume any existing elements are OK. if (oldC != null && newC == null) { invokeStatement(oldInstance, "addLayoutComponent", new Object[] { oldC, constraints }, out); } } }
Example #5
Source File: ViewElementSliderDouble.java From Robot-Overlord-App with GNU General Public License v2.0 | 6 votes |
public ViewElementSliderDouble(RobotOverlord ro,DoubleEntity e,int top,int bottom) { super(ro); this.e=e; e.addObserver(this); field = new JSlider(); field.setMaximum(top); field.setMinimum(bottom); field.setMinorTickSpacing(1); field.setValue((int)Math.floor(e.get())); field.addChangeListener(this); field.addFocusListener(this); JLabel label = new JLabel(e.getName(),JLabel.LEADING); value = new JLabel(Integer.toString(field.getValue()),JLabel.RIGHT); Dimension dim = new Dimension(30,1); value.setMinimumSize(dim); value.setPreferredSize(dim); value.setMaximumSize(dim); panel.setLayout(new BorderLayout()); panel.add(label,BorderLayout.LINE_START); panel.add(field,BorderLayout.CENTER); panel.add(value,BorderLayout.LINE_END); }
Example #6
Source File: JToggleButtonJavaElementTest.java From marathonv5 with Apache License 2.0 | 6 votes |
@BeforeMethod public void showDialog() throws Throwable { JavaElementFactory.add(JToggleButton.class, JToggleButtonJavaElement.class); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame = new JFrame(JToggleButtonJavaElementTest.class.getSimpleName()); frame.setName("frame-" + JToggleButtonJavaElementTest.class.getSimpleName()); frame.getContentPane().add(new CheckBoxDemo(), BorderLayout.CENTER); frame.getContentPane().add(new RadioButtonDemo(), BorderLayout.EAST); frame.pack(); frame.setAlwaysOnTop(true); frame.setVisible(true); } }); driver = new JavaAgent(); }
Example #7
Source File: MainPanel.java From ramus with GNU General Public License v3.0 | 6 votes |
private void setCurrentPanel(final int i) { currentPanel = i; { final IPanel panel = creator.getPanel(i); panel.get(); header.setDescription(panel.getDescribe()); this.panel.removeAll(); this.panel.add(panel.getComponent(), BorderLayout.CENTER); } panel.validate(); panel.repaint(); etap.setText(MessageFormat.format(Factory.getString("EtapOf"), new Object[]{Integer.toString(i + 1), Integer.toString(creator.getPanelCount())})); checkFinish(); }
Example #8
Source File: MultiRepAnalysis.java From sc2gears with Apache License 2.0 | 6 votes |
/** * Creates and returns the Chat words tab. * @return the Chat words tab */ private JComponent createChatWordsTab() { final JPanel panel = new JPanel( new BorderLayout() ); panel.addComponentListener( new FirstShownListener() { @Override public void firstShown( final ComponentEvent event ) { final Vector< Vector< Object > > dataVector = new Vector< Vector< Object > >( chatWordsStatisticsMap.size() ); for ( final WordStatistics ws : chatWordsStatisticsMap.values() ) { final Vector< Object > row = new Vector< Object >( 6 ); row.add( ws.word ); row.add( ws.count ); row.add( ws.replays ); row.add( NullAwareComparable.getPercent( ws.replays * 100 / replaysIncludedInAnalysis ) ); row.add( Language.formatDate( ws.firstDate ) ); row.add( Language.formatDate( ws.lastDate ) ); dataVector.add( row ); } createStatisticsTableTab( panel, "module.multiRepAnal.tab.chatWords.info", new Object[] { chatWordsStatisticsMap.size() }, 0, new int[] { 1, 2, 0 }, dataVector, CHAT_WORDS_HEADER_NAME_VECTOR, new WordCloudTableInput( Language.getText( "module.multiRepAnal.tab.chatWords.title" ), 0, 1 ), null, null ); } } ); return panel; }
Example #9
Source File: MarkdownTextAreaWithPreview.java From meka with GNU General Public License v3.0 | 6 votes |
/** * Initializes the widgets. */ @Override protected void initGUI() { super.initGUI(); setLayout(new BorderLayout()); m_TabbedPane = new JTabbedPane(); add(m_TabbedPane, BorderLayout.CENTER); m_TextCode = new JTextArea(); m_TextCode.setFont(GUIHelper.getMonospacedFont()); m_TabbedPane.addTab("Write", new BaseScrollPane(m_TextCode)); m_PanePreview = new JEditorPane(); m_PanePreview.setEditable(false); m_PanePreview.setContentType("text/html"); m_TabbedPane.addTab("Preview", new BaseScrollPane(m_PanePreview)); m_TabbedPane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { update(); } }); }
Example #10
Source File: CssStylesPanel.java From netbeans with Apache License 2.0 | 6 votes |
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { splitPane = createSplitPane(); topPanel = new javax.swing.JPanel(); setLayout(new java.awt.BorderLayout()); splitPane.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); splitPane.setDividerSize(4); splitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); topPanel.setLayout(new java.awt.BorderLayout()); splitPane.setTopComponent(topPanel); add(splitPane, java.awt.BorderLayout.CENTER); }
Example #11
Source File: AudioTimestampSelector.java From GpsPrune with GNU General Public License v2.0 | 6 votes |
/** * Create the GUI components * @param inTopLabelKey key for description label at top * @param inLowerLabelKey key for description label at bottom, if any */ private void createComponents(String inTopLabelKey, String inLowerLabelKey) { setLayout(new BorderLayout()); add(new JLabel(I18nManager.getText(inTopLabelKey)), BorderLayout.NORTH); // panel for the radio buttons JPanel gridPanel = new JPanel(); gridPanel.setLayout(new GridLayout(0, 3, 15, 3)); final String[] keys = {"beginning", "middle", "end"}; ButtonGroup group = new ButtonGroup(); for (int i=0; i<3; i++) { _radios[i] = new JRadioButton(I18nManager.getText("dialog.correlate.timestamp." + keys[i])); group.add(_radios[i]); gridPanel.add(_radios[i]); } _radios[0].setSelected(true); add(gridPanel, BorderLayout.CENTER); if (inLowerLabelKey != null) { add(new JLabel(I18nManager.getText(inLowerLabelKey)), BorderLayout.SOUTH); } }
Example #12
Source File: SwingTools.java From rapidminer-studio with GNU Affero General Public License v3.0 | 6 votes |
/** * Creates a helpLabel and adds it to the labelPanel. The helpLabel shows a help icon. * * @param labelPanel * the panel which will be used to add the label. The panel needs to have a * {@link BorderLayout} as layout manager as the label will be added with the * constraint {@link BorderLayout#EAST}. * @return the helpLabel for further use * @since 7.0.0 */ public static JLabel initializeHelpLabel(JPanel labelPanel) { JPanel helpPanel = new JPanel(); helpPanel.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.NORTH; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 3, 0, 0); final JLabel helpLabel = new JLabel(); helpLabel.setIcon(createIcon(HELP_ICON_PATH)); helpLabel.setFocusable(false); gbc.anchor = GridBagConstraints.CENTER; helpPanel.add(helpLabel, gbc); gbc.gridy += 1; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weighty = 1.0; gbc.insets = new Insets(0, 0, 0, 0); helpPanel.add(new JLabel(), gbc); labelPanel.add(helpPanel, BorderLayout.EAST); return helpLabel; }
Example #13
Source File: ProjectDialog.java From quickfix-messenger with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void initComponents() { setLayout(new BorderLayout()); mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); JScrollPane mainScrollPane = new JScrollPane(); mainScrollPane.setPreferredSize(new Dimension(300, 400)); add(mainScrollPane, BorderLayout.CENTER); projectTree = new JTree(); projectTree.setEditable(true); projectTree.setModel(new ProjectTreeModel(xmlProjectType)); projectTree.setCellRenderer(new ProjectTreeCellRenderer(frame)); projectTree.setCellEditor(new ProjectTreeCellEditor(projectTree)); projectTree.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION); projectTree.addMouseListener(new ProjectTreeMouseListener(frame, projectTree)); projectTree.expandRow(1); mainScrollPane.getViewport().add(projectTree); pack(); }
Example #14
Source File: RepositoryPanel.java From ghidra with Apache License 2.0 | 6 votes |
private JPanel createListPanel(String[] repositoryNames) { JPanel panel = new JPanel(new VerticalLayout(5)); panel.setBorder(BorderFactory.createTitledBorder("Choose Existing Repository")); existingRepButton = new GRadioButton("Existing Repository", (repositoryNames.length > 0)); existingRepButton.setEnabled(repositoryNames.length > 0); buttonGroup.add(existingRepButton); JPanel innerPanel = new JPanel(new BorderLayout()); JLabel label = new GDLabel("Repository Names", SwingConstants.LEFT); label.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 5)); innerPanel.add(label, BorderLayout.NORTH); listModel = new DefaultListModel<>(); for (String repositoryName : repositoryNames) { listModel.addElement(repositoryName); } nameList = new GList<>(listModel); nameList.setEnabled(existingRepButton.isSelected()); JScrollPane sp = new JScrollPane(nameList); innerPanel.add(sp); panel.add(existingRepButton); panel.add(innerPanel); return panel; }
Example #15
Source File: CGeneralSettingsPanel.java From binnavi with Apache License 2.0 | 6 votes |
/** * Creates a new general settings panel. */ public CGeneralSettingsPanel() { super(new BorderLayout()); idaDirectoryPanel = new FileChooserPanel( ConfigManager.instance().getGeneralSettings().getIdaDirectory(), new InternalIDAListener(), "...", TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT, 0); logLevelBox = new JComboBox<String>(new String[] {"Off", "On", "Verbose"}); logLevelBox.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT)); final ScriptEngineManager manager = new ScriptEngineManager(); scriptingBox = new LanguageBox(manager); scriptingBox.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT)); final JPanel pMain = new JPanel(new BorderLayout()); pMain.add(createEditElementsPanel(), BorderLayout.NORTH); emailBox.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT)); add(pMain); }
Example #16
Source File: JScrollBarTest.java From marathonv5 with Apache License 2.0 | 5 votes |
@BeforeMethod public void showDialog() throws Throwable { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame = new JFrame(JScrollBarTest.class.getSimpleName()); frame.setSize(320, 350); frame.setName("frame-" + JScrollBarTest.class.getSimpleName()); frame.getContentPane().add(new ScrollDemo(), BorderLayout.CENTER); // frame.pack(); frame.setAlwaysOnTop(true); frame.setVisible(true); } }); }
Example #17
Source File: JSearch.java From JByteMod-Beta with GNU General Public License v2.0 | 5 votes |
public JSearch(MyCodeList list) { this.list = list; this.setTitle("Code List Search"); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setBounds(100, 100, 300, 220); this.setResizable(false); this.setAlwaysOnTop(true); this.setFocusable(false); JPanel cp = new JPanel(new BorderLayout()); cp.setBorder(new EmptyBorder(16, 16, 16, 16)); this.setContentPane(cp); JPanel find = new JPanel(new BorderLayout(10, 10)); find.setBorder(new EmptyBorder(16, 16, 16, 16)); JPanel border = new JPanel(new BorderLayout()); border.setBorder(BorderFactory.createLineBorder(Color.lightGray)); border.add(find, BorderLayout.NORTH); JPanel boxes = new JPanel(new GridLayout(2, 2)); find.add(boxes, BorderLayout.SOUTH); boxes.add(mc = new JCheckBox(JByteMod.res.getResource("case_sens"))); boxes.add(ww = new JCheckBox(JByteMod.res.getResource("whole_word"))); cp.add(border, BorderLayout.NORTH); JPanel bottom = new JPanel(new GridLayout(1, 0, 10, 10)); JButton findBtn = new JButton(JByteMod.res.getResource("find_next")); findBtn.addActionListener(this); bottom.add(findBtn); JButton closeBtn = new JButton(JByteMod.res.getResource("close")); closeBtn.addActionListener(e -> { this.dispose(); }); bottom.add(closeBtn); cp.add(bottom, BorderLayout.SOUTH); final JPanel center = new JPanel(new GridLayout()); final JPanel left = new JPanel(new GridLayout()); find.add(left, "West"); find.add(center, "Center"); left.add(new JLabel("Find: ")); tf = new JTextField(); center.add(tf); }
Example #18
Source File: FourierPanel.java From osp with GNU General Public License v3.0 | 5 votes |
/** * Creates the plot variable buttons. * * @param datasets the fourier datasets */ protected void createButtons(ArrayList<Dataset> datasets) { if (buttons==null) { buttons = new JCheckBox[datasets.size()]; JPanel buttonPanel = new JPanel(); plotPanel.add(buttonPanel, BorderLayout.SOUTH); for (int i=0; i<buttons.length; i++) { Dataset next = datasets.get(i); buttons[i] = new PlotCheckBox(next.getYColumnName(), next.getFillColor()); buttonPanel.add(buttons[i]); } buttons[0].setSelected(true); } }
Example #19
Source File: EnvironmentViewSupport.java From visualvm with GNU General Public License v2.0 | 5 votes |
private void initComponents() { setLayout(new BorderLayout()); setOpaque(false); add(chartSupport.getChart(), BorderLayout.CENTER); chartSupport.updateDetails(new String[] { "<unknown>" }); }
Example #20
Source File: CoBrowser.java From Spark with Apache License 2.0 | 5 votes |
public void showDialog() { JFrame frame = new JFrame(FpRes.getString("title.cobrowsing.for", sessionID)); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(this); frame.pack(); frame.setSize(600, 400); frame.setLocationRelativeTo(SparkManager.getChatManager().getChatContainer().getChatFrame()); frame.setVisible(true); }
Example #21
Source File: ViewIDEF0PropertiosPanel.java From ramus with GNU General Public License v3.0 | 5 votes |
private JPanel getDefaultDoubleClickActionPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.add(new JLabel("ON_DOUBLE_CLICK"), BorderLayout.WEST); panel.add(actionType, BorderLayout.EAST); return panel; }
Example #22
Source File: WaitDialog.java From Ardulink-2 with Apache License 2.0 | 5 votes |
public WaitDialog(Window window) { super(window); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); setResizable(false); setTitle("Searching..."); setBounds(100, 100, 335, 112); getContentPane().setLayout(new BorderLayout()); getContentPane().add(createContentPanel(), BorderLayout.CENTER); }
Example #23
Source File: ServiceDialog.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Initialize "page setup" dialog */ void initPageDialog(int x, int y, PrintService ps, DocFlavor flavor, PrintRequestAttributeSet attributes) { this.psCurrent = ps; this.docFlavor = flavor; this.asOriginal = attributes; this.asCurrent = new HashPrintRequestAttributeSet(attributes); Container c = getContentPane(); c.setLayout(new BorderLayout()); pnlPageSetup = new PageSetupPanel(); c.add(pnlPageSetup, BorderLayout.CENTER); pnlPageSetup.updateInfo(); JPanel pnlSouth = new JPanel(new FlowLayout(FlowLayout.TRAILING)); btnApprove = createExitButton("button.ok", this); pnlSouth.add(btnApprove); getRootPane().setDefaultButton(btnApprove); btnCancel = createExitButton("button.cancel", this); handleEscKey(btnCancel); pnlSouth.add(btnCancel); c.add(pnlSouth, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { dispose(CANCEL); } }); getAccessibleContext().setAccessibleDescription(getMsg("dialog.pstitle")); setResizable(false); setLocation(x, y); pack(); }
Example #24
Source File: TagInfoPanel.java From jpexs-decompiler with GNU General Public License v3.0 | 5 votes |
public TagInfoPanel(MainPanel mainPanel) { this.mainPanel = mainPanel; setLayout(new BorderLayout()); JLabel topLabel = new JLabel(AppStrings.translate("taginfo.header"), JLabel.CENTER); add(topLabel, BorderLayout.NORTH); add(new JScrollPane(editorPane), BorderLayout.CENTER); editorPane.setContentType("text/html"); editorPane.setEditable(false); HyperlinkListener listener = new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent hyperLink) { if (HyperlinkEvent.EventType.ACTIVATED.equals(hyperLink.getEventType())) { String url = hyperLink.getDescription(); String strId = url.substring(7); Integer id = Integer.parseInt(strId); mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentSwf().getCharacter(id)); } } }; editorPane.addHyperlinkListener(listener); }
Example #25
Source File: DemoTheatreAppImproved.java From arcgis-runtime-demo-java with Apache License 2.0 | 5 votes |
/** * Creates a content pane. * * @return a content pane. */ private static JLayeredPane createContentPane() { JLayeredPane contentPane = new JLayeredPane(); contentPane.setBounds(100, 100, 1000, 700); contentPane.setLayout(new BorderLayout(0, 0)); contentPane.setVisible(true); return contentPane; }
Example #26
Source File: FrmCustom.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
private void init_Figure() { JFrame window = getFrame(); JMenuBar menuBar = new JMenuBar(); menuBar.add(new JMenu("File")); menuBar.add(new JMenu("Figure")); window.setJMenuBar(menuBar); JToolBar toolBar = new JToolBar(); JButton jButton_ZoomIn = new JButton(); jButton_ZoomIn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/TSB_ZoomIn.Image.png"))); // NOI18N jButton_ZoomIn.setToolTipText("Zoom In"); // NOI18N jButton_ZoomIn.setFocusable(false); jButton_ZoomIn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton_ZoomIn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton_ZoomIn.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { //jButton_ZoomInActionPerformed(evt); } }); toolBar.add(jButton_ZoomIn); JButton jButton_ZoomOut = new JButton(); JButton jButton_Pan = new JButton(); JButton jButton_FullExtent = new JButton(); //window.getContentPane().setLayout(new GridLayout(2, 1)); //window.add(toolBar); window.getContentPane().add(toolBar, BorderLayout.PAGE_START); }
Example #27
Source File: DataTrackClipControl.java From tracker with GNU General Public License v3.0 | 5 votes |
/** * Constructor. * * @param model the DataTrack */ public DataTrackClipControl(DataTrack model) { super(new BorderLayout()); dataTrack = model; dataTrack.addPropertyChangeListener(this); createGUI(); refreshSpinners(); refreshGUI(); }
Example #28
Source File: AuthTypeSelectorDlg.java From netbeans with Apache License 2.0 | 5 votes |
/** * * @param auth * @return false if cancelled */ public boolean initAuthentication(final Authentication auth) { AuthenticationSettingsPanel vpanel = new AuthenticationSettingsPanel(auth, false); vpanel.addValidationListener(new AuthValidationListener()); cfgPanel.add(vpanel, BorderLayout.CENTER); DialogDescriptor dd = new DialogDescriptor(this, NbBundle.getMessage(AuthTypeSelectorDlg.class, "TITLE_AuthTypeSelectorDlg"), // NOI18N true, new Object[]{ok, DialogDescriptor.CANCEL_OPTION}, ok, DialogDescriptor.DEFAULT_ALIGN, null, null); Dialog dialog = DialogDisplayer.getDefault().createDialog(dd); dialog.setResizable(false); try { dialog.setVisible(true); } catch (Throwable th) { if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose(); } if (dd.getValue() == ok) { vpanel.applyChanges(null); return true; } else { return false; } }
Example #29
Source File: OpenTCSView.java From openAGV with Apache License 2.0 | 5 votes |
/** * Initializes the frame with the toolbars and the dockable elements. */ private void initializeFrame() { if (!SwingUtilities.isEventDispatchThread()) { try { SwingUtilities.invokeAndWait(() -> initializeFrame()); } catch (InterruptedException | InvocationTargetException e) { LOG.warn("Exception initializing frame", e); } return; } fFrame.getContentPane().removeAll(); dockingManager.initializeDockables(fFrame, vehiclesPanel, fComponentsTreeManager.getTreeView(), fBlocksTreeManager.getTreeView(), fGroupsTreeManager.getTreeView(), fPropertiesComponent, kernelStatusPanel); // Frame fFrame.setLayout(new BorderLayout()); fFrame.add(wrapViewComponent(), BorderLayout.NORTH); fFrame.add(dockingManager.getCControl().getContentArea()); fFrame.add(statusPanel, BorderLayout.SOUTH); restoreDockables(); // Ensure that, after initialization, the selection tool is active. // This needs to be done after the initial drawing views have been set // up so they reflect the behaviour of the selected tool. // XXX Maybe there is a better way to ensure this... toolBarManager.getDragToolButton().doClick(); toolBarManager.getSelectionToolButton().doClick(); }
Example #30
Source File: JPrefsPanel.java From knopflerfish.org with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Create an empty preferences panel. * * <p> * As soon <tt>setPreferences</tt> is called, the panel is filled * with all keys and values from the node. As default, * the keys are also editable. * </p> */ public JPrefsPanel() { super(new BorderLayout()); valuePanel = new JPanel(); valuePanel.setBorder(new EmptyBorder(3,3,3,3)); valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.Y_AXIS)); JScrollPane scroll = new JScrollPane(valuePanel); add(scroll, BorderLayout.CENTER); JPanel cmdPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 1, 1)); addButton = new JButton("Add key") { private static final long serialVersionUID = 1L; { addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ev) { doAddKey(); } }); } }; addButton.setToolTipText("Add new key"); // cmdPanel.add(addButton); header = new JLabel(); add(cmdPanel, BorderLayout.SOUTH); add(header, BorderLayout.NORTH); }