org.acm.seguin.uml
Class UMLPackage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.acm.seguin.uml.line.LinedPanel
                      extended by org.acm.seguin.uml.UMLPackage
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, Saveable

public class UMLPackage
extends LinedPanel
implements Saveable

Draws a UML diagram for all the classes in a package

Version:
$Id: UMLPackage.java,v 1.6 2003/09/01 00:25:32 mikeatkinson Exp $
Author:
Chris Seguin, Mike Atkinson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
UMLPackage(PackageSummary packageSummary)
          Constructor for UMLPackage
UMLPackage(java.io.Reader input)
          Constructor for UMLPackage
UMLPackage(java.lang.String filename)
          Constructor for UMLPackage
 
Method Summary
 void clear()
          Description of the Method
 void drag(java.awt.Point actual)
          Dragging a segmented line point
 void drop()
          User dropped an item
protected  UMLType find(java.lang.String id)
          Find the type based on a id code
protected  SegmentedLine find(java.lang.String panel1, java.lang.String panel2)
          Find the type based on a id code
protected  UMLType findType(TypeSummary searching)
          Find the type based on a summary
 java.io.File getFile()
          Gets the File attribute of the UMLPackage object
 java.awt.Dimension getMinimumSize()
          Returns the minimum size
 java.lang.String getPackageName()
          Gets the PackageName attribute of the UMLPackage object
 java.awt.Dimension getPreferredSize()
          Returns the preferred size
 PackageSummary getSummary()
          Get the summary
 java.lang.String getTitle()
          Determines the title
 UMLType[] getTypes()
          Get the components that are UMLTypes
 void hit(java.awt.Point actual)
          Determine what you hit
 boolean isDirty()
          Gets the Dirty attribute of the UMLPackage object
 void jumpTo(TypeSummary type)
          Tells the scrollbar to jump to this location
 void paint(java.awt.Graphics g)
          Paint this object
 void print(java.awt.Graphics g, int x, int y)
          Print this object
 void rearragePositions(int temperature, int iterations, double springStrength)
          Uses a mixture of Simulated Annealling, springs along relationships and gravity (to position subclasses below their parents).
 void reload()
          Reloads the UML class diagrams
 void removeAssociation(UMLField field)
          Remove the association
 void reset()
          Resets the scroll panes
 void resetPositions()
          Initialises the positions of all types randomly.
 void save()
          Save the files
 void scale(double value)
          Sets the scale and resizes the panel.
 void setClassListPanel(ClassListPanel value)
          Sets the class list panel
 void setDirty()
          Sets the Dirty attribute of the UMLPackage object
 void setLoading(boolean value)
          Sets the loading value
 void setScrollPane(javax.swing.JScrollPane value)
          Sets the ScrollPane attribute of the UMLPackage object
 
Methods inherited from class org.acm.seguin.uml.line.LinedPanel
add, add, deselectAll, getEndPointIterator, getEndPoints, getLineIterator, getLines, remove, remove, shift
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UMLPackage

public UMLPackage(PackageSummary packageSummary)
Constructor for UMLPackage

Parameters:
packageSummary - the summary of the package

UMLPackage

public UMLPackage(java.lang.String filename)
Constructor for UMLPackage

Parameters:
filename - the name of the file

UMLPackage

public UMLPackage(java.io.Reader input)
Constructor for UMLPackage

Parameters:
input - the input stream
Method Detail

setDirty

public void setDirty()
Sets the Dirty attribute of the UMLPackage object


setScrollPane

public void setScrollPane(javax.swing.JScrollPane value)
Sets the ScrollPane attribute of the UMLPackage object

Parameters:
value - The new ScrollPane value

setClassListPanel

public void setClassListPanel(ClassListPanel value)
Sets the class list panel

Parameters:
value - the new list

setLoading

public void setLoading(boolean value)
Sets the loading value

Parameters:
value - The new Loading value

getPackageName

public java.lang.String getPackageName()
Gets the PackageName attribute of the UMLPackage object

Returns:
The PackageName value

getTypes

public UMLType[] getTypes()
Get the components that are UMLTypes

Returns:
Description of the Returned Value

scale

public void scale(double value)
Sets the scale and resizes the panel.

Overrides:
scale in class LinedPanel
Parameters:
value - Description of Parameter

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size

Overrides:
getMinimumSize in class javax.swing.JComponent
Returns:
The size

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
The size

getSummary

public PackageSummary getSummary()
Get the summary

Returns:
The package summary

getFile

public java.io.File getFile()
Gets the File attribute of the UMLPackage object

Returns:
The File value

isDirty

public boolean isDirty()
Gets the Dirty attribute of the UMLPackage object

Returns:
The Dirty value

getTitle

public java.lang.String getTitle()
Determines the title

Returns:
the title

removeAssociation

public void removeAssociation(UMLField field)
Remove the association

Parameters:
field - Description of Parameter

paint

public void paint(java.awt.Graphics g)
Paint this object

Overrides:
paint in class javax.swing.JComponent
Parameters:
g - the graphics object

print

public void print(java.awt.Graphics g,
                  int x,
                  int y)
Print this object

Parameters:
g - the graphics object
x - the x coordinate
y - the y coordinate

reload

public void reload()
Reloads the UML class diagrams


clear

public void clear()
Description of the Method

Overrides:
clear in class LinedPanel

hit

public void hit(java.awt.Point actual)
Determine what you hit

Specified by:
hit in class LinedPanel
Parameters:
actual - The hit location

drag

public void drag(java.awt.Point actual)
Dragging a segmented line point

Specified by:
drag in class LinedPanel
Parameters:
actual - The mouse's current location

drop

public void drop()
User dropped an item

Specified by:
drop in class LinedPanel

save

public void save()
          throws java.io.IOException
Save the files

Specified by:
save in interface Saveable
Throws:
java.io.IOException - Description of Exception

jumpTo

public void jumpTo(TypeSummary type)
Tells the scrollbar to jump to this location

Parameters:
type - Description of Parameter

findType

protected UMLType findType(TypeSummary searching)
Find the type based on a summary

Parameters:
searching - the variable we are searching for
Returns:
the UML type object

find

protected UMLType find(java.lang.String id)
Find the type based on a id code

Parameters:
id - the code we are searching for
Returns:
the UML type object

find

protected SegmentedLine find(java.lang.String panel1,
                             java.lang.String panel2)
Find the type based on a id code

Parameters:
panel1 - Description of Parameter
panel2 - Description of Parameter
Returns:
the UML type object

reset

public void reset()
Resets the scroll panes


resetPositions

public void resetPositions()
Initialises the positions of all types randomly.

Since:
2.7.04

rearragePositions

public void rearragePositions(int temperature,
                              int iterations,
                              double springStrength)
Uses a mixture of Simulated Annealling, springs along relationships and gravity (to position subclasses below their parents).

Parameters:
temperature - notional initial temperature of the diagram, a value of 2000 works well.
iterations - number of times to reduce temperature
Since:
2.7.04