|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
se.umu.cs.SequenceDiagramEditor.DrawingArea
This class represents the drawingarea where all objects in a sequence diagram is drawn.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
private java.util.Vector |
actorsAndObjects
The list with all classEntitys(actors and objects) in the drawingarea. |
protected bluej.extensions.BlueJ |
bluej
The BlueJ object used when the editor is connected to a BlueJ-project |
private javax.swing.JButton |
classCancel
Button when the user chose cancel instead of a new class |
private javax.swing.JDialog |
classDialog
A dialog that let the user chose a new class |
private bluej.extensions.BClass[] |
classes
All classes belonging to a given project |
private javax.swing.JComboBox |
classList
A list of available classes to chose from |
private javax.swing.JButton |
classOk
Button when the user chose a new class |
private Entity |
currentEntity
The active entity in the drawingarea. |
private java.io.File |
currentFile
The file for the current sequence diagram |
private CurrentState |
currentState
The current state for the drawingarea. |
static float[] |
dash1
Used for a dashed line |
static java.awt.BasicStroke |
dashed
Used for a dashed line |
private java.util.Vector |
drawingObjects
The list with all objects to draw in the drawingarea. |
private java.util.Vector |
lifelines
The list with all lifelines in the drawingarea. |
private javax.swing.JDialog |
messageDialog
A dialog that lets the user chose a method |
private javax.swing.JComboBox |
messageList
A list of available methods |
private javax.swing.JButton |
messageOk
Button when the user chose a new method |
private bluej.extensions.BMethod[] |
methods
Contains all methods for a choosen object |
private long |
newtime
The time for the second click, used to check doubleclicking |
private java.lang.String |
notes
Contains the notes belonging to a sequence diagram |
protected int |
nrOfObjects
The number of classEntitys(actor and objects) in the drawingarea. |
private long |
oldtime
The time for the first click, used to check doubleclicking |
private SeqDiagramEditor |
seqDiagramEditor
The Sequence Diagram Editor this drawingArea belongs to |
private java.util.Vector |
sequence
The messages belonging to a sequence in a diagram |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
DrawingArea(bluej.extensions.BlueJ b,
SeqDiagramEditor s)
The constructor for the class, used when the editor is started from BlueJ. |
|
DrawingArea(SeqDiagramEditor s)
The constructor for the class. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method is called when an event takes place. |
void |
addClassEntity(Entity e)
This method adds an object or an actor to the drawingarea. |
void |
addEntity(Entity e)
This method adds an entity to the drawingarea. |
void |
addToSequence(Message newMessage,
Message oldMessage)
This method is called when the user has placed a new message between another message and its returnmessage. |
void |
arrangeReturnMessages()
This method is used to arrange all return messages. |
protected void |
chooseMethod(Entity e)
This methos is used when the editor is in "BlueJ"-mode. |
private void |
chooseNewObject(Entity e)
This method is used when the editor is in "BlueJ"-mode. |
void |
clear()
This method is called when the user wants to open a new sequence diagram. |
java.util.Vector |
getActorsAndObject()
This method returns all actors and object in the drawing area. |
Entity |
getCurrentEntity()
This method returns the CurrentEntity of the drawing area. |
java.io.File |
getCurrentFile()
This method returns the currently open file in the drawingarea. |
CurrentState |
getCurrState()
This method return the currentstate of the drawing area. |
java.util.Vector |
getDrawingObjects()
This method returns all objects to draw in the drawing area. |
java.util.Vector |
getLifelines()
This method returns all lifelines in the drawing area. |
private Message |
getMessage(org.w3c.dom.Element e)
This method is used by the method readInMessage. |
java.lang.String |
getNoteFile()
This method returns the notes belonging to the current sequence diagram. |
SeqDiagramEditor |
getSeqDiagramEditor()
This method returns the object of the class SeqDiagramEditor. |
java.util.Vector |
getSequence()
This method returns all messages in a sequence in the current sequence diagram. |
void |
hideReturnMessages()
This method is used to remove all return messages from the drawingobjects. |
void |
mouseClicked(java.awt.event.MouseEvent e)
This method is called when the mouse is clicked in the drawingarea. |
void |
mouseDragged(java.awt.event.MouseEvent e)
This method is called when the mouse is dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
This method is called when the mouse is moved in the drawingarea. |
void |
mousePressed(java.awt.event.MouseEvent e)
This method is called when the mouse is pressed in the drawingarea. |
void |
mouseReleased(java.awt.event.MouseEvent e)
This method is called when the mouse is released on the drawingarea. |
void |
openFromFile(java.io.File file)
This method is called when the user wants to open a saved sequence diagram. |
void |
paintComponent(java.awt.Graphics g)
This method draws all objects on the drawingarea by calling the draw-method for all objects. |
private void |
readInDestroySymbol(ClassEntity c,
org.w3c.dom.Element d)
This method is used by the readInObject method. |
private void |
readInLifeLine(ClassEntity c,
org.w3c.dom.Element m)
This method is used by the readInObject method to read in a lifeline for an object/actor. |
private void |
readInMessage(ClassEntity c,
org.w3c.dom.Element m)
This method is used by the readInObject method. |
private void |
readInObject(org.w3c.dom.Element object)
This method is called to read in an actor or a sequenceobject from a file. |
org.w3c.dom.Document |
saveToFile(java.io.File file)
This method is called when the editor tells the drawingarea that it should save itself to a file. |
void |
setCurrentFile(java.io.File f)
This method sets the currently open file of the drawing area. |
void |
setNoteFile(java.lang.String n)
This methods sets the notes belonging to the currently open sequence diagram. |
void |
showReturnMessages()
This method is used to add all return messages to the drawingobjects. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getWidth, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private CurrentState currentState
private java.util.Vector drawingObjects
private java.util.Vector lifelines
private java.util.Vector actorsAndObjects
private Entity currentEntity
protected int nrOfObjects
protected bluej.extensions.BlueJ bluej
private SeqDiagramEditor seqDiagramEditor
private java.io.File currentFile
private java.util.Vector sequence
public static final float[] dash1
public static final java.awt.BasicStroke dashed
private javax.swing.JDialog messageDialog
private javax.swing.JComboBox messageList
private javax.swing.JButton messageOk
private bluej.extensions.BMethod[] methods
private javax.swing.JDialog classDialog
private javax.swing.JComboBox classList
private javax.swing.JButton classOk
private javax.swing.JButton classCancel
private bluej.extensions.BClass[] classes
private java.lang.String notes
private long oldtime
private long newtime
Constructor Detail |
public DrawingArea(SeqDiagramEditor s)
s
- The editor window that creates the drawingAreapublic DrawingArea(bluej.extensions.BlueJ b, SeqDiagramEditor s)
b
- The BlueJ-objects
- The editor window that creates the drawingAreaMethod Detail |
public void addEntity(Entity e)
e
- The Entity to addpublic void addClassEntity(Entity e)
e
- The entity to addpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- The mouseEvent.public void paintComponent(java.awt.Graphics g)
g
- The graphics used for the drawing.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- The mouseEvent.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- The mouseEvent.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- The mouseevent.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- The mouseEvent.public org.w3c.dom.Document saveToFile(java.io.File file) throws java.io.FileNotFoundException
file
- The file where the sequence diagram should
be saved.
java.io.FileNotFoundException
public void openFromFile(java.io.File file) throws javax.xml.parsers.ParserConfigurationException
file
- The file for the saved sequence diagram.
javax.xml.parsers.ParserConfigurationException
private void readInObject(org.w3c.dom.Element object)
object
- The actor/sequence-object to read in.private void readInLifeLine(ClassEntity c, org.w3c.dom.Element m)
c
- The ClassEntity for this lifelinem
- The lifelineprivate void readInMessage(ClassEntity c, org.w3c.dom.Element m)
c
- The startEntity or endEntity of this message.m
- The message.private Message getMessage(org.w3c.dom.Element e)
e
- The Message
private void readInDestroySymbol(ClassEntity c, org.w3c.dom.Element d)
c
- The ownerentity of this destroysymbol.d
- The destroysymbol.public void clear()
protected void chooseMethod(Entity e)
e
- The current entity of the drawingAreaprivate void chooseNewObject(Entity e)
e
- The current entity of the drawingArea.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- The ActionEventpublic void showReturnMessages()
public void hideReturnMessages()
public void arrangeReturnMessages()
public void addToSequence(Message newMessage, Message oldMessage)
newMessage
- The message that should be added to the sequenceoldMessage
- The message that is already in the sequencepublic java.util.Vector getDrawingObjects()
public java.util.Vector getLifelines()
public java.util.Vector getActorsAndObject()
public CurrentState getCurrState()
public java.io.File getCurrentFile()
public void setCurrentFile(java.io.File f)
f
- The filepublic SeqDiagramEditor getSeqDiagramEditor()
public Entity getCurrentEntity()
public java.lang.String getNoteFile()
public void setNoteFile(java.lang.String n)
n
- A string containing the notespublic java.util.Vector getSequence()
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |