|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.SketchController
public class SketchController
SketchController controls the behavior of a SketchPane. It is meant to be subclassed by application specific controllers to do "intelligent" interpretation on sketched input. The interpretation is performed by using a sketch interpreter. This basic implementation allows selection of symbols. It also adds strokes to a sketch model which can be written out to a sketch file.
BasicInterpreter
Field Summary | |
---|---|
static Color |
DEFAULT_FILL_COLOR
The default fill color used for sketching. |
static float |
DEFAULT_LINE_WIDTH
The default pen line width used for sketching. |
static Color |
DEFAULT_PEN_COLOR
The default pen color used for sketching. |
Constructor Summary | |
---|---|
SketchController()
Create a SketchController and initialize its foreground interpreter to a BasicInterpreter. |
Method Summary | |
---|---|
Iterator |
containedSketchFigures(Polygon2D region)
Return an iterator over the figures that are completely contained by the given polygonal region. |
Figure |
figureForSymbol(Symbol symbol)
Return a figure for the given symbol, or null if the symbol does not have a figure representation. |
Interactor |
getBackgroundInterpreter()
Return the interpreter that processes strokes on the backgound event layer. |
MouseFilter |
getDragFilter()
Return the mouse filter used for dragging. |
Color |
getFillColor()
Return the color used to fill symbols. |
Interactor |
getForegroundInterpreter()
Return the interpreter that processes strokes on the foreground event layer. |
float |
getLineWidth()
Return the line width used to draw symbols. |
Color |
getPenColor()
Return the color used to draw symbols. |
MouseFilter |
getSelectionFilter()
Return the mouse filter used for the selection interactor. |
SelectionInteractor |
getSelectionInteractor()
Return the selection interactor on all symbols. |
SelectionModel |
getSelectionModel()
Get the default selection model. |
SketchModel |
getSketchModel()
Return the sketch model this pane views. |
GraphicsPane |
getSketchPane()
Return the parent pane of this controller. |
Iterator |
hitSketchFigures(Rectangle2D region)
Return an iterator over the figures that intersect the given rectangular region. |
protected void |
initializeInteraction()
Initialize all interaction on the sketch pane. |
void |
setBackgroundInterpreter(Interactor interactor)
Set the interpreter that processes strokes in the background event layer. |
void |
setFillColor(Color c)
Set the color used to fill symbols. |
void |
setForegroundInterpreter(Interactor interactor)
Set the interpreter that processes strokes in the foreground event layer. |
void |
setLineWidth(float w)
Set the line width used to draw symbols. |
void |
setPenColor(Color c)
Set the color used to draw symbols. |
void |
setSelectionModel(SelectionModel m)
Set the default selection model. |
void |
setSketchModel(SketchModel m)
Set the sketch model in this controller. |
void |
setSketchPane(GraphicsPane p)
Set the graphics pane. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Color DEFAULT_PEN_COLOR
public static Color DEFAULT_FILL_COLOR
public static float DEFAULT_LINE_WIDTH
Constructor Detail |
---|
public SketchController()
Method Detail |
---|
public Iterator containedSketchFigures(Polygon2D region)
public Figure figureForSymbol(Symbol symbol)
public Interactor getBackgroundInterpreter()
public MouseFilter getDragFilter()
public Color getFillColor()
public Interactor getForegroundInterpreter()
public float getLineWidth()
public Color getPenColor()
public MouseFilter getSelectionFilter()
public SelectionInteractor getSelectionInteractor()
public SelectionModel getSelectionModel()
public SketchModel getSketchModel()
public GraphicsPane getSketchPane()
public Iterator hitSketchFigures(Rectangle2D region)
protected void initializeInteraction()
public void setBackgroundInterpreter(Interactor interactor)
public void setFillColor(Color c)
public void setForegroundInterpreter(Interactor interactor)
public void setLineWidth(float w)
public void setPenColor(Color c)
public void setSelectionModel(SelectionModel m)
public void setSketchModel(SketchModel m)
public void setSketchPane(GraphicsPane p)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |