com.levigo.jadice.document
Class Pages

java.lang.Object
  extended by com.levigo.jadice.document.Pages

public class Pages
extends Object

This utility class contains various methods for gaining information about given Pages.

Since:
jadice document platform 5.0

Method Summary
static Format getBaseFormat(Page page)
           Returns the base format of the given page.
static Format getBaseFormat(Page page, DocumentLayer layer)
           Returns the base format of the given layer in the given Page.
static Dimension getRenderedSize(Page page, RenderControls rc)
          Calculates the rendered size of the given page taking into account the given RenderControls.
static Dimension getScaledSize(Page page, RenderControls rc)
          Calculates the rendered size of the given page taking into account the given RenderControls, but disregarding page rotation.
static Dimension2D getSize(Page page, Unit u)
          Calculates the size of the given page using the given Unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSize

public static Dimension2D getSize(Page page,
                                  Unit u)
Calculates the size of the given page using the given Unit.

Parameters:
page - the Page of which to determine the size
Returns:
the size the given Unit
See Also:
getScaledSize(Page, RenderControls)

getRenderedSize

public static Dimension getRenderedSize(Page page,
                                        RenderControls rc)
Calculates the rendered size of the given page taking into account the given RenderControls. Three factors of the render controls influence the rotated size:

Parameters:
page - the Page of which to determine the rendered size
rc - provides the parameters to calculate the rendered size
Returns:
the size in device units
Throws:
NullPointerException - if one of the arguments is null.
See Also:
getScaledSize(Page, RenderControls)

getScaledSize

public static Dimension getScaledSize(Page page,
                                      RenderControls rc)
Calculates the rendered size of the given page taking into account the given RenderControls, but disregarding page rotation. Two factors of the render controls influence the rotated size:

Parameters:
page - the Page of which to determine the rendered size
rc - provides the parameters to calculate the rendered size
Returns:
the size in device units
Throws:
NullPointerException - if one of the arguments is null.
See Also:
getRenderedSize(Page, RenderControls)

getBaseFormat

public static Format getBaseFormat(Page page)

Returns the base format of the given page.

Detects the document's default layer and obtains the containing page segments format. If the document does not contain a default layer or no page segment is placed in the default layer this method throws a NullPointerException.

Parameters:
page - the Page of which to determine the base format
Returns:
the Format the AbstractPageSegment in the document's default layer represents
See Also:
getBaseFormat(Page, DocumentLayer)

getBaseFormat

public static Format getBaseFormat(Page page,
                                   DocumentLayer layer)

Returns the base format of the given layer in the given Page. Detects the given DocumentLayer and obtains the containing AbstractPageSegment's format.

If given page is null, the document does not contain such a layer or no page segment is placed in this layer this method throws a NullPointerException.

Parameters:
page - the Page of which to determine the base format
layer - the layer of the searched page segment format
Returns:
the Format the AbstractPageSegment in the given layer represents


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