Class MouseController
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- jadex.bpmn.editor.gui.controllers.MouseController
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
public class MouseController extends java.awt.event.MouseAdapter
Controller for handling mouse inputs to the graph.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description MouseController(ModelContainer container)
Creates a new mouse controller.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
modelcontainer
protected ModelContainer modelcontainer
Access to the models.
-
zoomtimer
protected javax.swing.Timer zoomtimer
Timer for animated zoom operations.
-
targetscale
protected double targetscale
Target scale for zoom operation.
-
zoomdist
protected double zoomdist
Initial zoom distance.
-
zoomstep
protected int zoomstep
Zoom step.
-
-
Constructor Detail
-
MouseController
public MouseController(ModelContainer container)
Creates a new mouse controller.- Parameters:
container
- Access to the models.
-
-
Method Detail
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
Called when the mouse is clicked.- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Overrides:
mouseClicked
in classjava.awt.event.MouseAdapter
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Called when the mouse is pressed.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Called when the mouse wheel is moved.- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Overrides:
mouseWheelMoved
in classjava.awt.event.MouseAdapter
-
setTargetScale
protected void setTargetScale(double scale)
-
setScale
public static final void setScale(ModelContainer modelcontainer, double oldscale, double scale, com.mxgraph.util.mxPoint center)
Sets the scale around a center.- Parameters:
modelcontainer
- Model container.oldscale
- The old scale.scale
- The new scale.center
- The center point.
-
-