Package org.pushingpixels.substance.api.painter.fill

Examples of org.pushingpixels.substance.api.painter.fill.SubstanceFillPainter


      if (fadeState.fadeKind == FadeKind.SELECTION) {
        checkMarkVisibility = fadeState.getFadePosition();
        isCheckMarkFadingOut = !fadeState.isFadingIn();
      }
    }
    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(this.menuItem);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.menuItem);
    int fontSize = SubstanceSizeUtils.getComponentFontSize(this.menuItem);
View Full Code Here


  private static BufferedImage getThumbVertical(JScrollBar scrollBar,
      int width, int height, float cyclePos, SubstanceColorScheme scheme,
      SubstanceColorScheme scheme2, float borderCyclePos,
      SubstanceColorScheme borderScheme,
      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
View Full Code Here

  private static BufferedImage getThumbHorizontal(JScrollBar scrollBar,
      int width, int height, float cyclePos, SubstanceColorScheme scheme,
      SubstanceColorScheme scheme2, float borderCyclePos,
      SubstanceColorScheme borderScheme,
      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
View Full Code Here

      Icon result = SliderHorizontalIcon.icons.get(key);
      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();
View Full Code Here

      Icon result = SliderRoundIcon.icons.get(key);
      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 = new Ellipse2D.Float(borderDelta, borderDelta, width
          - 2 * borderDelta - 1, width - 2 * borderDelta - 1);

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

      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();
View Full Code Here

      Icon result = SliderVerticalIcon.icons.get(key);
      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(
          height, sliderIcon.size, 2, borderDelta);

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

      fillPainter.paintContourBackground(g2d, slider, height,
          sliderIcon.size, contour, false, colorScheme, colorScheme2,
          cyclePos, true, colorScheme != colorScheme2);
      // BufferedImage biResult = SubstanceCoreUtilities.getBlankImage(
      // sliderIcon.size - 1, sliderIcon.size - 1);
      // Graphics2D bg2d = (Graphics2D) biResult.getGraphics();
View Full Code Here

      if (fadeState.fadeKind == FadeKind.SELECTION) {
        visibility = fadeState.getFadePosition();
      }
    }

    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(), fillPainter.getDisplayName(),
        borderPainter.getDisplayName(), currFillColorScheme
            .getDisplayName(),
        prevFillColorScheme.getDisplayName(), currMarkColorScheme
            .getDisplayName(),
        prevMarkColorScheme.getDisplayName(), currBorderColorScheme
View Full Code Here

    SubstanceColorScheme borderScheme = SubstanceColorSchemeUtilities
        .getColorScheme(button, ColorSchemeAssociationKind.BORDER,
            state);
    SubstanceColorScheme borderScheme2 = borderScheme;

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .isSpinnerButton(button) ? MatteFillPainter.INSTANCE
        : SubstanceImageCreator.SimplisticSoftBorderReverseFillPainter.INSTANCE;
    FadeTracker fadeTracker = FadeTracker.getInstance();
    FadeState fadeState = fadeTracker.getFadeState(button,
        FadeKind.ROLLOVER);
View Full Code Here

        stateAlpha, g));

    SubstanceColorScheme fillScheme = SubstanceColorSchemeUtilities
        .getColorScheme(progressBar, fillState);

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(progressBar);
    if (progressBar.getOrientation() == SwingConstants.HORIZONTAL) {
      BufferedImage back = getDeterminateBackground(progressBar,
          barRectWidth + 1, barRectHeight + 1, fillScheme,
          fillPainter, progressBar.getOrientation(), this.progressBar
View Full Code Here

   */
  private static BufferedImage getTabBackground(JTabbedPane tabPane,
      int width, int height, int tabPlacement,
      SubstanceColorScheme fillScheme, SubstanceColorScheme borderScheme,
      boolean paintOnlyBorder) {
    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(tabPane);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(tabPane);
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(tabPane);

    int borderDelta = (int) Math.ceil(2.0 * SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(tabPane)));
    int borderInsets = (int) Math.floor(SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
            .getComponentFontSize(tabPane)) / 2.0);
    int dy = 2 + borderDelta;
    Set<Side> straightSides = EnumSet.of(Side.BOTTOM);

    int cornerRadius = height / 3;
    if (shaper instanceof ClassicButtonShaper) {
      cornerRadius = (int) SubstanceSizeUtils
          .getClassicButtonCornerRadius(SubstanceSizeUtils
              .getComponentFontSize(tabPane));
      if ((tabPlacement == TOP) || (tabPlacement == BOTTOM))
        width -= 1;
      else
        height -= 1;
    }

    GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(width,
        height + dy, cornerRadius, straightSides, borderInsets);

    BufferedImage result = SubstanceCoreUtilities.getBlankImage(width,
        height);
    Graphics2D resGraphics = result.createGraphics();

    if (!paintOnlyBorder) {
      fillPainter.paintContourBackground(resGraphics, tabPane, width,
          height + dy, contour, false, fillScheme, true);
    }

    int borderThickness = (int) SubstanceSizeUtils
        .getBorderStrokeWidth(SubstanceSizeUtils
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.api.painter.fill.SubstanceFillPainter

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.