|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.washington.cs.supple.render.AbstractSolver
The base class for all UI solvers
| Field Summary | |
protected java.util.Hashtable |
bags
|
static int |
BOTTOM_UP
Variable ordering method |
protected ConstraintFactory |
constraintFactory
|
protected CostFunction |
costFunction
|
protected java.util.Vector |
currentRenderingConstraints
|
protected java.util.Vector |
currentRenderingHints
|
protected SearchParameters |
curSearchParameters
|
protected Solution |
curSolution
|
protected WidgetBag |
curSolutionRoot
|
protected java.util.Vector |
finalSolutionListeners
|
protected boolean |
interrupted
|
protected SolverListener |
listener
|
static int |
MRV
Variable ordering method |
static int |
propagationLevels
|
protected int |
searchCount
|
static int |
SORT_COST
Value sorting method |
static int |
SORT_COST_REVERSE
Value sorting method |
static int |
SORT_RANDOM
Value sorting method |
protected java.util.Vector |
spies
|
static int |
TOP_DOWN
Variable ordering method |
static int |
valueSorting
|
static int |
variableOrdering
|
protected WidgetFactory |
widgetFactory
|
| Constructor Summary | |
AbstractSolver()
|
|
| Method Summary | |
void |
addFinalSolutionListener(FinalSolutionListener listener)
|
void |
addSpy(SolverListener listener)
|
protected void |
applyConstraint(RenderingConstraint constraint)
|
protected void |
applyConstraints()
|
protected void |
applyCostFunction(java.util.Vector widgets)
Assigns the cost to each widget based on what the current cost function thinks about the assignment; if the cost function deems the widget unacceptable, it gets removed from the underlying data structure |
protected void |
applyHint(RenderingHint hint)
|
protected void |
applyHints()
|
protected void |
applyRenderingConstraint(RenderingConstraint constraint)
|
protected void |
applySameRenderingConstraint(SameRenderingConstraint constraint)
Given a same rendering constraint, this method creates all the necessary enforcement objects throughout the widget bag structure (the bag structure must be built before this method is called). |
protected void |
applySameRenderingHint(SameRenderingHint hint)
Given a same rendering hint, this method creates all the necessary enforcement objects throughout the widget bag structure (the bag structure must be built before this method is called). |
WidgetBag |
buildBagStructure(UiObject object,
SearchParameters searchParameters)
|
static java.util.Vector |
getBottomUpNodeList(WidgetBag root)
returns a list of nodes -- bottom up (i.e. |
static java.util.Vector |
getLeafNodes(WidgetBag root)
returns a list of leaf nodes |
protected float |
getShortcutCost(java.util.Collection shortcuts)
|
java.util.Vector |
getTopDownNodeList(WidgetBag root)
|
void |
interruptSearch()
|
protected void |
notifyFinalSolutionListeners(Solution soln)
|
protected boolean |
notifySpies(Solution soln)
For render-time notification to spies |
void |
removeFinalSolutionListener(FinalSolutionListener listener)
|
void |
removeSpy(SolverListener listener)
|
protected void |
reset()
|
void |
setListener(SolverListener listener)
|
protected void |
solutionFound(WidgetBag root)
Used by subclasses to report a solution when one is found |
protected void |
solutionFound(WidgetBag root,
java.util.Collection shortcuts)
|
abstract Solution |
solve(UiObject object,
java.awt.Dimension sizeConstraint)
The interface for invoking the search routine |
abstract Solution |
solve(UiObject object,
SearchParameters searchParameters,
java.awt.Dimension sizeConstraint)
The interface for invoking the search routine that allows you to override the search parameters |
protected void |
stop()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SORT_COST
public static final int SORT_COST_REVERSE
public static final int SORT_RANDOM
public static int valueSorting
public static final int BOTTOM_UP
public static final int TOP_DOWN
public static final int MRV
public static int variableOrdering
protected WidgetFactory widgetFactory
protected ConstraintFactory constraintFactory
protected CostFunction costFunction
protected SearchParameters curSearchParameters
protected SolverListener listener
protected java.util.Vector finalSolutionListeners
protected java.util.Vector spies
protected WidgetBag curSolutionRoot
protected Solution curSolution
protected java.util.Hashtable bags
protected int searchCount
protected boolean interrupted
protected java.util.Vector currentRenderingHints
protected java.util.Vector currentRenderingConstraints
public static int propagationLevels
| Constructor Detail |
public AbstractSolver()
| Method Detail |
public abstract Solution solve(UiObject object,
java.awt.Dimension sizeConstraint)
throws java.lang.InterruptedException
solve in interface Solverobject - the description of the UI to be renderedsizeConstraint - the maximum size
java.lang.InterruptedException
public abstract Solution solve(UiObject object,
SearchParameters searchParameters,
java.awt.Dimension sizeConstraint)
throws java.lang.InterruptedException
solve in interface Solverobject - the description of the UI to be renderedsizeConstraint - the maximum sizesearchParameters - hand-set parameters for the search
java.lang.InterruptedExceptionprotected void reset()
public WidgetBag buildBagStructure(UiObject object,
SearchParameters searchParameters)
protected void applyCostFunction(java.util.Vector widgets)
widgets - a set of widgets to be "priced"; may get modifiedprotected void applyHints()
protected void applyHint(RenderingHint hint)
protected void applySameRenderingHint(SameRenderingHint hint)
hint - same rendering hintprotected void applyConstraints()
protected void applyConstraint(RenderingConstraint constraint)
protected void applySameRenderingConstraint(SameRenderingConstraint constraint)
constraint - same rendering constraintprotected void applyRenderingConstraint(RenderingConstraint constraint)
public static java.util.Vector getBottomUpNodeList(WidgetBag root)
root - the root bag
public static java.util.Vector getLeafNodes(WidgetBag root)
root - the root bag
public java.util.Vector getTopDownNodeList(WidgetBag root)
root - the root bag
protected void solutionFound(WidgetBag root)
root - the root bag of a solution
protected void solutionFound(WidgetBag root,
java.util.Collection shortcuts)
public void interruptSearch()
interruptSearch in interface Solver
protected void stop()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void setListener(SolverListener listener)
setListener in interface Solverpublic void addSpy(SolverListener listener)
addSpy in interface Solverpublic void removeSpy(SolverListener listener)
removeSpy in interface Solverprotected boolean notifySpies(Solution soln)
soln - the current solution
public void addFinalSolutionListener(FinalSolutionListener listener)
addFinalSolutionListener in interface Solverpublic void removeFinalSolutionListener(FinalSolutionListener listener)
removeFinalSolutionListener in interface Solverprotected void notifyFinalSolutionListeners(Solution soln)
protected float getShortcutCost(java.util.Collection shortcuts)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||