com.lowagie.text.pdf
public class: PdfLayerMembership [javadoc |
source]
java.lang.Object
com.lowagie.text.pdf.PdfObject
com.lowagie.text.pdf.PdfDictionary
com.lowagie.text.pdf.PdfLayerMembership
All Implemented Interfaces:
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 |
|---|
| public static final PdfName | ALLON | Visible only if all of the entries are ON. |
| public static final PdfName | ANYON | Visible if any of the entries are ON. |
| public static final PdfName | ANYOFF | Visible if any of the entries are OFF. |
| public static final PdfName | ALLOFF | Visible only if all of the entries are OFF. |
| PdfIndirectReference | ref | |
| PdfArray | members | |
| HashSet | layers | |
| Fields inherited from com.lowagie.text.pdf.PdfObject: |
|---|
| BOOLEAN, NUMBER, STRING, NAME, ARRAY, DICTIONARY, STREAM, NULL, INDIRECT, NOTHING, TEXT_PDFDOCENCODING, TEXT_UNICODE, bytes, type, indRef |
| Constructor: |
public PdfLayerMembership(PdfWriter writer) {
super(PdfName.OCMD);
put(PdfName.OCGS, members);
ref = writer.getPdfIndirectReference();
}
Creates a new, empty, membership layer. Parameters:
writer - the writer
|
| Methods from com.lowagie.text.pdf.PdfDictionary: |
|---|
|
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString |
| Methods from com.lowagie.text.pdf.PdfObject: |
|---|
|
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, toPdf, toString, type |
| Method from com.lowagie.text.pdf.PdfLayerMembership Detail: |
public void addMember(PdfLayer layer) {
if (!layers.contains(layer)) {
members.add(layer.getRef());
layers.add(layer);
}
}
Adds a new member to the layer. |
public Collection getLayers() {
return layers;
}
|
public PdfObject getPdfObject() {
return this;
}
Gets the dictionary representing the membership layer. It just returns this. |
public PdfIndirectReference getRef() {
return ref;
}
Gets the PdfIndirectReference that represents this membership layer. |
public void setVisibilityPolicy(PdfName type) {
put(PdfName.P, 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. |