Package org.pushingpixels.substance.internal.animation

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


   * @return The current state for the specified cell.
   */
  public ComponentState getCellState(TableCellId cellIndex) {
    boolean isEnabled = this.table.isEnabled();

    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(cellIndex);
    if (tracker == null) {
      int row = cellIndex.row;
      int column = cellIndex.column;
      TableCellId cellId = this.getId(row, column);
      boolean isRollover = rolledOverIndices.contains(cellId);
      boolean isSelected = false;
      boolean hasSelectionAnimations = (this.updateInfo != null) ? this.updateInfo.hasSelectionAnimations
          : this._hasSelectionAnimations();
      if (hasSelectionAnimations
          && AnimationConfigurationManager
              .getInstance()
              .isAnimationAllowed(AnimationFacet.SELECTION, table))
        isSelected = this.selectedIndices.containsKey(cellId);
      else {
        isSelected = this.table.isCellSelected(row, column);
      }
      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(
      TableCellId cellId) {
    if (this.stateTransitionMultiTracker.size() == 0)
      return null;
    StateTransitionTracker tracker = this.stateTransitionMultiTracker
        .getTracker(cellId);
    if (tracker == null) {
      return null;
    } else {
      return tracker.getModelStateInfo();
    }
  }
View Full Code Here

    return rect;
  }

  private StateTransitionTracker getTracker(final TableCellId tableCellId,
      boolean initialRollover, boolean initialSelected) {
    StateTransitionTracker tracker = stateTransitionMultiTracker
        .getTracker(tableCellId);
    // System.out.println("TableID " + tableCellId + " has tracker "
    // + ((tracker == null) ? "null" : ("@" + tracker.hashCode())));
    if (tracker == null) {
      ButtonModel model = new DefaultButtonModel();
      model.setSelected(initialSelected);
      model.setRollover(initialRollover);
      tracker = new StateTransitionTracker(table, model);
      tracker.registerModelListeners();
      tracker.setRepaintCallback(new RepaintCallback() {
        @Override
        public TimelineCallback getRepaintCallback() {
          return new CellRepaintCallback(table, tableCellId.row,
              tableCellId.column);
        }
      });
      tracker.setName("row " + tableCellId.row + ", col "
          + tableCellId.column);
      // System.out.println("TableID " + tableCellId +
      // " has new tracker @"
      // + tracker.hashCode());
      stateTransitionMultiTracker.addTracker(tableCellId, tracker);
View Full Code Here

          return;

        this.fadeOutTableHeader();

        TableColumnModel columnModel = header.getColumnModel();
        StateTransitionTracker columnTransitionTracker = sthui
            .getTracker(column, false,
                columnModel.getColumnSelectionAllowed()
                    && columnModel.getSelectionModel()
                        .isSelectedIndex(column));
        columnTransitionTracker.getModel().setRollover(true);

        SubstanceTableUI.this.rolledOverColumn = column;
      }
      // }
    }
View Full Code Here

          return;
        SubstanceTableHeaderUI ui = (SubstanceTableHeaderUI) header
            .getUI();

        TableColumnModel columnModel = header.getColumnModel();
        StateTransitionTracker columnTransitionTracker = ui.getTracker(
            rolledOverColumn, true,
            columnModel.getColumnSelectionAllowed()
                && columnModel.getSelectionModel()
                    .isSelectedIndex(rolledOverColumn));
        columnTransitionTracker.getModel().setRollover(false);
      }
    }
View Full Code Here

              if (rolledOverIndices.contains(currCellId))
                continue;
              // System.out
              // .println("Getting rollover/in tracker for "
              // + currCellId);
              StateTransitionTracker tracker = getTracker(
                  currCellId,
                  false,
                  getCellState(currCellId).isFacetActive(
                      ComponentStateFacet.SELECTION));
              tracker.getModel().setRollover(true);

              rolledOverIndices.add(currCellId);
            }
          }
        }
View Full Code Here

     */
    private void fadeOutRollover(TableCellId tableCellId) {
      if (rolledOverIndices.contains(tableCellId)) {
        // System.out
        // .println("Getting rollover/out tracker for " + cellId);
        StateTransitionTracker tracker = getTracker(
            tableCellId,
            true,
            getCellState(tableCellId).isFacetActive(
                ComponentStateFacet.SELECTION));
        tracker.getModel().setRollover(false);
      }
    }
View Full Code Here

    this.setFont(table.getFont());

    TableCellId cellFocusId = new TableCellId(row, column);

    StateTransitionTracker focusStateTransitionTracker = ui
        .getStateTransitionTracker(cellFocusId);

    Insets regInsets = ui.getCellRendererInsets();
    if (hasFocus || (focusStateTransitionTracker != null)) {
      SubstanceTableCellBorder border = new SubstanceTableCellBorder(
          regInsets, ui, cellFocusId);

      // System.out.println("[" + row + ":" + column + "] hasFocus : "
      // + hasFocus + ", focusState : " + focusState);
      if (focusStateTransitionTracker != null) {
        border.setAlpha(focusStateTransitionTracker
            .getFocusStrength(hasFocus));
      }

      // special case for tables with no grids
      if (!table.getShowHorizontalLines()
View Full Code Here

        // focus indication.
        hasFocus = ui.isFocusedCell(row, column);

        TableCellId cellFocusId = new TableCellId(row, column);

        StateTransitionTracker stateTransitionTracker = ui
            .getStateTransitionTracker(cellFocusId);
        if (hasFocus || (stateTransitionTracker != null)) {
          SubstanceTableCellBorder border = new SubstanceTableCellBorder(
              new Insets(0, 0, 0, 0), ui, cellFocusId);
          if (stateTransitionTracker != null) {
            border.setAlpha(stateTransitionTracker
                .getFocusStrength(hasFocus));
          }
          this.setBorder(border);
        } else {
          this.setBorder(BooleanRenderer.noFocusBorder);
View Full Code Here

      // special case for the combobox. The selected value is
      // painted using the renderer of the list, and the index
      // is -1.
      if (index == -1) {
        StateTransitionTracker stateTransitionTracker = comboUI
            .getTransitionTracker();
        ModelStateInfo modelStateInfo = stateTransitionTracker
            .getModelStateInfo();
        ComponentState currState = modelStateInfo.getCurrModelState();
        float comboAlpha = SubstanceColorSchemeUtilities.getAlpha(
            combo, currState);
        Color fg = SubstanceTextUtilities
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.