/** * Returns all active component states. * * @return All active component states. */ public static ComponentState[] getActiveStates() { List<ComponentState> states = new LinkedList<ComponentState>(); for (ComponentState state : allStates) { if (state.isActive()) states.add(state); } return states.toArray(new ComponentState[0]); }
/** * Returns all active component states. * * @return All active component states. */ public static ComponentState[] getActiveStates() { List<ComponentState> states = new LinkedList<ComponentState>(); for (ComponentState state : allStates) { if (state.isActive()) states.add(state); } return states.toArray(new ComponentState[0]); }
void sync() { this.activeStrength = 0.0f; for (Map.Entry<ComponentState, StateContributionInfo> activeEntry : this.stateContributionMap .entrySet()) { ComponentState activeState = activeEntry.getKey(); if (activeState.isActive()) { this.activeStrength += activeEntry.getValue() .getContribution(); } } }
void sync() { this.activeStrength = 0.0f; for (Map.Entry<ComponentState, StateContributionInfo> activeEntry : this.stateContributionMap .entrySet()) { ComponentState activeState = activeEntry.getKey(); if (activeState.isActive()) { this.activeStrength += activeEntry.getValue() .getContribution(); } } }
public ComponentState bestFit(Collection<ComponentState> states) { ComponentState bestFit = null; int bestFitValue = 0; for (ComponentState state : states) { if (this.isActive() != state.isActive()) continue; int currFitValue = state.fitValue(this) + this.fitValue(state); if (bestFit == null) { bestFit = state; bestFitValue = currFitValue; } else { if (currFitValue > bestFitValue) { bestFit = state; bestFitValue = currFitValue; } } } // fit value must be positive if (bestFitValue > 0) return bestFit; return null; }
public ComponentState bestFit(Collection<ComponentState> states) { ComponentState bestFit = null; int bestFitValue = 0; for (ComponentState state : states) { if (this.isActive() != state.isActive()) continue; int currFitValue = state.fitValue(this) + this.fitValue(state); if (bestFit == null) { bestFit = state; bestFitValue = currFitValue; } else { if (currFitValue > bestFitValue) { bestFit = state; bestFitValue = currFitValue; } } } // fit value must be positive if (bestFitValue > 0) return bestFit; return null; }
if (!componentState.isActive()) { fillPainter = SimplisticSoftBorderReverseFillPainter.INSTANCE;
if (!componentState.isActive()) { fillPainter = SimplisticSoftBorderReverseFillPainter.INSTANCE;
for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : activeStates.entrySet()) { ComponentState activeState = activeEntry.getKey(); if (!activeState.isActive()) continue;
.entrySet()) { ComponentState activeState = activeEntry.getKey(); if (!activeState.isActive()) continue;
.entrySet()) { ComponentState activeState = activeEntry.getKey(); if (!activeState.isActive()) continue;
contourDim, contourDim, cornerRadius, null, borderDelta); if (!componentState.isActive()) { fillPainter = SimplisticSoftBorderReverseFillPainter.INSTANCE;
contourDim, contourDim, cornerRadius, null, borderDelta); if (!componentState.isActive()) { fillPainter = SimplisticSoftBorderReverseFillPainter.INSTANCE;