kaapo.types.diagramcomponents
Class DataBase

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

public class DataBase
extends Element

Author:
iheikkin
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
DataBase()
           
 
Method Summary
protected  DCGraphics buildDCGraphics(DiagramComponentWrapper wrapper, ProjectManager pm)
          Build a new graphical representation of the element as DCGraphics.
 boolean canMove(DiagramComponentWrapper wrapper)
          Tell whether the element can be moved by user.
 boolean canResize(DiagramComponentWrapper wrapper)
          Tell whether the element can be resized by user.
 double getDefaultHeight()
          Returns the default height of the element.
 double getDefaultWidth()
          Returns the default width of the element.
 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.Element
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

DataBase

public DataBase()
Method Detail

buildDCGraphics

protected DCGraphics buildDCGraphics(DiagramComponentWrapper wrapper,
                                     ProjectManager pm)
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.
pm - Project manager
Returns:
New DCGraphics instance

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

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.

canMove

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

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 element can be moved.

getDefaultWidth

public double getDefaultWidth()
Description copied from class: Element
Returns the default width of the element. Default width is used when creating a new element instance, for example.

Specified by:
getDefaultWidth in class Element
Returns:
Default width

getDefaultHeight

public double getDefaultHeight()
Description copied from class: Element
Returns the default height of the element. Default height is used when creating a new element instance, for example.

Specified by:
getDefaultHeight in class Element
Returns:
Default height

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

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