pipe.gui
Class PetriNetObjectHandler
java.lang.Object
|
+--javax.swing.event.MouseInputAdapter
|
+--pipe.gui.PetriNetObjectHandler
- All Implemented Interfaces:
- Constants, java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
- Direct Known Subclasses:
- ArcHandler, PlaceHandler, PlaceTransitionObjectHandler, TransitionHandler
- public class PetriNetObjectHandler
- extends javax.swing.event.MouseInputAdapter
- implements Constants
Class used to implement methods corresponding to mouse events on all PetriNetObjects.
Fields inherited from interface pipe.gui.Constants |
ADDTOKEN, ARC, DEFAULT_BACKGROUND_COLOR, DEFAULT_DIRECTORY, DEFAULT_ELEMENT_COLOR, DEFAULT_ELEMENT_TYPE, DEFAULT_FILENAME, DELETE, DELTOKEN, DRAW, FIRE, MOVE, PLACE, RANDOM, START, STEPBACKWARD, STEPFORWARD, STOP, TRANSITION |
Method Summary |
javax.swing.JPopupMenu |
getPopup(java.awt.event.MouseEvent e)
Creates the popup menu that the user will see when they right click on a component |
private void |
maybeShowPopup(java.awt.event.MouseEvent e)
Displays the popup menu |
void |
mouseDragged(java.awt.event.MouseEvent e)
Implements the moving of the objects |
void |
mousePressed(java.awt.event.MouseEvent e)
Handler for mousePressed event - currently includes code for displaying a menu which the mouse is right clicked, or deleting/moving a component according to the buttons modeType (ie. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Event handler for when the user releases the mouse, used in conjunction with mouseDragged and mouseReleased to implement the moving action |
Methods inherited from class javax.swing.event.MouseInputAdapter |
mouseClicked, mouseEntered, mouseExited, mouseMoved |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
contentPane
protected java.awt.Container contentPane
tempPnobject
protected PetriNetObject tempPnobject
theApp
protected CreateGui theApp
isDragging
protected boolean isDragging
animationmode
protected boolean animationmode
PetriNetObjectHandler
public PetriNetObjectHandler(CreateGui creategui,
java.awt.Container contentpane)
getPopup
public javax.swing.JPopupMenu getPopup(java.awt.event.MouseEvent e)
- Creates the popup menu that the user will see when they right click on a component
maybeShowPopup
private void maybeShowPopup(java.awt.event.MouseEvent e)
- Displays the popup menu
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Handler for mousePressed event - currently includes code for displaying a menu which the mouse is right clicked, or deleting/moving a component according to the buttons modeType (ie. which button has been selected at the top of the gui.
- Overrides:
mousePressed
in class javax.swing.event.MouseInputAdapter
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Event handler for when the user releases the mouse, used in conjunction with mouseDragged and mouseReleased to implement the moving action
- Overrides:
mouseReleased
in class javax.swing.event.MouseInputAdapter
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Implements the moving of the objects
- Overrides:
mouseDragged
in class javax.swing.event.MouseInputAdapter