edu.washington.cs.supple.render.search
Class AbstractShortcutSolver

java.lang.Object
  extended byedu.washington.cs.supple.render.AbstractSolver
      extended byedu.washington.cs.supple.render.search.BottomUpSearchSolver
          extended byedu.washington.cs.supple.render.search.AbstractShortcutSolver
All Implemented Interfaces:
Solver
Direct Known Subclasses:
NaiveShortcutSolver, ShortcutSolver

public abstract class AbstractShortcutSolver
extends BottomUpSearchSolver

Author:
kgajos

Field Summary
protected  java.util.Collection navShortcuts
           
protected  int numOfNavShortcuts
           
protected  int numOfPrimitiveShortcuts
           
protected  java.util.Vector primitiveShortcuts
           
 
Fields inherited from class edu.washington.cs.supple.render.search.BottomUpSearchSolver
costComparator, mrvComparator
 
Fields inherited from class edu.washington.cs.supple.render.AbstractSolver
bags, BOTTOM_UP, constraintFactory, costFunction, currentRenderingConstraints, currentRenderingHints, curSearchParameters, curSolution, curSolutionRoot, finalSolutionListeners, interrupted, listener, MRV, propagationLevels, searchCount, SORT_COST, SORT_COST_REVERSE, SORT_RANDOM, spies, TOP_DOWN, valueSorting, variableOrdering, widgetFactory
 
Constructor Summary
AbstractShortcutSolver()
           
 
Method Summary
protected  java.util.ArrayList findNavShortcutTargets(UiObject root)
          Goes through a UI specification and finds all elements that could potentially serve as targets of nav shortcuts (this includes all container elements except top level elements and those without names)
protected  java.util.ArrayList findNavShortcutTargetsFromSolution(WidgetBag root, float minEffort)
          Finds good shortcut targets given a rendered UI
protected  java.util.ArrayList findNavShortcutTargetsHelper(UiObject root, int skipLevels)
           
protected  java.util.Vector generateRandomShortcuts(UiObject root)
          Quickly generates shortcuts to the first-level children of the UI
 int getNumOfNavShortcuts()
           
 int getNumOfPrimitiveShortcuts()
           
protected  java.util.Vector makeShortcuts(UiObject root, java.util.Collection targets)
          builds a collection of shortcuts from a collection of ui objects that are to serve as shortcut targets
 void setNumOfNavShortcuts(int numOfNavShortcuts)
           
 void setNumOfPrimitiveShortcuts(int numOfPrimitiveShortcuts)
           
 
Methods inherited from class edu.washington.cs.supple.render.search.BottomUpSearchSolver
search, searchDispatch, solve, solve, sortMRV, sortWidgets
 
Methods inherited from class edu.washington.cs.supple.render.AbstractSolver
addFinalSolutionListener, addSpy, applyConstraint, applyConstraints, applyCostFunction, applyHint, applyHints, applyRenderingConstraint, applySameRenderingConstraint, applySameRenderingHint, buildBagStructure, getBottomUpNodeList, getLeafNodes, getShortcutCost, getTopDownNodeList, interruptSearch, notifyFinalSolutionListeners, notifySpies, removeFinalSolutionListener, removeSpy, reset, setListener, solutionFound, solutionFound, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numOfNavShortcuts

protected int numOfNavShortcuts

numOfPrimitiveShortcuts

protected int numOfPrimitiveShortcuts

navShortcuts

protected java.util.Collection navShortcuts

primitiveShortcuts

protected java.util.Vector primitiveShortcuts
Constructor Detail

AbstractShortcutSolver

public AbstractShortcutSolver()
Method Detail

getNumOfNavShortcuts

public int getNumOfNavShortcuts()
Returns:
Returns the numOfNavShortcuts.

generateRandomShortcuts

protected java.util.Vector generateRandomShortcuts(UiObject root)
Quickly generates shortcuts to the first-level children of the UI

Parameters:
root - the root of the UI
Returns:
a vector of shortcuts

makeShortcuts

protected java.util.Vector makeShortcuts(UiObject root,
                                         java.util.Collection targets)
builds a collection of shortcuts from a collection of ui objects that are to serve as shortcut targets

Parameters:
root - the root that will serve as the source for the shortcuts
targets - the target objects
Returns:
a vector of nav shortcuts

findNavShortcutTargets

protected java.util.ArrayList findNavShortcutTargets(UiObject root)
Goes through a UI specification and finds all elements that could potentially serve as targets of nav shortcuts (this includes all container elements except top level elements and those without names)

Parameters:
root - the root of the UI
Returns:
a list of potential shortcut targets

findNavShortcutTargetsHelper

protected java.util.ArrayList findNavShortcutTargetsHelper(UiObject root,
                                                           int skipLevels)

findNavShortcutTargetsFromSolution

protected java.util.ArrayList findNavShortcutTargetsFromSolution(WidgetBag root,
                                                                 float minEffort)
Finds good shortcut targets given a rendered UI

Parameters:
root - widget bag representing a solved rendering problem (each bag has to be set, i.e. have exactly one current widget)
minEffort - Each widget has an effort associated with the enter action; this parameter specifies the minimum effort required from the root of the UI before an element becomes eligible to be shortcut target
Returns:
a list of UiObjects that are valid nav shortcut targets

setNumOfNavShortcuts

public void setNumOfNavShortcuts(int numOfNavShortcuts)
Parameters:
numOfNavShortcuts - The numOfNavShortcuts to set.

getNumOfPrimitiveShortcuts

public int getNumOfPrimitiveShortcuts()
Returns:
Returns the numOfPrimitiveShortcuts.

setNumOfPrimitiveShortcuts

public void setNumOfPrimitiveShortcuts(int numOfPrimitiveShortcuts)
Parameters:
numOfPrimitiveShortcuts - The numOfPrimitiveShortcuts to set.