Package org.pushingpixels.substance.internal.animation

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


     */
    private void fadeOut() {
      if (currRolloverPathId == null)
        return;

      StateTransitionTracker tracker = getTracker(currRolloverPathId,
          true, selectedPaths.containsKey(currRolloverPathId));
      tracker.getModel().setRollover(false);
    }
View Full Code Here


    BufferedImage bgImage = getFullAlphaBackground(combo, comboModel,
        fillPainter, borderPainter, width, height);

    TransitionAwareUI transitionAwareUI = (TransitionAwareUI) combo.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

  private Icon getIconToPaint() {
    if (this.menuItem == null)
      return null;
    TransitionAwareUI transitionAwareUI = (TransitionAwareUI) this.menuItem
        .getUI();
    StateTransitionTracker stateTransitionTracker = transitionAwareUI
        .getTransitionTracker();

    StateTransitionTracker.ModelStateInfo modelStateInfo = stateTransitionTracker
        .getModelStateInfo();
    Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = modelStateInfo
        .getStateContributionMap();

    int fontSize = SubstanceSizeUtils.getComponentFontSize(this.menuItem);
    int checkMarkSize = this.size;

    SubstanceFillPainter fillPainter = SubstanceCoreUtilities
        .getFillPainter(this.menuItem);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.menuItem);
    ComponentState currState = modelStateInfo.getCurrModelState();

    SubstanceColorScheme baseFillColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem, ColorSchemeAssociationKind.FILL,
            currState);
    SubstanceColorScheme baseMarkColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem, ColorSchemeAssociationKind.MARK,
            currState);
    SubstanceColorScheme baseBorderColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem,
            ColorSchemeAssociationKind.BORDER, currState);
    float visibility = stateTransitionTracker
        .getFacetStrength(ComponentStateFacet.SELECTION);

    HashMapKey keyBase = SubstanceCoreUtilities.getHashKey(fontSize,
        checkMarkSize, fillPainter.getDisplayName(), borderPainter
            .getDisplayName(),
View Full Code Here

  public static void paintText(Graphics g, AbstractButton button,
      ButtonModel model, Rectangle textRect, String text,
      int mnemonicIndex) {
    TransitionAwareUI transitionAwareUI = (TransitionAwareUI) button
        .getUI();
    StateTransitionTracker stateTransitionTracker = transitionAwareUI
        .getTransitionTracker();

    float buttonAlpha = SubstanceColorSchemeUtilities.getAlpha(button,
        ComponentState.getState(button));

    if (button instanceof JMenuItem) {
      paintMenuItemText(g, (JMenuItem) button, textRect, text,
          mnemonicIndex, stateTransitionTracker.getModelStateInfo(),
          buttonAlpha);
    } else {
      paintText(g, button, textRect, text, mnemonicIndex,
          stateTransitionTracker.getModelStateInfo(), buttonAlpha);
    }
  }
View Full Code Here

    if (componentForTransitions != null) {
      ComponentUI ui = componentForTransitions.getUI();
      if (ui instanceof TransitionAwareUI) {
        TransitionAwareUI trackable = (TransitionAwareUI) ui;
        StateTransitionTracker stateTransitionTracker = trackable
            .getTransitionTracker();

        Color outerTextComponentBorderColor = SubstanceColorUtilities
            .getOuterTextComponentBorderColor(backgroundFillColor);
        outerTextComponentBorderColor = SubstanceColorUtilities
            .getInterpolatedColor(outerTextComponentBorderColor,
                backgroundFillColor, 0.6);

        float selectionStrength = stateTransitionTracker
            .getFacetStrength(ComponentStateFacet.SELECTION);
        float rolloverStrength = stateTransitionTracker
            .getFacetStrength(ComponentStateFacet.ROLLOVER);
        backgroundFillColor = SubstanceColorUtilities
            .getInterpolatedColor(outerTextComponentBorderColor,
                backgroundFillColor, Math.max(
                    selectionStrength, rolloverStrength));
View Full Code Here

   *            Arrow button.
   * @return Icon to be painted.
   */
  private Icon getIconToPaint() {
    boolean isMenu = (this.component instanceof JMenu);
    StateTransitionTracker stateTransitionTracker = this.transitionAwareUIDelegate
        .getTransitionAwareUI().getTransitionTracker();
    StateTransitionTracker.ModelStateInfo modelStateInfo = stateTransitionTracker
        .getModelStateInfo();
    Map<ComponentState, StateTransitionTracker.StateContributionInfo> activeStates = isMenu ? modelStateInfo
        .getStateNoSelectionContributionMap()
        : modelStateInfo.getStateContributionMap();
    ComponentState currState = isMenu ? modelStateInfo
View Full Code Here

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

    this.stateTransitionTracker = new StateTransitionTracker(
        this.textField, this.transitionModel);
    this.stateTransitionTracker
        .setRepaintCallback(new StateTransitionTracker.RepaintCallback() {
          @Override
          public SwingRepaintCallback getRepaintCallback() {
View Full Code Here

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

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

      Component rendererComponent) {
    boolean isEnabled = this.list.isEnabled();
    if (rendererComponent != null) {
      isEnabled = isEnabled && rendererComponent.isEnabled();
    }
    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(cellIndex);
    if (tracker == null) {
      boolean isRollover = (rolledOverIndex >= 0)
          && (rolledOverIndex == cellIndex);
      boolean isSelected = selectedIndices.containsKey(cellIndex);
      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(int row,
      Component rendererComponent) {
    if (this.stateTransitionMultiTracker.size() == 0)
      return null;
    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(row);
    if (tracker == null) {
      return null;
    } else {
      return tracker.getModelStateInfo();
    }
  }
View Full Code Here

TOP

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

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.