org.acm.seguin.uml
Class UMLLine

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.UMLLine
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
UMLField, UMLMethod, UMLNestedType

public class UMLLine
extends EndPointPanel

Displays a single UML line

Author:
Chris Seguin
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 static java.awt.Font abstractFont
          Description of the Field
protected static java.awt.Font abstractTitleFont
          Description of the Field
static int DEFAULT
          Description of the Field
protected static java.awt.Font defaultFont
          Description of the Field
protected  int high
          Description of the Field
protected  UMLIcon icon
          Stores the icon for this object
protected static int iconMargin
          Description of the Field
protected  SizableLabel label
          Description of the Field
protected static int labelMargin
          Description of the Field
static int PRIVATE
          Description of the Field
static int PROTECTED
          Description of the Field
static int PROTECTED_PRIVATE
          Description of the Field
protected static java.awt.Color[] protectionColors
          Description of the Field
static int PUBLIC
          Description of the Field
protected static java.awt.Font staticFont
          Description of the Field
protected static java.awt.Font titleFont
          Description of the Field
protected  int wide
          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
UMLLine(UMLType parent, DragPanelAdapter adapter)
          Create a new instance of a UMLLine
 
Method Summary
 void addMouseListener(java.awt.event.MouseListener listener)
          Add a mouse listener
 void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
          Add a mouse listener
protected  void drawIcon(java.awt.Graphics g, int x, int y)
          Draws the icon
protected  java.awt.Color getDefaultBackground()
          Return the default background color
 java.awt.Dimension getMinimumSize()
          Returns the minimum size
 UMLType getParentType()
          Gets the ParentType attribute of the UMLLine object
 java.awt.Dimension getPreferredSize()
          Returns the preferred size
protected static int getProtectionCode(net.sourceforge.jrefactory.ast.ModifierHolder modifiers)
          Add the protection information for this field or method
protected static java.awt.Color getProtectionColor(int level)
          Get the color associated with a level of protection
protected static java.awt.Font getProtectionFont(boolean title, net.sourceforge.jrefactory.ast.ModifierHolder modifiers)
          Get the font appropriate for the level of protection
 boolean isSelected()
          Gets the Selected attribute of the UMLLine object
 void paint(java.awt.Graphics g)
          Paint this object
 void print(java.awt.Graphics g, int x, int y)
          Print this object
 void removeMouseListener(java.awt.event.MouseListener listener)
          Remove a mouse listener
 void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
          Remove a mouse listener
 void scale(double value)
          Sets the scaling factor
 void setLabelFont(java.awt.Font font)
          Set the font
 void setLabelText(java.lang.String msg)
          Set the text
 void setProtection(int code)
          Set the protection code
 void setSelected(boolean value)
          Sets the Selected attribute of the UMLLine object
 
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, 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, 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

label

protected SizableLabel label
Description of the Field


wide

protected int wide
Description of the Field


high

protected int high
Description of the Field


icon

protected UMLIcon icon
Stores the icon for this object


PUBLIC

public static final int PUBLIC
Description of the Field

See Also:
Constant Field Values

PROTECTED_PRIVATE

public static final int PROTECTED_PRIVATE
Description of the Field

See Also:
Constant Field Values

PROTECTED

public static final int PROTECTED
Description of the Field

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
Description of the Field

See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
Description of the Field

See Also:
Constant Field Values

protectionColors

protected static java.awt.Color[] protectionColors
Description of the Field


defaultFont

protected static java.awt.Font defaultFont
Description of the Field


staticFont

protected static java.awt.Font staticFont
Description of the Field


abstractFont

protected static java.awt.Font abstractFont
Description of the Field


titleFont

protected static java.awt.Font titleFont
Description of the Field


abstractTitleFont

protected static java.awt.Font abstractTitleFont
Description of the Field


iconMargin

protected static final int iconMargin
Description of the Field

See Also:
Constant Field Values

labelMargin

protected static final int labelMargin
Description of the Field

See Also:
Constant Field Values
Constructor Detail

UMLLine

public UMLLine(UMLType parent,
               DragPanelAdapter adapter)
Create a new instance of a UMLLine

Parameters:
parent - Description of Parameter
adapter - Description of Parameter
Method Detail

setProtection

public void setProtection(int code)
Set the protection code

Parameters:
code - the code

setLabelText

public void setLabelText(java.lang.String msg)
Set the text

Parameters:
msg - the message

setLabelFont

public void setLabelFont(java.awt.Font font)
Set the font

Parameters:
font - the new font

setSelected

public void setSelected(boolean value)
Sets the Selected attribute of the UMLLine object

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

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

getParentType

public UMLType getParentType()
Gets the ParentType attribute of the UMLLine object

Returns:
The ParentType value

isSelected

public boolean isSelected()
Gets the Selected attribute of the UMLLine object

Specified by:
isSelected in class EndPointPanel
Returns:
The Selected value

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

addMouseListener

public void addMouseListener(java.awt.event.MouseListener listener)
Add a mouse listener

Overrides:
addMouseListener in class java.awt.Component
Parameters:
listener - the new listener

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener listener)
Remove a mouse listener

Overrides:
removeMouseListener in class java.awt.Component
Parameters:
listener - the new listener

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
Add a mouse listener

Overrides:
addMouseMotionListener in class java.awt.Component
Parameters:
listener - the new listener

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
Remove a mouse listener

Overrides:
removeMouseMotionListener in class java.awt.Component
Parameters:
listener - the new listener

scale

public void scale(double value)
Sets the scaling factor

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

getDefaultBackground

protected java.awt.Color getDefaultBackground()
Return the default background color

Returns:
the color

drawIcon

protected void drawIcon(java.awt.Graphics g,
                        int x,
                        int y)
Draws the icon

Parameters:
g - the graphics object
x - Description of Parameter
y - Description of Parameter

getProtectionCode

protected static int getProtectionCode(net.sourceforge.jrefactory.ast.ModifierHolder modifiers)
Add the protection information for this field or method

Parameters:
modifiers - the modifier information
Returns:
Description of the Returned Value

getProtectionFont

protected static java.awt.Font getProtectionFont(boolean title,
                                                 net.sourceforge.jrefactory.ast.ModifierHolder modifiers)
Get the font appropriate for the level of protection

Parameters:
title - is this a title
modifiers - the modifiers
Returns:
Description of the Returned Value

getProtectionColor

protected static java.awt.Color getProtectionColor(int level)
Get the color associated with a level of protection

Parameters:
level - the level that we need to know
Returns:
the color