Package org.pushingpixels.substance.internal.animation

Examples of org.pushingpixels.substance.internal.animation.StateTransitionTracker$StateContributionInfo


    this.transitionModel.setSelected(false);
    this.transitionModel.setPressed(false);
    this.transitionModel.setRollover(false);
    this.transitionModel.setEnabled(this.passwordField.isEnabled());

    this.stateTransitionTracker = new StateTransitionTracker(
        this.passwordField, this.transitionModel);
  }
View Full Code Here


    if (componentForTransitions != null) {
      ComponentUI ui = componentForTransitions.getUI();
      if (ui instanceof TransitionAwareUI) {
        TransitionAwareUI trackable = (TransitionAwareUI) ui;
        StateTransitionTracker stateTransitionTracker = trackable
            .getTransitionTracker();
        StateTransitionTracker.ModelStateInfo modelStateInfo = stateTransitionTracker
            .getModelStateInfo();
        Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = modelStateInfo
            .getStateContributionMap();
        ComponentState currState = modelStateInfo.getCurrModelState();
        if (currState.isDisabled())
View Full Code Here

    this.compositeScrollTrackModel = new CompositeButtonModel(
        this.thumbModel, this.incrButton, this.decrButton,
        this.mySecondDecreaseButton, this.mySecondIncreaseButton);
    this.compositeScrollTrackModel.registerListeners();

    this.compositeStateTransitionTracker = new StateTransitionTracker(
        this.scrollbar, this.compositeScrollTrackModel);
    this.compositeStateTransitionTracker.registerModelListeners();
  }
View Full Code Here

   *            If <code>true</code>, the button will have the rollover
   *            listener installed on it.
   */
  public void installListeners(final AbstractButton b,
      boolean toInstallRolloverListener) {
    this.stateTransitionTracker = new StateTransitionTracker(b, b
        .getModel());
    if (b instanceof SubstanceScrollButton) {
      this.stateTransitionTracker
          .setRepaintCallback(new StateTransitionTracker.RepaintCallback() {
            @Override
View Full Code Here

    BufferedImage bgImage = getFullAlphaBackground(button, button
        .getModel(), shaper, fillPainter, borderPainter, width, height);

    TransitionAwareUI transitionAwareUI = (TransitionAwareUI) button
        .getUI();
    StateTransitionTracker stateTransitionTracker = transitionAwareUI
        .getTransitionTracker();
    StateTransitionTracker.ModelStateInfo modelStateInfo = stateTransitionTracker
        .getModelStateInfo();
    Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = modelStateInfo
        .getStateContributionMap();

    // Two special cases here:
View Full Code Here

   *            Path index.
   * @return The current state for the specified path.
   */
  public ComponentState getPathState(TreePathId pathId) {
    boolean isEnabled = this.tree.isEnabled();
    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(pathId);
    if (tracker == null) {
      int rowIndex = this.tree.getRowForPath(pathId.path);
      boolean isRollover = (this.currRolloverPathId != null)
          && pathId.equals(this.currRolloverPathId);
      boolean isSelected = this.tree.isRowSelected(rowIndex);
      return ComponentState.getState(isEnabled, isRollover, isSelected);
    } else {
      ComponentState fromTracker = tracker.getModelStateInfo()
          .getCurrModelState();
      return ComponentState.getState(isEnabled, fromTracker
          .isFacetActive(ComponentStateFacet.ROLLOVER), fromTracker
          .isFacetActive(ComponentStateFacet.SELECTION));
    }
View Full Code Here

  public StateTransitionTracker.ModelStateInfo getModelStateInfo(
      TreePathId pathId) {
    if (this.stateTransitionMultiTracker.size() == 0)
      return null;
    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(pathId);
    if (tracker == null) {
      return null;
    } else {
      return tracker.getModelStateInfo();
    }
  }
View Full Code Here

    return result;
  }

  private StateTransitionTracker getTracker(final TreePathId pathId,
      boolean initialRollover, boolean initialSelected) {
    StateTransitionTracker tracker = stateTransitionMultiTracker
        .getTracker(pathId);
    if (tracker == null) {
      ButtonModel model = new DefaultButtonModel();
      model.setSelected(initialSelected);
      model.setRollover(initialRollover);
      tracker = new StateTransitionTracker(this.tree, model);
      tracker.registerModelListeners();
      tracker.setRepaintCallback(new RepaintCallback() {
        @Override
        public TimelineCallback getRepaintCallback() {
          return new PathRepaintCallback(tree, pathId.path);
        }
      });
View Full Code Here

          TreePathId pathId = new TreePathId(selectionPath);

          // check if was selected before
          if (!selectedPaths.containsKey(pathId)) {
            // start fading in
            StateTransitionTracker tracker = getTracker(pathId,
                (currRolloverPathId != null)
                    && pathId.equals(currRolloverPathId),
                false);
            tracker.getModel().setSelected(true);
            selectedPaths.put(pathId, selectionPath
                .getLastPathComponent());
          }
        }
      }

      for (Iterator<Map.Entry<TreePathId, Object>> it = selectedPaths
          .entrySet().iterator(); it.hasNext();) {
        Map.Entry<TreePathId, Object> entry = it.next();
        if (tree.getSelectionModel()
            .isPathSelected(entry.getKey().path))
          continue;
        // fade out for deselected path
        TreePathId pathId = entry.getKey();
        StateTransitionTracker tracker = getTracker(pathId,
            (currRolloverPathId != null)
                && pathId.equals(currRolloverPathId), true);
        tracker.getModel().setSelected(false);
        it.remove();
      }
    }
View Full Code Here

        return;
      }

      this.fadeOut();

      StateTransitionTracker tracker = getTracker(newPathId, false,
          selectedPaths.containsKey(newPathId));
      tracker.getModel().setRollover(true);

      currRolloverPathId = newPathId;
    }
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.internal.animation.StateTransitionTracker$StateContributionInfo

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.