org.argouml.uml.reveng
Class DiagramInterface

java.lang.Object
  extended byorg.argouml.uml.reveng.DiagramInterface

public class DiagramInterface
extends java.lang.Object

Instances of this class interface the current Class diagram.

This class is used by the import mechanism to create packages, interfaces and classes within the diagrams. It is also used to find the correct diagram to work in.

Since:
0.9

Field Summary
(package private)  org.tigris.gef.base.Editor _currentEditor
           
(package private)  java.util.Vector _modifiedDiagrams
          To know what diagrams we have to layout after the import, we store them in this Vector.
protected static org.apache.log4j.Logger cat
          Deprecated. by Linus Tolke as of 0.15.4. Use your own logger in your class. This will be removed.
(package private)  ArgoDiagram currentDiagram
          The current diagram for the isInDiagram method.
(package private)  ClassDiagramGraphModel currentGM
          The current GraphModel of the current classdiagram.
(package private)  org.tigris.gef.base.LayerPerspective currentLayer
          The current Layer of the current classdiagram.
 
Constructor Summary
DiagramInterface(org.tigris.gef.base.Editor editor)
          Creates a new DiagramInterface.
 
Method Summary
 void addClass(java.lang.Object newClass, boolean minimise)
          Add a class to the current diagram.
 void addClassDiagram(java.lang.Object ns, java.lang.String name)
          Add a new class diagram for a package to the project.
 void addInterface(java.lang.Object newInterface, boolean minimise)
          Add a interface to the current diagram.
 void addPackage(java.lang.Object newPackage)
          Add a package to the current diagram.
 void createOrSelectClassDiagram(java.lang.Object currentPackage, java.lang.String currentPackageName)
          Creates new class diagram for package or selects existing one.
 void createRootClassDiagram()
          Creates class diagram under the root.
private  java.lang.String getDiagramName(java.lang.Object p)
          Create a diagram name for a package
private  java.lang.String getDiagramName(java.lang.String packageName)
          Create a diagram name from a package name
(package private)  org.tigris.gef.base.Editor getEditor()
          Get the current editor.
 java.util.Vector getModifiedDiagrams()
          Get the list of modified diagrams.
 boolean isDiagramInProject(java.lang.String name)
          Check if this diagram already exists in the project.
 boolean isInDiagram(java.lang.Object p)
          Check if a given package has a representation in the current diagram.
(package private)  void markDiagramAsModified(java.lang.Object diagram)
          Mark a diagram as modified, so we can layout it, after the import is complete.
(package private)  void resetModifiedDiagrams()
          Reset the list of modified diagrams.
 void selectClassDiagram(java.lang.Object p, java.lang.String name)
          Select or create a class diagram for a package.
 void setCurrentDiagram(ArgoDiagram diagram)
          selects a diagram without affecting the gui.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Logger cat
Deprecated. by Linus Tolke as of 0.15.4. Use your own logger in your class. This will be removed.


_currentEditor

org.tigris.gef.base.Editor _currentEditor

_modifiedDiagrams

java.util.Vector _modifiedDiagrams
To know what diagrams we have to layout after the import, we store them in this Vector.


currentGM

ClassDiagramGraphModel currentGM
The current GraphModel of the current classdiagram.


currentLayer

org.tigris.gef.base.LayerPerspective currentLayer
The current Layer of the current classdiagram.


currentDiagram

ArgoDiagram currentDiagram
The current diagram for the isInDiagram method.

Constructor Detail

DiagramInterface

public DiagramInterface(org.tigris.gef.base.Editor editor)
Creates a new DiagramInterface.

Parameters:
editor - The editor to operate on.
Method Detail

getEditor

org.tigris.gef.base.Editor getEditor()
Get the current editor.

Returns:
The current editor.

markDiagramAsModified

void markDiagramAsModified(java.lang.Object diagram)
Mark a diagram as modified, so we can layout it, after the import is complete.

If the diagram is not already marked, add it to the list.

Parameters:
diagram - The diagram to mark as modified.

getModifiedDiagrams

public java.util.Vector getModifiedDiagrams()
Get the list of modified diagrams.

Returns:
The list of modified diagrams.

resetModifiedDiagrams

void resetModifiedDiagrams()
Reset the list of modified diagrams.


addPackage

public void addPackage(java.lang.Object newPackage)
Add a package to the current diagram. If the package already has a representation in the current diagram, it is not(!) added.

Parameters:
newPackage - The package to add.

isInDiagram

public boolean isInDiagram(java.lang.Object p)
Check if a given package has a representation in the current diagram.

Parameters:
p - The package to lookup in the current diagram.
Returns:
true if this package has a figure in the current diagram, false otherwise.

isDiagramInProject

public boolean isDiagramInProject(java.lang.String name)
Check if this diagram already exists in the project.

Parameters:
name - diagram name.
Returns:
true if diagram exists in project.

getDiagramName

private java.lang.String getDiagramName(java.lang.String packageName)
Create a diagram name from a package name

Parameters:
packageName - The package name.
Returns:
The name for the diagram.

getDiagramName

private java.lang.String getDiagramName(java.lang.Object p)
Create a diagram name for a package

Parameters:
p - The package.
Returns:
The name for the diagram.

selectClassDiagram

public void selectClassDiagram(java.lang.Object p,
                               java.lang.String name)
Select or create a class diagram for a package.

Parameters:
p - The package.
name - The fully qualified name of this package.

addClassDiagram

public void addClassDiagram(java.lang.Object ns,
                            java.lang.String name)
Add a new class diagram for a package to the project.

Parameters:
ns - The package to attach the diagram to.
name - The fully qualified name of the package, which is used to generate the diagram name from.

addClass

public void addClass(java.lang.Object newClass,
                     boolean minimise)
Add a class to the current diagram.

Parameters:
newClass - The new class to add to the editor.

addInterface

public void addInterface(java.lang.Object newInterface,
                         boolean minimise)
Add a interface to the current diagram.

Parameters:
newInterface - The interface to add.

createOrSelectClassDiagram

public void createOrSelectClassDiagram(java.lang.Object currentPackage,
                                       java.lang.String currentPackageName)
Creates new class diagram for package or selects existing one.

Parameters:
currentPackage - The package to attach the diagram to.
currentPackageName - The fully qualified name of the package, which is used to generate the diagram name from.

createRootClassDiagram

public void createRootClassDiagram()
Creates class diagram under the root. Is used for classes out of packages.


setCurrentDiagram

public void setCurrentDiagram(ArgoDiagram diagram)
selects a diagram without affecting the gui.



ArgoUML © 1996-2004 (20040316)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook