Search in sources :

Example 96 with EmptyBorder

use of javax.swing.border.EmptyBorder in project processdash by dtuma.

the class DefectImportForm method buildAndShowWindow.

private void buildAndShowWindow(Element xml, String windowName) {
    frame = new JFrame(windowName) {

        public void dispose() {
            super.dispose();
            disposeForm();
        }
    };
    DashboardIconFactory.setWindowIcon(frame);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frame.getContentPane().setLayout(new BorderLayout());
    ((JComponent) getContainer()).setBorder(new EmptyBorder(5, 5, 5, 5));
    frame.getContentPane().add(BorderLayout.NORTH, getContainer());
    BoundDefectTable defectTable = new BoundDefectTable(this);
    defectTable.setBorder(new EmptyBorder(0, 10, 0, 10));
    frame.getContentPane().add(BorderLayout.CENTER, defectTable);
    frame.getContentPane().add(BorderLayout.SOUTH, createButtonBox());
    int width = XMLUtils.getXMLInt(xml, "windowWidth");
    if (width <= 0)
        width = 600;
    int height = XMLUtils.getXMLInt(xml, "windowHeight");
    if (height <= 0)
        height = 500;
    frame.setSize(width, height);
    frame.setVisible(true);
}
Also used : BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) JComponent(javax.swing.JComponent) EmptyBorder(javax.swing.border.EmptyBorder)

Example 97 with EmptyBorder

use of javax.swing.border.EmptyBorder in project processdash by dtuma.

the class AbstractLibraryEditor method buildContents.

private void buildContents() {
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    Insets insets0 = new Insets(0, 0, 0, 0);
    Insets insets10 = new Insets(10, 10, 10, 10);
    projectTable = buildJTable(projectModel);
    projectTable.setEditingEnabled(false);
    JScrollPane sp = new JScrollPane(projectTable);
    initConstraints(c, 0, 1, 2, 2, GridBagConstraints.BOTH, 2, 2, GridBagConstraints.CENTER, insets0);
    layout.setConstraints(sp, c);
    panel.add(sp);
    libraryTable = buildJTable(libraryModel);
    libraryTable.setEditingEnabled(false);
    libraryTable.setBackground(LIGHT_SEPIA);
    sp = new JScrollPane(libraryTable);
    initConstraints(c, 3, 1, 2, 2, GridBagConstraints.BOTH, 2, 2, GridBagConstraints.CENTER, insets0);
    layout.setConstraints(sp, c);
    panel.add(sp);
    selectedDefinitionNames = new NameSetPropertyEditor();
    WBSNameSelectionModel wsm = new WBSNameSelectionModel(projectTable, selectedDefinitionNames);
    projectTable.setSelectionModel(wsm);
    WBSNameSelectionModel lsm = new WBSNameSelectionModel(libraryTable, selectedDefinitionNames);
    libraryTable.setSelectionModel(lsm);
    new SelectionListener(wsm, lsm, export);
    addButton = new JButton(resources.getString("Overwrite"));
    addButton.setIcon(export ? IconFactory.getRightArrowIcon() : IconFactory.getLeftArrowIcon());
    addButton.setHorizontalTextPosition(export ? SwingConstants.LEFT : SwingConstants.RIGHT);
    addButton.setMinimumSize(addButton.getPreferredSize());
    addButton.setText(resources.getString("Add"));
    addButton.setMnemonic('A');
    addButton.setEnabled(false);
    addButton.addActionListener(createActionListener("addDefinitionAction"));
    initConstraints(c, 2, 1, 1, 1, GridBagConstraints.HORIZONTAL, 0, 1, GridBagConstraints.SOUTH, insets10);
    layout.setConstraints(addButton, c);
    panel.add(addButton);
    addAllButton = new JButton(resources.getString("Add_All"));
    addAllButton.setMnemonic('L');
    addAllButton.setIcon(export ? IconFactory.getRightArrowIcon() : IconFactory.getLeftArrowIcon());
    addAllButton.setHorizontalTextPosition(export ? SwingConstants.LEFT : SwingConstants.RIGHT);
    addAllButton.addActionListener(createActionListener("addAllDefinitionsAction"));
    initConstraints(c, 2, 2, 1, 1, GridBagConstraints.HORIZONTAL, 0, 1, GridBagConstraints.NORTH, insets10);
    layout.setConstraints(addAllButton, c);
    panel.add(addAllButton);
    JLabel label = new JLabel(resources.format("Project_Heading_FMT", teamProject.getProjectName()));
    initConstraints(c, 0, 0, 1, 1, GridBagConstraints.NONE, 0, 0, GridBagConstraints.WEST, insets0);
    layout.setConstraints(label, c);
    panel.add(label);
    String libraryFileName = libraryFile.getFileName();
    String header = (libraryFileName != null ? resources.format("Library_Heading_FMT", libraryFileName) : resources.getString("Org_Library_Heading"));
    label = new JLabel(header);
    initConstraints(c, 3, 0, 1, 1, GridBagConstraints.NONE, 0, 0, GridBagConstraints.WEST, insets0);
    layout.setConstraints(label, c);
    panel.add(label);
    Box buttonPanel = Box.createHorizontalBox();
    buttonPanel.add(Box.createHorizontalGlue());
    okButton = new JButton(resources.getString(export ? "Export" : "Import"));
    okButton.addActionListener(createActionListener("okAction"));
    buttonPanel.add(okButton);
    cancelButton = new JButton(resources.getString("Cancel"));
    cancelButton.addActionListener(createActionListener("cancelAction"));
    buttonPanel.add(Box.createHorizontalStrut(10));
    buttonPanel.add(cancelButton);
    initConstraints(c, 0, 3, 5, 1, GridBagConstraints.BOTH, 0, 0, GridBagConstraints.NORTH, new Insets(10, 0, 0, 0));
    layout.setConstraints(buttonPanel, c);
    panel.add(buttonPanel);
    dialog.setContentPane(panel);
    dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    dialog.addWindowListener(new WindowAdapter() {

        public void windowClosing(WindowEvent e) {
            cancelAction();
        }
    });
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) Box(javax.swing.Box) WindowEvent(java.awt.event.WindowEvent) EmptyBorder(javax.swing.border.EmptyBorder) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 98 with EmptyBorder

use of javax.swing.border.EmptyBorder in project processdash by dtuma.

the class TimeLogEditor method constructFilterPanel.

private JPanel constructFilterPanel() {
    JPanel retPanel = new JPanel(false);
    retPanel.setLayout(new BoxLayout(retPanel, BoxLayout.X_AXIS));
    retPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    DropDownButton button;
    JLabel label;
    retPanel.add(Box.createHorizontalGlue());
    addTimeFormatControl(retPanel);
    retPanel.add(new JLabel("          "));
    label = new JLabel(getResource("Filter.Label") + " ");
    retPanel.add(label);
    retPanel.add(Box.createHorizontalStrut(5));
    addScrollButton(retPanel, "Filter.Scroll_Backward", "scrollFilterBackward");
    fromDate = addDateField(retPanel, "Filter.From");
    toDate = addDateField(retPanel, "Filter.To");
    addScrollButton(retPanel, "Filter.Scroll_Forward", "scrollFilterForward");
    button = new DropDownButton(getResource("Filter.Apply"));
    button.setRunFirstMenuOption(false);
    button.getButton().addActionListener(createActionListener("applyFilter"));
    JMenu menu = button.getMenu();
    addFilterMenuItem(menu, "Filter.Today", "filterToday");
    addFilterMenuItem(menu, "Filter.Week", "filterThisWeek");
    menu.add(createWeekFilterStartDaySubmenu());
    addFilterMenuItem(menu, "Filter.Month", "filterThisMonth");
    menu.addSeparator();
    addFilterMenuItem(menu, "Filter.Remove", "clearFilter");
    retPanel.add(button);
    retPanel.add(Box.createHorizontalGlue());
    return retPanel;
}
Also used : JPanel(javax.swing.JPanel) DropDownButton(net.sourceforge.processdash.ui.lib.DropDownButton) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder) JMenu(javax.swing.JMenu)

Example 99 with EmptyBorder

use of javax.swing.border.EmptyBorder in project gephi by gephi.

the class BasicRichTooltipPanelUI method installDefaults.

/**
	 * Installs default settings for the associated rich tooltip panel.
	 */
protected void installDefaults() {
    Border b = this.richTooltipPanel.getBorder();
    if (b == null || b instanceof UIResource) {
        Border toSet = UIManager.getBorder("RichTooltipPanel.border");
        if (toSet == null)
            toSet = new BorderUIResource.CompoundBorderUIResource(new LineBorder(FlamingoUtilities.getBorderColor()), new EmptyBorder(2, 4, 3, 4));
        this.richTooltipPanel.setBorder(toSet);
    }
    LookAndFeel.installProperty(this.richTooltipPanel, "opaque", Boolean.TRUE);
}
Also used : LineBorder(javax.swing.border.LineBorder) EmptyBorder(javax.swing.border.EmptyBorder) LineBorder(javax.swing.border.LineBorder) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder) BorderUIResource(javax.swing.plaf.BorderUIResource) UIResource(javax.swing.plaf.UIResource)

Example 100 with EmptyBorder

use of javax.swing.border.EmptyBorder in project gephi by gephi.

the class DirectoryChooserUI method installComponents.

@Override
public void installComponents(JFileChooser fc) {
    fileChooser = fc;
    fc.setFocusCycleRoot(true);
    fc.setBorder(new EmptyBorder(4, 10, 10, 10));
    fc.setLayout(new BorderLayout(8, 8));
    updateUseShellFolder();
    createCenterPanel(fc);
    fc.add(centerPanel, BorderLayout.CENTER);
    if (fc.isMultiSelectionEnabled()) {
        setFileName(getStringOfFileNames(fc.getSelectedFiles()));
    } else {
        setFileName(getStringOfFileName(fc.getSelectedFile()));
    }
    if (fc.getControlButtonsAreShown()) {
        addControlButtons();
    }
    createPopup();
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)198 JPanel (javax.swing.JPanel)79 BorderLayout (java.awt.BorderLayout)73 JLabel (javax.swing.JLabel)52 JScrollPane (javax.swing.JScrollPane)39 JButton (javax.swing.JButton)38 Dimension (java.awt.Dimension)30 Insets (java.awt.Insets)26 ActionListener (java.awt.event.ActionListener)21 Border (javax.swing.border.Border)21 Box (javax.swing.Box)20 GridBagLayout (java.awt.GridBagLayout)19 ActionEvent (java.awt.event.ActionEvent)19 TitledBorder (javax.swing.border.TitledBorder)18 FlowLayout (java.awt.FlowLayout)15 GridLayout (java.awt.GridLayout)15 JTextArea (javax.swing.JTextArea)15 JTextField (javax.swing.JTextField)15 BoxLayout (javax.swing.BoxLayout)14 GridBagConstraints (java.awt.GridBagConstraints)13