public class OptionalContentContext
extends java.lang.Object
The context tracks the On/Off status for Optional Content Groups (layers) within a document. It contains flags that control whether to display content that is marked as optional.
| Constructor and Description |
|---|
OptionalContentContext(Document document)
Creates a context object that represents an optional-content state of the document, using the current state as the initial state for each group (OCG), as determined by the document's optional-content configuration.
|
| Modifier and Type | Method and Description |
|---|---|
OptionalContentContext |
clone()
Makes a copy of the optional content context.
|
void |
delete() |
boolean |
equals(java.lang.Object rhs) |
OptionalContentDrawingPolicy |
getDrawOptionalContent()
Gets the drawing policy for the optional content in this optional content context.
|
java.util.List<java.lang.Boolean> |
getOCGStates(java.util.List<OptionalContentGroup> ocgs)
Gets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.
|
boolean |
getStateOfOCG(OptionalContentGroup ocg)
Gets the ON-OFF state for the given optional content group (OCG) in this optional content context.
|
void |
setDrawOptionalContent(OptionalContentDrawingPolicy newPolicy)
Sets the drawing policy for the optional content in this optional content context.
|
void |
setOCGStates(java.util.List<OptionalContentGroup> ocgs,
java.util.List<java.lang.Boolean> newStates)
Sets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.
|
void |
setStateOfOCG(OptionalContentGroup ocg,
boolean newValue)
Sets the ON-OFF state for the given optional content group (OCG) in this optional content context.
|
java.lang.String |
toString() |
public OptionalContentContext(Document document)
document - The document for which to create a context.public void delete()
public boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.util.List<java.lang.Boolean> getOCGStates(java.util.List<OptionalContentGroup> ocgs)
ocgs - A list of optional-content groups whose states are obtained.public void setOCGStates(java.util.List<OptionalContentGroup> ocgs, java.util.List<java.lang.Boolean> newStates)
ocgs - A list of optional-content groups.newStates - A list of new OCG states corresponding to the list of OCGs, true for ON and false for OFF. The list must contain as many states as there are non-NULL OCGs in the pdocgs list.public boolean getStateOfOCG(OptionalContentGroup ocg)
ocg - The optional content group whose state will be retrieved.public void setStateOfOCG(OptionalContentGroup ocg, boolean newValue)
ocg - The optional content group whose state will be set.newValue - The new ON-OFF state for the optional content group.public OptionalContentContext clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic OptionalContentDrawingPolicy getDrawOptionalContent()
public void setDrawOptionalContent(OptionalContentDrawingPolicy newPolicy)
newPolicy - The new drawing policy for optional content in this optional content context.