Package org.jvnet.substance.api

Examples of org.jvnet.substance.api.ComponentState


    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


      int fontSize = SubstanceSizeUtils.getComponentFontSize(this.field);
      int dotDiameter = SubstanceSizeUtils
          .getPasswordDotDiameter(fontSize);
      int dotGap = SubstanceSizeUtils.getPasswordDotGap(fontSize);
      ComponentState state = // isSelected ? ComponentState.SELECTED
      (field.isEnabled() ? ComponentState.DEFAULT
          : ComponentState.DISABLED_UNSELECTED);
      SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
          .getColorScheme(field, state);
      Color topColor = isSelected ? scheme.getSelectionForegroundColor()
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

  @Override
  public void paintCurrentValueBackground(Graphics g, Rectangle bounds,
      boolean hasFocus) {
    ListUI listUI = this.popup.getList().getUI();
    SubstanceListUI ui = (SubstanceListUI) listUI;
    ComponentState state = ui.getCellState(-1, null);
    boolean isEnabled = this.comboBox.isEnabled();
    boolean isSelected = hasFocus;
    if (isSelected && isEnabled) {
      state = ComponentState.SELECTED;
    }
View Full Code Here

    // Color background = renderer.getBackground();
    // if (background == null)
    // background = tree.getBackground();

    ComponentState prevState = this.getPrevPathState(pathId);
    ComponentState currState = this.getPathState(pathId);

    // Compute the alpha values for the animation.
    float startAlpha = SubstanceColorSchemeUtilities.getHighlightAlpha(
        this.tree, prevState);
    float endAlpha = SubstanceColorSchemeUtilities.getHighlightAlpha(
View Full Code Here

     */
    @Override
    public void fadeEnded(FadeKind fadeKind) {
      if (SubstanceTreeUI.this.tree == tree) {
        TreePathId pathId = new TreePathId(treePath);
        ComponentState currState = getPathState(pathId);
        if (currState == ComponentState.DEFAULT) {
          prevStateMap.remove(pathId);
          nextStateMap.remove(pathId);
        } else {
          prevStateMap.put(pathId, currState);
View Full Code Here

    @Override
    public void fadeReversed(FadeKind fadeKind, boolean isFadingIn,
        float fadeCycle10) {
      if (SubstanceTreeUI.this.tree == tree) {
        TreePathId pathId = new TreePathId(treePath);
        ComponentState nextState = nextStateMap.get(pathId);
        if (nextState == null) {
          prevStateMap.remove(pathId);
        } else {
          prevStateMap.put(pathId, nextState);
        }
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)) {// ==
        // ComponentState.ROLLOVER_UNSELECTED) {
        // Came from default state
        SubstanceCoreUtilities.getIcon(b, null, this.glowingIcon, true)
            .paintIcon(b, graphics, iconRect.x, iconRect.y);
        graphics.setComposite(TransitionLayout.getAlphaComposite(b,
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

  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);

    // special case for enabled buttons with no background -
    // always use the color scheme for the default state.
    if (SubstanceCoreUtilities.isButtonNeverPainted(button)
View Full Code Here

TOP

Related Classes of org.jvnet.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.