Search in sources :

Example 16 with JSeparator

use of javax.swing.JSeparator in project ACS by ACS-Community.

the class FilterChooserDialog method initMenubar.

/**
	 * Initialize the menubar
	 *
	 */
private void initMenubar() {
    JMenu fileMenu = new JMenu("File");
    fileMenu.add(loadMI);
    fileMenu.add(saveMI);
    fileMenu.add(saveAsMI);
    fileMenu.add(new JSeparator());
    fileMenu.add(closeMI);
    JMenu editMenu = new JMenu("Edit");
    editMenu.add(activateAllMI);
    editMenu.add(deactivateAllMI);
    editMenu.add(new JSeparator());
    editMenu.add(clearAllMI);
    menuBar.add(fileMenu);
    menuBar.add(editMenu);
    setJMenuBar(menuBar);
    // Add the event listeners
    loadMI.addActionListener(bl);
    saveMI.addActionListener(bl);
    saveAsMI.addActionListener(bl);
    closeMI.addActionListener(bl);
    activateAllMI.addActionListener(bl);
    deactivateAllMI.addActionListener(bl);
    clearAllMI.addActionListener(bl);
}
Also used : JMenu(javax.swing.JMenu) JSeparator(javax.swing.JSeparator)

Example 17 with JSeparator

use of javax.swing.JSeparator in project ACS by ACS-Community.

the class ObjectExplorer method getconverterMenu.

/**
	 * Return the convertMenuItem property value.
	 * @return javax.swing.JMenuItem
	 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JMenu getconverterMenu() {
    if (ivjconverterMenu == null) {
        try {
            ivjconverterMenu = new javax.swing.JMenu();
            ivjconverterMenu.setName("converterMenu");
            ivjconverterMenu.setText("convert");
            // user code begin {1}
            // list of converters is static
            List converters = getConverterRepository();
            if (converters.size() > 0) {
                JMenuItem item = new JMenuItem("none");
                item.addActionListener(new SetConverterActionListener(null));
                ivjconverterMenu.add(item);
                ivjconverterMenu.add(new JSeparator());
            }
            Iterator iter = converters.iterator();
            while (iter.hasNext()) {
                Converter converter = (Converter) iter.next();
                JMenuItem item = new JMenuItem(converter.getDescription());
                item.addActionListener(new SetConverterActionListener(converter));
                ivjconverterMenu.add(item);
            }
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjconverterMenu;
}
Also used : Iterator(java.util.Iterator) JMenu(javax.swing.JMenu) Converter(si.ijs.acs.objectexplorer.engine.Converter) ArrayList(java.util.ArrayList) List(java.util.List) JMenuItem(javax.swing.JMenuItem) JSeparator(javax.swing.JSeparator)

Example 18 with JSeparator

use of javax.swing.JSeparator in project ACS by ACS-Community.

the class CommandCenterGui method prepare.

public void prepare() {
    boolean setLookAndFeel = false;
    if (setLookAndFeel) {
        String lafName = UIManager.getSystemLookAndFeelClassName();
        try {
            UIManager.setLookAndFeel(lafName);
        } catch (Exception exc) {
            log.fine("Couldn't set look and feel " + lafName + " due to " + exc);
        }
    }
    // title added later in doFrameTitle()
    frame = new JFrame("");
    frame.addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            controller.stop();
        }
    });
    dlgContainerSettings = new EditContainerSettingsDialog(this);
    frontPanel = new TabPanel(this);
    writeModelToFrontPanel();
    // Splitter between tree and the rest
    splitLeftRight = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitLeftRight.setOneTouchExpandable(true);
    JPanel p2 = new JPanel(new BorderLayout());
    p2.setBorder(new EmptyBorder(10, 10, 10, 10));
    p2.add(frontPanel, BorderLayout.NORTH);
    splitLeftRight.setLeftComponent(p2);
    // Deployment Tree
    deploymentInfoPanel = new JPanel(new BorderLayout());
    deploymentInfoPanel.setBorder(new CompoundBorder(new EmptyBorder(5, 7, 5, 7), new TitledBorder(LineBorder.createBlackLineBorder(), " Deployment Info ")));
    deployTree = new DeploymentTree(controller.deploymentTreeControllerImpl);
    JPanel addToDeployTree = new AddToDeployTree(this, deployTree);
    deploymentInfoPanel.add(addToDeployTree, BorderLayout.NORTH);
    deploymentInfoPanel.add(new JScrollPane(deployTree), BorderLayout.CENTER);
    splitLeftRight.setRightComponent(deploymentInfoPanel);
    // Feedback Area
    feedbackTabs = new FeedbackTabs(this, FeedbackTabs.BOTTOM);
    // Logo Panel
    JPanel logoPanel = new LogoPanel(COLOR_LogoBackground_A, COLOR_LogoBackground_B);
    logoPanel.setLayout(new BorderLayout());
    JLabel alma = new JLabel(new ImageIcon(controller.findResource("alma.jpg")));
    logoPanel.add(alma, BorderLayout.WEST);
    JLabel text = new JLabel("Acs Command Center");
    text.setForeground(COLOR_LogoForeground);
    text.setHorizontalTextPosition(SwingConstants.CENTER);
    text.setFont(text.getFont().deriveFont((float) (text.getFont().getSize() * 2.5)));
    text.setBorder(new EmptyBorder(5, 30, 5, 30));
    logoPanel.add(text, BorderLayout.CENTER);
    //		JLabel version = new JLabel(controller.version());
    //		version.setForeground(COLOR_LogoForeground);
    //		version.setBorder(new EmptyBorder(0, 0, 0, 4));
    //		JPanel pnl2 = new JPanel(new BorderLayout());
    //		pnl2.setOpaque(false);
    //		pnl2.add(version, BorderLayout.SOUTH);
    //		logoPanel.add(pnl2, BorderLayout.EAST);
    menuBar = new JMenuBar();
    JMenu fileMenu = new JMenu("Project");
    fileMenu.setMnemonic(KeyEvent.VK_P);
    {
        JMenu newMenu = new JMenu("New");
        newMenu.add(new ActionNewProject("Project"));
        fileMenu.add(newMenu);
    }
    fileMenu.add(new ActionOpenProject("Open..."));
    fileMenu.add(new ActionSaveProject("Save"));
    fileMenu.add(new ActionSaveAsProject("Save As..."));
    fileMenu.addSeparator();
    fileMenu.add(new ActionExit("Exit"));
    menuBar.add(fileMenu);
    toolsMenu = new JMenu("Tools");
    toolsMenu.setMnemonic(KeyEvent.VK_T);
    toolsMenu.add(new ActionConfigureTools("Configure Tools..."));
    toolsMenu.addSeparator();
    menuBar.add(toolsMenu);
    // ---
    JMenu extrasMenu = new JMenu("Expert");
    extrasMenu.setMnemonic(KeyEvent.VK_E);
    {
        //				JMenu sshMode = new JMenu("SSH Library");
        //				sshMode.add(new ActionSetSshMode("Platform-independent", false, false));
        //				sshMode.add(new ActionSetSshMode("Natively installed ssh", true, true));
        //				extrasMenu.add(sshMode);
        //				extrasMenu.add(new JSeparator());
        JMenu extraTools = new JMenu("Tools Menu");
        extraTools.add(new ActionShowExtraTools("View..."));
        extraTools.add(new ActionInstallExtraTools("Replace..."));
        extrasMenu.add(extraTools);
        JMenu builtinTools = new JMenu("Acs Scripts");
        builtinTools.add(new ActionShowBuiltinTools("View..."));
        builtinTools.add(new ActionLoadBuiltinTools("Replace..."));
        extrasMenu.add(builtinTools);
    }
    extrasMenu.add(new JSeparator());
    extrasMenu.add(new ActionShowVariables("Variables..."));
    menuBar.add(extrasMenu);
    // ---
    JMenuItem item;
    JMenu helpMenu = new JMenu("Help");
    helpMenu.setMnemonic(KeyEvent.VK_H);
    item = helpMenu.add(new ActionShowHelp("Online Help"));
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
    item = helpMenu.add(new ActionShowAbout("About"));
    menuBar.add(Box.createHorizontalGlue());
    menuBar.add(helpMenu);
    // ---
    JPanel h = new JPanel(new SpringLayout());
    h.add(logoPanel);
    h.add(menuBar);
    SpringUtilities.makeCompactGrid(h, 0, 1);
    frame.getContentPane().add(h, BorderLayout.NORTH);
    // ---
    pnlManagerLocationForTools = new ManagerLocationPanel.ForTools();
    managerLocationDialog1 = new BasicDialog(this, "Specify Manager and Services for Tools", "Set", pnlManagerLocationForTools);
    // ---
    pnlManagerLocationForContainers = new ManagerLocationPanel.ForContainers();
    managerLocationDialog2 = new BasicDialog(this, "Specify Manager and Services for Containers", "Set", pnlManagerLocationForContainers);
    // ---
    splitTopBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT, splitLeftRight, feedbackTabs);
    splitTopBottom.setOneTouchExpandable(true);
    // --- 
    // 2009-04: Introducing a desktop layout so i can make the
    // progress dialog a lightweight window on top the front panel
    AccInternalFrame bigInternalFrame = new AccInternalFrame();
    bigInternalFrame.add(splitTopBottom);
    desktop = new JDesktopPane();
    bigInternalFrame.setVisible(true);
    desktop.add(bigInternalFrame);
    frame.getContentPane().add(desktop, BorderLayout.CENTER);
    try {
        bigInternalFrame.setSelected(true);
        bigInternalFrame.setMaximum(true);
    } catch (PropertyVetoException exc) {
    }
    // for mysterious swing reasons, the desktop has a preferred size
    // of (1,1) instead of picking up the preferred size of its child
    // component, so i'm doing this manually here.
    desktop.setPreferredSize(bigInternalFrame.getPreferredSize());
    doFrameTitle();
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) JDesktopPane(javax.swing.JDesktopPane) WindowAdapter(java.awt.event.WindowAdapter) TitledBorder(javax.swing.border.TitledBorder) JSeparator(javax.swing.JSeparator) BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) JMenuItem(javax.swing.JMenuItem) JScrollPane(javax.swing.JScrollPane) JLabel(javax.swing.JLabel) PropertyVetoException(java.beans.PropertyVetoException) UnresolvableException(alma.acs.commandcenter.util.VariableString.UnresolvableException) PropertyVetoException(java.beans.PropertyVetoException) WindowEvent(java.awt.event.WindowEvent) SpringLayout(javax.swing.SpringLayout) JSplitPane(javax.swing.JSplitPane) JMenuBar(javax.swing.JMenuBar) JMenu(javax.swing.JMenu)

Example 19 with JSeparator

use of javax.swing.JSeparator in project zaproxy by zaproxy.

the class DialogAddUser method getFieldsPanel.

@Override
protected JPanel getFieldsPanel() {
    if (fieldsPanel == null) {
        fieldsPanel = new JPanel();
        fieldsPanel.setLayout(new GridBagLayout());
        fieldsPanel.setName("DialogAddUser");
        Insets insets = new Insets(4, 8, 2, 4);
        JLabel nameLabel = new JLabel(Constant.messages.getString("users.dialog.add.field.label.name"));
        JLabel enabledLabel = new JLabel(Constant.messages.getString("users.dialog.add.field.label.enabled"));
        fieldsPanel.add(nameLabel, LayoutHelper.getGBC(0, 0, 1, 0.5D, insets));
        fieldsPanel.add(getNameTextField(), LayoutHelper.getGBC(1, 0, 1, 0.5D, insets));
        fieldsPanel.add(enabledLabel, LayoutHelper.getGBC(0, 1, 1, 0.5D, insets));
        fieldsPanel.add(getEnabledCheckBox(), LayoutHelper.getGBC(1, 1, 1, 0.5D, insets));
        fieldsPanel.add(new JSeparator(), LayoutHelper.getGBC(0, 2, 2, 0.5D, insets));
    }
    return fieldsPanel;
}
Also used : JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator)

Example 20 with JSeparator

use of javax.swing.JSeparator in project jdk8u_jdk by JetBrains.

the class DimensionEncapsulation method run.

@Override
public void run() {
    runTest(new Panel());
    runTest(new Button());
    runTest(new Checkbox());
    runTest(new Canvas());
    runTest(new Choice());
    runTest(new Label());
    runTest(new Scrollbar());
    runTest(new TextArea());
    runTest(new TextField());
    runTest(new Dialog(new JFrame()));
    runTest(new Frame());
    runTest(new Window(new JFrame()));
    runTest(new FileDialog(new JFrame()));
    runTest(new List());
    runTest(new ScrollPane());
    runTest(new JFrame());
    runTest(new JDialog(new JFrame()));
    runTest(new JWindow(new JFrame()));
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    //runTest(new JScrollBar()); --> don't test defines max and min in
    // terms of preferred
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) Choice(java.awt.Choice) JTextArea(javax.swing.JTextArea) TextArea(java.awt.TextArea) JTextArea(javax.swing.JTextArea) Label(java.awt.Label) JLabel(javax.swing.JLabel) JTableHeader(javax.swing.table.JTableHeader) JToggleButton(javax.swing.JToggleButton) JToggleButton(javax.swing.JToggleButton) Button(java.awt.Button) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) JFrame(javax.swing.JFrame) Checkbox(java.awt.Checkbox) JDialog(javax.swing.JDialog) FileDialog(java.awt.FileDialog) Dialog(java.awt.Dialog) JTextField(javax.swing.JTextField) TextField(java.awt.TextField) JFormattedTextField(javax.swing.JFormattedTextField) JSlider(javax.swing.JSlider) ArrayList(java.util.ArrayList) List(java.awt.List) Canvas(java.awt.Canvas) JWindow(javax.swing.JWindow) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) ScrollPane(java.awt.ScrollPane) JScrollPane(javax.swing.JScrollPane) JTable(javax.swing.JTable) JSpinner(javax.swing.JSpinner) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JDialog(javax.swing.JDialog) JFrame(javax.swing.JFrame) Frame(java.awt.Frame) JInternalFrame(javax.swing.JInternalFrame) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JTextPane(javax.swing.JTextPane) JMenuItem(javax.swing.JMenuItem) Component(java.awt.Component) Scrollbar(java.awt.Scrollbar) Window(java.awt.Window) JWindow(javax.swing.JWindow) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) Panel(java.awt.Panel) JEditorPane(javax.swing.JEditorPane) JRootPane(javax.swing.JRootPane) FileDialog(java.awt.FileDialog) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Aggregations

JSeparator (javax.swing.JSeparator)147 JPanel (javax.swing.JPanel)74 JLabel (javax.swing.JLabel)65 ActionEvent (java.awt.event.ActionEvent)44 BoxLayout (javax.swing.BoxLayout)44 JButton (javax.swing.JButton)44 JMenuItem (javax.swing.JMenuItem)38 JMenu (javax.swing.JMenu)32 GridBagConstraints (java.awt.GridBagConstraints)31 Insets (java.awt.Insets)30 ActionListener (java.awt.event.ActionListener)30 Dimension (java.awt.Dimension)24 FlowLayout (java.awt.FlowLayout)24 JScrollPane (javax.swing.JScrollPane)24 GridBagLayout (java.awt.GridBagLayout)22 JPopupMenu (javax.swing.JPopupMenu)19 BorderLayout (java.awt.BorderLayout)16 JTextField (javax.swing.JTextField)16 JCheckBox (javax.swing.JCheckBox)13 AbstractAction (javax.swing.AbstractAction)12