kaapo.types.diagramcomponents
Class Dependency

java.lang.Object
  extended by kaapo.Observable
      extended by kaapo.project.ProjectComponent
          extended by kaapo.project.DiagramComponent
              extended by kaapo.project.Connection
                  extended by kaapo.types.diagramcomponents.Dependency
All Implemented Interfaces:
Serializable

public class Dependency
extends Connection

Author:
holsti Basic dependency connection for usecase diagrams.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class kaapo.project.DiagramComponent
DiagramComponent.ComponentType
 
Nested classes/interfaces inherited from class kaapo.project.ProjectComponent
ProjectComponent.ObservableMessage
 
Field Summary
 
Fields inherited from class kaapo.project.ProjectComponent
attributeMap, attributePanel
 
Constructor Summary
Dependency()
          Constructor that calls super().
 
Method Summary
protected  DCGraphics buildDCGraphics(DiagramComponentWrapper wrapper, ProjectManager projectManager)
          Build a new graphical representation of the element as DCGraphics.
 boolean canMove(DiagramComponentWrapper wrapper)
          Tests if the connection can move.
 boolean canResize(DiagramComponentWrapper wrapper)
          Tell whether the element can be resized by user.
 boolean getIsDirect()
          Tell whether the connection goes directly from end point to start point or has multiple segments.
 ImageIcon getLargeIcon()
          Returns a 24*24 pixel icon of the diagram component type.
 ImageIcon getSmallIcon()
          Returns a 16*16 icon representing the project component type.
 String getTypeName()
          Returns the component type name formatted in a human-friendly manner.
 
Methods inherited from class kaapo.project.Connection
getComponentType, isElement
 
Methods inherited from class kaapo.project.ProjectComponent
addAttribute, addAttribute, buildAttributePanel, getAttribute, getAttributeMap, getAttributePanel, hasAttribute, removeAttribute, setAttribute
 
Methods inherited from class kaapo.Observable
addObserver, notifyObservers, notifyObservers, removeAllObservers, removeObserver, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency()
Constructor that calls super().

Method Detail

buildDCGraphics

protected DCGraphics buildDCGraphics(DiagramComponentWrapper wrapper,
                                     ProjectManager projectManager)
Description copied from class: DiagramComponent
Build a new graphical representation of the element as DCGraphics. This method must always build a new instance.

Specified by:
buildDCGraphics in class DiagramComponent
Parameters:
wrapper - The wrapper containing the attributes of the element the differ between diagrams.
projectManager - Project manager
Returns:
New DCGraphics instance
See Also:
DiagramComponent.buildDCGraphics(kaapo.project.DiagramComponentWrapper, kaapo.projectmanager.ProjectManager)

getTypeName

public String getTypeName()
Description copied from class: ProjectComponent
Returns the component type name formatted in a human-friendly manner. For example, a UML class diagram type should return "Class Diagram" or "UML Class Diagram" or similar, not "classdiagram" or "uml_class_diagram".

Specified by:
getTypeName in class ProjectComponent
See Also:
ProjectComponent.getTypeName()

getLargeIcon

public ImageIcon getLargeIcon()
Description copied from class: DiagramComponent
Returns a 24*24 pixel icon of the diagram component type. The icon is used in element palette by the GUI.

Specified by:
getLargeIcon in class DiagramComponent
Returns:
Icon
See Also:
DiagramComponent.getLargeIcon()

canResize

public boolean canResize(DiagramComponentWrapper wrapper)
Description copied from class: DiagramComponent
Tell whether the element can be resized by user.

Specified by:
canResize in class DiagramComponent
Parameters:
wrapper - The wrapper in question. The wrapper is given as parameter because it may depend on the wrapper whether the component can be resized.
Returns:
True if element can be resized.
See Also:
DiagramComponent.canResize(kaapo.project.DiagramComponentWrapper)

canMove

public boolean canMove(DiagramComponentWrapper wrapper)
Tests if the connection can move. Dependency can move only if both of its ends are not connceted.

Specified by:
canMove in class DiagramComponent
Parameters:
wrapper - The wrapper in question. The wrapper is given as parameter because it may depend on the wrapper whether the component can be moved.
Returns:
true if the connection is free at both ends, false if it is connected at either.
See Also:
DiagramComponent.canMove(kaapo.project.DiagramComponentWrapper)

getSmallIcon

public ImageIcon getSmallIcon()
Description copied from class: ProjectComponent
Returns a 16*16 icon representing the project component type. The icon is used by GUI in the diagram tree.

Specified by:
getSmallIcon in class ProjectComponent
See Also:
ProjectComponent.getSmallIcon()

getIsDirect

public boolean getIsDirect()
Description copied from class: Connection
Tell whether the connection goes directly from end point to start point or has multiple segments.

Overrides:
getIsDirect in class Connection
Returns:
True if connection is direct, false if connection has multiple segments.
See Also:
Connection.getIsDirect()