public class PanZoomController extends SketchController
The interactors that perform conventional interaction can be accessed through the methods getSelectionDragger(), getDragInteractor(), and getSelectionInteractor().
The gesture pan and zoom is activated by gesturing on the background of the pane. To start zooming, draw a "Z" shape on the background. (The "Z" must be drawn in the usual way, starting at the top left and ending at the bottom right. Without releasing the mouse button, move the mouse up or down to zoom in and out respectively. To start panning, draw a "P" on the canvas, starting at the bottom of the vertical stroke and proceeding in a single stroke upwards and around the loop. Again without releasing the mouse button, move the mouse in any direction to pan in that direction.
Modifier and Type | Field and Description |
---|---|
static String |
PZ_TRAINING_DATA
The name of the training file that contains "P" and "Z"
gestures.
|
DEFAULT_FILL_COLOR, DEFAULT_LINE_WIDTH, DEFAULT_PEN_COLOR
Constructor and Description |
---|
PanZoomController()
Create a new controller for the given pane
|
Modifier and Type | Method and Description |
---|---|
DragInteractor |
getDragInteractor()
Get the drag interactor
|
SelectionDragger |
getSelectionDragger()
Get the selection interactor
|
SelectionInteractor |
getSelectionInteractor()
Get the selection interactor
|
SelectionRenderer |
getSelectionRenderer()
Get the selection renderer
|
protected void |
initializeInteraction()
Initialize all interaction on the sketch pane.
|
void |
pan(double dx,
double dy) |
void |
setSelectionManipulator(Manipulator manipulator)
Set the prototype selection manipulator.
|
void |
setSelectionRenderer(SelectionRenderer renderer)
Set the selection renderer.
|
void |
strokeCompleted()
Re-enable the selection, now that gesturing is completed.
|
void |
zoom(double centerX,
double centerY,
double zoomAmount,
TimedStroke s) |
containedSketchFigures, figureForSymbol, getBackgroundInterpreter, getDragFilter, getFillColor, getForegroundInterpreter, getLineWidth, getPenColor, getSelectionFilter, getSelectionModel, getSketchModel, getSketchPane, hitSketchFigures, setBackgroundInterpreter, setFillColor, setForegroundInterpreter, setLineWidth, setPenColor, setSelectionModel, setSketchModel, setSketchPane
public static final String PZ_TRAINING_DATA
public PanZoomController()
protected void initializeInteraction()
SketchController
initializeInteraction
in class SketchController
public DragInteractor getDragInteractor()
public SelectionDragger getSelectionDragger()
public SelectionRenderer getSelectionRenderer()
public SelectionInteractor getSelectionInteractor()
getSelectionInteractor
in class SketchController
public void setSelectionManipulator(Manipulator manipulator)
public void setSelectionRenderer(SelectionRenderer renderer)
public void pan(double dx, double dy)
public void zoom(double centerX, double centerY, double zoomAmount, TimedStroke s)
public void strokeCompleted()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.