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.


Field Summary
protected  boolean animationmode
           
protected  java.awt.Container contentPane
           
protected  boolean isDragging
           
protected  PetriNetObject tempPnobject
           
protected  CreateGui theApp
           
 
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
 
Constructor Summary
PetriNetObjectHandler(CreateGui creategui, java.awt.Container contentpane)
           
 
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
 

Field Detail

contentPane

protected java.awt.Container contentPane

tempPnobject

protected PetriNetObject tempPnobject

theApp

protected CreateGui theApp

isDragging

protected boolean isDragging

animationmode

protected boolean animationmode
Constructor Detail

PetriNetObjectHandler

public PetriNetObjectHandler(CreateGui creategui,
                             java.awt.Container contentpane)
Method Detail

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