org.kite9.diagram.builders
Class DiagramBuilder

java.lang.Object
  extended by org.kite9.diagram.builders.AbstractBuilder
      extended by org.kite9.diagram.builders.DiagramBuilder

public class DiagramBuilder
extends AbstractBuilder

Builds a diagram from a method. Each object from the java project may only be represented once in the diagram.

Author:
robmoffat

Field Summary
protected  IdHelper idHelper
           
protected  KeyHelper kh
           
static Object THE_DIAGRAM
           
protected  TypeNounHelper typeHelper
           
 
Fields inherited from class org.kite9.diagram.builders.AbstractBuilder
a, model, nf
 
Constructor Summary
DiagramBuilder(Aliaser a, Method creator, ProjectModel pm)
           
 
Method Summary
 Format asContexts()
           
 Format asContexts(boolean border, Layout l)
           
 Format asGlyphs()
           
 Format asGlyphs(String stereotypeOverride)
           
 Format asSymbols()
           
 Format asTextLines()
           
 Diagram createRepresentation(String id)
           
 Aliaser getAliaser()
           
 Diagram getDiagram()
           
 DiagramElement getElement(Object o)
          Returns the element in the diagram representing this object
 String getId(Object o)
           
 InsertionInterface getInsertionInterface()
           
 ProjectModel getProjectModel()
           
 DiagramElement getRelationshipElement(Object o, Relationship r)
           
<X> Filter<X>
not(Filter<X> only)
          Returns the opposite filter to the one entered
 Filter<Object> only(Object... items)
          Filters to just the items mentioned in the arguments
 Filter<AnnotatedElement> onlyAnnotated()
          Filters methods, fields, inner classes to just the ones with a K9 annotation.
 Filter<Object> onlyOnDiagram()
          Filters to just the items already on the diagram
 ClassBuilder withClasses(Class<?>... forClasses)
           
 DiagramBuilder withKeyText(String boldtext, String body)
           
 PackageBuilder withPackages(Class<?>... packagesForClasses)
           
 PackageBuilder withPackages(Package... packages)
           
 StringBuilder withStrings(String... strings)
           
 
Methods inherited from class org.kite9.diagram.builders.AbstractBuilder
createNewSubjectNounPart, createNoun, createTies, getCurrentClassLoader, getNounFactory, getUnderlyingSimpleNoun, packagesOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_DIAGRAM

public static final Object THE_DIAGRAM

idHelper

protected IdHelper idHelper

typeHelper

protected TypeNounHelper typeHelper

kh

protected KeyHelper kh
Constructor Detail

DiagramBuilder

public DiagramBuilder(Aliaser a,
                      Method creator,
                      ProjectModel pm)
Method Detail

getProjectModel

public ProjectModel getProjectModel()

getDiagram

public Diagram getDiagram()

createRepresentation

public Diagram createRepresentation(String id)

withKeyText

public DiagramBuilder withKeyText(String boldtext,
                                  String body)

getId

public String getId(Object o)

getInsertionInterface

public InsertionInterface getInsertionInterface()

withStrings

public StringBuilder withStrings(String... strings)

withClasses

public ClassBuilder withClasses(Class<?>... forClasses)

withPackages

public PackageBuilder withPackages(Package... packages)

withPackages

public PackageBuilder withPackages(Class<?>... packagesForClasses)

onlyAnnotated

public Filter<AnnotatedElement> onlyAnnotated()
Filters methods, fields, inner classes to just the ones with a K9 annotation.


only

public Filter<Object> only(Object... items)
Filters to just the items mentioned in the arguments


onlyOnDiagram

public Filter<Object> onlyOnDiagram()
Filters to just the items already on the diagram


not

public <X> Filter<X> not(Filter<X> only)
Returns the opposite filter to the one entered


asGlyphs

public Format asGlyphs()

asGlyphs

public Format asGlyphs(String stereotypeOverride)

asContexts

public Format asContexts()

asContexts

public Format asContexts(boolean border,
                         Layout l)

asSymbols

public Format asSymbols()

asTextLines

public Format asTextLines()

getElement

public DiagramElement getElement(Object o)
Returns the element in the diagram representing this object

Parameters:
o -
Returns:

getRelationshipElement

public DiagramElement getRelationshipElement(Object o,
                                             Relationship r)

getAliaser

public Aliaser getAliaser()


Copyright © 2011. All Rights Reserved.