com.lowagie.text.pdf

Class PdfLayerMembership

public 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.

Author: Paulo Soares (psoares@consiste.pt)

Field Summary
static PdfNameALLOFF
Visible only if all of the entries are OFF.
static PdfNameALLON
Visible only if all of the entries are ON.
static PdfNameANYOFF
Visible if any of the entries are OFF.
static PdfNameANYON
Visible if any of the entries are ON.
HashSetlayers
PdfArraymembers
PdfIndirectReferenceref
Constructor Summary
PdfLayerMembership(PdfWriter writer)
Creates a new, empty, membership layer.
Method Summary
voidaddMember(PdfLayer layer)
Adds a new member to the layer.
CollectiongetLayers()
Gets the member layers.
PdfObjectgetPdfObject()
Gets the dictionary representing the membership layer.
PdfIndirectReferencegetRef()
Gets the PdfIndirectReference that represents this membership layer.
voidsetVisibilityPolicy(PdfName type)
Sets the visibility policy for content belonging to this membership dictionary.

Field Detail

ALLOFF

public static final PdfName ALLOFF
Visible only if all of the entries are OFF.

ALLON

public static final PdfName ALLON
Visible only if all of the entries are ON.

ANYOFF

public static final PdfName ANYOFF
Visible if any of the entries are OFF.

ANYON

public static final PdfName ANYON
Visible if any of the entries are ON.

layers

HashSet layers

members

PdfArray members

ref

PdfIndirectReference ref

Constructor Detail

PdfLayerMembership

public PdfLayerMembership(PdfWriter writer)
Creates a new, empty, membership layer.

Parameters: writer the writer

Method Detail

addMember

public void addMember(PdfLayer layer)
Adds a new member to the layer.

Parameters: layer the new member to the layer

getLayers

public Collection getLayers()
Gets the member layers.

Returns: the member layers

getPdfObject

public PdfObject getPdfObject()
Gets the dictionary representing the membership layer. It just returns this.

Returns: the dictionary representing the layer

getRef

public PdfIndirectReference getRef()
Gets the PdfIndirectReference that represents this membership layer.

Returns: the PdfIndirectReference that represents this layer

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