Examples of SubstanceButtonShaper


Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

   *            Composite to apply before painting the track.
   * @return Vertical track image.
   */
  private static BufferedImage getTrackVertical(JScrollBar scrollBar,
      int width, int height) {
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    SubstanceColorScheme mainScheme = SubstanceColorSchemeUtilities
        .getColorScheme(scrollBar,
            scrollBar.isEnabled() ? ComponentState.ENABLED
                : ComponentState.DISABLED_UNSELECTED);
    SubstanceColorScheme mainBorderScheme = SubstanceColorSchemeUtilities
        .getColorScheme(scrollBar, ColorSchemeAssociationKind.BORDER,
            scrollBar.isEnabled() ? ComponentState.ENABLED
                : ComponentState.DISABLED_UNSELECTED);
    HashMapKey key = SubstanceCoreUtilities.getHashKey(mainScheme
        .getDisplayName(), mainBorderScheme.getDisplayName(), width,
        height, shaper.getDisplayName());
    BufferedImage result = SubstanceScrollBarUI.trackVerticalMap.get(key);
    if (result == null) {
      float radius = width / 2;
      if (shaper instanceof ClassicButtonShaper)
        radius = SubstanceSizeUtils
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

   * @return Vertical track image.
   */
  private static void paintTrackBackVertical(Graphics g,
      JScrollBar scrollBar, AbstractButton topActiveButton,
      AbstractButton bottomActiveButton, int width, int height) {
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    int radius = width / 2;
    if (shaper instanceof ClassicButtonShaper)
      radius = 2;

View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

  private static BufferedImage getThumbVertical(JScrollBar scrollBar,
      int width, int height, SubstanceColorScheme scheme,
      SubstanceColorScheme borderScheme) {
    SubstanceFillPainter painter = SubstanceCoreUtilities
        .getFillPainter(scrollBar);
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(scrollBar);
    HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
        scheme.getDisplayName(), borderScheme.getDisplayName(), 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");
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

  private static BufferedImage getThumbHorizontal(JScrollBar scrollBar,
      int width, int height, SubstanceColorScheme scheme,
      SubstanceColorScheme borderScheme) {
    SubstanceFillPainter painter = SubstanceCoreUtilities
        .getFillPainter(scrollBar);
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(scrollBar);
    HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
        scheme.getDisplayName(), borderScheme.getDisplayName(), painter
            .getDisplayName(), shaper.getDisplayName(),
        borderPainter.getDisplayName());

    float radius = height / 2;
    if (shaper instanceof ClassicButtonShaper)
      radius = SubstanceSizeUtils
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

      return;
    }

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

    BufferedImage bgImage = getFullAlphaBackground(button, button
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

  public static boolean contains(AbstractButton button, int x, int y) {
    // failsafe for LAF change
    if (!SubstanceLookAndFeel.isCurrentLookAndFeel()) {
      return false;
    }
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(button);
    if (shaper == null)
      return false;
    Shape contour = shaper.getButtonOutline(button, null,
        button.getWidth(), button.getHeight(), false);
    return contour.contains(x, y);
  }
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

    if (b.getClientProperty(SubstanceButtonUI.BORDER_ORIGINAL) == null)
      b.putClientProperty(SubstanceButtonUI.BORDER_ORIGINAL, b
          .getBorder());

    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(b);

    if (b.getClientProperty(SubstanceButtonUI.BORDER_COMPUTED) == null) {
      b.setBorder(shaper.getButtonBorder(b));
    } else {
      Border currBorder = b.getBorder();
      if (!(currBorder instanceof SubstanceButtonBorder)) {
        b.setBorder(shaper.getButtonBorder(b));
      } else {
        SubstanceButtonBorder sbCurrBorder = (SubstanceButtonBorder) currBorder;
        if (shaper.getClass() != sbCurrBorder.getButtonShaperClass())
          b.setBorder(shaper.getButtonBorder(b));
      }
    }
    b.putClientProperty(SubstanceButtonUI.OPACITY_ORIGINAL, b.isOpaque());
    // fix for defect 140
    b.setOpaque(false);
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

   * javax.swing.plaf.ComponentUI#getPreferredSize(javax.swing.JComponent)
   */
  @Override
  public Dimension getPreferredSize(JComponent c) {
    AbstractButton button = (AbstractButton) c;
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(button);

    // fix for defect 263
    Dimension superPref = super.getPreferredSize(button);
    if (superPref == null)
      return null;

    if (shaper == null)
      return superPref;

    return shaper.getPreferredSize(button, superPref);
  }
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

    if (b.getClientProperty(SubstanceButtonUI.BORDER_ORIGINAL) == null)
      b.putClientProperty(SubstanceButtonUI.BORDER_ORIGINAL, b
          .getBorder());

    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(b);

    if (b.getClientProperty(SubstanceButtonUI.BORDER_COMPUTED) == null) {
      b.setBorder(shaper.getButtonBorder(b));
    } else {
      Border currBorder = b.getBorder();
      if (!(currBorder instanceof SubstanceButtonBorder)) {
        b.setBorder(shaper.getButtonBorder(b));
      } else {
        SubstanceButtonBorder sbCurrBorder = (SubstanceButtonBorder) currBorder;
        if (shaper.getClass() != sbCurrBorder.getButtonShaperClass())
          b.setBorder(shaper.getButtonBorder(b));
      }
    }
    b.putClientProperty(SubstanceButtonUI.OPACITY_ORIGINAL, b.isOpaque());
    b.setOpaque(false);
View Full Code Here

Examples of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

   * javax.swing.plaf.ComponentUI#getPreferredSize(javax.swing.JComponent)
   */
  @Override
  public Dimension getPreferredSize(JComponent c) {
    AbstractButton button = (AbstractButton) c;
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(button);

    // fix for defect 263
    Dimension superPref = super.getPreferredSize(button);
    if (superPref == null)
      return null;

    if (shaper == null)
      return superPref;

    Dimension result = shaper.getPreferredSize(button, superPref);
    return result;
  }
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.