Package org.jvnet.substance.painter.border

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


      result = SubstanceCoreUtilities.getBlankImage(width, height);
      SimplisticGradientPainter.INSTANCE.paintContourBackground(result
          .createGraphics(), scrollBar, width, height, contour,
          false, mainScheme, mainScheme, 0, true, false);

      SubstanceBorderPainter borderPainter = new SimplisticSoftBorderPainter();
      borderPainter.paintBorder(result.getGraphics(), scrollBar, width,
          height, contour, null, mainBorderScheme, mainBorderScheme,
          0, false);

      SubstanceScrollBarUI.trackHorizontalMap.put(key, result);
    }
View Full Code Here


      result = SubstanceCoreUtilities.getBlankImage(height, width);
      SimplisticGradientPainter.INSTANCE.paintContourBackground(result
          .createGraphics(), scrollBar, height, width, contour,
          false, mainScheme, mainScheme, 0, true, false);

      SubstanceBorderPainter borderPainter = new SimplisticSoftBorderPainter();
      borderPainter.paintBorder(result.getGraphics(), scrollBar, height,
          width, contour, null, mainBorderScheme, mainBorderScheme,
          0, false);
      result = SubstanceImageCreator.getRotated(result, 3);

      SubstanceScrollBarUI.trackVerticalMap.put(key, result);
View Full Code Here

    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

TOP

Related Classes of org.jvnet.substance.painter.border.SimplisticSoftBorderPainter

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.