Package org.pushingpixels.substance.internal.ui

Examples of org.pushingpixels.substance.internal.ui.SubstanceListUI$RolloverFadeListener


   * @see javax.swing.plaf.basic.BasicComboPopup#hide()
   */
  @Override
  public void hide() {
    super.hide();
    SubstanceListUI ui = (SubstanceListUI) this.list.getUI();
    ui.resetRolloverIndex();
    // this.list.putClientProperty(SubstanceListUI.ROLLED_OVER_INDEX, null);
  }
View Full Code Here


      int index, boolean isSelected, boolean cellHasFocus) {
    this.setComponentOrientation(list.getComponentOrientation());

    ListUI listUI = list.getUI();
    if (listUI instanceof SubstanceListUI) {
      SubstanceListUI ui = (SubstanceListUI) listUI;
      ComponentState state = ui.getCellState(index, this);
      ComponentState prevState = ui.getPrevCellState(index, this);

      SubstanceColorScheme scheme = (state == ComponentState.DEFAULT) ? ui
          .getDefaultColorScheme()
          : ui.getHighlightColorScheme(state);
      if (scheme == null) {
        scheme = (state == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
            .getColorScheme(list, state)
            : SubstanceColorSchemeUtilities.getColorScheme(list,
                ColorSchemeAssociationKind.HIGHLIGHT, state);
      }
      SubstanceColorScheme prevScheme = scheme;
      if (prevState != state) {
        prevScheme = (prevState == ComponentState.DEFAULT) ? ui
            .getDefaultColorScheme() : ui
            .getHighlightColorScheme(prevState);
        if (prevScheme == null) {
          prevScheme = (prevState == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
              .getColorScheme(list, prevState)
              : SubstanceColorSchemeUtilities.getColorScheme(
                  list, ColorSchemeAssociationKind.HIGHLIGHT,
                  prevState);
        }
      }

      Timeline runningTimeline = ui.getRunningTimeline(index);
      Color color = SubstanceColorUtilities
          .getInterpolatedForegroundColor(list, index, scheme, state,
              prevScheme, prevState, runningTimeline);

      // System.out.println("[row " + index + "] - " + prevState.name()
View Full Code Here

    ListUI baseListUI = list.getUI();
    ComboBoxUI baseComboUI = combo.getUI();
    if ((baseListUI instanceof SubstanceListUI)
        && (baseComboUI instanceof SubstanceComboBoxUI)) {
      SubstanceListUI listUI = (SubstanceListUI) baseListUI;
      SubstanceComboBoxUI comboUI = (SubstanceComboBoxUI) baseComboUI;

      ComponentState state = listUI.getCellState(index, result);
      ComponentState prevState = listUI.getPrevCellState(index, result);

      // special case for the combobox. The selected value is
      // painted using the renderer of the list, and the index
      // is -1.
      if (index == -1) {
        ButtonModel transitionModel = comboUI.getTransitionModel();
        state = ComponentState.getState(transitionModel, this.combo);
        prevState = SubstanceCoreUtilities.getPrevComponentState(combo);
        // boolean isEnabled = this.combo.isEnabled();
        // if (isSelected && isEnabled) {
        // state = ComponentState.SELECTED;
        // prevState = ComponentState.SELECTED;
        // }
        // if (!isEnabled) {
        // state = ComponentState.DISABLED_UNSELECTED;
        // prevState = ComponentState.DISABLED_UNSELECTED;
        // }
      }
      Component compForSchemeQuery = (index == -1) ? combo : list;
      // use highlight color scheme for selected and focused
      // elements in the drop down list
      Timeline runningTimeline = listUI.getRunningTimeline(index);
      boolean toUseHighlightKindForCurrState = (index >= 0)
          && ((runningTimeline != null)
              || state.isKindActive(FadeKind.ROLLOVER) || state
              .isKindActive(FadeKind.SELECTION));
      boolean toUseHighlightKindForPrevState = (index >= 0)
View Full Code Here

    this.setComponentOrientation(list.getComponentOrientation());

    ListUI listUI = list.getUI();
    if (listUI instanceof SubstanceListUI) {
      SubstanceListUI ui = (SubstanceListUI) listUI;
      ComponentState state = ui.getCellState(index, this);
      ComponentState prevState = ui.getPrevCellState(index, this);

      SubstanceColorScheme scheme = (state == ComponentState.DEFAULT) ? ui
          .getDefaultColorScheme()
          : ui.getHighlightColorScheme(state);
          if (scheme == null) {
            scheme = (state == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
                .getColorScheme(list, state)
                : SubstanceColorSchemeUtilities.getColorScheme(list,
                    ColorSchemeAssociationKind.HIGHLIGHT, state);
          }
          SubstanceColorScheme prevScheme = scheme;
          if (prevState != state) {
            prevScheme = (prevState == ComponentState.DEFAULT) ? ui
                .getDefaultColorScheme() : ui
                .getHighlightColorScheme(prevState);
                if (prevScheme == null) {
                  prevScheme = (prevState == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
                      .getColorScheme(list, prevState)
                      : SubstanceColorSchemeUtilities.getColorScheme(
                          list, ColorSchemeAssociationKind.HIGHLIGHT,
                          prevState);
                }
          }

          Timeline runningTimeline = ui.getRunningTimeline(index);
          Color color = SubstanceColorUtilities
          .getInterpolatedForegroundColor(list, index, scheme, state,
              prevScheme, prevState, runningTimeline);

          // System.out.println("[row " + index + "] - " + prevState.name()
View Full Code Here

                                                  int index, boolean isSelected, boolean cellHasFocus) {
        this.setComponentOrientation(list.getComponentOrientation());

        ListUI listUI = list.getUI();
        if (listUI instanceof SubstanceListUI) {
            SubstanceListUI ui = (SubstanceListUI) listUI;
            ComponentState state = ui.getCellState(index, this);
            ComponentState prevState = ui.getPrevCellState(index, this);

            SubstanceColorScheme scheme = (state == ComponentState.DEFAULT) ? ui
                    .getDefaultColorScheme()
                    : ui.getHighlightColorScheme(state);
            if (scheme == null) {
                scheme = (state == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
                        .getColorScheme(list, state)
                        : SubstanceColorSchemeUtilities.getColorScheme(list,
                        ColorSchemeAssociationKind.HIGHLIGHT, state);
            }
            SubstanceColorScheme prevScheme = scheme;
            if (prevState != state) {
                prevScheme = (prevState == ComponentState.DEFAULT) ? ui
                        .getDefaultColorScheme() : ui
                        .getHighlightColorScheme(prevState);
                if (prevScheme == null) {
                    prevScheme = (prevState == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
                            .getColorScheme(list, prevState)
                            : SubstanceColorSchemeUtilities.getColorScheme(
                            list, ColorSchemeAssociationKind.HIGHLIGHT,
                            prevState);
                }
            }

            Timeline runningTimeline = ui.getRunningTimeline(index);
            Color color = SubstanceColorUtilities
                    .getInterpolatedForegroundColor(list, index, scheme, state,
                            prevScheme, prevState, runningTimeline);

            // System.out.println("[row " + index + "] - " + prevState.name()
View Full Code Here

   * @see javax.swing.plaf.basic.BasicComboPopup#hide()
   */
  @Override
  public void hide() {
    super.hide();
    SubstanceListUI ui = (SubstanceListUI) this.list.getUI();
    ui.resetRolloverIndex();
    // this.list.putClientProperty(SubstanceListUI.ROLLED_OVER_INDEX, null);
  }
View Full Code Here

      int index, boolean isSelected, boolean cellHasFocus) {
    this.setComponentOrientation(list.getComponentOrientation());

    ListUI listUI = list.getUI();
    if (listUI instanceof SubstanceListUI) {
      SubstanceListUI ui = (SubstanceListUI) listUI;

      StateTransitionTracker.ModelStateInfo modelStateInfo = ui
          .getModelStateInfo(index, this);
      ComponentState currState = ui.getCellState(index, this);

      // special case for drop location
      JList.DropLocation dropLocation = list.getDropLocation();
      boolean isDropLocation = (dropLocation != null
          && !dropLocation.isInsert() && dropLocation.getIndex() == index);
View Full Code Here

    ListUI baseListUI = list.getUI();
    ComboBoxUI baseComboUI = combo.getUI();
    if ((baseListUI instanceof SubstanceListUI)
        && (baseComboUI instanceof SubstanceComboBoxUI)) {
      SubstanceListUI listUI = (SubstanceListUI) baseListUI;
      SubstanceComboBoxUI comboUI = (SubstanceComboBoxUI) baseComboUI;

      // 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
            .getForegroundColor(combo, ((JLabel) result).getText(),
                modelStateInfo, comboAlpha);
        result.setForeground(fg);
      } else {
        // use highlight color scheme for selected and rollover
        // elements in the drop down list
        StateTransitionTracker.ModelStateInfo modelStateInfo = listUI
            .getModelStateInfo(index, result);
        ComponentState currState = listUI.getCellState(index, result);
        if (modelStateInfo == null) {
          SubstanceColorScheme scheme = getColorSchemeForState(list,
              index, listUI, currState);
          // SubstanceColorScheme scheme =
          // SubstanceColorSchemeUtilities
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.internal.ui.SubstanceListUI$RolloverFadeListener

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.