|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLabel | +--uk.ac.ic.doc.y2002.tool.editor.PNLabel
The PNLabel class is the basis of all Petri Net Labels in the program. Each PNLabel contains a reference to the Element within the DOM that the Label represents on screen. PNLabel itself should not be instantiated.
PlaceLabel
, Serialized FormInner classes inherited from class javax.swing.JLabel |
javax.swing.JLabel.AccessibleJLabel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected boolean |
beingMoved
|
protected java.lang.Class |
contextmenu
Class that is used to generate a context (right-click) menu for this type of PNLabel. |
protected org.jdom.Element |
element
Reference to the JDOM Element which represents this object. |
protected java.awt.Color |
fillcolour
|
protected boolean |
firsttime
|
protected int |
height
|
protected java.awt.Color |
highlightfill
|
protected java.lang.String |
id
Locally-stored copy of the object's unique id. |
protected int |
lastX
|
protected int |
lastY
|
protected java.awt.Color |
normalfill
|
protected org.jdom.Namespace |
ns
Namespace of the JDOM Element which represents this object. |
protected int |
offset
|
protected java.lang.Class |
propertiesbox
Class that is used to generate a properties box for this type of PNLabel. |
protected int |
rotation
|
protected int |
scaling
|
protected boolean |
selected
|
protected int |
textspace
|
protected int |
width
|
protected int |
xoffset
|
protected int |
xPress
|
protected int |
yoffset
|
protected int |
yPress
|
Fields inherited from class javax.swing.JLabel |
labelFor |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
PNLabel(org.jdom.Element element)
|
Method Summary | |
void |
addToken()
Override this as necessary (eg for PlaceLabel). |
void |
changeElement(org.jdom.Element newElement)
Changes the element this PNLabel is representing. |
protected void |
dofirst()
|
void |
doubleclickAction()
Override in subclasses to produce required functionality |
DisplayPane |
getDisplayPane()
|
java.lang.String |
getID()
|
int |
getJX()
Get X value from the JDOM Document Defaults to 0 if not found |
int |
getJY()
Get Y value from the JDOM Document Defaults to 0 if not found |
java.util.List |
getLinkedLabels()
Override in subclasses to return a list of PNLabels which are linked to this PNLabel. |
java.awt.Dimension |
getPreferredSize()
|
org.jdom.Element |
getToolspecific()
Function to find and return the Toolspecific element corresponding to this tool. |
void |
highlight(boolean highlight)
Should not be called directly: call select instead. |
boolean |
isActive()
Override in subclasses to indicate when an element is enabled within the net. |
static org.jdom.Element |
makeGraphics(java.lang.String x,
java.lang.String y,
org.jdom.Namespace ns)
Creates a graphics JDOM Element for use by a new PN element. |
org.jdom.Element |
makeToolspecific()
Function to make a Toolspecific element - assumes one does not exist already. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
java.lang.String |
myElementName()
|
void |
paintComponent(java.awt.Graphics g)
The function which draws the PNLabel on screen. |
DisplayPane |
remove()
Function that should be called when the element is removed from the Petri Net. |
void |
remToken()
Override as necessary (eg for PlaceLabel). |
org.jdom.Element |
returnElement()
An access function that returns the JDOM Element which this PNLabel represents. |
boolean |
returnSelected()
|
void |
select(boolean select)
Selects the PNLabel. |
void |
selectOnly(boolean select)
Selects the PNLabel without unselecting others in the display. |
protected void |
setJX(int x)
Set X value in the JDOM Document note this may need conversion from the actual x,y values for the label |
protected void |
setJY(int y)
Set Y value in the JDOM Document note this may need conversion from the actual x,y values for the label |
void |
setPosition(int x,
int y)
Update DOM with new values and set the label position. |
void |
showContextMenu(java.awt.event.MouseEvent e)
Brings up the right-click popup menu. |
protected void |
updateBounds()
may be overridden to deal with different sizes and shapes of labels. |
protected void |
updateLocation(int newx,
int newy)
|
protected void |
updateLocation(java.awt.event.MouseEvent e)
|
protected void |
updatePosition()
|
void |
updateSelf()
Function which allows the label to update itself (eg for modifying screen display) in response to changes in the underlying JDOM Element. |
Methods inherited from class javax.swing.JLabel |
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected org.jdom.Element element
protected org.jdom.Namespace ns
protected java.lang.Class propertiesbox
protected java.lang.Class contextmenu
protected boolean beingMoved
protected boolean selected
protected boolean firsttime
protected java.awt.Color fillcolour
protected java.awt.Color normalfill
protected java.awt.Color highlightfill
protected int height
protected int width
protected int lastX
protected int lastY
protected int offset
protected int xoffset
protected int yoffset
protected int scaling
protected int textspace
protected int xPress
protected int yPress
protected java.lang.String id
protected int rotation
Constructor Detail |
public PNLabel(org.jdom.Element element)
element
- a JDOM Element which contains
all the relevant data for this Petri net object,
e.g. the <place> element.Method Detail |
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public org.jdom.Element returnElement()
public void changeElement(org.jdom.Element newElement)
public boolean returnSelected()
public void highlight(boolean highlight)
public void select(boolean select)
PNAnimator
public void selectOnly(boolean select)
PNAnimator
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
protected void dofirst()
protected void updatePosition()
protected void updateLocation(java.awt.event.MouseEvent e)
protected void updateLocation(int newx, int newy)
public void setPosition(int x, int y)
x
- the x position on screeny
- the y position on screenpublic int getJX()
public int getJY()
protected void setJX(int x)
protected void setJY(int y)
protected void updateBounds()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void doubleclickAction()
public void showContextMenu(java.awt.event.MouseEvent e)
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public DisplayPane getDisplayPane()
public static org.jdom.Element makeGraphics(java.lang.String x, java.lang.String y, org.jdom.Namespace ns)
public java.lang.String getID()
public java.lang.String myElementName()
public DisplayPane remove()
public boolean isActive()
public void addToken()
PlaceLabel
,
ArcLabel
public void remToken()
PlaceLabel
,
ArcLabel
public java.util.List getLinkedLabels()
public void updateSelf()
public org.jdom.Element getToolspecific()
public org.jdom.Element makeToolspecific()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |