com.levigo.jadice.document
Class BasicPage

java.lang.Object
  extended by com.levigo.jadice.document.AbstractPage
      extended by com.levigo.jadice.document.BasicPage
All Implemented Interfaces:
Page, PropertiesProvider

public class BasicPage
extends AbstractPage

Represents a page of a Document.

The Page provides additional page specific information of a document. This may be ModelElements, containing the actual representation of the document, like annotations or document content or some page specific metadata.


Field Summary
 
Fields inherited from class com.levigo.jadice.document.AbstractPage
listenerSupport
 
Fields inherited from interface com.levigo.jadice.document.Page
PROPERTY_PREFIX_USER_PROPERTY
 
Constructor Summary
BasicPage()
          Construct a new Page and attach it to the given Document.
 
Method Summary
 void add(DocumentLayer layer, PageSegment pageSegment)
          Adds given page segment at given DocumentLayer.
 DocumentLayer getDocumentLayer(PageSegment segment)
          Retrieve the DocumentLayer for a given AbstractPageSegment
 Set<DocumentLayer> getLayers()
          Return the DocumentLayers for which this page has a page segment.
 PageSegment getPageSegment(DocumentLayer layer)
          Retrieve the ModelElement at a given DocumentLayer
 Collection<PageSegment> getPageSegments()
          Return the PageSegments this page holds.
 Map<DocumentLayer,PageSegment> getSegmentMap()
          Return the map of DocumentLayers to PageSegments.
 Dimension2D getSize()
          Get the raw size of the page in base units.
 void remove(DocumentLayer layer)
          Removes the page segment at the given DocumentLayer.
 String toString()
           
 
Methods inherited from class com.levigo.jadice.document.AbstractPage
addPageListener, getModCount, getProperties, removePageListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicPage

public BasicPage()
Construct a new Page and attach it to the given Document.

Method Detail

getPageSegment

public PageSegment getPageSegment(DocumentLayer layer)
Retrieve the ModelElement at a given DocumentLayer

Parameters:
layer - the layer for which to extract the page segment.
Returns:
a ModelElement or null if there is no page segment at the specified layer.

getDocumentLayer

public DocumentLayer getDocumentLayer(PageSegment segment)
Retrieve the DocumentLayer for a given AbstractPageSegment

Parameters:
segment - the page segment for which to extract the layer.
Returns:
a DocumentLayer or null if there is no layer for the specified page segment.

add

public void add(DocumentLayer layer,
                PageSegment pageSegment)
Adds given page segment at given DocumentLayer.

Parameters:
layer - the layer at which to add the segment.
pageSegment - the page segment to add

remove

public void remove(DocumentLayer layer)
Removes the page segment at the given DocumentLayer.

Parameters:
layer - the layer at which to add the segment.

getSize

public Dimension2D getSize()
Get the raw size of the page in base units.

Returns:
Dimension the raw size

getLayers

public Set<DocumentLayer> getLayers()
Return the DocumentLayers for which this page has a page segment.

Returns:
the DocumentLayers in an unordered set.

getPageSegments

public Collection<PageSegment> getPageSegments()
Return the PageSegments this page holds.

Returns:
the PageSegments in an unordered set.

toString

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

getSegmentMap

public Map<DocumentLayer,PageSegment> getSegmentMap()
Description copied from interface: Page
Return the map of DocumentLayers to PageSegments. Depending on the implementation of this interface, the returned map may be "live" or read-only.

Specified by:
getSegmentMap in interface Page
Overrides:
getSegmentMap in class AbstractPage
Returns:
the map of DocumentLayers to PageSegments.


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