org.cumt.view
Class BaseView<T extends ModelObject>

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.cumt.view.BaseView<T>
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, SelectionListener, ActionAware
Direct Known Subclasses:
BaseComponent, RelationView

public abstract class BaseView<T extends ModelObject>
extends javax.swing.JComponent
implements SelectionListener, ActionAware

The base class for object views

Author:
Carlos Descalzi
See Also:
Serialized Form

Nested Class Summary
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.ActionMap defaultActionMap
           
 
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
BaseView()
           
 
Method Summary
 javax.swing.ActionMap getActions()
           
 T getModel()
           
 DiagramView getParentDiagram()
           
protected  SelectionManager getSelectionManager()
           
 java.awt.Rectangle getUnscaledBounds()
           
protected
<VAType extends ViewAttributes>
VAType
getViewAttributes(java.lang.Class<VAType> defaultType)
           
 boolean isSelected()
           
 boolean isSensitive()
           
 void itemAddedToSelection(SelectionEvent event)
           
 void itemRemovedToSelection(SelectionEvent event)
           
protected  void modelChanged()
           
abstract  void modelToView()
          Sets view attributes from model to view
protected  void processFocusEvent(java.awt.event.FocusEvent event)
           
protected  void processMouseEvent(java.awt.event.MouseEvent mouseEvent)
           
 void selectionChanged(SelectionEvent event)
           
 void selectionCleared(SelectionEvent event)
           
 void setModel(T model)
           
 void setParentDiagram(DiagramView parentDiagram)
           
 void setSensitive(boolean sensitive)
           
 boolean shouldUseLabel()
           
 java.lang.String toString()
           
protected  void updateComponent(java.lang.String propertyName, java.lang.Object newValue)
           
abstract  void viewToModel()
          Sets view attributes to the model object
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, updateUI
 
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, 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, 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, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultActionMap

protected final javax.swing.ActionMap defaultActionMap
Constructor Detail

BaseView

public BaseView()
Method Detail

getActions

public javax.swing.ActionMap getActions()
Specified by:
getActions in interface ActionAware

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent mouseEvent)
Overrides:
processMouseEvent in class javax.swing.JComponent

processFocusEvent

protected void processFocusEvent(java.awt.event.FocusEvent event)
Overrides:
processFocusEvent in class java.awt.Component

getModel

public T getModel()

setModel

public void setModel(T model)

updateComponent

protected void updateComponent(java.lang.String propertyName,
                               java.lang.Object newValue)

modelChanged

protected void modelChanged()

getParentDiagram

public DiagramView getParentDiagram()

setParentDiagram

public void setParentDiagram(DiagramView parentDiagram)

getSelectionManager

protected SelectionManager getSelectionManager()

shouldUseLabel

public boolean shouldUseLabel()

isSelected

public boolean isSelected()

itemAddedToSelection

public void itemAddedToSelection(SelectionEvent event)
Specified by:
itemAddedToSelection in interface SelectionListener

itemRemovedToSelection

public void itemRemovedToSelection(SelectionEvent event)
Specified by:
itemRemovedToSelection in interface SelectionListener

selectionChanged

public void selectionChanged(SelectionEvent event)
Specified by:
selectionChanged in interface SelectionListener

selectionCleared

public void selectionCleared(SelectionEvent event)
Specified by:
selectionCleared in interface SelectionListener

getViewAttributes

protected <VAType extends ViewAttributes> VAType getViewAttributes(java.lang.Class<VAType> defaultType)

viewToModel

public abstract void viewToModel()
Sets view attributes to the model object


modelToView

public abstract void modelToView()
Sets view attributes from model to view


toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component

isSensitive

public boolean isSensitive()

setSensitive

public void setSensitive(boolean sensitive)

getUnscaledBounds

public java.awt.Rectangle getUnscaledBounds()


Copyright © 2006 null. All Rights Reserved.