net.sourceforge.nite.meta.impl
Class NiteElement

java.lang.Object
  extended by net.sourceforge.nite.meta.impl.NiteElement
All Implemented Interfaces:
NElement

public class NiteElement
extends java.lang.Object
implements NElement

A element as referred to in the metadata

Author:
jonathan

Field Summary
 
Fields inherited from interface net.sourceforge.nite.meta.NElement
CODING, CORPUSRESOURCE, OBJECTSET, ONTOLOGY
 
Constructor Summary
NiteElement(java.lang.String name, java.util.ArrayList attributes, java.util.ArrayList pointers, NiteLayer layer, java.lang.String col, java.lang.String textc)
           
NiteElement(java.lang.String name, java.util.ArrayList attributes, java.util.ArrayList pointers, java.lang.Object object, java.lang.String col, java.lang.String textc)
           
 
Method Summary
 void addAttribute(NAttribute nat)
          add an attribute declaration to the list for this element
 NAttribute getAttributeByName(java.lang.String attname)
          find the NAttribute with the given name in this Element, or return null
 java.util.List getAttributes()
          Find the attributes for this element - returns an ArrayList of NAttributes
 java.lang.Object getContainer()
          returns the Object to which this element belongs.
 int getContainerType()
          returns the type of the container of this element: if it's an element in an ontology, this returns ONTOLOGY etc.
 java.awt.Color getDisplayColor()
          return the colour used to display this type of element on the OTAB.
 java.lang.String getExternalPointerRole()
          return the role of any external pointer for this element: will only ever be non-null for elements in layers of type EXTERNAL_POINTER_LAYER.
 NLayer getLayer()
          returns the NLayer to which this element belongs.
 java.lang.String getName()
          returns the name of the element
 java.util.List getPointers()
          find the valid pointers on this element - returns an ArrayList of NPointers
 boolean textContentPermitted()
          returns true if text content is permitted in this element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiteElement

public NiteElement(java.lang.String name,
                   java.util.ArrayList attributes,
                   java.util.ArrayList pointers,
                   NiteLayer layer,
                   java.lang.String col,
                   java.lang.String textc)

NiteElement

public NiteElement(java.lang.String name,
                   java.util.ArrayList attributes,
                   java.util.ArrayList pointers,
                   java.lang.Object object,
                   java.lang.String col,
                   java.lang.String textc)
Method Detail

getName

public java.lang.String getName()
returns the name of the element

Specified by:
getName in interface NElement

getLayer

public NLayer getLayer()
returns the NLayer to which this element belongs. Note that we disallow the use of the same element name in multiple layers.

Specified by:
getLayer in interface NElement

getAttributes

public java.util.List getAttributes()
Find the attributes for this element - returns an ArrayList of NAttributes

Specified by:
getAttributes in interface NElement

getAttributeByName

public NAttribute getAttributeByName(java.lang.String attname)
find the NAttribute with the given name in this Element, or return null

Specified by:
getAttributeByName in interface NElement

getPointers

public java.util.List getPointers()
find the valid pointers on this element - returns an ArrayList of NPointers

Specified by:
getPointers in interface NElement

getContainerType

public int getContainerType()
returns the type of the container of this element: if it's an element in an ontology, this returns ONTOLOGY etc.

Specified by:
getContainerType in interface NElement

getContainer

public java.lang.Object getContainer()
returns the Object to which this element belongs. This can be an NLayer, an NOntology or an NObjectSet.

Specified by:
getContainer in interface NElement

addAttribute

public void addAttribute(NAttribute nat)
add an attribute declaration to the list for this element


getExternalPointerRole

public java.lang.String getExternalPointerRole()
return the role of any external pointer for this element: will only ever be non-null for elements in layers of type EXTERNAL_POINTER_LAYER.

Specified by:
getExternalPointerRole in interface NElement

textContentPermitted

public boolean textContentPermitted()
returns true if text content is permitted in this element. Note that since mixed content is disallowed, this will override any content model suggested by the layer to which this element belongs.

Specified by:
textContentPermitted in interface NElement

getDisplayColor

public java.awt.Color getDisplayColor()
return the colour used to display this type of element on the OTAB. If no colour is set in the metadata or programatically, the return will be black

Specified by:
getDisplayColor in interface NElement