Search in sources :

Example 6 with CompoundBorder

use of javax.swing.border.CompoundBorder in project nhin-d by DirectProject.

the class EditorPanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    policyText = new JTextArea();
    policyText.setLineWrap(true);
    policyText.setWrapStyleWord(true);
    policyText.setEditable(true);
    final JScrollPane scrollPane = new JScrollPane(policyText);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    fileNameLabel = new JLabel("*New File*");
    final JPanel reportPanel = new JPanel(new BorderLayout());
    reportPanel.add(fileNameLabel, BorderLayout.NORTH);
    reportPanel.add(scrollPane, BorderLayout.CENTER);
    //this.add(reportPanel, BorderLayout.CENTER);
    validatePanel = new ValidatePanel();
    validatePanel.setFeedMode(PolicyLexicon.SIMPLE_TEXT_V1, policyText.getDocument());
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, reportPanel, validatePanel);
    splitPane.setDividerLocation(400);
    this.add(splitPane, BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JTextArea(javax.swing.JTextArea) ValidatePanel(org.nhindirect.policy.tools.policyvalidate.ValidatePanel) BorderLayout(java.awt.BorderLayout) SoftBevelBorder(javax.swing.border.SoftBevelBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) JSplitPane(javax.swing.JSplitPane)

Example 7 with CompoundBorder

use of javax.swing.border.CompoundBorder in project jdk8u_jdk by JetBrains.

the class Test8039750 method test.

private static void test(Object value, String one, String two) {
    if (value instanceof CompoundBorder) {
        CompoundBorder border = (CompoundBorder) value;
        test(border.getOutsideBorder(), one);
        test(border.getInsideBorder(), two);
    } else {
        throw new Error("CompoundBorder");
    }
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder)

Example 8 with CompoundBorder

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

the class TestResultsPanel method createOutputTab.

private static JComponent createOutputTab(JComponent console, AnAction[] consoleActions) {
    JPanel outputTab = new JPanel(new BorderLayout());
    console.setFocusable(true);
    final Color editorBackground = EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground();
    console.setBorder(new CompoundBorder(IdeBorderFactory.createBorder(SideBorder.RIGHT | SideBorder.TOP), new SideBorder(editorBackground, SideBorder.LEFT)));
    outputTab.add(console, BorderLayout.CENTER);
    final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, new DefaultActionGroup(consoleActions), false);
    outputTab.add(toolbar.getComponent(), BorderLayout.EAST);
    return outputTab;
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder)

Example 9 with CompoundBorder

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

the class DarculaSpinnerUI method createArrow.

private JButton createArrow(@MagicConstant(intValues = { SwingConstants.NORTH, SwingConstants.SOUTH }) int direction) {
    final Color shadow = UIUtil.getPanelBackground();
    final Color enabledColor = new JBColor(Gray._255, UIUtil.getLabelForeground());
    final Color disabledColor = new JBColor(Gray._200, UIUtil.getLabelForeground().darker());
    BasicArrowButton b = new BasicArrowButton(direction, shadow, shadow, enabledColor, shadow) {

        @Override
        public void paint(Graphics g) {
            paintArrowButton(g, this, direction);
        }

        @Override
        public boolean isOpaque() {
            return false;
        }

        @Override
        public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) {
            final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
            int mid;
            final int w = 8;
            final int h = 6;
            mid = w / 2;
            g.setColor(isEnabled ? enabledColor : disabledColor);
            g.translate(x, y);
            switch(direction) {
                case SOUTH:
                    g.fillPolygon(new int[] { 0, w, mid }, new int[] { 1, 1, h }, 3);
                    break;
                case NORTH:
                    g.fillPolygon(new int[] { 0, w, mid }, new int[] { h - 1, h - 1, 0 }, 3);
                    break;
                case WEST:
                case EAST:
            }
            g.translate(-x, -y);
            config.restore();
        }
    };
    Border buttonBorder = UIManager.getBorder("Spinner.arrowButtonBorder");
    if (buttonBorder instanceof UIResource) {
        // Wrap the border to avoid having the UIResource be replaced by
        // the ButtonUI. This is the opposite of using BorderUIResource.
        b.setBorder(new CompoundBorder(buttonBorder, null));
    } else {
        b.setBorder(buttonBorder);
    }
    b.setInheritsPopupMenu(true);
    return b;
}
Also used : BasicArrowButton(javax.swing.plaf.basic.BasicArrowButton) JBColor(com.intellij.ui.JBColor) JBColor(com.intellij.ui.JBColor) CompoundBorder(javax.swing.border.CompoundBorder) GraphicsConfig(com.intellij.openapi.ui.GraphicsConfig) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) UIResource(javax.swing.plaf.UIResource)

Example 10 with CompoundBorder

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

the class TextFieldAction method createCustomComponent.

@Override
public JComponent createCustomComponent(Presentation presentation) {
    // honestly borrowed from SearchTextField
    final JPanel panel = new JPanel(new BorderLayout());
    final JLabel label = new JLabel(myIcon);
    label.setOpaque(true);
    label.setBackground(myField.getBackground());
    myField.setOpaque(true);
    panel.add(myField, BorderLayout.WEST);
    panel.add(label, BorderLayout.EAST);
    myField.setToolTipText(myDescription);
    label.setToolTipText(myDescription);
    final Border originalBorder;
    if (SystemInfo.isMac) {
        originalBorder = BorderFactory.createLoweredBevelBorder();
    } else {
        originalBorder = myField.getBorder();
    }
    panel.setBorder(new CompoundBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0), originalBorder));
    myField.setOpaque(true);
    myField.setBorder(IdeBorderFactory.createEmptyBorder(0, 5, 0, 5));
    new ClickListener() {

        @Override
        public boolean onClick(@NotNull MouseEvent e, int clickCount) {
            actionPerformed(null);
            return true;
        }
    }.installOn(label);
    return panel;
}
Also used : MouseEvent(java.awt.event.MouseEvent) CompoundBorder(javax.swing.border.CompoundBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) ClickListener(com.intellij.ui.ClickListener)

Aggregations

CompoundBorder (javax.swing.border.CompoundBorder)43 EmptyBorder (javax.swing.border.EmptyBorder)23 Border (javax.swing.border.Border)20 BorderLayout (java.awt.BorderLayout)14 JLabel (javax.swing.JLabel)13 JPanel (javax.swing.JPanel)13 Insets (java.awt.Insets)10 LineBorder (javax.swing.border.LineBorder)9 GridBagConstraints (java.awt.GridBagConstraints)8 GridBagLayout (java.awt.GridBagLayout)8 JButton (javax.swing.JButton)8 TitledBorder (javax.swing.border.TitledBorder)8 ActionEvent (java.awt.event.ActionEvent)7 EtchedBorder (javax.swing.border.EtchedBorder)7 CustomLineBorder (com.intellij.ui.border.CustomLineBorder)5 ActionListener (java.awt.event.ActionListener)5 File (java.io.File)5 JTextField (javax.swing.JTextField)5 NotNull (org.jetbrains.annotations.NotNull)5 Color (java.awt.Color)4