public class MouseController
extends java.awt.event.MouseAdapter
| Modifier and Type | Field and Description |
|---|---|
protected ModelContainer |
modelcontainer
Access to the models.
|
protected double |
targetscale
Target scale for zoom operation.
|
protected double |
zoomdist
Initial zoom distance.
|
protected int |
zoomstep
Zoom step.
|
protected javax.swing.Timer |
zoomtimer
Timer for animated zoom operations.
|
| Constructor and Description |
|---|
MouseController(ModelContainer container)
Creates a new mouse controller.
|
| Modifier and Type | Method and Description |
|---|---|
void |
mouseClicked(java.awt.event.MouseEvent e)
Called when the mouse is clicked.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Called when the mouse is pressed.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Called when the mouse wheel is moved.
|
static void |
setScale(ModelContainer modelcontainer,
double oldscale,
double scale,
com.mxgraph.util.mxPoint center)
Sets the scale around a center.
|
protected void |
setTargetScale(double scale) |
protected ModelContainer modelcontainer
protected javax.swing.Timer zoomtimer
protected double targetscale
protected double zoomdist
protected int zoomstep
public MouseController(ModelContainer container)
container - Access to the models.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class java.awt.event.MouseAdapterpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class java.awt.event.MouseAdapterpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermouseWheelMoved in class java.awt.event.MouseAdapterprotected void setTargetScale(double scale)
public static final void setScale(ModelContainer modelcontainer, double oldscale, double scale, com.mxgraph.util.mxPoint center)
modelcontainer - Model container.oldscale - The old scale.scale - The new scale.center - The center point.