Package com.intellij.openapi.ui

Examples of com.intellij.openapi.ui.GraphicsConfig


        }

        @Override
        public void paintBorder(Component c, Graphics g2, int x, int y, int width, int height) {
            Graphics2D g = ((Graphics2D)g2);
            final GraphicsConfig config = new GraphicsConfig(g);
            g.translate(x, y);

            if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
                if (valueSelector.isActive) {
                    DarculaUIUtil.paintFocusRing(g, 2, 2, width - 4, height - 4);
                } else {
                    boolean editable = valueSelector.isEnabled;
                    g.setColor(getBorderColor(c.isEnabled() && editable));
                    g.drawRect(1, 1, width-2, height-2);
                    g.setColor(UIUtil.getPanelBackground());
                    g.drawRect(0, 0, width, height);

                }
            } else {
                Border textFieldBorder = UIUtil.getTextFieldBorder();
                if (textFieldBorder instanceof LineBorder) {
                    LineBorder lineBorder = (LineBorder) textFieldBorder;
                    g.setColor(lineBorder.getLineColor());
                } else {
                    g.setColor(UIUtil.getBorderColor());
                }
                g.drawRect(1, 1, width - 3, height - 3);
                g.setColor(UIUtil.getPanelBackground());
                g.drawRect(0, 0, width-1, height-1);
            }
            g.translate(-x, -y);
            config.restore();

        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.ui.GraphicsConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.