Package org.pushingpixels.substance.api.shaper

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


    if (isUnbroken) {
      g2d.setColor(this.highlight);
      g2d.drawLine(x, y, x + w - 1, y);
    } else {
      // Break line to show visual connection to selected tab
      SubstanceButtonShaper shaper = SubstanceCoreUtilities
          .getButtonShaper(this.tabPane);
      int delta = (shaper instanceof ClassicButtonShaper) ? 1 : 0;
      int borderInsets = (int) Math.floor(SubstanceSizeUtils
          .getBorderStrokeWidth(SubstanceSizeUtils
              .getComponentFontSize(tabPane)) / 2.0);
View Full Code Here


  @Override
  public boolean isInside(MouseEvent me) {
    if (!SubstanceLookAndFeel.isCurrentLookAndFeel()) {
      return false;
    }
    SubstanceButtonShaper shaper = ClassicButtonShaper.INSTANCE;
    if (shaper == null)
      return false;
    Shape contour = SubstanceOutlineUtilities.getBaseOutline(this.comboBox,
        SubstanceSizeUtils
            .getClassicButtonCornerRadius(SubstanceSizeUtils
View Full Code Here

   *            Composite to apply before painting the track.
   * @return Horizontal track image.
   */
  private static BufferedImage getTrackHorizontal(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());
    float radius = height / 2;
    if (shaper instanceof ClassicButtonShaper)
      radius = SubstanceSizeUtils
          .getClassicButtonCornerRadius(SubstanceSizeUtils
              .getComponentFontSize(scrollBar));
View Full Code Here

   * @return Horizontal track image.
   */
  private static void paintTrackBackHorizontal(Graphics g,
      JScrollBar scrollBar, AbstractButton leftActiveButton,
      AbstractButton rightActiveButton, int width, int height) {
    SubstanceButtonShaper shaper = SubstanceCoreUtilities
        .getButtonShaper(scrollBar);
    int radius = height / 2;
    if (shaper instanceof ClassicButtonShaper)
      radius = 2;
    SubstanceImageCreator.paintCompositeRoundedBackground(scrollBar, g,
View Full Code Here

   *            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

   * @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

  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

  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

      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

  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

TOP

Related Classes of org.pushingpixels.substance.api.shaper.SubstanceButtonShaper

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.