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
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private double
private boolean
private double
private String
-
Constructor Summary
ConstructorDescriptionAdaptation
(String type, boolean state, Map<String, String> styleConfig, double strength) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
applyStyleChange
(double stepAmount) Applies style change as specified by the stepAmountvoid
double
getScore()
double
getType()
boolean
boolean
boolean
isState()
void
setBeingObservedByMediator
(boolean beingObservedByMediator) Used by mediator to flag that the Adaptation is currently selected and under observation for changesvoid
setScore
(double score) void
setState
(boolean state) void
setStrength
(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()
-