Enterprise Information Portal APIs

com.ibm.mm.viewer.annotation
Class CMBAnnotationSet

java.lang.Object
  |
  +--com.ibm.mm.viewer.annotation.CMBAnnotationSet
All Implemented Interfaces:
java.io.Serializable

public class CMBAnnotationSet
extends java.lang.Object
implements java.io.Serializable

CMBAnnotationSet represents the set of annotations associated with a document. This represents the logical format to which the annotations in physical format are converted to by CMBAnnotationServices. Provides methods to query annotation properties and has an array property that provides access to each CMBPageAnnotation object that represents a single annotation in the document.

There is no public constructor for CMBAnnotationSet. Use CMBAnnotationServices.loadAnnotations() to obtain an instance of CMBAnnotationSet.

Since:
8.1
See Also:
CMBAnnotationServices, CMBAnnotationEngine, Serialized Form

Method Summary
 void addAnnCreatedListener(CMBAnnotationCreatedListener listener)
          Adds a listener to the list of annotation created event listeners.
 void addAnnDeletedListener(CMBAnnotationDeletedListener listener)
          Adds a listener to the list of annotation deleted event listeners.
 void addAnnMovedListener(CMBAnnotationMovedListener listener)
          Adds a listener to the list of annotation moved event listeners.
 void addAnnotation(CMBPageAnnotation a)
          Adds a new annotation to the set
 void addAnnPropertiesUpdatedListener(CMBAnnotationPropertiesUpdatedListener listener)
          Adds a listener to the list of annotation properties updated event listeners.
 void addAnnReorderedListener(CMBAnnotationReorderedListener listener)
          Adds a listener to the list of annotation reordered event listeners.
 void addAnnResizedListener(CMBAnnotationResizedListener listener)
          Adds a listener to the list of annotation resized event listeners.
 void addAnnSelectedListener(CMBAnnotationSelectedListener listener)
          Adds a listener to the list of annotation selected event listeners.
 void dispose()
          Disposes the annotation set and all the page annotations.
 void fireCMBAnnCreatedEvent(CMBAnnotationView view, CMBPageAnnotation annotation)
          Notifies all the listeners that an annotation was created.
 void fireCMBAnnDeletedEvent(CMBAnnotationView view, CMBPageAnnotation annotation, CMBPageAnnotation nextAnno)
          Notifies all the listeners that an annotation was deleted.
 void fireCMBAnnMovedEvent(CMBAnnotationView view, CMBPageAnnotation annotation, java.awt.Point newPoint, java.awt.Point oldPoint)
          Notifies all the listeners that an annotation was moved.
 void fireCMBAnnPropertiesUpdatedEvent(CMBAnnotationView view, CMBPageAnnotation annotation)
          Notifies all the listeners that an annotation's properties was changed.
 void fireCMBAnnReorderedEvent(CMBAnnotationView view, CMBPageAnnotation annotation, int newIndex)
          Notifies all the listeners that an annotation was reordered.
 void fireCMBAnnResizedEvent(CMBAnnotationView view, CMBPageAnnotation annotation, java.awt.Point deltaSize, java.awt.Point oldSize)
          Notifies all the listeners that an annotation was resized.
 void fireCMBAnnSelectedEvent(CMBAnnotationView view, CMBPageAnnotation annotation)
          Notifies all the listeners that an annotation was resized.
 CMBPageAnnotation getAnnotationAt(int index)
           
 int getAnnotationCount()
          Returns the annotation count.
 java.lang.String getAnnotationFormat()
          Returns the annotation format of this annotation set.
 int getAnnotationPartNumber()
          Gets the annotation part number that this set belongs to.
 boolean getCanLoadAnnotationFormat(java.lang.String format)
          Tests if the engine can load the specified annotation format.
 boolean getCanSaveAnnotationFormat(java.lang.String srcFormat, java.lang.String dstFormat)
          Tests if the engine can save annotations to the specified annotation format.
 int getImageHeight()
           
 int getImageWidth()
           
 java.util.Iterator getIterator()
          Returns an Iterator instance to the caller.
 java.util.Iterator getIterator(int pageNum)
          Returns the iterator that lists the annotations on the specified page.
 CMBPageAnnotation[] getPageAnnotations()
          Returns an array of all the page annotations in this set.
 CMBPageAnnotation[] getPageAnnotations(int pageNum)
          Returns an array of page annotations corresponding to the specified page.
 boolean getPrivilege(int privilege)
           
 int getRotation()
           
 int getScale()
          Returns the scale factor.
 boolean isDirty()
           
 void removeAnnCreatedListener(CMBAnnotationCreatedListener listener)
          Removes the annotation created event listener from the list.
 void removeAnnDeletedListener(CMBAnnotationDeletedListener listener)
          Removes the annotation deleted event listener from the list.
 void removeAnnMovedListener(CMBAnnotationMovedListener listener)
          Removes the annotation moved event listener from the list.
 CMBPageAnnotation removeAnnotation(CMBPageAnnotation a)
          Removes an annotation from the set
 void removeAnnPropertiesUpdatedListener(CMBAnnotationPropertiesUpdatedListener listener)
          Removes the annotation properties updated event listener from the list.
 void removeAnnReorderedListener(CMBAnnotationReorderedListener listener)
          Removes the annotation reordered event listener from the list.
 void removeAnnResizedListener(CMBAnnotationResizedListener listener)
          Removes the annotation resized event listener from the list.
 void removeAnnSelectedListener(CMBAnnotationSelectedListener listener)
          Removes the annotation resized event listener from the list.
 void reorderAnnotation(CMBPageAnnotation a, int index)
          Change the order of the annotations.
 void saveAnnotations()
          Calls the engine to save the annotations.
 void setDirty(boolean bAnnoDirty)
           
 void setImageSize(int wd, int ht)
           
 void setRotation(int rotation)
           
 void setRotation(int rotation, int pageNumber)
           
 void setScale(int scale)
           
 java.lang.String toString()
           
 void updateAnnotation(CMBPageAnnotation a, int index)
          Updates the annotation with the specified annotation at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCanLoadAnnotationFormat

public boolean getCanLoadAnnotationFormat(java.lang.String format)
Tests if the engine can load the specified annotation format.
Parameters:
format - the annotation format
Returns:
true if the engine can load this format false otherwise

getCanSaveAnnotationFormat

public boolean getCanSaveAnnotationFormat(java.lang.String srcFormat,
                                          java.lang.String dstFormat)
Tests if the engine can save annotations to the specified annotation format.
Parameters:
srcFormat - the annotation format that was initially loaded
destFormat - the annotation format to convert to
Returns:
true if the engine can save annotations to the destination format false otherwise

getAnnotationFormat

public java.lang.String getAnnotationFormat()
Returns the annotation format of this annotation set.
Returns:
String The annotation format for this annotation set.

getPrivilege

public boolean getPrivilege(int privilege)

getPageAnnotations

public CMBPageAnnotation[] getPageAnnotations()
Returns an array of all the page annotations in this set.
Returns:
CMBPageAnnotation[]

getPageAnnotations

public CMBPageAnnotation[] getPageAnnotations(int pageNum)
Returns an array of page annotations corresponding to the specified page.
Parameters:
pageNum - The page number of the page to which returned array of annotations belong.
Returns:
CMBPageAnnotation[]

getAnnotationCount

public int getAnnotationCount()
Returns the annotation count.
Returns:
int The total number of annotations in the set.

getAnnotationPartNumber

public int getAnnotationPartNumber()
Gets the annotation part number that this set belongs to.
Returns:
int The annotation part sequence number stored on the server.

addAnnotation

public void addAnnotation(CMBPageAnnotation a)
Adds a new annotation to the set
Parameters:
a - The annotation to add

removeAnnotation

public CMBPageAnnotation removeAnnotation(CMBPageAnnotation a)
Removes an annotation from the set
Parameters:
a - The annotation to remove
Returns:
int The index of the currently removed annotation

reorderAnnotation

public void reorderAnnotation(CMBPageAnnotation a,
                              int index)
Change the order of the annotations. Useful for changing the z-order of the annotations.
Parameters:
a - The page annotation to be re-ordered.
index - The new index of the page annotation.

getAnnotationAt

public CMBPageAnnotation getAnnotationAt(int index)

updateAnnotation

public void updateAnnotation(CMBPageAnnotation a,
                             int index)
Updates the annotation with the specified annotation at the specified index.
Parameters:
a - The page annotation to update.
index - The index of the page annotation to be updated.

saveAnnotations

public void saveAnnotations()
                     throws java.io.IOException
Calls the engine to save the annotations.

getIterator

public java.util.Iterator getIterator()
Returns an Iterator instance to the caller.
Returns:
Iterator The iterator for the list of page annotations stored in this set.

getIterator

public java.util.Iterator getIterator(int pageNum)
Returns the iterator that lists the annotations on the specified page.
Parameters:
pageNum - The Iterator that contains annotations on this page.

addAnnCreatedListener

public void addAnnCreatedListener(CMBAnnotationCreatedListener listener)
Adds a listener to the list of annotation created event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationCreatedListener interface.

removeAnnCreatedListener

public void removeAnnCreatedListener(CMBAnnotationCreatedListener listener)
Removes the annotation created event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationCreatedListener interface.

fireCMBAnnCreatedEvent

public void fireCMBAnnCreatedEvent(CMBAnnotationView view,
                                   CMBPageAnnotation annotation)
Notifies all the listeners that an annotation was created.
Parameters:
annotation - The annotation that is created.

addAnnDeletedListener

public void addAnnDeletedListener(CMBAnnotationDeletedListener listener)
Adds a listener to the list of annotation deleted event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationDeletedListener interface.

removeAnnDeletedListener

public void removeAnnDeletedListener(CMBAnnotationDeletedListener listener)
Removes the annotation deleted event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationDeletedListener interface.

fireCMBAnnDeletedEvent

public void fireCMBAnnDeletedEvent(CMBAnnotationView view,
                                   CMBPageAnnotation annotation,
                                   CMBPageAnnotation nextAnno)
Notifies all the listeners that an annotation was deleted.
Parameters:
annotation - The annotation that is deleted.
nextAnno - The annotation that is next in the set that must be selected.

addAnnPropertiesUpdatedListener

public void addAnnPropertiesUpdatedListener(CMBAnnotationPropertiesUpdatedListener listener)
Adds a listener to the list of annotation properties updated event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationPropertiesUpdatedListener interface.

removeAnnPropertiesUpdatedListener

public void removeAnnPropertiesUpdatedListener(CMBAnnotationPropertiesUpdatedListener listener)
Removes the annotation properties updated event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationPropertiesUpdatedListener interface.

fireCMBAnnPropertiesUpdatedEvent

public void fireCMBAnnPropertiesUpdatedEvent(CMBAnnotationView view,
                                             CMBPageAnnotation annotation)
Notifies all the listeners that an annotation's properties was changed.
Parameters:
annotation - The annotation whose property was changed.

addAnnReorderedListener

public void addAnnReorderedListener(CMBAnnotationReorderedListener listener)
Adds a listener to the list of annotation reordered event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationReorderedListener interface.

removeAnnReorderedListener

public void removeAnnReorderedListener(CMBAnnotationReorderedListener listener)
Removes the annotation reordered event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationReorderedListener interface.

fireCMBAnnReorderedEvent

public void fireCMBAnnReorderedEvent(CMBAnnotationView view,
                                     CMBPageAnnotation annotation,
                                     int newIndex)
Notifies all the listeners that an annotation was reordered.
Parameters:
annotation - The annotation that is reordered.
newIndex - The new index of the annotation that is reordered.

addAnnMovedListener

public void addAnnMovedListener(CMBAnnotationMovedListener listener)
Adds a listener to the list of annotation moved event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationMovedListener interface.

removeAnnMovedListener

public void removeAnnMovedListener(CMBAnnotationMovedListener listener)
Removes the annotation moved event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationMovedListener interface.

fireCMBAnnMovedEvent

public void fireCMBAnnMovedEvent(CMBAnnotationView view,
                                 CMBPageAnnotation annotation,
                                 java.awt.Point newPoint,
                                 java.awt.Point oldPoint)
Notifies all the listeners that an annotation was moved.
Parameters:
annotation - The annotation that is moved.
newPoint - The new point to which the annotation is moved.
oldPoint - The old point from which the annotation is moved.

addAnnResizedListener

public void addAnnResizedListener(CMBAnnotationResizedListener listener)
Adds a listener to the list of annotation resized event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationResizedListener interface.

removeAnnResizedListener

public void removeAnnResizedListener(CMBAnnotationResizedListener listener)
Removes the annotation resized event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationResizedListener interface.

fireCMBAnnResizedEvent

public void fireCMBAnnResizedEvent(CMBAnnotationView view,
                                   CMBPageAnnotation annotation,
                                   java.awt.Point deltaSize,
                                   java.awt.Point oldSize)
Notifies all the listeners that an annotation was resized.
Parameters:
annotation - The annotation that is resized.
deltaSize - The values of the changed width and height of the specified annotation.
oldSize - The original size of the annotation.

addAnnSelectedListener

public void addAnnSelectedListener(CMBAnnotationSelectedListener listener)
Adds a listener to the list of annotation selected event listeners.
Parameters:
listener - An instance of a class implementing the CMBAnnotationSelectedListener interface.

removeAnnSelectedListener

public void removeAnnSelectedListener(CMBAnnotationSelectedListener listener)
Removes the annotation resized event listener from the list.
Parameters:
listener - An instance of a class implementing the CMBAnnotationSelecteddListener interface.

fireCMBAnnSelectedEvent

public void fireCMBAnnSelectedEvent(CMBAnnotationView view,
                                    CMBPageAnnotation annotation)
Notifies all the listeners that an annotation was resized.
Parameters:
annotation - The annotation that is resized.

setRotation

public void setRotation(int rotation)

getRotation

public int getRotation()

setRotation

public void setRotation(int rotation,
                        int pageNumber)

setScale

public void setScale(int scale)
Parameters:
scale - The new scale to set.

getScale

public int getScale()
Returns the scale factor.

setImageSize

public void setImageSize(int wd,
                         int ht)

getImageHeight

public int getImageHeight()

getImageWidth

public int getImageWidth()

setDirty

public void setDirty(boolean bAnnoDirty)

isDirty

public boolean isDirty()

dispose

public void dispose()
Disposes the annotation set and all the page annotations.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

EIP JavaBeans

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.