org.cumt.view
Class DiagramView

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.cumt.view.DiagramView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, DiagramModelListener, SelectionListener, ActionAware
Direct Known Subclasses:
AnalysisDiagramView, DefaultDiagramView, SequenceDiagramView, UserInterfaceDiagramView

public class DiagramView
extends javax.swing.JPanel
implements DiagramModelListener, SelectionListener, ActionAware

Author:
Carlos Descalzi
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ar.com.da.swing.event.EventSupport<DiagramViewListener> diagramViewEventSupport
           
protected  ar.com.da.swing.DragSupport dragSupport
           
protected  org.apache.commons.logging.Log LOG
           
protected  ar.com.da.swing.event.EventSupport<ViewActionListener> viewActionEventSupport
           
 
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
DiagramView()
           
 
Method Summary
protected  void addBaseView(BaseView component)
           
 void addDiagramViewListener(DiagramViewListener listener)
           
 void addViewActionListener(ViewActionListener listener)
           
 void alignCentersHorizontally()
           
 void alignCentersVertically()
           
 void alignToBottom()
           
 void alignToLeft()
           
 void alignToRight()
           
 void alignToTop()
           
 void contentsChanged(DiagramModelEvent event)
           
 void copy()
           
 void cut()
           
 void delete()
           
 void editVisualAttributes()
           
 void elementAdded(DiagramModelEvent event)
           
 void elementChanged(DiagramModelEvent event)
           
 void elementRemoved(DiagramModelEvent event)
           
 boolean equals(java.lang.Object o)
           
 javax.swing.ActionMap getActions()
           
static DiagramView getContainerDiagram(javax.swing.JComponent component)
           
 java.awt.Rectangle getEffectiveArea()
           
 DiagramModel getModel()
           
 float getScale()
           
 SelectionManager getSelectionManager()
           
 BaseView getViewFor(ModelObject object)
           
 java.util.List<BaseView> getViews()
           
 int getXSnap()
           
 int getYSnap()
           
 int hashCode()
           
 boolean isGridVisible()
           
 boolean isSnapEnabled()
           
 void itemAddedToSelection(SelectionEvent event)
           
 void itemRemovedToSelection(SelectionEvent event)
           
 void modelToView()
           
protected  void paintComponent(java.awt.Graphics g)
           
 void paste()
           
protected  void processContainerEvent(java.awt.event.ContainerEvent e)
           
 void putSameHeight()
           
 void putSameWidth()
           
 void putSameWidthAndHeight()
           
 void removeDiagramViewListener(DiagramViewListener listener)
           
 void removeViewActionListener(ViewActionListener listener)
           
 void selectionChanged(SelectionEvent event)
           
 void selectionCleared(SelectionEvent event)
           
 void setGridVisible(boolean gridVisible)
           
 void setModel(DiagramModel model)
           
 void setScale(float scale)
           
 void setSnapEnabled(boolean snapEnabled)
           
 void setXSnap(int snap)
           
 void setYSnap(int snap)
           
 java.lang.String toString()
           
 void viewToModel()
           
 void zoomIn()
           
 void zoomOut()
           
 
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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected final org.apache.commons.logging.Log LOG

diagramViewEventSupport

protected final ar.com.da.swing.event.EventSupport<DiagramViewListener> diagramViewEventSupport

viewActionEventSupport

protected final ar.com.da.swing.event.EventSupport<ViewActionListener> viewActionEventSupport

dragSupport

protected final ar.com.da.swing.DragSupport dragSupport
Constructor Detail

DiagramView

public DiagramView()
Method Detail

getEffectiveArea

public java.awt.Rectangle getEffectiveArea()

processContainerEvent

protected void processContainerEvent(java.awt.event.ContainerEvent e)
Overrides:
processContainerEvent in class java.awt.Container

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

setSnapEnabled

public void setSnapEnabled(boolean snapEnabled)

isSnapEnabled

public boolean isSnapEnabled()

isGridVisible

public boolean isGridVisible()

setGridVisible

public void setGridVisible(boolean gridVisible)

getXSnap

public int getXSnap()

setXSnap

public void setXSnap(int snap)

getYSnap

public int getYSnap()

setYSnap

public void setYSnap(int snap)

getContainerDiagram

public static DiagramView getContainerDiagram(javax.swing.JComponent component)

modelToView

public void modelToView()

viewToModel

public void viewToModel()

getModel

public DiagramModel getModel()

getViews

public java.util.List<BaseView> getViews()

getViewFor

public BaseView getViewFor(ModelObject object)

setModel

public void setModel(DiagramModel model)

addBaseView

protected void addBaseView(BaseView component)

elementAdded

public void elementAdded(DiagramModelEvent event)
Specified by:
elementAdded in interface DiagramModelListener

elementRemoved

public void elementRemoved(DiagramModelEvent event)
Specified by:
elementRemoved in interface DiagramModelListener

elementChanged

public void elementChanged(DiagramModelEvent event)
Specified by:
elementChanged in interface DiagramModelListener

contentsChanged

public void contentsChanged(DiagramModelEvent event)
Specified by:
contentsChanged in interface DiagramModelListener

addDiagramViewListener

public void addDiagramViewListener(DiagramViewListener listener)

removeDiagramViewListener

public void removeDiagramViewListener(DiagramViewListener listener)

addViewActionListener

public void addViewActionListener(ViewActionListener listener)

removeViewActionListener

public void removeViewActionListener(ViewActionListener listener)

getActions

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

zoomIn

public void zoomIn()

zoomOut

public void zoomOut()

cut

public void cut()

copy

public void copy()

paste

public void paste()

delete

public void delete()

alignToTop

public void alignToTop()

alignToBottom

public void alignToBottom()

alignToLeft

public void alignToLeft()

alignToRight

public void alignToRight()

alignCentersHorizontally

public void alignCentersHorizontally()

alignCentersVertically

public void alignCentersVertically()

putSameWidth

public void putSameWidth()

putSameHeight

public void putSameHeight()

putSameWidthAndHeight

public void putSameWidthAndHeight()

editVisualAttributes

public void editVisualAttributes()

getSelectionManager

public SelectionManager getSelectionManager()

selectionChanged

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

itemAddedToSelection

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

itemRemovedToSelection

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

selectionCleared

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

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getScale

public float getScale()

setScale

public void setScale(float scale)


Copyright © 2006 null. All Rights Reserved.