com.levigo.jadice.document
Class AbstractPageSegment

java.lang.Object
  extended by com.levigo.jadice.document.AbstractPageSegment
All Implemented Interfaces:
com.levigo.jadice.document.internal.model.RenderRoot, MetadataProvider, PageSegment, PermissionsProvider<PageSegment>, PropertiesProvider, Identifiable
Direct Known Subclasses:
AbstractContentsPageSegment, AbstractMutablePageSegment

public abstract class AbstractPageSegment
extends Object
implements PageSegment, com.levigo.jadice.document.internal.model.RenderRoot


Nested Class Summary
protected static class AbstractPageSegment.CacheableRendering
           
 
Field Summary
protected static Object CACHE_KEY_CONTENTS
          the key with which the contents will be cached if this PageSegment is able to cache its contents
protected  Format format
          Human readable format description.
protected  String id
           
 
Constructor Summary
AbstractPageSegment()
          Construct a page segment.
 
Method Summary
 com.levigo.jadice.document.internal.model.RenderElement createRendering()
          Caveat: this method is not part of the public API.
protected  AbstractPageSegment.CacheableRendering doCreateCacheableRendering()
           
 Rectangle2D getBounds()
          Returns the raw size and position of the PageSegment in base units.
protected  AbstractPageSegment.CacheableRendering getCachedRendering()
           
 String getId()
          Return the unique identifier for this object.
 Metadata getMetadata()
          Return the exposed meta-data or null if no meta-data is available.
 Permissions<PageSegment> getPermissions()
          Provides an instance of Permissions.
 Map<String,Object> getProperties()
          Return a map of user properties.
 Resolution getResolution()
          Return the resolution of the page segment (in DPI).
 Dimension2D getSize()
          Returns the raw size/dimensions of the PageSegment in base units.
 PageSegmentSource getSource()
          Get the PageSegmentSource describing the source of this page segment.
 boolean isAuxiliary()
          Return whether this PageSegment is in some way "auxiliary".
 boolean isInitialized()
           
protected  void setSource(PageSegmentSource source)
           
 String toString()
          Description of this page segment instances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CACHE_KEY_CONTENTS

protected static final Object CACHE_KEY_CONTENTS
the key with which the contents will be cached if this PageSegment is able to cache its contents


format

protected Format format
Human readable format description.


id

protected String id
Constructor Detail

AbstractPageSegment

public AbstractPageSegment()
Construct a page segment.

Method Detail

getSource

public PageSegmentSource getSource()
Description copied from interface: PageSegment
Get the PageSegmentSource describing the source of this page segment. Returns null if the page segment is not derived from a source.

Specified by:
getSource in interface PageSegment
Returns:
the page segment source

setSource

protected void setSource(PageSegmentSource source)

getResolution

public Resolution getResolution()
Return the resolution of the page segment (in DPI).

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.

Returns:
Dimension where the width part contains the horizontal and the height part contains the vertical resolution

getSize

public Dimension2D getSize()
Description copied from interface: PageSegment
Returns the raw size/dimensions of the PageSegment in base units.

Specified by:
getSize in interface PageSegment
Returns:
the PageSegment's raw size

getBounds

public Rectangle2D getBounds()
Description copied from interface: PageSegment
Returns the raw size and position of the PageSegment in base units. Position is measured in relation to the Page's coordinate system's origin point (0,0).

Specified by:
getBounds in interface com.levigo.jadice.document.internal.model.RenderRoot
Specified by:
getBounds in interface PageSegment
Returns:
the raw size and position

toString

public String toString()
Description of this page segment instances

Overrides:
toString in class Object
See Also:
Object.toString()

getCachedRendering

protected AbstractPageSegment.CacheableRendering getCachedRendering()

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface com.levigo.jadice.document.internal.model.RenderRoot

createRendering

public com.levigo.jadice.document.internal.model.RenderElement createRendering()
Caveat: this method is not part of the public API.

Specified by:
createRendering in interface com.levigo.jadice.document.internal.model.RenderRoot
See Also:
RenderRoot.createRendering()

doCreateCacheableRendering

protected AbstractPageSegment.CacheableRendering doCreateCacheableRendering()
                                                                     throws JadiceException
Throws:
JadiceException

getMetadata

public Metadata getMetadata()
Description copied from interface: MetadataProvider
Return the exposed meta-data or null if no meta-data is available. An object being a MetadataProvider is not required to provide a non-null meta-data.

Specified by:
getMetadata in interface MetadataProvider
Returns:
the metadata document or null

getProperties

public Map<String,Object> getProperties()
Description copied from interface: PropertiesProvider
Return a map of user properties. What to store and which keys to use is largely up to the user of classes implementing this interface, since those classes will generally be oblivious to the map's contents. There are no guarantees regarding the thread-safety of the returned map, unless otherwise specified by implementors.

Specified by:
getProperties in interface PropertiesProvider
Returns:
the map of user properties

getId

public String getId()
Description copied from interface: Identifiable
Return the unique identifier for this object.

Specified by:
getId in interface Identifiable
Returns:

isAuxiliary

public boolean isAuxiliary()
Description copied from interface: PageSegment
Return 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:
isAuxiliary in interface PageSegment
Returns:
true if this page segment is auxiliary, false if it represents "main" page content.

getPermissions

public Permissions<PageSegment> getPermissions()
Description copied from interface: PermissionsProvider
Provides an instance of Permissions. Must never return null.

Specified by:
getPermissions in interface PermissionsProvider<PageSegment>
Returns:
a Permissions object.


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.