org.argouml.application.notation
Class NotationNameImpl

java.lang.Object
  |
  +--org.argouml.application.notation.NotationNameImpl
All Implemented Interfaces:
ArgoEventListener, ArgoModuleEventListener, java.util.EventListener, NotationName

public class NotationNameImpl
extends java.lang.Object
implements NotationName, ArgoModuleEventListener

This class provides definition and manipulation of notation names. All notation names will be accessed using the NotationName wrapper. Not mutable!

Since:
0.9.4

Field Summary
(package private)  javax.swing.Icon _icon
           
(package private)  java.lang.String _name
           
private static java.util.ArrayList _notations
           
(package private)  java.lang.String _version
           
private static Logger cat
          logger
 
Constructor Summary
protected NotationNameImpl(java.lang.String name)
          A notation without a version or icon.
protected NotationNameImpl(java.lang.String name, javax.swing.Icon icon)
          A notation without a version and with an icon.
protected NotationNameImpl(java.lang.String name, java.lang.String version)
          A notation with a version and no icon.
protected NotationNameImpl(java.lang.String name, java.lang.String version, javax.swing.Icon icon)
          A notation with a version and an icon.
 
Method Summary
 boolean equals(NotationName nn)
          Ease-of-use helper to determine if this notation is the same as another.
static NotationName findNotation(java.lang.String s)
          Finds a NotationName matching the configuration string.
private static void fireEvent(int eventType, NotationName nn)
           
static java.util.ArrayList getAvailableNotations()
          Get all of the registered notations.
 java.lang.String getConfigurationValue()
          Returns the text string stored in the configuration for this notation.
 javax.swing.Icon getIcon()
          Returns an icon for the notation, or null if no icon is available.
 java.lang.String getName()
          Accessor for the language name
static NotationName getNotation(java.lang.String k1)
          Finds a NotationName matching the language with no version.
static NotationName getNotation(java.lang.String k1, java.lang.String k2)
          Finds a NotationName matching the language and version.
static java.lang.String getNotationNameString(java.lang.String k1, java.lang.String k2)
           
 java.lang.String getTitle()
          Gets a textual title for the notation suitable for use in a combo box or other such visual location.
 java.lang.String getVersion()
          Accessor for the language version
static NotationName makeNotation(java.lang.String k1, java.lang.String k2, javax.swing.Icon icon)
          Create a NotationName with or without a version.
 void moduleDisabled(ArgoModuleEvent event)
          Invoked when a module has been disabled.
 void moduleEnabled(ArgoModuleEvent event)
          Invoked when a module has been enabled.
 void moduleLoaded(ArgoModuleEvent event)
          Invoked when a module has been loaded.
 void moduleUnloaded(ArgoModuleEvent event)
          Invoked when a module has been unloaded.
 java.lang.String toString()
          Ease-of-use helper for usage in swing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cat

private static Logger cat
logger


_name

java.lang.String _name

_version

java.lang.String _version

_icon

javax.swing.Icon _icon

_notations

private static java.util.ArrayList _notations
Constructor Detail

NotationNameImpl

protected NotationNameImpl(java.lang.String name)
A notation without a version or icon.


NotationNameImpl

protected NotationNameImpl(java.lang.String name,
                           javax.swing.Icon icon)
A notation without a version and with an icon.


NotationNameImpl

protected NotationNameImpl(java.lang.String name,
                           java.lang.String version)
A notation with a version and no icon.


NotationNameImpl

protected NotationNameImpl(java.lang.String name,
                           java.lang.String version,
                           javax.swing.Icon icon)
A notation with a version and an icon.

Method Detail

getName

public java.lang.String getName()
Accessor for the language name

Specified by:
getName in interface NotationName
Returns:
the language name.

getVersion

public java.lang.String getVersion()
Accessor for the language version

Specified by:
getVersion in interface NotationName
Returns:
the language version or null

getTitle

public java.lang.String getTitle()
Gets a textual title for the notation suitable for use in a combo box or other such visual location.

Specified by:
getTitle in interface NotationName
Returns:
a title for the language.

getIcon

public javax.swing.Icon getIcon()
Returns an icon for the notation, or null if no icon is available.

Specified by:
getIcon in interface NotationName
Returns:
an Icon for the language or null if not available.

getConfigurationValue

public java.lang.String getConfigurationValue()
Description copied from interface: NotationName
Returns the text string stored in the configuration for this notation. This string is used to determine notation equality in NotationName.equals(NotationName). This should incorporate both the name and the version if one exists.

Specified by:
getConfigurationValue in interface NotationName
Returns:
the value for this notation to be stored in the configuration.

toString

public java.lang.String toString()
Description copied from interface: NotationName
Ease-of-use helper for usage in swing. Usually, it is equal to getConfigurationValue().

Specified by:
toString in interface NotationName
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the notation name.

getNotationNameString

public static java.lang.String getNotationNameString(java.lang.String k1,
                                                     java.lang.String k2)

fireEvent

private static void fireEvent(int eventType,
                              NotationName nn)

makeNotation

public static NotationName makeNotation(java.lang.String k1,
                                        java.lang.String k2,
                                        javax.swing.Icon icon)
Create a NotationName with or without a version. The NotationName is only created if there is no such notation before.

Returns:
the newly created or the old NotationName

getAvailableNotations

public static java.util.ArrayList getAvailableNotations()
Get all of the registered notations.


findNotation

public static NotationName findNotation(java.lang.String s)
Finds a NotationName matching the configuration string. Returns null if no match.


equals

public boolean equals(NotationName nn)
Description copied from interface: NotationName
Ease-of-use helper to determine if this notation is the same as another. This must be equivalent to getConfigurationValue().equals(nn.getConfigurationValue())

Specified by:
equals in interface NotationName
Parameters:
nn - to compare
Returns:
boolean indicating equality or inequality.

getNotation

public static NotationName getNotation(java.lang.String k1)
Finds a NotationName matching the language with no version. Returns null if no match.


getNotation

public static NotationName getNotation(java.lang.String k1,
                                       java.lang.String k2)
Finds a NotationName matching the language and version. Returns null if no match.


moduleLoaded

public void moduleLoaded(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been loaded.

Specified by:
moduleLoaded in interface ArgoModuleEventListener

moduleUnloaded

public void moduleUnloaded(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been unloaded.

Specified by:
moduleUnloaded in interface ArgoModuleEventListener

moduleEnabled

public void moduleEnabled(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been enabled.

Specified by:
moduleEnabled in interface ArgoModuleEventListener

moduleDisabled

public void moduleDisabled(ArgoModuleEvent event)
Description copied from interface: ArgoModuleEventListener
Invoked when a module has been disabled.

Specified by:
moduleDisabled in interface ArgoModuleEventListener


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