Package org.pushingpixels.substance.internal.utils.scroll

Examples of org.pushingpixels.substance.internal.utils.scroll.SubstanceScrollButton


   *
   * @see javax.swing.plaf.basic.BasicTabbedPaneUI#createScrollButton(int)
   */
  @Override
  protected JButton createScrollButton(final int direction) {
    SubstanceScrollButton ssb = new SubstanceScrollButton(direction);
    Icon icon = new TransitionAwareIcon(ssb,
        new TransitionAwareIcon.Delegate() {
          public Icon getColorSchemeIcon(SubstanceColorScheme scheme) {
            // fix for defect 279 - tab pane might not yet have the
            // font installed.
            int fontSize = SubstanceSizeUtils
                .getComponentFontSize(tabPane);
            return SubstanceImageCreator.getArrowIcon(fontSize,
                direction, scheme);
          }
        }, "substance.tabbedpane.scroll." + direction);
    ssb.setIcon(icon);
    return ssb;
  }
View Full Code Here


   *            kinds.
   * @return Decrease button.
   */
  protected JButton createGeneralDecreaseButton(final int orientation,
      boolean isRegular) {
    JButton result = new SubstanceScrollButton(orientation);
    result.setFont(this.scrollbar.getFont());
    Icon icon = new ArrowButtonTransitionAwareIcon(result, orientation);
    // new TransitionAwareIcon(result,
    // new TransitionAwareIcon.Delegate() {
    // public Icon getColorSchemeIcon(SubstanceColorScheme scheme) {
    // return SubstanceImageCreator.getArrowIcon(
    // SubstanceSizeUtils
    // .getComponentFontSize(scrollbar),
    // orientation, scheme);
    // }
    // });
    result.setIcon(icon);
    result.setFont(scrollbar.getFont());

    result.setPreferredSize(new Dimension(this.scrollBarWidth,
        this.scrollBarWidth));

    Set<Side> openSides = EnumSet.noneOf(Side.class);
    Set<Side> straightSides = EnumSet.noneOf(Side.class);
    switch (orientation) {
    case NORTH:
      openSides.add(Side.BOTTOM);
      if (!isRegular)
        openSides.add(Side.TOP);
      if (isRegular)
        straightSides.add(Side.TOP);
      break;
    case EAST:
      openSides.add(Side.LEFT);
      if (!isRegular)
        openSides.add(Side.RIGHT);
      if (isRegular)
        straightSides.add(Side.RIGHT);
      break;
    case WEST:
      openSides.add(Side.RIGHT);
      if (!isRegular)
        openSides.add(Side.LEFT);
      if (isRegular)
        straightSides.add(Side.LEFT);
      break;
    }
    result.putClientProperty(
        SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);
    result.putClientProperty(SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY,
        straightSides);

    return result;
  }
View Full Code Here

   *            kind.
   * @return Increase button.
   */
  protected JButton createGeneralIncreaseButton(final int orientation,
      boolean isRegular) {
    JButton result = new SubstanceScrollButton(orientation);
    result.setFont(this.scrollbar.getFont());
    Icon icon = new ArrowButtonTransitionAwareIcon(result, orientation);
    // Icon icon = new TransitionAwareIcon(result,
    // new TransitionAwareIcon.Delegate() {
    // public Icon getColorSchemeIcon(SubstanceColorScheme scheme) {
    // return SubstanceImageCreator.getArrowIcon(
    // SubstanceSizeUtils
    // .getComponentFontSize(scrollbar),
    // orientation, scheme);
    // }
    // });
    result.setIcon(icon);
    result.setFont(scrollbar.getFont());
    // JButton result = new SubstanceScrollBarButton(icon, orientation);
    result.setPreferredSize(new Dimension(this.scrollBarWidth,
        this.scrollBarWidth));

    Set<Side> openSides = EnumSet.noneOf(Side.class);
    Set<Side> straightSides = EnumSet.noneOf(Side.class);
    switch (orientation) {
    case SOUTH:
      openSides.add(Side.TOP);
      if (!isRegular)
        openSides.add(Side.BOTTOM);
      if (isRegular)
        straightSides.add(Side.BOTTOM);
      break;
    case EAST:
      openSides.add(Side.LEFT);
      if (!isRegular)
        openSides.add(Side.RIGHT);
      if (isRegular)
        straightSides.add(Side.RIGHT);
      break;
    case WEST:
      openSides.add(Side.RIGHT);
      if (!isRegular)
        openSides.add(Side.LEFT);
      if (isRegular)
        straightSides.add(Side.LEFT);
      break;
    }
    result.putClientProperty(
        SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);
    result.putClientProperty(SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY,
        straightSides);
    return result;
  }
View Full Code Here

    Graphics2D graphics = (Graphics2D) g.create();

    // System.out.println("Track");
    ScrollPaneButtonPolicyKind buttonPolicy = SubstanceCoreUtilities
        .getScrollPaneButtonsPolicyKind(this.scrollbar);
    SubstanceScrollButton compTopState = null;
    SubstanceScrollButton compBottomState = null;
    if (this.decrButton.isShowing() && this.incrButton.isShowing()
        && this.mySecondDecreaseButton.isShowing()
        && this.mySecondIncreaseButton.isShowing()) {
      switch (buttonPolicy) {
      case OPPOSITE:
View Full Code Here

   *
   * @see javax.swing.plaf.basic.BasicTabbedPaneUI#createScrollButton(int)
   */
  @Override
  protected JButton createScrollButton(final int direction) {
    SubstanceScrollButton ssb = new SubstanceScrollButton(direction);
    Icon icon = new TransitionAwareIcon(ssb,
        new TransitionAwareIcon.Delegate() {
          public Icon getColorSchemeIcon(SubstanceColorScheme scheme) {
            // fix for defect 279 - tab pane might not yet have the
            // font installed.
            int fontSize = SubstanceSizeUtils
                .getComponentFontSize(tabPane);
            return SubstanceImageCreator.getArrowIcon(fontSize,
                direction, scheme);
          }
        }, "substance.tabbedpane.scroll." + direction);
    ssb.setIcon(icon);
    return ssb;
  }
View Full Code Here

   *            kinds.
   * @return Decrease button.
   */
  protected JButton createGeneralDecreaseButton(final int orientation,
      boolean isRegular) {
    JButton result = new SubstanceScrollButton(orientation);
    result.setName("Decrease " + (isRegular ? "regular" : "additional"));
    result.setFont(this.scrollbar.getFont());
    Icon icon = new ArrowButtonTransitionAwareIcon(result, orientation);
    result.setIcon(icon);
    result.setFont(scrollbar.getFont());

    result.setPreferredSize(new Dimension(this.scrollBarWidth,
        this.scrollBarWidth));

    Set<Side> openSides = EnumSet.noneOf(Side.class);
    Set<Side> straightSides = EnumSet.noneOf(Side.class);
    switch (orientation) {
    case NORTH:
      openSides.add(Side.BOTTOM);
      if (!isRegular)
        openSides.add(Side.TOP);
      if (isRegular)
        straightSides.add(Side.TOP);
      break;
    case EAST:
      openSides.add(Side.LEFT);
      if (!isRegular)
        openSides.add(Side.RIGHT);
      if (isRegular)
        straightSides.add(Side.RIGHT);
      break;
    case WEST:
      openSides.add(Side.RIGHT);
      if (!isRegular)
        openSides.add(Side.LEFT);
      if (isRegular)
        straightSides.add(Side.LEFT);
      break;
    }
    result.putClientProperty(
        SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);
    result.putClientProperty(SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY,
        straightSides);

    return result;
  }
View Full Code Here

   *            kind.
   * @return Increase button.
   */
  protected JButton createGeneralIncreaseButton(final int orientation,
      boolean isRegular) {
    JButton result = new SubstanceScrollButton(orientation);
    result.setName("Increase " + (isRegular ? "regular" : "additional"));
    result.setFont(this.scrollbar.getFont());
    Icon icon = new ArrowButtonTransitionAwareIcon(result, orientation);
    result.setIcon(icon);
    result.setFont(scrollbar.getFont());
    // JButton result = new SubstanceScrollBarButton(icon, orientation);
    result.setPreferredSize(new Dimension(this.scrollBarWidth,
        this.scrollBarWidth));

    Set<Side> openSides = EnumSet.noneOf(Side.class);
    Set<Side> straightSides = EnumSet.noneOf(Side.class);
    switch (orientation) {
    case SOUTH:
      openSides.add(Side.TOP);
      if (!isRegular)
        openSides.add(Side.BOTTOM);
      if (isRegular)
        straightSides.add(Side.BOTTOM);
      break;
    case EAST:
      openSides.add(Side.LEFT);
      if (!isRegular)
        openSides.add(Side.RIGHT);
      if (isRegular)
        straightSides.add(Side.RIGHT);
      break;
    case WEST:
      openSides.add(Side.RIGHT);
      if (!isRegular)
        openSides.add(Side.LEFT);
      if (isRegular)
        straightSides.add(Side.LEFT);
      break;
    }
    result.putClientProperty(
        SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);
    result.putClientProperty(SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY,
        straightSides);
    return result;
  }
View Full Code Here

    Graphics2D graphics = (Graphics2D) g.create();

    // System.out.println("Track");
    ScrollPaneButtonPolicyKind buttonPolicy = SubstanceCoreUtilities
        .getScrollPaneButtonsPolicyKind(this.scrollbar);
    SubstanceScrollButton compTopState = null;
    SubstanceScrollButton compBottomState = null;
    if (this.decrButton.isShowing() && this.incrButton.isShowing()
        && this.mySecondDecreaseButton.isShowing()
        && this.mySecondIncreaseButton.isShowing()) {
      switch (buttonPolicy) {
      case OPPOSITE:
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.internal.utils.scroll.SubstanceScrollButton

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.