Examples of SubstanceBorderPainter


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

      SubstanceColorScheme fillColorScheme,
      SubstanceColorScheme borderScheme, int width, int height) {
    Graphics2D g2d = (Graphics2D) graphics.create();

    SubstanceFillPainter fillPainter = ClassicFillPainter.INSTANCE;
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.slider);

    int componentFontSize = SubstanceSizeUtils
        .getComponentFontSize(this.slider);
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(componentFontSize) / 2.0);
    float radius = SubstanceSizeUtils
        .getClassicButtonCornerRadius(componentFontSize) / 2.0f;
    int borderThickness = (int) SubstanceSizeUtils
        .getBorderStrokeWidth(componentFontSize);

    HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
        radius, borderDelta, borderThickness, fillColorScheme
            .getDisplayName(), borderScheme.getDisplayName());

    if (!trackCache.containsKey(key)) {
      BufferedImage trackImage = SubstanceCoreUtilities.getBlankImage(
          width + 1, height + 1);
      Graphics2D cacheGraphics = trackImage.createGraphics();

      Shape contour = SubstanceOutlineUtilities.getBaseOutline(width + 1,
          height + 1, radius, null, borderDelta);

      fillPainter.paintContourBackground(cacheGraphics, slider, width,
          height, contour, false, fillColorScheme, fillColorScheme,
          0, false, false);

      GeneralPath contourInner = SubstanceOutlineUtilities
          .getBaseOutline(width + 1, height + 1, radius
              - borderThickness, null, borderThickness
              + borderDelta);
      borderPainter.paintBorder(cacheGraphics, slider, width + 1,
          height + 1, contour, contourInner, borderScheme,
          borderScheme, 0, false);

      trackCache.put(key, trackImage);
      cacheGraphics.dispose();
View Full Code Here

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

    insets.bottom /= 2;
    insets.right /= 2;

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(this.slider);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.slider);
    float radius = SubstanceSizeUtils
        .getClassicButtonCornerRadius(SubstanceSizeUtils
            .getComponentFontSize(slider)) / 2.0f;
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(slider)) / 2.0);

    // fill selected portion
    if (this.slider.isEnabled()) {
      if (this.slider.getOrientation() == SwingConstants.HORIZONTAL) {
        int middleOfThumb = this.thumbRect.x
            + (this.thumbRect.width / 2) - paintRect.x;
        int fillMinX;
        int fillMaxX;

        if (drawInverted) {
          fillMinX = middleOfThumb;
          fillMaxX = width;
        } else {
          fillMinX = 0;
          fillMaxX = middleOfThumb;
        }

        int fillWidth = fillMaxX - fillMinX;
        int fillHeight = height + 1;
        if ((fillWidth > 0) && (fillHeight > 0)) {
          Shape contour = SubstanceOutlineUtilities.getBaseOutline(
              fillWidth, fillHeight, radius, null, borderDelta);
          g2d.translate(fillMinX, 0);
          fillPainter.paintContourBackground(g2d, this.slider,
              fillWidth, fillHeight, contour, false, fillScheme,
              fillScheme, 0.0f, false, false);
          borderPainter.paintBorder(g2d, this.slider, fillWidth,
              fillHeight, contour, null, borderScheme,
              borderScheme, 0.0f, false);
        }
      } else {
        int middleOfThumb = this.thumbRect.y
            + (this.thumbRect.height / 2) - paintRect.y;
        int fillMin;
        int fillMax;

        if (this.drawInverted()) {
          fillMin = 0;
          fillMax = middleOfThumb;
          // fix for issue 368 - inverted vertical sliders
          g2d.translate(width + 2 - middleOfThumb, 0);
        } else {
          fillMin = middleOfThumb;
          fillMax = width + 1;
        }

        int fillWidth = fillMax - fillMin;
        int fillHeight = height + 1;
        if ((fillWidth > 0) && (fillHeight > 0)) {
          Shape contour = SubstanceOutlineUtilities.getBaseOutline(
              fillWidth, fillHeight, radius, null, borderDelta);

          fillPainter.paintContourBackground(g2d, this.slider,
              fillWidth, fillHeight, contour, false, fillScheme,
              fillScheme, 0.0f, false, false);
          borderPainter.paintBorder(g2d, this.slider, fillWidth,
              fillHeight, contour, null, borderScheme,
              borderScheme, 0.0f, false);
        }
      }
    }
View Full Code Here

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

    int fontSize = SubstanceSizeUtils.getComponentFontSize(button);
    int checkMarkSize = SubstanceSizeUtils.getRadioButtonMarkSize(fontSize);

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(button);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(button);

    HashMapKey key = SubstanceCoreUtilities.getHashKey(fontSize,
        checkMarkSize, currState.name(), currState.name(), fillPainter
            .getDisplayName(), borderPainter.getDisplayName(),
        currFillColorScheme.getDisplayName(), prevFillColorScheme
            .getDisplayName(),
        currMarkColorScheme.getDisplayName(), prevMarkColorScheme
            .getDisplayName(), currBorderColorScheme
            .getDisplayName(), prevBorderColorScheme
View Full Code Here

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

    int height = combo.getHeight();
    int y = 0;

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(combo);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(combo);

    BufferedImage bgImage = getFullAlphaBackground(combo, comboModel,
        fillPainter, borderPainter, width, height);
    ComponentState state = ComponentState.getState(comboModel, combo);
View Full Code Here

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

        isCheckMarkFadingOut = !fadeState.isFadingIn();
      }
    }
    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(this.menuItem);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.menuItem);
    int fontSize = SubstanceSizeUtils.getComponentFontSize(this.menuItem);

    HashMapKey key = SubstanceCoreUtilities.getHashKey(fontSize, currState
        .name(), prevState.name(),
View Full Code Here

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

      result = SubstanceCoreUtilities.getBlankImage(width, height);
      SimplisticFillPainter.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

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

      result = SubstanceCoreUtilities.getBlankImage(height, width);
      SimplisticFillPainter.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

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

      SubstanceColorScheme borderScheme2) {
    SubstanceFillPainter painter = SubstanceCoreUtilities
        .getFillPainter(scrollBar);
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(scrollBar);
    HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
        scheme.getDisplayName(), scheme2.getDisplayName(), borderScheme
            .getDisplayName(), borderScheme2.getDisplayName(),
        cyclePos, borderCyclePos, painter.getDisplayName(), shaper
            .getDisplayName(), borderPainter.getDisplayName());
    BufferedImage result = SubstanceScrollBarUI.thumbVerticalMap.get(key);
    if (result == null) {
      // System.out.println("Cache miss - computing");
      // System.out.println("New image for vertical thumb");
      float radius = width / 2;
      if (shaper instanceof ClassicButtonShaper)
        radius = SubstanceSizeUtils
            .getClassicButtonCornerRadius(SubstanceSizeUtils
                .getComponentFontSize(scrollBar));

      int borderDelta = (int) Math.floor(SubstanceSizeUtils
          .getBorderStrokeWidth(SubstanceSizeUtils
              .getComponentFontSize(scrollBar)) / 2.0);
      GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(
          height, width, radius, null, borderDelta);

      result = SubstanceCoreUtilities.getBlankImage(height, width);
      painter.paintContourBackground(result.createGraphics(), scrollBar,
          height, width, contour, false, scheme, scheme2, cyclePos,
          true, scheme != scheme2);

      // int borderThickness = (int) SubstanceSizeUtils
      // .getBorderStrokeWidth(SubstanceSizeUtils
      // .getComponentFontSize(scrollBar));
      // GeneralPath contourInner = SubstanceOutlineUtilities
      // .getBaseOutline(height, width, radius, null,
      // borderThickness + borderDelta);
      borderPainter.paintBorder(result.getGraphics(), scrollBar, height,
          width, contour, null, borderScheme, borderScheme2,
          borderCyclePos, borderScheme != borderScheme2);
      result = SubstanceImageCreator.getRotated(result, 3);
      // System.out.println(key);
      SubstanceScrollBarUI.thumbVerticalMap.put(key, result);
View Full Code Here

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

      SubstanceColorScheme borderScheme2) {
    SubstanceFillPainter painter = SubstanceCoreUtilities
        .getFillPainter(scrollBar);
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(scrollBar);
    // GripPainter gripPainter = SubstanceCoreUtilities.getGripPainter(
    // scrollBar, null);
    // System.out.println(state.name());
    HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
        scheme.getDisplayName(), scheme2.getDisplayName(), borderScheme
            .getDisplayName(), borderScheme2.getDisplayName(),
        cyclePos, borderCyclePos, painter.getDisplayName(), shaper
            .getDisplayName(), borderPainter.getDisplayName());
    // + ":"
    // + ((gripPainter != null) ? gripPainter.getDisplayName()
    // : "null");

    float radius = height / 2;
    if (shaper instanceof ClassicButtonShaper)
      radius = SubstanceSizeUtils
          .getClassicButtonCornerRadius(SubstanceSizeUtils
              .getComponentFontSize(scrollBar));
    int borderDelta = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(scrollBar)) / 2.0);
    GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(width,
        height, radius, null, borderDelta);
    BufferedImage opaque = SubstanceScrollBarUI.thumbHorizontalMap.get(key);
    if (opaque == null) {
      // System.out.println("New image for horizontal thumb");

      opaque = SubstanceCoreUtilities.getBlankImage(width, height);
      painter.paintContourBackground(opaque.createGraphics(), scrollBar,
          width, height, contour, false, scheme, scheme2, cyclePos,
          true, scheme != scheme2);

      // int borderThickness = (int) SubstanceSizeUtils
      // .getBorderStrokeWidth(SubstanceSizeUtils
      // .getComponentFontSize(scrollBar));
      // GeneralPath contourInner = SubstanceOutlineUtilities
      // .getBaseOutline(width, height, radius, null,
      // borderThickness + borderDelta);
      borderPainter.paintBorder(opaque.getGraphics(), scrollBar, width,
          height, contour, null, borderScheme, borderScheme2,
          borderCyclePos, borderScheme != borderScheme2);
      SubstanceScrollBarUI.thumbHorizontalMap.put(key, opaque);
    }
View Full Code Here

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

      if (result != null)
        return result;

      SubstanceFillPainter fillPainter = SubstanceCoreUtilities
          .getFillPainter(slider);
      SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
          .getBorderPainter(slider);

      int borderDelta = (int) Math.floor(SubstanceSizeUtils
          .getBorderStrokeWidth(SubstanceSizeUtils
              .getComponentFontSize(slider)) / 2.0);
      Shape contour = SubstanceOutlineUtilities.getTriangleButtonOutline(
          width, sliderIcon.size - 1, 2, borderDelta);

      BufferedImage stateImage = SubstanceCoreUtilities.getBlankImage(
          sliderIcon.size - 1, sliderIcon.size - 1);
      Graphics2D g2d = stateImage.createGraphics();
      g2d.translate(delta, 0);

      fillPainter.paintContourBackground(g2d, slider, width,
          sliderIcon.size - 1, contour, false, colorScheme,
          colorScheme2, cyclePos, true, colorScheme != colorScheme2);
      // BufferedImage biResult = SubstanceCoreUtilities.getBlankImage(
      // sliderIcon.size - 1, sliderIcon.size - 1);
      // Graphics2D bg2d = (Graphics2D) biResult.getGraphics();
      // bg2d.translate(delta, 0);
      // bg2d.drawImage(stateImage, 0, 0, null);

      int borderThickness = (int) SubstanceSizeUtils
          .getBorderStrokeWidth(SubstanceSizeUtils
              .getComponentFontSize(slider));
      GeneralPath contourInner = SubstanceOutlineUtilities
          .getTriangleButtonOutline(width, sliderIcon.size - 1, 2,
              borderThickness + borderDelta);

      borderPainter.paintBorder(g2d, slider, width, sliderIcon.size - 1,
          contour, contourInner, borderScheme, borderScheme2,
          cyclePos, borderScheme != borderScheme2);
      g2d.translate(-delta, 0);

      if (sliderIcon.isMirrorred)
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.