Class AbstractAttributeComponent
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.graffiti.plugin.view.AttributeComponent
org.graffiti.plugin.attributecomponent.AbstractAttributeComponent
- All Implemented Interfaces:
 ImageObserver,MenuContainer,Serializable,GraffitiViewComponent
- Direct Known Subclasses:
 ChartAttributeComponent,CompoundImageAttributeComponent,LabelComponent,PathwayLinkVisualizationComponent
public abstract class AbstractAttributeComponent extends AttributeComponent implements GraffitiViewComponent
This component represents a 
org.graffiti.attributes.Attribute.- Version:
 - $Revision: 1.9 $
 - See Also:
 - Serialized Form
 
- 
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior - 
Field Summary
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH - 
Constructor Summary
Constructors Constructor Description AbstractAttributeComponent()Instantiates anAttributeComponent - 
Method Summary
Modifier and Type Method Description voidadjustComponentPosition()adjust the component position onlyvoidadjustComponentSize()adjust the component size and positionabstract voidattributeChanged(Attribute attr)Called when a graphics attribute of the attribute represented by this component has changed.booleancheckVisibility(int minimumComponentSize)Attribute components can use this method to check if they are or should be visible in the view.voidcreateNewShape(CoordinateSystem coordSys)Called to initialise the component of this attribute correctly.AttributegetAttribute()Returns the attribute that is displayed by this component.voidpaint(Graphics g)voidpaintComponent(Graphics g)abstract voidrecreate()Used when the shape changed in the datastructure.voidsetAttribute(Attribute attr)Sets an instance of attribute which this component displays.voidsetGraphElementShape(GraphElementShape geShape)Sets shape of graph element to which the attribute of this component belongs.voidsetShift(Point shift)DOCUMENT ME!Methods inherited from class org.graffiti.plugin.view.AttributeComponent
highlight, setAlpha, setHiddenMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle 
- 
Constructor Details
- 
AbstractAttributeComponent
public AbstractAttributeComponent()Instantiates anAttributeComponent 
 - 
 - 
Method Details
- 
setAttribute
Sets an instance of attribute which this component displays.- Specified by:
 setAttributein classAttributeComponent- Parameters:
 attr-
 - 
getAttribute
Returns the attribute that is displayed by this component.- Specified by:
 getAttributein classAttributeComponent- Returns:
 - the attribute that is displayed by this component.
 
 - 
setGraphElementShape
Sets shape of graph element to which the attribute of this component belongs.- Specified by:
 setGraphElementShapein classAttributeComponent- Parameters:
 geShape-
 - 
setShift
DOCUMENT ME!- Specified by:
 setShiftin classAttributeComponent- Parameters:
 shift- DOCUMENT ME!
 - 
adjustComponentPosition
public void adjustComponentPosition()Description copied from class:AttributeComponentadjust the component position only- Specified by:
 adjustComponentPositionin classAttributeComponent
 - 
attributeChanged
Called when a graphics attribute of the attribute represented by this component has changed.- Specified by:
 attributeChangedin interfaceGraffitiViewComponent- Specified by:
 attributeChangedin classAttributeComponent- Parameters:
 attr- the attribute that has triggered the event.- Throws:
 ShapeNotFoundException
 - 
createNewShape
Called to initialise the component of this attribute correctly. Also callsrepaint().- Specified by:
 createNewShapein interfaceGraffitiViewComponent- Parameters:
 coordSys- TODO- Throws:
 ShapeNotFoundException- thrown when the shapeclass couldn't be resolved.
 - 
recreate
Used when the shape changed in the datastructure. Makes the painter to create a new shape.- Specified by:
 recreatein classAttributeComponent- Throws:
 ShapeNotFoundException
 - 
checkVisibility
public boolean checkVisibility(int minimumComponentSize)Attribute components can use this method to check if they are or should be visible in the view. Currently there is hard coded variables defining visibility such as presumed size of the component and the current drawing mode Future implementation should parameterize this.- Parameters:
 minimumComponentSize- TODO- Returns:
 
 - 
paintComponent
 - 
paint
- Overrides:
 paintin classJComponent
 - 
adjustComponentSize
public void adjustComponentSize()Description copied from class:AttributeComponentadjust the component size and position- Specified by:
 adjustComponentSizein classAttributeComponent
 
 -