Search in sources :

Example 31 with EmptyBorder

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

the class ContextAuthenticationPanel method initialize.

/**
	 * Initialize the panel.
	 */
private void initialize() {
    this.setLayout(new CardLayout());
    this.setName(buildName(getContextIndex()));
    this.setLayout(new GridBagLayout());
    this.setBorder(new EmptyBorder(2, 2, 2, 2));
    this.add(new JLabel(LABEL_DESCRIPTION), LayoutHelper.getGBC(0, 0, 1, 1.0D));
    // Method type combo box
    this.add(new JLabel(FIELD_LABEL_TYPE_SELECT), LayoutHelper.getGBC(0, 1, 1, 1.0D, new Insets(20, 0, 5, 5)));
    this.add(getAuthenticationMethodsComboBox(), LayoutHelper.getGBC(0, 2, 1, 1.0D));
    // Method config panel container
    this.add(getConfigContainerPanel(), LayoutHelper.getGBC(0, 3, 1, 1.0d, new Insets(10, 0, 10, 0)));
    // Logged In/Out indicators
    this.add(new JLabel(FIELD_LABEL_LOGGED_IN_INDICATOR), LayoutHelper.getGBC(0, 4, 1, 1.0D));
    this.add(getLoggedInIndicaterRegexField(), LayoutHelper.getGBC(0, 5, 1, 1.0D));
    this.add(new JLabel(FIELD_LABEL_LOGGED_OUT_INDICATOR), LayoutHelper.getGBC(0, 6, 1, 1.0D));
    this.add(getLoggedOutIndicaterRegexField(), LayoutHelper.getGBC(0, 7, 1, 1.0D));
    // Padding
    this.add(new JLabel(), LayoutHelper.getGBC(0, 99, 1, 1.0D, 1.0D));
}
Also used : CardLayout(java.awt.CardLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 32 with EmptyBorder

use of javax.swing.border.EmptyBorder in project pcgen by PCGen.

the class KitPanel method initComponents.

private void initComponents() {
    renderer.setCharacter(character);
    FlippingSplitPane topPane = new FlippingSplitPane("kitTop");
    setTopComponent(topPane);
    setOrientation(VERTICAL_SPLIT);
    FilterBar<Object, KitFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
    bar.addDisplayableFilter(qFilterButton);
    availableTable.setTreeViewModel(new KitTreeViewModel(character, true));
    availableTable.setTreeCellRenderer(renderer);
    JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTable, bar);
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    addButton.setHorizontalTextPosition(SwingConstants.LEADING);
    addButton.setAction(addAction);
    box.add(addButton);
    box.add(Box.createHorizontalStrut(5));
    box.setBorder(new EmptyBorder(0, 0, 5, 0));
    availPanel.add(box, BorderLayout.SOUTH);
    topPane.setLeftComponent(availPanel);
    JPanel selPanel = new JPanel(new BorderLayout());
    FilterBar<Object, KitFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeViewModel(new KitTreeViewModel(character, false));
    selectedTable.setTreeCellRenderer(renderer);
    selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
    topPane.setRightComponent(selPanel);
    setBottomComponent(infoPane);
    setResizeWeight(0.75);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) KitFacade(pcgen.facade.core.KitFacade) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane)

Example 33 with EmptyBorder

use of javax.swing.border.EmptyBorder in project EnrichmentMapApp by BaderLab.

the class PopupDaemon method stateChanged.

/**
	 * Upon state change, pop-up a tiny window with low-high.
	 *
	 * @param e ChangeEvent Object.
	 */
public void stateChanged(ChangeEvent e) {
    NumberRangeModel model = (NumberRangeModel) getModel();
    Number low = (Number) model.getLowValue();
    Number high = (Number) model.getHighValue();
    Number min = (Number) model.getMinValue();
    Number max = (Number) model.getMaxValue();
    DecimalFormat format;
    String lowStr = null;
    String highStr = null;
    if (low instanceof Integer) {
        lowStr = Integer.toString((Integer) low);
        highStr = Integer.toString((Integer) high);
    } else {
        if ((max.doubleValue() - min.doubleValue()) < .001) {
            format = new DecimalFormat("0.###E0");
        } else if ((max.doubleValue() - min.doubleValue()) > 100000) {
            format = new DecimalFormat("0.###E0");
        } else {
            format = new DecimalFormat("###,###.000");
        }
        lowStr = format.format(low);
        highStr = format.format(high);
    }
    if (isVisible()) {
        if (popup == null) {
            PopupFactory popupFactory = PopupFactory.getSharedInstance();
            JPanel panel = new JPanel();
            panel.setBorder(new LineBorder(Color.LIGHT_GRAY, 1));
            panel.setPreferredSize(getPreferredSize());
            panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
            popupLow = new JLabel(lowStr);
            popupLow.setBorder(new EmptyBorder(6, 2, 6, 2));
            popupHigh = new JLabel(highStr);
            popupHigh.setBorder(new EmptyBorder(6, 2, 6, 2));
            panel.add(popupLow);
            panel.add(Box.createHorizontalGlue());
            panel.add(popupHigh);
            popup = popupFactory.getPopup(this, panel, getLocationOnScreen().x, getLocationOnScreen().y + getPreferredSize().height + 2);
            popupDaemon = new PopupDaemon(this, 1000);
            popup.show();
        } else {
            popupLow.setText(lowStr);
            popupHigh.setText(highStr);
            popupDaemon.restart();
        }
    }
}
Also used : DecimalFormat(java.text.DecimalFormat) LineBorder(javax.swing.border.LineBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 34 with EmptyBorder

use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.

the class StudyToolWindow method enterEditingMode.

public void enterEditingMode(VirtualFile taskFile, Project project) {
    final EditorFactory factory = EditorFactory.getInstance();
    Document document = FileDocumentManager.getInstance().getDocument(taskFile);
    if (document == null) {
        return;
    }
    WebBrowserManager.getInstance().setShowBrowserHover(false);
    final EditorEx createdEditor = (EditorEx) factory.createEditor(document, project, taskFile, false);
    Disposer.register(project, new Disposable() {

        public void dispose() {
            factory.releaseEditor(createdEditor);
        }
    });
    JComponent editorComponent = createdEditor.getComponent();
    editorComponent.setBorder(new EmptyBorder(10, 20, 0, 10));
    editorComponent.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
    EditorSettings editorSettings = createdEditor.getSettings();
    editorSettings.setLineMarkerAreaShown(false);
    editorSettings.setLineNumbersShown(false);
    editorSettings.setFoldingOutlineShown(false);
    mySplitPane.setFirstComponent(editorComponent);
    mySplitPane.repaint();
    StudyTaskManager.getInstance(project).setToolWindowMode(StudyToolWindowMode.EDITING);
}
Also used : Disposable(com.intellij.openapi.Disposable) EditorFactory(com.intellij.openapi.editor.EditorFactory) EditorSettings(com.intellij.openapi.editor.EditorSettings) EditorEx(com.intellij.openapi.editor.ex.EditorEx) Document(com.intellij.openapi.editor.Document) EmptyBorder(javax.swing.border.EmptyBorder)

Example 35 with EmptyBorder

use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.

the class StartBrowserPanel method createUIComponents.

private void createUIComponents() {
    myBrowserSelector = new BrowserSelector();
    myBrowserComboBox = myBrowserSelector.getMainComponent();
    if (UIUtil.isUnderAquaLookAndFeel()) {
        myBrowserComboBox.setBorder(new EmptyBorder(3, 0, 0, 0));
    }
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)224 JPanel (javax.swing.JPanel)96 BorderLayout (java.awt.BorderLayout)87 JLabel (javax.swing.JLabel)70 JButton (javax.swing.JButton)44 JScrollPane (javax.swing.JScrollPane)44 Insets (java.awt.Insets)37 Dimension (java.awt.Dimension)35 Border (javax.swing.border.Border)30 GridBagLayout (java.awt.GridBagLayout)29 ActionEvent (java.awt.event.ActionEvent)27 ActionListener (java.awt.event.ActionListener)27 TitledBorder (javax.swing.border.TitledBorder)25 GridBagConstraints (java.awt.GridBagConstraints)24 Box (javax.swing.Box)22 JTextField (javax.swing.JTextField)21 CompoundBorder (javax.swing.border.CompoundBorder)20 BoxLayout (javax.swing.BoxLayout)17 FlowLayout (java.awt.FlowLayout)16 JCheckBox (javax.swing.JCheckBox)16