Package com.aowagie.text.pdf
Class PdfLayerMembership
- java.lang.Object
-
- com.aowagie.text.pdf.PdfObject
-
- com.aowagie.text.pdf.PdfDictionary
-
- com.aowagie.text.pdf.PdfLayerMembership
-
- All Implemented Interfaces:
PdfOCG
class PdfLayerMembership extends PdfDictionary implements PdfOCG
Content typically belongs to a single optional content group, and is visible when the group is ON and invisible when it is OFF. To express more complex visibility policies, content should not declare itself to belong to an optional content group directly, but rather to an optional content membership dictionary represented by this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashSet
layers
private PdfArray
members
private PdfIndirectReference
ref
-
Fields inherited from class com.aowagie.text.pdf.PdfDictionary
CATALOG, hashMap, OUTLINES, PAGE
-
Fields inherited from class com.aowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
-
-
Constructor Summary
Constructors Constructor Description PdfLayerMembership(PdfWriter writer)
Creates a new, empty, membership layer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection
getLayers()
Gets the member layers.PdfObject
getPdfObject()
Gets the dictionary representing the membership layer.PdfIndirectReference
getRef()
Gets thePdfIndirectReference
that represents this membership layer.void
setVisibilityPolicy(PdfName type)
Sets the visibility policy for content belonging to this membership dictionary.-
Methods inherited from class com.aowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, remove, size, toPdf, toString
-
Methods inherited from class com.aowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, type
-
-
-
-
Field Detail
-
ref
private final PdfIndirectReference ref
-
members
private final PdfArray members
-
layers
private final java.util.HashSet layers
-
-
Constructor Detail
-
PdfLayerMembership
public PdfLayerMembership(PdfWriter writer)
Creates a new, empty, membership layer.- Parameters:
writer
- the writer
-
-
Method Detail
-
getRef
public PdfIndirectReference getRef()
Gets thePdfIndirectReference
that represents this membership layer.
-
getLayers
public java.util.Collection getLayers()
Gets the member layers.- Returns:
- the member layers
-
setVisibilityPolicy
public void setVisibilityPolicy(PdfName type)
Sets the visibility policy for content belonging to this membership dictionary. Possible values are ALLON, ANYON, ANYOFF and ALLOFF. The default value is ANYON.- Parameters:
type
- the visibility policy
-
getPdfObject
public PdfObject getPdfObject()
Gets the dictionary representing the membership layer. It just returnsthis
.- Specified by:
getPdfObject
in interfacePdfOCG
- Returns:
- the dictionary representing the layer
-
-