/** * Retrieves component state based on the button model (required parameter) * and component itself (optional parameter). * * @param model * Button model (required). * @param component * Component (optional). * @return The matching component state. */ public static ComponentState getState(ButtonModel model, JComponent component) { return getState(model, component, false); }
/** * Retrieves component state based on the button model (required parameter) * and component itself (optional parameter). * * @param model * Button model (required). * @param component * Component (optional). * @return The matching component state. */ public static ComponentState getState(ButtonModel model, JComponent component) { return getState(model, component, false); }
/** * Returns the state of the specified button. * * @param button * Button. * @return The state of the specified button. */ public static ComponentState getState(AbstractButton button) { return getState(button.getModel(), button, false); }
/** * Returns the state of the specified button. * * @param button * Button. * @return The state of the specified button. */ public static ComponentState getState(AbstractButton button) { return getState(button.getModel(), button, false); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); BackgroundPaintingUtils.update(graphics, c, false); float alpha = SubstanceColorSchemeUtilities.getAlpha(this.scrollbar, ComponentState.getState(this.thumbModel, this.scrollbar)); graphics .setComposite(LafWidgetUtilities.getAlphaComposite(c, alpha, g)); super.paint(graphics, c); graphics.dispose(); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); BackgroundPaintingUtils.update(graphics, c, false); float alpha = SubstanceColorSchemeUtilities.getAlpha(this.scrollbar, ComponentState.getState(this.thumbModel, this.scrollbar)); graphics .setComposite(LafWidgetUtilities.getAlphaComposite(c, alpha, g)); super.paint(graphics, c); graphics.dispose(); }
public void setModel(ButtonModel model) { this.model.removeChangeListener(this.modelChangeListener); if (this.transitionTimeline != null) { this.transitionTimeline.abort(); this.transitionPosition = 0.0f; } this.modelStateInfo.currState = ComponentState.getState(model, component); this.modelStateInfo.currStateNoSelection = ComponentState.getState( model, component, true); this.modelStateInfo.clear(); this.model = model; this.model.addChangeListener(this.modelChangeListener); this.component.repaint(); }
public void setModel(ButtonModel model) { this.model.removeChangeListener(this.modelChangeListener); if (this.transitionTimeline != null) { this.transitionTimeline.abort(); this.transitionPosition = 0.0f; } this.modelStateInfo.currState = ComponentState.getState(model, component); this.modelStateInfo.currStateNoSelection = ComponentState.getState( model, component, true); this.modelStateInfo.clear(); this.model = model; this.model.addChangeListener(this.modelChangeListener); this.component.repaint(); }
/** * Returns the current state for the specified tab. * * @param tabIndex * Tab index. * @return The current state for the specified tab. */ protected ComponentState getTabState(int tabIndex) { boolean isEnabled = this.tabPane.isEnabledAt(tabIndex); StateTransitionTracker tracker = this.stateTransitionMultiTracker .getTracker(tabIndex); if (tracker == null) { boolean isRollover = this.getRolloverTabIndex() == tabIndex; boolean isSelected = this.tabPane.getSelectedIndex() == tabIndex; return ComponentState.getState(isEnabled, isRollover, isSelected); } else { ComponentState fromTracker = tracker.getModelStateInfo() .getCurrModelState(); return ComponentState.getState(isEnabled, fromTracker .isFacetActive(ComponentStateFacet.ROLLOVER), fromTracker .isFacetActive(ComponentStateFacet.SELECTION)); } }
private ComponentState getMonthState(int monthIndex, int yearIndex) { MonthId monthId = new MonthId(monthIndex, yearIndex); boolean isEnabled = this.monthView.isEnabled(); StateTransitionTracker tracker = this.monthStateTransitionMultiTracker .getTracker(monthId); if (tracker == null) { boolean isRollover = (this.rolloverDateId != null) && (this.rolloverDateId.month == monthIndex) && (this.rolloverDateId.year == yearIndex); return ComponentState.getState(isEnabled, isRollover, false); } else { ComponentState fromTracker = tracker.getModelStateInfo() .getCurrModelState(); return ComponentState.getState(isEnabled, fromTracker .isFacetActive(ComponentStateFacet.ROLLOVER), fromTracker .isFacetActive(ComponentStateFacet.SELECTION)); } }
private ComponentState getDayState(int dayIndex, int monthIndex, int yearIndex) { DateId dateId = new DateId(dayIndex, monthIndex, yearIndex); boolean isEnabled = this.monthView.isEnabled(); StateTransitionTracker tracker = this.dayStateTransitionMultiTracker .getTracker(dateId); if (tracker == null) { boolean isRollover = dateId.equals(this.rolloverDateId); boolean isSelected = this.selectedDates.contains(dateId); return ComponentState.getState(isEnabled, isRollover, isSelected); } else { ComponentState fromTracker = tracker.getModelStateInfo() .getCurrModelState(); return ComponentState.getState(isEnabled, fromTracker .isFacetActive(ComponentStateFacet.ROLLOVER), fromTracker .isFacetActive(ComponentStateFacet.SELECTION)); } }
/** * Returns the current state for the specified tab. * * @param tabIndex * Tab index. * @return The current state for the specified tab. */ protected ComponentState getTabState(int tabIndex) { boolean isEnabled = this.tabPane.isEnabledAt(tabIndex); StateTransitionTracker tracker = this.stateTransitionMultiTracker .getTracker(tabIndex); if (tracker == null) { boolean isRollover = this.getRolloverTabIndex() == tabIndex; boolean isSelected = this.tabPane.getSelectedIndex() == tabIndex; return ComponentState.getState(isEnabled, isRollover, isSelected); } else { ComponentState fromTracker = tracker.getModelStateInfo() .getCurrModelState(); return ComponentState.getState(isEnabled, fromTracker .isFacetActive(ComponentStateFacet.ROLLOVER), fromTracker .isFacetActive(ComponentStateFacet.SELECTION)); } }
/** * Returns the current state for the specified cell. * * @param cellIndex * Cell index. * @param rendererComponent * Renderer component for the specified cell index. * @return The current state for the specified cell. */ public ComponentState getCellState(int cellIndex, 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)); } }
/** * Returns the current state for the specified cell. * * @param cellIndex * Cell index. * @param rendererComponent * Renderer component for the specified cell index. * @return The current state for the specified cell. */ public ComponentState getCellState(int cellIndex, 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)); } }
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));
Graphics2D graphics = (Graphics2D) g.create(); ComponentState currState = ComponentState.getState(this.thumbModel, this.slider); float alpha = SubstanceColorSchemeUtilities.getAlpha(this.slider,
/** * Returns the current state for the specified path. * * @param pathId * 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)); } }
/** * Returns the current state for the specified path. * * @param pathId * 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)); } }
ComponentState.getState(button));
ComponentState.getState(button));