org.eml.MMAX2.annotation.markables
Class MarkableRelation

java.lang.Object
  extended by org.eml.MMAX2.annotation.markables.MarkableRelation
All Implemented Interfaces:
MarkableRelationAPI

public class MarkableRelation
extends java.lang.Object
implements MarkableRelationAPI


Constructor Summary
MarkableRelation(java.lang.String _attributeName, int type, boolean _ordered, int _lineWidth, java.awt.Color _color, int _lineStyle, int _maxSize, boolean _dashed, java.lang.String _attributeNameToShowInFlag)
           
 
Method Summary
 MarkableSet addMarkableWithAttributeValueToMarkableSet(Markable _markable, java.lang.String value)
          This method adds Markable _markable to the MarkableSet attributeValue value (e.g.
static java.awt.Point calculateControlPoint(int x_source, int y_source, int x_target, int y_target, int lineStyle)
           
static java.lang.String condenseSatelliteSpan_bak(java.lang.String span)
           
static java.lang.String condenseTargetSpan(java.lang.String span)
          This method accepts a target span string and returns a condensed form of it for display in the AttributeWindow.
 void createMarkablePointer(Markable sourceMarkable, Markable firstTargetMarkable)
          This method is used to create a new MarkablePointer with sourceMarkable as source Markable.
 void createMarkablePointer(Markable sourceMarkable, MarkableLevel sourceMarkableLevel)
          This method is used to create a new MarkablePointer with sourceMarkable as source Markable.
static java.lang.String expandTargetSpan(java.lang.String span)
           
 java.lang.String getAttributeName()
           
 java.lang.String getAttributeNameToShowInFlag()
           
 java.awt.Color getLineColor()
           
 int getLineStyle()
           
 MarkablePointer getMarkablePointerForSourceMarkable(Markable sourceMarkable)
          (API) Returns the MarkablePointer object for which the Markable sourceMarkable is the source Markable (i.e.
 MarkablePointer[] getMarkablePointers(boolean order)
          (API) Returns an array of all MarkablePointer objects associated with this MarkableRelation.
 MarkablePointer[] getMarkablePointersWithTargetMarkable(Markable target)
          (API) Returns an array of all MarkablePointer objects that contain Markable targetMarkable as target markable.
 MarkableSet getMarkableSetContainingMarkable(Markable contained)
          (API) Returns the MarkableSet object of which Markable markable is a member.
 MarkableSet[] getMarkableSets(boolean order)
          (API) Returns an array of all MarkableSet objects associated with this MarkableRelation.
 MarkableSet getMarkableSetWithAttributeValue(java.lang.String _attributeValue)
          (API) Returns the MarkableSet object containing Markable objects with the value setID in the Attribute pertaining to this MarkableRelation.
static java.util.ArrayList parseTargetSpan(java.lang.String span, java.lang.String delimiter)
           
 void removeMarkablePointer(MarkablePointer removee)
           
 void removeMarkableSet(MarkableSet removee)
           
 void setLineColor(java.awt.Color _color)
           
 void setLineStyle(java.lang.Integer _style)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkableRelation

public MarkableRelation(java.lang.String _attributeName,
                        int type,
                        boolean _ordered,
                        int _lineWidth,
                        java.awt.Color _color,
                        int _lineStyle,
                        int _maxSize,
                        boolean _dashed,
                        java.lang.String _attributeNameToShowInFlag)
Method Detail

getLineColor

public final java.awt.Color getLineColor()

setLineColor

public final void setLineColor(java.awt.Color _color)

getAttributeNameToShowInFlag

public final java.lang.String getAttributeNameToShowInFlag()

getLineStyle

public final int getLineStyle()

setLineStyle

public final void setLineStyle(java.lang.Integer _style)

calculateControlPoint

public static final java.awt.Point calculateControlPoint(int x_source,
                                                         int y_source,
                                                         int x_target,
                                                         int y_target,
                                                         int lineStyle)

getMarkableSets

public final MarkableSet[] getMarkableSets(boolean order)
Description copied from interface: MarkableRelationAPI
(API) Returns an array of all MarkableSet objects associated with this MarkableRelation.

Specified by:
getMarkableSets in interface MarkableRelationAPI
Parameters:
order - If true, the array of MarkableSet objects is sorted according to the discourse position of the initial elements. If false, the order is undefined.
Returns:
An array of all MarkableSet objects associated with this MarkableRelation.

getMarkablePointers

public final MarkablePointer[] getMarkablePointers(boolean order)
Description copied from interface: MarkableRelationAPI
(API) Returns an array of all MarkablePointer objects associated with this MarkableRelation.

Specified by:
getMarkablePointers in interface MarkableRelationAPI
Parameters:
order - If true, the array of MarkablePointer objects is sorted according to the discourse position of the respective source Markables elements. If false, the order is undefined.
Returns:
An array of all MarkablePointer objects associated with this MarkableRelation.

getAttributeName

public final java.lang.String getAttributeName()

addMarkableWithAttributeValueToMarkableSet

public final MarkableSet addMarkableWithAttributeValueToMarkableSet(Markable _markable,
                                                                    java.lang.String value)
This method adds Markable _markable to the MarkableSet attributeValue value (e.g. 'set_5'). If no set exists, a new one will be created. This method is called to add a Markable that has a valid value in the MARKABLE_SET-type attribute that this MarkableRelation object is associated with.


getMarkableSetWithAttributeValue

public final MarkableSet getMarkableSetWithAttributeValue(java.lang.String _attributeValue)
Description copied from interface: MarkableRelationAPI
(API) Returns the MarkableSet object containing Markable objects with the value setID in the Attribute pertaining to this MarkableRelation.

Specified by:
getMarkableSetWithAttributeValue in interface MarkableRelationAPI
Parameters:
_attributeValue - The ID of the MarkableSet object to be returned (e.g. 'set_4'). In order to retrieve the MarkableSet containing a particular Markable M and all of M's peer Markables in the set called 'coref', use M.getAttributeValue('coref', 'empty') to retrieve the ID of the set that M is a member of, and use this method to retrieve the corresponding set.
Returns:
The MarkableSet object with ID setID.

getMarkableSetContainingMarkable

public final MarkableSet getMarkableSetContainingMarkable(Markable contained)
Description copied from interface: MarkableRelationAPI
(API) Returns the MarkableSet object of which Markable markable is a member.

Specified by:
getMarkableSetContainingMarkable in interface MarkableRelationAPI
Parameters:
contained - The Markable object to be contained in the MarkableSet to be returned.
Returns:
The MarkableSet object containing the Markable markable (among others).

removeMarkableSet

public final void removeMarkableSet(MarkableSet removee)

removeMarkablePointer

public final void removeMarkablePointer(MarkablePointer removee)

createMarkablePointer

public final void createMarkablePointer(Markable sourceMarkable,
                                        MarkableLevel sourceMarkableLevel)
This method is used to create a new MarkablePointer with sourceMarkable as source Markable. The value that the source Markable has in its this.attributeName attribute is parsed into a list of satellite Markable IDs, which are then added to the set. This method is called to add a Markable with a valid value in its MARKABLE_POINTER-type attribute.


createMarkablePointer

public final void createMarkablePointer(Markable sourceMarkable,
                                        Markable firstTargetMarkable)
This method is used to create a new MarkablePointer with sourceMarkable as source Markable. The value that the source Markable has in its this.attributeName attribute is parsed into a list of satellite Markable IDs, which are then added to the set. This method is called to add a Markable with a valid value in its MARKABLE_POINTER-type attribute.


getMarkablePointerForSourceMarkable

public final MarkablePointer getMarkablePointerForSourceMarkable(Markable sourceMarkable)
Description copied from interface: MarkableRelationAPI
(API) Returns the MarkablePointer object for which the Markable sourceMarkable is the source Markable (i.e. the origin of the pointing relation.)

Specified by:
getMarkablePointerForSourceMarkable in interface MarkableRelationAPI
Parameters:
sourceMarkable - The source Markable of the MarkablePointer object to be returned.
Returns:
The MarkablePointer containing the Markable sourceMarkable as source Markable.

getMarkablePointersWithTargetMarkable

public final MarkablePointer[] getMarkablePointersWithTargetMarkable(Markable target)
Description copied from interface: MarkableRelationAPI
(API) Returns an array of all MarkablePointer objects that contain Markable targetMarkable as target markable.

Specified by:
getMarkablePointersWithTargetMarkable in interface MarkableRelationAPI
Parameters:
target - The Markable object to which the returned MarkablePointer objects are supposed to point.
Returns:
An array of all MarkablePointer objects pointing to Markable targetMarkable as target markable.

condenseSatelliteSpan_bak

public static final java.lang.String condenseSatelliteSpan_bak(java.lang.String span)

condenseTargetSpan

public static final java.lang.String condenseTargetSpan(java.lang.String span)
This method accepts a target span string and returns a condensed form of it for display in the AttributeWindow.


expandTargetSpan

public static final java.lang.String expandTargetSpan(java.lang.String span)

parseTargetSpan

public static final java.util.ArrayList parseTargetSpan(java.lang.String span,
                                                        java.lang.String delimiter)