org.argouml.application.api
Class Notation

java.lang.Object
  extended byorg.argouml.application.api.Notation
All Implemented Interfaces:
EventListener, PropertyChangeListener

public final class Notation
extends Object
implements PropertyChangeListener

Provides centralized methods dealing with notation.

Since:
0.9.4

Field Summary
static ConfigurationKey KEY_DEFAULT_NOTATION
          The configuration key for the preferred notation.
static ConfigurationKey KEY_DEFAULT_SHADOW_WIDTH
          Default value for the shadow size of classes, interfaces etc.
static ConfigurationKey KEY_SHOW_INITIAL_VALUE
          Indicates if the user wants to see the initial value.
static ConfigurationKey KEY_SHOW_MULTIPLICITY
          Indicates if the user wants to see multiplicity in attributes and classes.
static ConfigurationKey KEY_SHOW_PROPERTIES
          Indicates if the user wants to see the properties (everything between braces), that is for example the concurrency.
static ConfigurationKey KEY_SHOW_STEREOTYPES
          The configuration key that indicates whether to show stereotypes in the navigation panel.
static ConfigurationKey KEY_SHOW_VISIBILITY
          Indicates if the user wants to see visibility signs (public, private, protected or # + -).
static ConfigurationKey KEY_UML_NOTATION_ONLY
          Indicates if the user only wants to see UML notation.
static ConfigurationKey KEY_USE_GUILLEMOTS
          The configuration key that indicates whether to use guillemots or greater/lessthan characters in stereotypes.
private static Logger LOG
          Define a static log4j category variable for ArgoUML notation.
private static NotationName notationArgo
          The name of the default Argo notation.
private static Notation SINGLETON
           
 
Constructor Summary
private Notation()
           
 
Method Summary
 void finalize()
          Remove the notation change listener.
static NotationName findNotation(String s)
          Convert a String into a NotationName.
static String generate(NotationContext ctx, Object o)
           
static String generate(NotationContext ctx, Object o, boolean documented)
          General purpose static generator for any object that wishes to set the documented flag.
static String generate(NotationName nn, Object o)
           
static String generate(NotationName nn, Object o, boolean documented)
          General purpose static generator for any object that wishes to set the documented flag.
static String generateAction(NotationContext ctx, Object m)
           
private static String generateAction(NotationName notation, Object m)
           
private static String generateActionState(NotationName notation, Object m)
           
static String generateAssociation(NotationContext ctx, Object a)
           
private static String generateAssociation(NotationName notation, Object a)
           
static String generateAssociationEnd(NotationContext ctx, Object ae)
           
private static String generateAssociationEnd(NotationName notation, Object ae)
           
static String generateAssociationRole(NotationContext ctx, Object m)
           
private static String generateAssociationRole(NotationName notation, Object m)
           
static String generateAttribute(NotationContext ctx, Object attr)
           
static String generateAttribute(NotationContext ctx, Object attr, boolean documented)
           
private static String generateAttribute(NotationName notation, Object attr, boolean documented)
           
static String generateClassifier(NotationContext ctx, Object cls)
           
private static String generateClassifier(NotationName notation, Object cls)
           
private static String generateClassifierInState(NotationName notation, Object m)
           
static String generateClassifierRef(NotationContext ctx, Object cls)
           
private static String generateClassifierRef(NotationName notation, Object m)
           
private static String generateExpression(NotationName notation, Object expr)
           
static String generateExtensionPoint(NotationContext ctx, Object ep)
          Static accessor for extension point generation.
protected static String generateExtensionPoint(NotationName notation, Object ep)
          General accessor for an extension point.
static String generateGuard(NotationContext ctx, Object m)
           
private static String generateGuard(NotationName notation, Object m)
           
static String generateMessage(NotationContext ctx, Object m)
           
private static String generateMessage(NotationName notation, Object m)
           
static String generateMultiplicity(NotationContext ctx, Object m)
           
private static String generateMultiplicity(NotationName notation, Object m)
           
private static String generateName(NotationName notation, String name)
           
private static String generateObjectFlowState(NotationName notation, Object m)
           
static String generateOperation(NotationContext ctx, Object op)
          Static accessor for operation generation.
static String generateOperation(NotationContext ctx, Object op, boolean documented)
           
private static String generateOperation(NotationName notation, Object op, boolean documented)
           
static String generatePackage(NotationContext ctx, Object p)
           
private static String generatePackage(NotationName notation, Object pkg)
           
static String generateParameter(NotationContext ctx, Object param)
           
private static String generateParameter(NotationName notation, Object param)
           
static String generateState(NotationContext ctx, Object m)
           
private static String generateState(NotationName notation, Object m)
           
static String generateStateBody(NotationContext ctx, Object m)
           
private static String generateStateBody(NotationName notation, Object stt)
           
static String generateStereotype(NotationContext ctx, Object s)
           
private static String generateStereotype(NotationName notation, Object s)
           
private static String generateSubmachine(NotationName notation, Object m)
           
static String generateTaggedValue(NotationContext ctx, Object s)
           
private static String generateTaggedValue(NotationName notation, Object s)
           
static String generateTransition(NotationContext ctx, Object m)
           
private static String generateTransition(NotationName notation, Object m)
           
static String generateVisibility(NotationContext ctx, Object m)
           
private static String generateVisibility(NotationName notation, Object m)
           
static ArrayList getAvailableNotations()
          Get list of available notations.
static NotationName getDefaultNotation()
           
static NotationProvider2 getDefaultProvider()
           
static int getDefaultShadowWidth()
          Get the default width for Fig shadows.
static Notation getInstance()
           
static NotationName getNotation(NotationContext context)
           
private static NotationProvider2 getProvider(NotationName notation)
           
static boolean getUseGuillemots()
           
static NotationName makeNotation(String k1, String k2, Icon icon)
          Create a versioned notation name with an icon.
 void propertyChange(PropertyChangeEvent pce)
          Called after the notation default property gets changed.
static void setDefaultNotation(NotationName n)
           
static void setDefaultShadowWidth(int width)
          Set the default width for Fig Shadow.
static void setUseGuillemots(boolean useGuillemots)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Define a static log4j category variable for ArgoUML notation.


notationArgo

private static NotationName notationArgo
The name of the default Argo notation. This notation is part of Argo core distribution.


KEY_DEFAULT_NOTATION

public static final ConfigurationKey KEY_DEFAULT_NOTATION
The configuration key for the preferred notation.


KEY_SHOW_STEREOTYPES

public static final ConfigurationKey KEY_SHOW_STEREOTYPES
The configuration key that indicates whether to show stereotypes in the navigation panel.


KEY_USE_GUILLEMOTS

public static final ConfigurationKey KEY_USE_GUILLEMOTS
The configuration key that indicates whether to use guillemots or greater/lessthan characters in stereotypes.


KEY_UML_NOTATION_ONLY

public static final ConfigurationKey KEY_UML_NOTATION_ONLY
Indicates if the user only wants to see UML notation.


KEY_SHOW_VISIBILITY

public static final ConfigurationKey KEY_SHOW_VISIBILITY
Indicates if the user wants to see visibility signs (public, private, protected or # + -).


KEY_SHOW_MULTIPLICITY

public static final ConfigurationKey KEY_SHOW_MULTIPLICITY
Indicates if the user wants to see multiplicity in attributes and classes.


KEY_SHOW_INITIAL_VALUE

public static final ConfigurationKey KEY_SHOW_INITIAL_VALUE
Indicates if the user wants to see the initial value.


KEY_SHOW_PROPERTIES

public static final ConfigurationKey KEY_SHOW_PROPERTIES
Indicates if the user wants to see the properties (everything between braces), that is for example the concurrency.


KEY_DEFAULT_SHADOW_WIDTH

public static final ConfigurationKey KEY_DEFAULT_SHADOW_WIDTH
Default value for the shadow size of classes, interfaces etc.


SINGLETON

private static final Notation SINGLETON
Constructor Detail

Notation

private Notation()
Method Detail

finalize

public void finalize()
Remove the notation change listener. finalize should never happen, but play it safe.


getProvider

private static NotationProvider2 getProvider(NotationName notation)

setDefaultNotation

public static void setDefaultNotation(NotationName n)
Parameters:
n - the NotationName that will become default

findNotation

public static NotationName findNotation(String s)
Convert a String into a NotationName.

Parameters:
s - the String
Returns:
the matching Notationname

getDefaultNotation

public static NotationName getDefaultNotation()
Returns:
the default NotationName

generateExtensionPoint

protected static String generateExtensionPoint(NotationName notation,
                                               Object ep)
General accessor for an extension point.

Parameters:
notation - Name of the notation to be used.
ep - The extension point to generate for.
Returns:
The generated text.

generateOperation

private static String generateOperation(NotationName notation,
                                        Object op,
                                        boolean documented)

generateAttribute

private static String generateAttribute(NotationName notation,
                                        Object attr,
                                        boolean documented)

generateParameter

private static String generateParameter(NotationName notation,
                                        Object param)

generateName

private static String generateName(NotationName notation,
                                   String name)

generatePackage

private static String generatePackage(NotationName notation,
                                      Object pkg)

generateExpression

private static String generateExpression(NotationName notation,
                                         Object expr)

generateClassifier

private static String generateClassifier(NotationName notation,
                                         Object cls)

generateStereotype

private static String generateStereotype(NotationName notation,
                                         Object s)

generateTaggedValue

private static String generateTaggedValue(NotationName notation,
                                          Object s)

generateAssociation

private static String generateAssociation(NotationName notation,
                                          Object a)

generateAssociationEnd

private static String generateAssociationEnd(NotationName notation,
                                             Object ae)

generateMultiplicity

private static String generateMultiplicity(NotationName notation,
                                           Object m)

generateState

private static String generateState(NotationName notation,
                                    Object m)

generateSubmachine

private static String generateSubmachine(NotationName notation,
                                         Object m)

generateObjectFlowState

private static String generateObjectFlowState(NotationName notation,
                                              Object m)

generateClassifierInState

private static String generateClassifierInState(NotationName notation,
                                                Object m)

generateStateBody

private static String generateStateBody(NotationName notation,
                                        Object stt)

generateTransition

private static String generateTransition(NotationName notation,
                                         Object m)

generateVisibility

private static String generateVisibility(NotationName notation,
                                         Object m)

generateAction

private static String generateAction(NotationName notation,
                                     Object m)

generateActionState

private static String generateActionState(NotationName notation,
                                          Object m)

generateGuard

private static String generateGuard(NotationName notation,
                                    Object m)

generateMessage

private static String generateMessage(NotationName notation,
                                      Object m)

generateClassifierRef

private static String generateClassifierRef(NotationName notation,
                                            Object m)

generateAssociationRole

private static String generateAssociationRole(NotationName notation,
                                              Object m)

getInstance

public static Notation getInstance()
Returns:
the singleton

generateExtensionPoint

public static String generateExtensionPoint(NotationContext ctx,
                                            Object ep)
Static accessor for extension point generation. Invokes our protected accessor from the singleton instance with the "documented" flag set false.

Parameters:
ctx - Context used to identify the notation
ep - The extension point to generate for.
Returns:
The generated text.

generateOperation

public static String generateOperation(NotationContext ctx,
                                       Object op)
Static accessor for operation generation. Invokes our protected accessor from the singleton instance with the "documented" flag set false.

Parameters:
ctx - Context used to identify the notation
op - The operation to generate for.
Returns:
The generated text.

generateOperation

public static String generateOperation(NotationContext ctx,
                                       Object op,
                                       boolean documented)
Parameters:
ctx - Context used to identify the notation
op - The operation to generate for.
documented - true if documentation shall be generated.
Returns:
The generated text.

generateAttribute

public static String generateAttribute(NotationContext ctx,
                                       Object attr)
Parameters:
ctx - Context used to identify the notation
attr - The attribute to generate for.
Returns:
The generated text.

generateAttribute

public static String generateAttribute(NotationContext ctx,
                                       Object attr,
                                       boolean documented)
Parameters:
ctx - Context used to identify the notation
attr - The attribute to generate for.
documented - true if documentation shall be generated.
Returns:
The generated text.

generateParameter

public static String generateParameter(NotationContext ctx,
                                       Object param)
Parameters:
ctx - Context used to identify the notation
param - The parameter to generate for.
Returns:
The generated text.

generatePackage

public static String generatePackage(NotationContext ctx,
                                     Object p)
Parameters:
ctx - Context used to identify the notation
p - The UML element to generate for.
Returns:
The generated text.

generateClassifier

public static String generateClassifier(NotationContext ctx,
                                        Object cls)
Parameters:
ctx - Context used to identify the notation
cls - The UML element to generate for.
Returns:
The generated text.

generateStereotype

public static String generateStereotype(NotationContext ctx,
                                        Object s)
Parameters:
ctx - Context used to identify the notation
s - The UML element to generate for.
Returns:
The generated text.

generateTaggedValue

public static String generateTaggedValue(NotationContext ctx,
                                         Object s)
Parameters:
ctx - Context used to identify the notation
s - The UML element to generate for.
Returns:
The generated text.

generateAssociation

public static String generateAssociation(NotationContext ctx,
                                         Object a)
Parameters:
ctx - Context used to identify the notation
a - The UML element to generate for.
Returns:
The generated text.

generateAssociationEnd

public static String generateAssociationEnd(NotationContext ctx,
                                            Object ae)
Parameters:
ctx - Context used to identify the notation
ae - The UML element to generate for.
Returns:
The generated text.

generateMultiplicity

public static String generateMultiplicity(NotationContext ctx,
                                          Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateState

public static String generateState(NotationContext ctx,
                                   Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateStateBody

public static String generateStateBody(NotationContext ctx,
                                       Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateTransition

public static String generateTransition(NotationContext ctx,
                                        Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateVisibility

public static String generateVisibility(NotationContext ctx,
                                        Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateAction

public static String generateAction(NotationContext ctx,
                                    Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateGuard

public static String generateGuard(NotationContext ctx,
                                   Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateMessage

public static String generateMessage(NotationContext ctx,
                                     Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generateClassifierRef

public static String generateClassifierRef(NotationContext ctx,
                                           Object cls)
Parameters:
ctx - Context used to identify the notation
cls - The UML element to generate for.
Returns:
The generated text.

generateAssociationRole

public static String generateAssociationRole(NotationContext ctx,
                                             Object m)
Parameters:
ctx - Context used to identify the notation
m - The UML element to generate for.
Returns:
The generated text.

generate

public static String generate(NotationContext ctx,
                              Object o,
                              boolean documented)
General purpose static generator for any object that wishes to set the documented flag.

Uses the class of the object to determine which method to invoke. Only actually looks for MOperation and MAttribute. All others invoke the simpler version with no documented flag, so taking the default version.

Parameters:
ctx - The context to look up the notation generator.
o - The object to generate.
documented - A flag of unknown meaning. Only has any effect for Operations and Attributes.
Returns:
The generated string.

generate

public static String generate(NotationName nn,
                              Object o,
                              boolean documented)
General purpose static generator for any object that wishes to set the documented flag.

Uses the class of the object to determine which method to invoke. Only actually looks for MOperation and MAttribute. All others invoke the simpler version with no documented flag, so taking the default version.

Parameters:
nn - The notation name.
o - The object to generate.
documented - A flag of unknown meaning. Only has any effect for Operations and Attributes.
Returns:
The generated string.

generate

public static String generate(NotationContext ctx,
                              Object o)
Parameters:
ctx - Context used to identify the notation
o - The UML element to generate for.
Returns:
The generated string.

generate

public static String generate(NotationName nn,
                              Object o)
Parameters:
nn - The NotationName to be used for the generation
o - The UML element to generate for.
Returns:
The generated string.

getNotation

public static NotationName getNotation(NotationContext context)
Parameters:
context - the notation context
Returns:
the notation name

propertyChange

public void propertyChange(PropertyChangeEvent pce)
Called after the notation default property gets changed.

Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

getDefaultProvider

public static NotationProvider2 getDefaultProvider()
Returns:
the provider

getAvailableNotations

public static ArrayList getAvailableNotations()
Get list of available notations.

Returns:
list of available notations

makeNotation

public static NotationName makeNotation(String k1,
                                        String k2,
                                        Icon icon)
Create a versioned notation name with an icon.

Parameters:
k1 - the name (?)
k2 - the version (?)
icon - the icon
Returns:
the notation name

getUseGuillemots

public static boolean getUseGuillemots()
Returns:
true if guillemots (« and ») are used instead of << and >>.

setUseGuillemots

public static void setUseGuillemots(boolean useGuillemots)
Parameters:
useGuillemots - true if guillemots (« and ») shall be used instead of << and >>.

getDefaultShadowWidth

public static int getDefaultShadowWidth()
Get the default width for Fig shadows.

Returns:
the default width for Fig shadows

setDefaultShadowWidth

public static void setDefaultShadowWidth(int width)
Set the default width for Fig Shadow.

Parameters:
width - the Fig shadow width


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