Class AbstractCompositePageSegment
- java.lang.Object
-
- com.levigo.jadice.document.AbstractPageSegment
-
- com.levigo.jadice.document.AbstractMutablePageSegment
-
- com.levigo.jadice.document.composite.AbstractCompositePageSegment
-
- All Implemented Interfaces:
ConditionFactoryProvider,com.levigo.jadice.document.internal.PageAwarePageSegment,com.levigo.jadice.document.internal.presentation.group.PresentationInitializer,com.levigo.jadice.document.internal.presentation.group.VisualizationInitializer,MetadataProvider,MutablePageSegment,PageSegment,PermissionsProvider<PageSegment>,PropertiesProvider,Identifiable
- Direct Known Subclasses:
CompositePageSegment,DynamicCompositePageSegment
public abstract class AbstractCompositePageSegment extends AbstractMutablePageSegment implements com.levigo.jadice.document.internal.PageAwarePageSegment
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractCompositePageSegment.TransformedElement-
Nested classes/interfaces inherited from class com.levigo.jadice.document.AbstractPageSegment
AbstractPageSegment.CacheableVisualElement
-
-
Field Summary
-
Fields inherited from class com.levigo.jadice.document.AbstractPageSegment
CACHE_KEY_CONTENTS, format, id
-
-
Constructor Summary
Constructors Constructor Description AbstractCompositePageSegment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPageSegment(PageSegment segment, AffineTransform tx)Place the given PageSegment into the composition using the given transform.voidaddPageSegment(PageSegment segment, AffineTransform tx, Shape clipPath)Place the given PageSegment into the composition using the given transform.protected AbstractPageSegment.CacheableVisualElementcreateCacheableVisualElement()This method is not part of the public APIprotected voidfireModified()Fire a notification about a general change to the page segment.MetadatagetMetadata()Return the exposed meta-data ornullif no meta-data is available.ResolutiongetResolution()Returns the base resolution (7200dpi), independent of the resolutions any of the PageSegments added to this instance may have.protected List<AbstractCompositePageSegment.TransformedElement>getSegments()Warning: Just for internal use.booleanisAuxiliary()Return whether this PageSegment is in some way "auxiliary".booleanisOpaque()Set whether this page segment is opaque (all white) regardless of whether the whole bounds are taken up by component segments or not.voidsetCurrentPage(Page page)Set the context page for this page segment.voidsetOpaque(boolean clearBackground)Set whether this page segment is opaque (all white) regardless of whether the whole bounds are taken up by component segments or not.voidsetSource(PageSegmentSource source)-
Methods inherited from class com.levigo.jadice.document.AbstractMutablePageSegment
addPageSegmentListener, createPageSegmentEvent, fireModified, fireModified, removePageSegmentListener
-
Methods inherited from class com.levigo.jadice.document.AbstractPageSegment
getBounds, getCachedVisualElement, getId, getInitialized, getPermissions, getProperties, getSource, isInitialized, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.levigo.jadice.document.condition.ConditionFactoryProvider
getConditionFactories
-
Methods inherited from interface org.jadice.util.base.Identifiable
getId
-
Methods inherited from interface com.levigo.jadice.document.PageSegment
getBounds, getSize, getSource
-
Methods inherited from interface com.levigo.jadice.document.PermissionsProvider
getPermissions
-
Methods inherited from interface com.levigo.jadice.document.internal.presentation.group.PresentationInitializer
getInitialized, isInitialized
-
Methods inherited from interface com.levigo.jadice.document.util.PropertiesProvider
getProperties
-
-
-
-
Method Detail
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataProviderReturn the exposed meta-data ornullif no meta-data is available. An object being a MetadataProvider is not required to provide a non-nullmeta-data.- Specified by:
getMetadatain interfaceMetadataProvider- Overrides:
getMetadatain classAbstractPageSegment- Returns:
- the metadata document or
null
-
setSource
public void setSource(PageSegmentSource source)
- Overrides:
setSourcein classAbstractPageSegment
-
isAuxiliary
public boolean isAuxiliary()
Description copied from interface:PageSegmentReturn whether this PageSegment is in some way "auxiliary". Auxiliary page segments contain additions to the main page segment, but rarely represent the main page content in their own right. Currently most page segments are non-auxiliary except for the AnnotationPageSegment.- Specified by:
isAuxiliaryin interfacePageSegment- Overrides:
isAuxiliaryin classAbstractPageSegment- Returns:
trueif this page segment is auxiliary,falseif it represents "main" page content.
-
addPageSegment
public void addPageSegment(PageSegment segment, AffineTransform tx)
Place the given PageSegment into the composition using the given transform.- Parameters:
segment- the page segment to be placedtx- the affine transform to be used
-
addPageSegment
public void addPageSegment(PageSegment segment, AffineTransform tx, Shape clipPath)
Place the given PageSegment into the composition using the given transform. Apply the given clip path to the placed page segments to cut away undesired parts. The clip path is interpreted in the coordinate system of the placed page segment, i.e. before the transform is applied.- Parameters:
segment- the page segment to be placedtx- the affine transform to be usedclipPath- the clip path to be applied ornullif no clipping shall be applied.- Throws:
IllegalArgumentException- if segment or tx is null.
-
setCurrentPage
public void setCurrentPage(Page page)
Description copied from interface:com.levigo.jadice.document.internal.PageAwarePageSegmentSet the context page for this page segment. Typically, only the first call to this method is used by implementations. When page segments are added to further pages, this call may therefore be ignored.- Specified by:
setCurrentPagein interfacecom.levigo.jadice.document.internal.PageAwarePageSegment
-
createCacheableVisualElement
protected AbstractPageSegment.CacheableVisualElement createCacheableVisualElement() throws JadiceException
Description copied from class:AbstractPageSegmentThis method is not part of the public API- Overrides:
createCacheableVisualElementin classAbstractPageSegment- Throws:
JadiceException
-
isOpaque
public boolean isOpaque()
Set whether this page segment is opaque (all white) regardless of whether the whole bounds are taken up by component segments or not.- Returns:
- whether this page segment is opaque
-
setOpaque
public void setOpaque(boolean clearBackground)
Set whether this page segment is opaque (all white) regardless of whether the whole bounds are taken up by component segments or not.
-
fireModified
protected void fireModified()
Description copied from class:AbstractMutablePageSegmentFire a notification about a general change to the page segment. Please consider firing a more specialized one, indicating the actual damage region.- Overrides:
fireModifiedin classAbstractMutablePageSegment
-
getSegments
protected List<AbstractCompositePageSegment.TransformedElement> getSegments()
Warning: Just for internal use. As the returned segments represent the actual segments, changes may lead to inconsistencies.
-
getResolution
public Resolution getResolution()
Returns the base resolution (7200dpi), independent of the resolutions any of the PageSegments added to this instance may have.- Specified by:
getResolutionin classAbstractPageSegment- Returns:
- always the base resolution
-
-