Examples of StandardBorderPainter


Examples of org.jvnet.substance.painter.border.StandardBorderPainter

          DecorationAreaType.NONE);

      this.watermark = new SubstanceStripeWatermark();
      this.buttonShaper = new StandardButtonShaper();
      this.gradientPainter = new StandardGradientPainter();
      this.borderPainter = new StandardBorderPainter();
      this.highlightPainter = new ClassicHighlightPainter();
      this.decorationPainter = new Glass3DDecorationPainter();
    }
View Full Code Here

Examples of org.jvnet.substance.painter.border.StandardBorderPainter

    JScrollPane scrollPane = (JScrollPane) c;
    JScrollBar vertical = scrollPane.getVerticalScrollBar();
    JScrollBar horizontal = scrollPane.getHorizontalScrollBar();
    JViewport columnHeader = scrollPane.getColumnHeader();

    StandardBorderPainter painter = new SimplisticSoftBorderPainter();

    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(c, ColorSchemeAssociationKind.BORDER, c
            .isEnabled() ? ComponentState.DEFAULT
            : ComponentState.DISABLED_UNSELECTED);

    float borderStrokeWidth = SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c));
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c)) / 2.0);
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.setStroke(new BasicStroke(borderStrokeWidth,
        BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
    x += borderDelta;
    y += borderDelta;
    width -= 2 * borderDelta;
    height -= 2 * borderDelta;

    boolean horizontalVisible = (horizontal != null)
        && horizontal.isVisible();
    boolean verticalVisible = (vertical != null) && vertical.isVisible();

    if (scrollPane.getComponentOrientation().isLeftToRight()) {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x, y, x + width - vertical.getWidth(), y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (horizontalVisible) {
        g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
      } else {
        g2d.drawLine(x, y, x, y + height);
      }

      // bottom portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (horizontalVisible) {
        // g.drawLine(x + horizontal.getWidth(), y + height - 1,
        // x + width, y + height - 1);
      } else {
        if (verticalVisible) {
          g2d.drawLine(x, y + height - 1, x + width
              - vertical.getWidth(), y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (verticalVisible) {
        // g.drawLine(x + width - 1, y + vertical.getHeight(), x + width
        // - 1, y + height);

        if (columnHeader != null) {
          g2d.drawLine(x + width - 1, y, x + width - 1, y
              + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible)
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height
              - horizontal.getHeight());
        else
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
      }
    } else {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x + vertical.getWidth(), y, x + width, y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (verticalVisible) {
        // g.drawLine(x, y, x, y + height - horizontal.getHeight());
        if (columnHeader != null) {
          g2d.drawLine(x, y, x, y + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible) {
          g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
        } else {
          g2d.drawLine(x, y, x, y + height - 1);
        }
      }

      // bottom portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (horizontalVisible) {
        // g.drawLine(x + horizontal.getWidth(), y + height - 1,
        // x + width, y + height - 1);
      } else {
        if (verticalVisible) {
          g2d.drawLine(x + vertical.getWidth(), y + height - 1, x
              + width, y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (horizontalVisible) {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height
            - horizontal.getHeight());
      } else {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
View Full Code Here

Examples of org.pushingpixels.substance.api.painter.border.StandardBorderPainter

    JScrollPane scrollPane = (JScrollPane) c;
    JScrollBar vertical = scrollPane.getVerticalScrollBar();
    JScrollBar horizontal = scrollPane.getHorizontalScrollBar();
    JViewport columnHeader = scrollPane.getColumnHeader();

    StandardBorderPainter painter = new SimplisticSoftBorderPainter();

    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(c, ColorSchemeAssociationKind.BORDER, c
            .isEnabled() ? ComponentState.DEFAULT
            : ComponentState.DISABLED_UNSELECTED);

    float borderStrokeWidth = SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c));
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c)) / 2.0);
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.setStroke(new BasicStroke(borderStrokeWidth,
        BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
    x += borderDelta;
    y += borderDelta;
    width -= 2 * borderDelta;
    height -= 2 * borderDelta;

    boolean horizontalVisible = (horizontal != null)
        && horizontal.isVisible();
    boolean verticalVisible = (vertical != null) && vertical.isVisible();

    if (scrollPane.getComponentOrientation().isLeftToRight()) {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x, y, x + width - vertical.getWidth(), y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (horizontalVisible) {
        g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
      } else {
        g2d.drawLine(x, y, x, y + height);
      }

      // bottom portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (horizontalVisible) {
        // g.drawLine(x + horizontal.getWidth(), y + height - 1,
        // x + width, y + height - 1);
      } else {
        if (verticalVisible) {
          g2d.drawLine(x, y + height - 1, x + width
              - vertical.getWidth(), y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (verticalVisible) {
        // g.drawLine(x + width - 1, y + vertical.getHeight(), x + width
        // - 1, y + height);

        if (columnHeader != null) {
          g2d.drawLine(x + width - 1, y, x + width - 1, y
              + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible)
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height
              - horizontal.getHeight());
        else
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
      }
    } else {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x + vertical.getWidth(), y, x + width, y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (verticalVisible) {
        // g.drawLine(x, y, x, y + height - horizontal.getHeight());
        if (columnHeader != null) {
          g2d.drawLine(x, y, x, y + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible) {
          g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
        } else {
          g2d.drawLine(x, y, x, y + height - 1);
        }
      }

      // bottom portion
      g2d
          .setColor(painter.getBottomBorderColor(scheme, scheme, 0,
              false));
      if (horizontalVisible) {
        // g.drawLine(x + horizontal.getWidth(), y + height - 1,
        // x + width, y + height - 1);
      } else {
        if (verticalVisible) {
          g2d.drawLine(x + vertical.getWidth(), y + height - 1, x
              + width, y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d.setColor(painter.getTopBorderColor(scheme, scheme, 0, false));
      if (horizontalVisible) {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height
            - horizontal.getHeight());
      } else {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
View Full Code Here

Examples of org.pushingpixels.substance.api.painter.border.StandardBorderPainter

    JScrollPane scrollPane = (JScrollPane) c;
    JScrollBar vertical = scrollPane.getVerticalScrollBar();
    JScrollBar horizontal = scrollPane.getHorizontalScrollBar();
    JViewport columnHeader = scrollPane.getColumnHeader();

    StandardBorderPainter painter = new SimplisticSoftBorderPainter();

    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(c, ColorSchemeAssociationKind.BORDER, c
            .isEnabled() ? ComponentState.ENABLED
            : ComponentState.DISABLED_UNSELECTED);

    float borderStrokeWidth = SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c));
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(c)) / 2.0);
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.setStroke(new BasicStroke(borderStrokeWidth,
        BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
    x += borderDelta;
    y += borderDelta;
    width -= 2 * borderDelta;
    height -= 2 * borderDelta;

    boolean horizontalVisible = (horizontal != null)
        && horizontal.isVisible();
    boolean verticalVisible = (vertical != null) && vertical.isVisible();
    boolean hasRowHeader = (scrollPane.getRowHeader() != null);

    if (scrollPane.getComponentOrientation().isLeftToRight()) {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x, y, x + width - vertical.getWidth(), y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d.setColor(painter.getTopBorderColor(scheme));
      if (horizontalVisible && !hasRowHeader) {
        g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
      } else {
        g2d.drawLine(x, y, x, y + height);
      }

      // bottom portion
      g2d.setColor(painter.getBottomBorderColor(scheme));
      if (horizontalVisible) {
        if (hasRowHeader) {
          g2d.drawLine(x, y + height - 1, x
              + scrollPane.getRowHeader().getSize().width, y
              + height - 1);
        }
      } else {
        if (verticalVisible) {
          g2d.drawLine(x, y + height - 1, x + width
              - vertical.getWidth(), y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d.setColor(painter.getBottomBorderColor(scheme));
      if (verticalVisible) {
        // g.drawLine(x + width - 1, y + vertical.getHeight(), x + width
        // - 1, y + height);

        if (columnHeader != null) {
          g2d.drawLine(x + width - 1, y, x + width - 1, y
              + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible)
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height
              - horizontal.getHeight());
        else
          g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
      }
    } else {
      // top portion
      g2d.setColor(painter.getTopBorderColor(scheme));
      if (verticalVisible && (columnHeader == null)) {
        g2d.drawLine(x + vertical.getWidth(), y, x + width, y);
      } else {
        g2d.drawLine(x, y, x + width, y);
      }

      // left portion
      g2d.setColor(painter.getBottomBorderColor(scheme));
      if (verticalVisible) {
        // g.drawLine(x, y, x, y + height - horizontal.getHeight());
        if (columnHeader != null) {
          g2d.drawLine(x, y, x, y + columnHeader.getHeight());
        }
      } else {
        if (horizontalVisible) {
          g2d.drawLine(x, y, x, y + height - horizontal.getHeight());
        } else {
          g2d.drawLine(x, y, x, y + height - 1);
        }
      }

      // bottom portion
      g2d.setColor(painter.getBottomBorderColor(scheme));
      if (horizontalVisible) {
        if (hasRowHeader) {
          g2d.drawLine(x + width
              - scrollPane.getRowHeader().getSize().width, y
              + height - 1, x + width - 1, y + height - 1);
        }
      } else {
        if (verticalVisible) {
          g2d.drawLine(x + vertical.getWidth(), y + height - 1, x
              + width, y + height - 1);
        } else {
          g2d.drawLine(x, y + height - 1, x + width, y + height - 1);
        }
      }

      // right portion
      g2d.setColor(painter.getTopBorderColor(scheme));
      if (horizontalVisible && !hasRowHeader) {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height
            - horizontal.getHeight());
      } else {
        g2d.drawLine(x + width - 1, y, x + width - 1, y + height);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.