|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.viewer.annotation.CMBAnnotationServices
CMBAnnotationServices provides the main interfaces to the annotation services support in the java viewer toolkit. Loading, manipulating and saving annotation objects can be done using the annotation services independent of backends. The annotation data can be passed in as a stream and a suitable annotation engine can be plugged in to convert the annotation objects to CMBPageAnnotation instances. The annotations can then be manipulated and edited and saved back to the original format using the annotation engine. It uses the CMBAnnotationSet as a 'model' to represent the logical format of the annotation blob. It uses the CMBAnnotationView as a 'view' to handle the rendering of the annotations on a JComponent. It additionally internally uses a 'controller' that facilitates manipulation of the annotations graphically.
CMBAnnotationEngine is an abstract class that must be exended by any annotation engine implementation.
CMBAnnotationServicesCallbacks and CMBAnnotationEngineCallbacks interfaces are utilized by the
annotation engine to communicate with the application and annotation services. The default annotation
engine provided with the annotation services is
CMBAnnotationEngine
,
CMBAnnotationServicesCallbacks
,
CMBAnnotationEngineCallbacks
,
CMBAnnotationView
,
CMBAnnotationSet
Constructor Summary | |
CMBAnnotationServices(CMBAnnotationServicesCallbacks callbacks)
Constructs the annotation services. |
Method Summary | |
void |
addAnnotation(CMBPageAnnotation a)
Adds the specified annotation to the current annotation set. |
void |
changeAnnotationProperties(CMBPageAnnotation anno)
Pops up the properties dialog for the corresponding annotation. |
void |
dropAllAnnotationSets()
Drops all the annotation sets that are currently being processed. |
void |
dropAnnotationSet(CMBAnnotationSet annSet)
Drops the specified annotation set. |
CMBAnnotationSet[] |
getAllAnnotationSets()
Returns the annotation sets being processed. |
CMBAnnotationSet |
getAnnotationSet(int index)
Returns a particular annotation set for a document being processed. |
CMBAnnotationSet |
getAnnotationSet(java.lang.Object hItem)
Returns the annotation set , given the handle to the annotation set. |
java.util.Properties |
getEngineProperties()
Returns the engine properties. |
java.lang.Object |
getItemHandle(CMBAnnotationSet annSet)
Returns the handle to the annotations given the annotation set. |
boolean |
getPrivilege(CMBAnnotationSet annoSet,
int privilegeID)
Gets privilege for annotationSet. |
CMBPageAnnotation |
getSelectedAnnotation()
Gets the currently selected or active annotation. |
void |
hideAllAnnotations()
Hides all the annotations from the current view. |
CMBAnnotationSet |
loadAnnotationSet(java.io.InputStream annotationStream,
java.lang.String format,
int documentResolution,
int numOfParts,
int partNumber)
Loads the annotations from the annotation engines. |
CMBAnnotationView |
prepareAnnotationView(javax.swing.JComponent viewcomponent,
CMBAnnotationSet annotationSet)
Sets the view component for the annotations to be drawn on. |
void |
prepareToAddAnnotation(int annoType,
int pageNumber)
Prepares the annotation controller to create the annotation specified by the type. |
void |
prepareToAddAnnotation(int annoType,
java.lang.String className,
int pageNumber)
Prepares the annotation controller to create a custom annotation type by specifying the fully qualified class name. |
void |
removeAnnotation(CMBPageAnnotation a)
Removes the specified annotation from the current annotation set. |
void |
reorderAnnotation(CMBPageAnnotation a,
int index)
Reorders the specified annotation within the current list of annotations. |
void |
saveAllAnnotationSets()
Saves all the current annotations. |
void |
saveAnnotationSet(CMBAnnotationSet annSet)
Saves the currently loaded annotation set that the annotation services is working with. |
void |
setAnnotationView(CMBAnnotationView view,
CMBAnnotationSet annoSet)
Use this method to replace the annotation set for the view and the controller. |
void |
setCurrentPageNumber(int pageNumber)
Sets the current page number for the annotation controller to keep track. |
void |
setEngineProperties(java.util.Properties engineProperties)
Sets the engine properties. |
void |
setEraseMode()
Sets the annotation editing in erase mode. |
void |
setIdleDrawingMode()
Sets the annotation editing in idle mode. |
void |
setItemHandle(CMBAnnotationSet annSet,
java.lang.Object handle)
Saves the reference to the actual object used to retrieve the annotations. |
void |
setPopupMenu(java.lang.Object popupmenu)
Sets the popup menu that is used as annotation popup menus. |
void |
showAllAnnotations()
Shows all the annotations on the current view. |
void |
terminate()
Terminates all the engines and drops all annotations. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMBAnnotationServices(CMBAnnotationServicesCallbacks callbacks)
callbacks
- The implementation of CMBAnnotationServicesCallbacks used
to retrieve additional annotation parts.Method Detail |
public java.util.Properties getEngineProperties()
public void setEngineProperties(java.util.Properties engineProperties)
engineProperties
- a Properties object defining the annotation engines to load
and their initialization properties.
The properties have the following names:
getEngineProperties()
to get
the current engine properties, and add properties using properties.put()
.public CMBAnnotationSet[] getAllAnnotationSets()
public CMBAnnotationSet getAnnotationSet(int index) throws java.lang.ArrayIndexOutOfBoundsException
public CMBAnnotationSet loadAnnotationSet(java.io.InputStream annotationStream, java.lang.String format, int documentResolution, int numOfParts, int partNumber) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
annotationStream
- An input stream containing the data for the annotations.
If the annotation data is a multi-parted, this input stream contains the data
for the first part of the annotation data.format
- A string constant for the type of annotations.
For ex.'application/vnd.ibm.modcap' for CM v8 annotations or a two letter representation
of the server type such as 'DL','OD','V4'.documentResolution
- The image resolution of the document that was loaded in pixels per inch.numberOfParts
- The number of parts that compose the entire set of annotations.
This will be 1 for a single-part annotation group.partNumber
- The annotation part number that is loaded. First part is usually '0'.public void saveAllAnnotationSets()
public void saveAnnotationSet(CMBAnnotationSet annSet)
annSet
- the current annotation set.public void dropAllAnnotationSets()
public void dropAnnotationSet(CMBAnnotationSet annSet)
annSet
- The annotation set to be removed.public void setItemHandle(CMBAnnotationSet annSet, java.lang.Object handle)
annotationSet
- The annotationSet whose handle is being sethAnnotationSet
- The reference to the handle ( in the case of EIP, the CMBItem reference is used )public java.lang.Object getItemHandle(CMBAnnotationSet annSet)
annotationSet
- The annotationSetpublic CMBAnnotationSet getAnnotationSet(java.lang.Object hItem)
hItem
- The object reference that is used as a handle to the annotation set.
In the case of EIP, this is the CMBItem reference.public boolean getPrivilege(CMBAnnotationSet annoSet, int privilegeID)
annoSet
- the annotationSet for which to get the privilegeprivilegeID
- the privilege ID for which the permissions
need to be obtainedpublic void terminate()
public void prepareToAddAnnotation(int annoType, int pageNumber)
annoType
- The type of the annotation as defined by the CMBAnnotationConstants.
For example, ANN_ARROW, ANN_STAMP, etc.pageNumber
- The page number of the document where the annotation is being prepared to be created.public void prepareToAddAnnotation(int annoType, java.lang.String className, int pageNumber)
annoType
- The type of the annotation as defined by the CMBAnnotationConstants.
For example, ANN_ARROW, ANN_STAMP, etc.
For custom annotation type, use ANN_CUSTOM.className
- The fully qualified class name of any custom page annotationpageNumber
- The page number of the document where the annotation is being prepared to be created.public void setCurrentPageNumber(int pageNumber)
int
- the current page number of the document where the annotations are being edited.public void setIdleDrawingMode()
public void setEraseMode()
public CMBPageAnnotation getSelectedAnnotation()
public void addAnnotation(CMBPageAnnotation a)
a
- The page annotation to be added.public void removeAnnotation(CMBPageAnnotation a)
a
- The page annotation to be removed.public void reorderAnnotation(CMBPageAnnotation a, int index)
a
- The page annotation to be reordered.public void hideAllAnnotations()
public void showAllAnnotations()
public void changeAnnotationProperties(CMBPageAnnotation anno)
anno
- The annotation whose properties needs to be modified.public void setPopupMenu(java.lang.Object popupmenu)
popupmenu
- the annotation popup menu.public CMBAnnotationView prepareAnnotationView(javax.swing.JComponent viewcomponent, CMBAnnotationSet annotationSet)
viewcomponent
- The JComponent to draw the annotations on. This JComponent is used by the annotation view
to render the annotations.annotationSet
- The model that contains the CMBPageAnnotations to be drawn.setAnnotationView( CMBAnnotationView view,CMBAnnotationSet annoSet )
public void setAnnotationView(CMBAnnotationView view, CMBAnnotationSet annoSet)
view
- The annotation view currently used for rendering annotationsannoSet
- The model - the set of annotations loaded.
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |