Class MouseController
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- jadex.gpmn.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 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 Instance Methods Concrete Methods Modifier and Type Method Description protected VNode
createNode(java.lang.String editmode, java.awt.Point p)
Creates the right node for the edit mode.void
mouseClicked(java.awt.event.MouseEvent e)
Called when the mouse is clicked.void
mousePressed(java.awt.event.MouseEvent e)
void
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Called when the mouse wheel is moved.protected void
setTargetScale(double scale)
Sets the target 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.
-
-
Constructor Detail
-
MouseController
public MouseController(ModelContainer container)
Creates a new mouse controller.- Parameters:
container
- Access to the models.
-
-
Method Detail
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
-
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
-
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)
Sets the target scale.- Parameters:
scale
- The scale.
-
createNode
protected VNode createNode(java.lang.String editmode, java.awt.Point p)
Creates the right node for the edit mode.- Parameters:
editmode
- The current edit mode.p
- The target position.- Returns:
- The new node.
-
-