org.icepdf.core.pobjects.annotations
Class AnnotationState

java.lang.Object
  extended by org.icepdf.core.pobjects.annotations.AnnotationState
All Implemented Interfaces:
Memento

public class AnnotationState
extends java.lang.Object
implements Memento

Stores state paramaters for annotation objects to be used in conjuction with a care taker as part of the memento pattern.

Since:
4.0

Field Summary
protected  AnnotationComponent annotationComponent
           
protected  java.awt.Color color
           
protected  java.lang.String highlightStyle
           
protected  java.lang.String lineStyle
           
protected  float lineThickness
           
protected  java.lang.Integer linkType
           
protected  java.awt.geom.Rectangle2D.Float userSpaceRectangle
           
 
Constructor Summary
AnnotationState(AnnotationComponent annotationComponent)
          Stores the annotation state associated with the AnnotationComponents annotation object.
AnnotationState(java.lang.Integer linkType, java.lang.String highlightStyle, float lineThickness, java.lang.String lineStyle, java.awt.Color color)
           
 
Method Summary
 void apply(AnnotationState applyState)
           
 void restore()
          Restores the AnnotationComponents state to the state stored during the construction of this object.
 void restore(Annotation annotation)
          Restores the annotation state in this instance to the Annotation specified as a param.
 void synchronizeState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

linkType

protected java.lang.Integer linkType

highlightStyle

protected java.lang.String highlightStyle

lineThickness

protected float lineThickness

lineStyle

protected java.lang.String lineStyle

color

protected java.awt.Color color

userSpaceRectangle

protected java.awt.geom.Rectangle2D.Float userSpaceRectangle

annotationComponent

protected AnnotationComponent annotationComponent
Constructor Detail

AnnotationState

public AnnotationState(AnnotationComponent annotationComponent)
Stores the annotation state associated with the AnnotationComponents annotation object. When a new instance of this object is created the annotation's proeprties are saved.

Parameters:
annotationComponent - annotation component who's state will be stored.

AnnotationState

public AnnotationState(java.lang.Integer linkType,
                       java.lang.String highlightStyle,
                       float lineThickness,
                       java.lang.String lineStyle,
                       java.awt.Color color)
Method Detail

apply

public void apply(AnnotationState applyState)

restore

public void restore()
Restores the AnnotationComponents state to the state stored during the construction of this object.

Specified by:
restore in interface Memento

restore

public void restore(Annotation annotation)
Restores the annotation state in this instance to the Annotation specified as a param. This method is ment to bue used in AnnotationState(Integer, String, float, String, java.awt.Color)

Parameters:
annotation - annotation to retore state to.

synchronizeState

public void synchronizeState()