Package com.intellij.openapi.wm.impl.content

Examples of com.intellij.openapi.wm.impl.content.GraphicsConfig


  public DetailsComponent() {
    myComponent = new JPanel(new BorderLayout()) {
      protected void paintComponent(final Graphics g) {
        if (NullableComponent.Check.isNull(myContentWrapper)) return;

        GraphicsConfig c = new GraphicsConfig(g);
        c.setAntialiasing(true);

        int arc = 8;

        Insets insets = getInsets();
        if (insets == null) {
          insets = new Insets(0, 0, 0, 0);
        }

        g.setColor(UIUtil.getFocusedFillColor());

        final Rectangle banner = myBanner.getBounds();
        final GeneralPath header = new GeneralPath();

        final int leftX = insets.left;
        final int leftY = insets.top;
        final int rightX = insets.left + getWidth() - 1 - insets.right;
        final int rightY = banner.y + banner.height;

        header.moveTo(leftX, rightY);
        header.lineTo(leftX, leftY + arc);
        header.quadTo(leftX, leftY, leftX + arc, leftY);
        header.lineTo(rightX - arc, leftY);
        header.quadTo(rightX, leftY, rightX, leftY + arc);
        header.lineTo(rightX, rightY);
        header.closePath();

        c.getG().fill(header);

        g.setColor(UIUtil.getFocusedBoundsColor());

        c.getG().draw(header);

        final int down = getHeight() - insets.top - insets.bottom - 1;
        g.drawLine(leftX, rightY, leftX, down);
        g.drawLine(rightX, rightY, rightX, down);
        g.drawLine(leftX, down, rightX, down);

        c.restore();
      }
    };

    myComponent.setOpaque(false);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.wm.impl.content.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.