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.MouseListener
mouseClicked
in class java.awt.event.MouseAdapter
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class java.awt.event.MouseAdapter
protected 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.