public class LazyStreamPageSegment extends AbstractPageSegment
PageSegment
to prevent early loading of the streams.
The LazyStreamPageSegment
can be rendered, after getInitialized() is called. This will
trigger the reading of the provided Stream. It will replace itself in the Page provided, and
route some of the calls to the real loaded one, so the LazyStreamPageSegment
can be
rendered direct from DOCP.
If the lazy loading fails, the class will throw a RuntimeException
Implementation limits:
Modifier and Type | Class and Description |
---|---|
static class |
LazyStreamPageSegment.DocumentProvider
A Provider for a
Document for the LazyStreamPageSegment . |
static class |
LazyStreamPageSegment.PageSegmentProvider
A Provider for a
PageSegment for the LazyStreamPageSegment . |
static class |
LazyStreamPageSegment.StreamDataProvider
A Provider for an
InputStream for the LazyStreamPageSegment . |
AbstractPageSegment.CacheableVisualElement
CACHE_KEY_CONTENTS, format, id
Constructor and Description |
---|
LazyStreamPageSegment(Page page,
LazyStreamPageSegment.PageSegmentProvider pageSegmentProvider) |
LazyStreamPageSegment(Page page,
LazyStreamPageSegment.PageSegmentProvider pageSegmentProvider,
int pageStreamIndex) |
Modifier and Type | Method and Description |
---|---|
protected void |
doLoad() |
protected DocumentLayer |
getDocumentLayer() |
com.levigo.jadice.document.internal.presentation.group.TransparencyGroupContainer |
getInitialized()
Caveat: this method is not part of the public API.
|
protected Dimension |
getInitialSize()
Returns the initial raw size of this page segment in document base units before the lazy load
process replaces this page segment.
|
Resolution |
getResolution()
Return the resolution of the page segment (in DPI).
|
Dimension2D |
getSize()
Returns the raw size/dimensions of the
PageSegment in base units. |
void |
initialize()
Make sure the real PageSegment is initialized and loaded
|
boolean |
isInitialized() |
void |
setInitialSize(Dimension initialSize)
Sets the initial Size of the PageSegment, before the PageSegment is loaded
|
createCacheableVisualElement, getBounds, getCachedVisualElement, getId, getMetadata, getPermissions, getProperties, getSource, isAuxiliary, setSource, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConditionFactories
public LazyStreamPageSegment(Page page, LazyStreamPageSegment.PageSegmentProvider pageSegmentProvider)
page
- the referenced page, the PageSegment will be replaced inpageSegmentProvider
- the provider, called when the pageSegment should be renderedpublic LazyStreamPageSegment(Page page, LazyStreamPageSegment.PageSegmentProvider pageSegmentProvider, int pageStreamIndex)
page
- the referenced page, the PageSegment will be replaced inpageSegmentProvider
- the provider, called when the pageSegment should be renderedpageStreamIndex
- the index of the page inside of the lazy loaded documentprotected DocumentLayer getDocumentLayer()
public boolean isInitialized()
isInitialized
in interface com.levigo.jadice.document.internal.presentation.group.PresentationInitializer
isInitialized
in class AbstractPageSegment
public void initialize()
public com.levigo.jadice.document.internal.presentation.group.TransparencyGroupContainer getInitialized()
AbstractPageSegment
getInitialized
in interface com.levigo.jadice.document.internal.presentation.group.PresentationInitializer
getInitialized
in class AbstractPageSegment
protected void doLoad()
public Dimension2D getSize()
PageSegment
PageSegment
in base units.getSize
in interface PageSegment
getSize
in class AbstractPageSegment
PageSegment
's raw sizepublic Resolution getResolution()
AbstractPageSegment
Page segments usually return just the base resolution as their native resolution. Page segments with pixel-data return the actual pixel resolution they can provide. This information is used to hint e.g. the printer about the maximum resolution a page segment can produce.
getResolution
in class AbstractPageSegment
public void setInitialSize(Dimension initialSize)
initialSize
- the size of the PageSegment, before the PageSegment is loadedprotected Dimension getInitialSize()
Copyright © 2024 levigo holding gmbh. All rights reserved.