Package org.pushingpixels.substance.api

Examples of org.pushingpixels.substance.api.ComponentState


  public static void paintText(Graphics g, AbstractButton button,
      ButtonModel model, Rectangle textRect, String text,
      int mnemonicIndex) {
    // Ignore the selection state of the menu item. This is especially
    // relevant for dark color schemes.
    ComponentState state = ComponentState.getState(model, button,
        button instanceof JMenuItem);
    ComponentState prevState = (state == ComponentState.ACTIVE) ? state
        : SubstanceCoreUtilities.getPrevComponentState(button);
    float transitionPosition = -1.0f;
    if (button.getUI() instanceof TransitionAwareUI) {
      TransitionAwareUI transitionAwareUI = (TransitionAwareUI) button
          .getUI();
View Full Code Here


    if (componentForTransitions != null) {
      ComponentUI ui = componentForTransitions.getUI();
      if (ui instanceof Trackable) {
        Trackable trackable = (Trackable) ui;
        ButtonModel transitionModel = trackable.getTransitionModel();
        ComponentState state = ComponentState.getState(transitionModel,
            componentForTransitions);
        ComponentState prevState = (trackable == null) ? state
            : SubstanceCoreUtilities
                .getPrevComponentState(componentForTransitions);
        if (!state.isKindActive(FadeKind.ENABLE))
          state = ComponentState.DISABLED_SELECTED;
        if (!prevState.isKindActive(FadeKind.ENABLE))
          prevState = ComponentState.DISABLED_SELECTED;

        FadeState rolloverFadeState = SubstanceFadeUtilities
            .getFadeState(componentForTransitions,
                FadeKind.ROLLOVER);
View Full Code Here

    Icon icon = SubstanceCoreUtilities.getIcon(b, null, this.glowingIcon,
        false);

    graphics.setComposite(TransitionLayout.getAlphaComposite(b, g));
    if (fadeTracker.isTracked(b, FadeKind.ROLLOVER)) {
      ComponentState state = ComponentState.getState(b);
      // System.out.println(state.name() + ":" + state.isRollover());
      if (state.isKindActive(FadeKind.ROLLOVER)) {
        // Came from default state
        SubstanceCoreUtilities.getIcon(b, null, this.glowingIcon, true)
            .paintIcon(b, graphics, iconRect.x, iconRect.y);
        graphics.setComposite(TransitionLayout.getAlphaComposite(b,
            fadeTracker.getFade(b, FadeKind.ROLLOVER), g));
View Full Code Here

    Graphics2D g2d = (Graphics2D) g.create();
    BackgroundPaintingUtils.updateIfOpaque(g2d, c);
    if (icon != null) {
      icon.paintIcon(c, g2d, paintIconR.x, paintIconR.y);
    }
    ComponentState labelState = label.isEnabled() ? ComponentState.DEFAULT
        : ComponentState.DISABLED_UNSELECTED;
    float labelAlpha = SubstanceColorSchemeUtilities.getAlpha(label,
        labelState);
    if (text != null) {
      final View v = (View) c.getClientProperty(BasicHTML.propertyKey);
View Full Code Here

      result.setBackground(list.getSelectionBackground());

    // mark every fifth row as disabled
    if ((index % 5) == 0) {
      result.setEnabled(false);
      ComponentState state = isSelected ? ComponentState.DISABLED_SELECTED
          : ComponentState.DISABLED_UNSELECTED;
      result.setForeground(SubstanceLookAndFeel.getCurrentSkin(list)
          .getColorScheme(list, state).getForegroundColor());
      result.setBackground(new Color(255, 196, 196));
      ((JLabel) result).setText(value + " [disabled by renderer]");
View Full Code Here

    ButtonModel model = menuItem.getModel();
    // int menuWidth = menuItem.getWidth();
    // int menuHeight = menuItem.getHeight();

    ComponentState prevState = SubstanceCoreUtilities
        .getPrevComponentState(menuItem);
    ComponentState currState = ComponentState.getState(model, menuItem,
        !(menuItem instanceof JMenu));

    // Compute the alpha values for the animation (the highlights
    // have separate alpha channels, so that rollover animation can start
    // from 0.0 alpha and goes to 0.4 alpha on non-selected cells,
View Full Code Here

    this.model = model;
    this.component.repaint();
  }

  public void onModelStateChanged() {
    ComponentState newState = ComponentState.getState(this.model,
        this.component);
    // if (this.currState == newState) {
    // if (this.transitionTimeline != null) {
    // if (this.transitionTimeline.getState() ==
    // TimelineState.PLAYING_REVERSE) {
View Full Code Here

   * @param comp
   *            Component.
   * @return The previous state of the specified component.
   */
  public static ComponentState getPrevComponentState(JComponent comp) {
    ComponentState result = (ComponentState) comp
        .getClientProperty(PREV_COMPONENT_STATE);
    if (result == null) {
      result = ComponentState.DEFAULT;
    }
    return result;
View Full Code Here

  public static ComponentState getPrevComponentState(JComponent comp,
      String extraKey) {
    String prevComponentStateKey = (extraKey == null) ? SubstanceAnimationUtilities.PREV_COMPONENT_STATE
        : SubstanceAnimationUtilities.PREV_COMPONENT_STATE + ":"
            + extraKey;
    ComponentState result = (ComponentState) comp
        .getClientProperty(prevComponentStateKey);
    if (result == null) {
      result = ComponentState.DEFAULT;
    }
    return result;
View Full Code Here

   * @param comp
   *            Component.
   * @return The previous state of the specified component.
   */
  public static ComponentState getPrevSelComponentState(JComponent comp) {
    ComponentState result = (ComponentState) comp
        .getClientProperty(PREV_SEL_COMPONENT_STATE);
    if (result == null) {
      result = ComponentState.DEFAULT;
    }
    return result;
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.api.ComponentState

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.