pipe.gui
Class PetriNetObjectHandler
java.lang.Object
javax.swing.event.MouseInputAdapter
pipe.gui.PetriNetObjectHandler
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener, Constants
- Direct Known Subclasses:
- AnnotationNoteHandler, ArcHandler, ArcPathPointHandler, PlaceTransitionObjectHandler
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, ANIMATE, ANNOTATION, ANNOTATION_DEFAULT_FONT, ANNOTATION_DEFAULT_FONT_SIZE, ANNOTATION_LAYER_OFFSET, ANNOTATION_MIN_WIDTH, ANNOTATION_SIZE_OFFSET, ARC, ARC_CONTROL_POINT_CONSTANT, ARC_LAYER_OFFSET, ARC_PATH_PROXIMITY_WIDTH, ARC_PATH_SELECTION_WIDTH, ARC_POINT_LAYER_OFFSET, CLASS_FILE_DESC, CLASS_FILE_EXTENSION, CREATING, DEFAULT_ELEMENT_TYPE, DELETE, DELTOKEN, DRAG, DRAW, ELEMENT_FILL_COLOUR, ELEMENT_LINE_COLOUR, ENABLED_TRANSITION_COLOUR, FIRE, GRID, IMMTRANS, LOWEST_LAYER_OFFSET, NOTE_DISABLED_COLOUR, NOTE_EDITING_COLOUR, PLACE, PLACE_TRANSITION_HEIGHT, PLACE_TRANSITION_LAYER_OFFSET, PLACE_TRANSITION_PROXIMITY_RADIUS, PROPERTY_FILE_DESC, PROPERTY_FILE_EXTENSION, RANDOM, RESERVED_BORDER, RESIZE_POINT_DOWN_COLOUR, SELECT, SELECTION_FILL_COLOUR, SELECTION_LAYER_OFFSET, SELECTION_LINE_COLOUR, START, STEPBACKWARD, STEPFORWARD, STOP, TIMEDTRANS |
Method Summary |
void |
enablePopupMenu(boolean allow)
|
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 |
void |
mouseDragged(java.awt.event.MouseEvent e)
Handler for dragging PlaceTransitionObjects around |
void |
mousePressed(java.awt.event.MouseEvent e)
|
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, toString, wait, wait, wait |
contentPane
protected java.awt.Container contentPane
myObject
protected PetriNetObject myObject
justSelected
protected static boolean justSelected
isDragging
protected boolean isDragging
enablePopup
protected boolean enablePopup
dragInit
protected java.awt.Point dragInit
PetriNetObjectHandler
public PetriNetObjectHandler(java.awt.Container contentpane,
PetriNetObject obj)
enablePopupMenu
public void enablePopupMenu(boolean allow)
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
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
- 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
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class javax.swing.event.MouseInputAdapter
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Handler for dragging PlaceTransitionObjects around
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in class javax.swing.event.MouseInputAdapter