edu.northwestern.at.wordhoard.model.annotations
Class RemoteAnnotation

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.annotations.RemoteAnnotation
All Implemented Interfaces:
Attachment, TextAttachment

public class RemoteAnnotation
extends java.lang.Object
implements TextAttachment

A remote annotation.

A remote annotation has the following attributes:


Nested Class Summary
protected  class RemoteAnnotation.Context
          Text generation context.
 
Constructor Summary
RemoteAnnotation()
          Creates a new annotation.
RemoteAnnotation(org.w3c.dom.Element el)
          Creates a new annotation from DOM.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
protected  TextLine genText(java.lang.String str, Text text, TextLine line, RemoteAnnotation.Context context)
          Generates a string of text.
 java.lang.String getAnnotates()
          Gets the annotates.
 java.lang.String getAuthor()
          Gets the author.
 AnnotationCategory getCategory()
          Gets the annotation category.
 java.util.Date getCreatedDate()
          Gets the creation date.
 java.lang.Long getId()
          Gets the unique id.
 java.lang.String getIdentifier()
          Gets the identifier.
 java.util.Date getModifiedDate()
          Gets the modified date.
 java.lang.String getStatus()
          Gets the status.
 TextRange getTarget()
          Gets the target.
 TextWrapped getText()
          Gets the text.
 java.lang.String getTextAsString()
          Gets the text as a String.
 java.lang.String getType()
          Gets the type.
 java.lang.String getUserID()
          Gets the userID.
 WorkPart getWorkPart()
          Gets the work part.
 int hashCode()
          Returns a hash code for the object.
protected  void processBodyEl(org.w3c.dom.Element el, RemoteAnnotation annot)
           
protected  TextLine processBoldEl(org.w3c.dom.Element el, Text text, TextLine line, RemoteAnnotation.Context context)
          Processes an "b" element.
protected  TextLine processChildren(org.w3c.dom.Element el, Text text, TextLine line, RemoteAnnotation.Context context)
          Processes the children of an element.
protected  void processContextEl(org.w3c.dom.Element el, RemoteAnnotation annot)
           
protected  TextLine processItalicEl(org.w3c.dom.Element el, Text text, TextLine line, RemoteAnnotation.Context context)
          Processes an "i" element.
protected  TextLine processTextNode(org.w3c.dom.Node node, Text text, TextLine line, RemoteAnnotation.Context context)
          Processes a text node.
 void resetText(java.lang.String textString)
          Reset the Text from a String.
 void setAnnotates(java.lang.String annotates)
          Sets the annotates.
 void setAuthor(java.lang.String author)
          Sets the author.
 void setCategory(AnnotationCategory category)
          Sets the annotation category.
 void setCreatedDate(java.util.Date created)
          Sets the creation date.
 void setIdentifier(java.lang.String identifier)
          Sets the identifier.
 void setModifiedDate(java.util.Date modified)
          Sets the modified date.
 void setStatus(java.lang.String status)
          Sets the status.
 void setTarget(TextRange target)
          Sets the target.
 void setText(TextWrapped text)
          Sets the text.
 void setType(java.lang.String type)
          Sets the type.
 void setUserID(java.lang.String userID)
          Sets the userID.
 void setWorkPart(WorkPart workPart)
          Sets the work part.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteAnnotation

public RemoteAnnotation()
Creates a new annotation.


RemoteAnnotation

public RemoteAnnotation(org.w3c.dom.Element el)
Creates a new annotation from DOM.

Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface Attachment
Returns:
The unique id.

getCategory

public AnnotationCategory getCategory()
Gets the annotation category.

Specified by:
getCategory in interface Attachment
Returns:
The annotation category.

setCategory

public void setCategory(AnnotationCategory category)
Sets the annotation category.

Specified by:
setCategory in interface Attachment
Parameters:
category - The annotation category.

getText

public TextWrapped getText()
Gets the text.

Specified by:
getText in interface Attachment
Returns:
The text.

getTextAsString

public java.lang.String getTextAsString()
Gets the text as a String.

Returns:
The text.

resetText

public void resetText(java.lang.String textString)
Reset the Text from a String.

Parameters:
textString - The string.

setText

public void setText(TextWrapped text)
Sets the text.

Specified by:
setText in interface Attachment
Parameters:
text - The text.

getIdentifier

public java.lang.String getIdentifier()
Gets the identifier.

Returns:
The identifier.

setIdentifier

public void setIdentifier(java.lang.String identifier)
Sets the identifier.

Parameters:
identifier - The identifier.

getUserID

public java.lang.String getUserID()
Gets the userID.

Returns:
The userID.

setUserID

public void setUserID(java.lang.String userID)
Sets the userID.

Parameters:
userID - The userID.

getAuthor

public java.lang.String getAuthor()
Gets the author.

Returns:
The author.

setAuthor

public void setAuthor(java.lang.String author)
Sets the author.

Parameters:
author - The author.

getAnnotates

public java.lang.String getAnnotates()
Gets the annotates.

Returns:
The annotates.

setAnnotates

public void setAnnotates(java.lang.String annotates)
Sets the annotates.

Parameters:
annotates - The annotates.

getType

public java.lang.String getType()
Gets the type.

Returns:
The type.

setType

public void setType(java.lang.String type)
Sets the type.

Parameters:
type - The type.

getStatus

public java.lang.String getStatus()
Gets the status.

Returns:
The status.

setStatus

public void setStatus(java.lang.String status)
Sets the status.

Parameters:
status - The status.

getCreatedDate

public java.util.Date getCreatedDate()
Gets the creation date.

Returns:
The created date.

setCreatedDate

public void setCreatedDate(java.util.Date created)
Sets the creation date.

Parameters:
created - The created date.

getModifiedDate

public java.util.Date getModifiedDate()
Gets the modified date.

Returns:
The modified date.

setModifiedDate

public void setModifiedDate(java.util.Date modified)
Sets the modified date.

Parameters:
modified - The modified date.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two annotations are equal if their ids are equal.

Specified by:
equals in interface Attachment
Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Specified by:
hashCode in interface Attachment
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

getWorkPart

public WorkPart getWorkPart()
Gets the work part.

Specified by:
getWorkPart in interface TextAttachment
Returns:
The work part.

setWorkPart

public void setWorkPart(WorkPart workPart)
Sets the work part.

Specified by:
setWorkPart in interface TextAttachment
Parameters:
workPart - The work part.

getTarget

public TextRange getTarget()
Gets the target.

Specified by:
getTarget in interface TextAttachment
Returns:
The target - the range of text to which this annotation is attached.

setTarget

public void setTarget(TextRange target)
Sets the target.

Specified by:
setTarget in interface TextAttachment
Parameters:
target - The target - the range of text to which this annotation is attached.

processContextEl

protected void processContextEl(org.w3c.dom.Element el,
                                RemoteAnnotation annot)

processBodyEl

protected void processBodyEl(org.w3c.dom.Element el,
                             RemoteAnnotation annot)

processChildren

protected TextLine processChildren(org.w3c.dom.Element el,
                                   Text text,
                                   TextLine line,
                                   RemoteAnnotation.Context context)
Processes the children of an element.

Parameters:
el - The element.

processTextNode

protected TextLine processTextNode(org.w3c.dom.Node node,
                                   Text text,
                                   TextLine line,
                                   RemoteAnnotation.Context context)
Processes a text node.

Parameters:
node - Text node.

genText

protected TextLine genText(java.lang.String str,
                           Text text,
                           TextLine line,
                           RemoteAnnotation.Context context)
Generates a string of text.

Parameters:
str - String of text.

processItalicEl

protected TextLine processItalicEl(org.w3c.dom.Element el,
                                   Text text,
                                   TextLine line,
                                   RemoteAnnotation.Context context)
Processes an "i" element.

Parameters:
el - italics element.

processBoldEl

protected TextLine processBoldEl(org.w3c.dom.Element el,
                                 Text text,
                                 TextLine line,
                                 RemoteAnnotation.Context context)
Processes an "b" element.

Parameters:
el - bold element.