Package adaptlil.adaptations
Class Adaptation
java.lang.Object
adaptlil.adaptations.Adaptation
- Direct Known Subclasses:
ColorAdaptation,DeemphasisAdaptation,HighlightingAdaptation
Abstract class for Adaptations. When making an adaptation in the AdaptLIL Architecture, following this abstract
class structure allows for an easier implementation with the rest of the system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate doubleprivate booleanprivate doubleprivate String -
Constructor Summary
ConstructorsConstructorDescriptionAdaptation(String type, boolean state, Map<String, String> styleConfig, double strength) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidapplyStyleChange(double stepAmount) Applies style change as specified by the stepAmountvoiddoublegetScore()doublegetType()booleanbooleanbooleanisState()voidsetBeingObservedByMediator(boolean beingObservedByMediator) Used by mediator to flag that the Adaptation is currently selected and under observation for changesvoidsetScore(double score) voidsetState(boolean state) voidsetStrength(double strength) void
-
Field Details
-
type
-
state
private boolean state -
styleConfig
-
isBeingObservedByMediator
private boolean isBeingObservedByMediator -
score
private double score -
strength
private double strength -
hasFlipped
private boolean hasFlipped
-
-
Constructor Details
-
Adaptation
- Parameters:
type-state-styleConfig- A map containing CSS style name and it's corresponding string value.strength-
-
-
Method Details
-
setBeingObservedByMediator
public void setBeingObservedByMediator(boolean beingObservedByMediator) Used by mediator to flag that the Adaptation is currently selected and under observation for changes- Parameters:
beingObservedByMediator-
-
flipDirection
public void flipDirection() -
applyStyleChange
public abstract void applyStyleChange(double stepAmount) Applies style change as specified by the stepAmount- Parameters:
stepAmount-
-
setType
-
setState
public void setState(boolean state) -
setScore
public void setScore(double score) -
getScore
public double getScore() -
getDefaultStyleConfig
-
isBeingObservedByMediator
public boolean isBeingObservedByMediator()- Returns:
-
getType
-
isState
public boolean isState() -
getStyleConfig
-
getStrength
public double getStrength() -
setStrength
public void setStrength(double strength) -
hasFlipped
public boolean hasFlipped()
-