org.acm.seguin.uml
Class UMLType

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.ScalablePanel
                      extended by org.acm.seguin.uml.line.EndPointPanel
                          extended by org.acm.seguin.uml.UMLType
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ISourceful

public class UMLType
extends EndPointPanel
implements ISourceful

Displays the summary of a type object

Since:
empty
Version:
$Id: UMLType.java,v 1.4 2003/07/29 20:51:57 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
protected  int borderWidth
          Description of the Field
protected  int lineSize
          Description of the Field
 
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
UMLType(UMLPackage initParent, TypeSummary initType, boolean foreign)
          Create a new instance of a UMLType
 
Method Summary
 AssociationRelationship convertToAssociation(UMLPackage packagePanel, UMLField fieldPanel)
          Convert an attribute to an association
 void convertToAttribute(UMLPackage packagePanel, UMLField fieldPanel)
          Convert from an association to an attribute
 void deselect()
          Select this item
 java.awt.Color getBackgroundColor()
          Return the background color
 UMLField getField(java.lang.String name)
          Count the number of attributes
 java.lang.String getID()
          Returns an identifier for a type
 java.awt.Dimension getMinimumSize()
          Returns the minimum size
 UMLPackage getPackage()
          Get the UML package that is holding this
 java.awt.Dimension getPreferredSize()
          Returns the preferred size
 Summary getSourceSummary()
          Returns the type summary for this class
 TypeSummary getSummary()
          Get the summary
 boolean isForeign()
          Determine if this is foreign
 boolean isSelected()
          Determine if this is selected
 void load(java.lang.String buffer)
          Load the type
 void paint(java.awt.Graphics g)
          Paint this object
 void print(java.awt.Graphics g, int x, int y)
          Print this object
 void resize()
          Resizes and repositions the compontents, and repaints them.
 void save(java.io.PrintWriter output)
          Save the files
 void scale(double value)
          Sets the scaling factor
 void select()
          Select this item
 void setSelected(boolean way)
          Sets the Selected attribute of the UMLType object
 void toggleSelect()
          Toggle the selected state
 
Methods inherited from class org.acm.seguin.uml.line.ScalablePanel
getScale, getUnscaledBounds, getUnscaledLocation, move, reshape, resize, resize, scaleInteger, setBounds, setBounds, setLocation, setLocation, setSize, setSize, shift, unscaleInteger
 
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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setName, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

borderWidth

protected int borderWidth
Description of the Field


lineSize

protected int lineSize
Description of the Field

Constructor Detail

UMLType

public UMLType(UMLPackage initParent,
               TypeSummary initType,
               boolean foreign)
Create a new instance of a UMLType

Parameters:
initParent - the parent
initType - the initial type data
foreign - Description of Parameter
Method Detail

setSelected

public void setSelected(boolean way)
Sets the Selected attribute of the UMLType object

Specified by:
setSelected in class EndPointPanel
Parameters:
way - The new Selected value

getBackgroundColor

public java.awt.Color getBackgroundColor()
Return the background color

Returns:
the background color

getField

public UMLField getField(java.lang.String name)
Count the number of attributes

Parameters:
name - Description of Parameter
Returns:
the number of attributes

getID

public java.lang.String getID()
Returns an identifier for a type

Returns:
an identifier for this panel

getMinimumSize

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

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

getPackage

public UMLPackage getPackage()
Get the UML package that is holding this

Returns:
the package

getPreferredSize

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

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

getSourceSummary

public Summary getSourceSummary()
Returns the type summary for this class

Specified by:
getSourceSummary in interface ISourceful
Returns:
the type summary

getSummary

public TypeSummary getSummary()
Get the summary

Returns:
the summary

isForeign

public boolean isForeign()
Determine if this is foreign

Returns:
true if this is foreign

isSelected

public boolean isSelected()
Determine if this is selected

Specified by:
isSelected in class EndPointPanel
Returns:
true if this is selected

convertToAssociation

public AssociationRelationship convertToAssociation(UMLPackage packagePanel,
                                                    UMLField fieldPanel)
Convert an attribute to an association

Parameters:
packagePanel - the package panel
fieldPanel - the field panel
Returns:
the new segmented line

convertToAttribute

public void convertToAttribute(UMLPackage packagePanel,
                               UMLField fieldPanel)
Convert from an association to an attribute

Parameters:
packagePanel - the package panel
fieldPanel - the field panel

deselect

public void deselect()
Select this item


load

public void load(java.lang.String buffer)
Load the type

Parameters:
buffer - the buffer

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

resize

public void resize()
Resizes and repositions the compontents, and repaints them.


save

public void save(java.io.PrintWriter output)
Save the files

Parameters:
output - the output stream

scale

public void scale(double value)
Sets the scaling factor

Overrides:
scale in class ScalablePanel
Parameters:
value - scaling factor

select

public void select()
Select this item


toggleSelect

public void toggleSelect()
Toggle the selected state