OME
Interface OMEFramework


public interface OMEFramework

This interface describes all the methods that need to be implemented by any framework that is to be supported by OME. These methods specifically include methods for maintaining the types of objects, as well as information restrictions associated with thos objects. Here types may have associated names, images, images sizes and positions. In addition, these types may be a type of link or element.


Method Summary
 boolean autoGenInterface(java.lang.Object type)
          Returns true iff the GUI should automatically generate widgets to created instances of this type.
 java.util.Iterator getAllInstantiable()
          Returns only those classes that can be directly instantiated.
 java.util.Iterator getAllTypes()
          Returns all the classes in the framework, both instantiable and not.
 java.awt.Image getImage(java.lang.Object type)
          Returns the principal image for a type.
 java.lang.String getImageFilename(java.lang.Object type)
          Returns the filename of an image for a specified type.
 int getImageHeight(java.lang.Object o)
          Returns the object's images' height.
 java.util.Iterator getImageNames(java.lang.Object type)
          Returns the possible imagenames for a specified type.
 ImageTable getImageTable()
          Returns the framework's ImageTable.
 int getImageWidth(java.lang.Object o)
          Returns the object's images' width.
 java.lang.String getName(java.lang.Object o)
          Returns the name of a type.
 java.awt.Point getPosition(java.lang.Object o)
          Returns the position of the given object (if it has one).
 java.lang.String getStrokeString(java.lang.Object type)
          Returns the STRING DESCRIPTION of the stroke associated with a link type.
 java.lang.Object getType(java.lang.String name)
          Returns the type as found by its name.
 boolean isCommentSupported()
          Is the "comment" feature supported for this framework.
 boolean isElement(java.lang.Object type)
          Returns whether type is an element or not.
 boolean isExpandable(java.lang.Object type)
          Returns whether type is expandeable.
 boolean isLink(java.lang.Object type)
          Returns whether type is a link or not.
 

Method Detail

getAllTypes

public java.util.Iterator getAllTypes()
Returns all the classes in the framework, both instantiable and not.

getAllInstantiable

public java.util.Iterator getAllInstantiable()
Returns only those classes that can be directly instantiated.

getType

public java.lang.Object getType(java.lang.String name)
Returns the type as found by its name. Returns null if there is no type with that name.

getName

public java.lang.String getName(java.lang.Object o)
Returns the name of a type.
Parameters:
o - the object (type) whose name we want.

getStrokeString

public java.lang.String getStrokeString(java.lang.Object type)
Returns the STRING DESCRIPTION of the stroke associated with a link type. If the link does not have a stroke explicitly described in the framework (or if an element or attribute type is passed), the return value will be "solid".

autoGenInterface

public boolean autoGenInterface(java.lang.Object type)
Returns true iff the GUI should automatically generate widgets to created instances of this type. If the type is not-instantiable, the answer is false.

getImageNames

public java.util.Iterator getImageNames(java.lang.Object type)
Returns the possible imagenames for a specified type. This collection is not likely writeable.
Parameters:
type - the type whose possible image names we want.
Returns:
an Iterator of possible image names for the specified type

getImageFilename

public java.lang.String getImageFilename(java.lang.Object type)
Returns the filename of an image for a specified type.
Parameters:
type - the type whose image filename we want.

getImage

public java.awt.Image getImage(java.lang.Object type)
Returns the principal image for a type.
Parameters:
type - the type whose principal image we want.

getImageWidth

public int getImageWidth(java.lang.Object o)
Returns the object's images' width. If the width returned is zero, then it means don't scale but instead use the image's pixel width.
Parameters:
o - the object whose width we want.

getImageHeight

public int getImageHeight(java.lang.Object o)
Returns the object's images' height. If the height returned is zero, then it means don't scale but instead use the image's pixel height.

getPosition

public java.awt.Point getPosition(java.lang.Object o)
Returns the position of the given object (if it has one). This object is most likely the target of an attribute, and in this case the position is relative to the object that has the attribute. Note This could return null, so always check before using it.

getImageTable

public ImageTable getImageTable()
Returns the framework's ImageTable.

isElement

public boolean isElement(java.lang.Object type)
Returns whether type is an element or not.
Parameters:
type - the type which we are checking is an element.
Returns:
true if the specified type is an element and false otherwise.

isLink

public boolean isLink(java.lang.Object type)
Returns whether type is a link or not.
Parameters:
type - the type which we are checking is an link
Returns:
true if the specified type is a link and false otherwise.

isExpandable

public boolean isExpandable(java.lang.Object type)
Returns whether type is expandeable.
Returns:
true if specified type is expandable and false otherwise.

isCommentSupported

public boolean isCommentSupported()
Is the "comment" feature supported for this framework. The comment is simply a string attribute (sort of like name) that every object in the model has. It allows us to associate arbitrary information with an object in the model, but not have it drawn on the screen (as it is with name). This feature is really just a work around until we get arbitrary (value) attributes supported.