Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfPagePresentation

java.lang.Object
  extended bycom.gnostice.pdfone.PdfPagePresentation
All Implemented Interfaces:
Cloneable

public class PdfPagePresentation
extends Object
implements Cloneable

This class represents a PDF page transition. A page transition specifies a certain graphical special effects to applied when a page is displayed on a viewer application. If a pages in a document are to be displayed as a slide show, then transitions can make the display of the pages more attractive. Several types of transitions have been defined in this class - one of which can be applied to a page.

// Create a PDF page
PdfPage page1 = new PdfPage(PdfPageSize.A4);

// Create a transition
PdfPagePresentation pp = new PdfPagePresentation();
pp.setTransitionDuration(2);
pp.setFlyTransitionEndScale(1);
pp.setTransitionDirection(90);
pp.setFlyTransitionAreaOpaque(true);
pp.setTransitionDimension(PdfPagePresentation.VERTICAL);
pp.setTransitionMotion(PdfPagePresentation.OUTWARD);
pp.setTransitionStyle(PdfPagePresentation.GLITTER);

// Apply transitiont to the page
page1.setPresentation(pp);

page1.drawCircle(new PdfPoint(300, 300), 100, false, true);

// Create another page
PdfPage page2 = (PdfPage) page1.clone();
page2.writeText("Page 2", 250, 250, 45.0);

// Modify the transition 
pp.setTransitionStyle(PdfPagePresentation.DISSOLVE);
// Apply the modified transition to the second page  
page2.setPresentation(pp);


Field Summary
static int BLINDS
          Constant specifying a transition style where horizontal or vertical blinds that sweep downward or to the right to display the page.
static int BOTTOM_TO_TOP
          Transition direction constant specifying transition effect that moves at 90 degrees to the left-to-right direction (counting counterclockwise).
static int BOX
          Constant specifying a transition style where a box that either moves from the edges to the center or otherwise to reveal the page.
static int COVER
          Constant specifying a transition style where the page slides in from the direction specified by setTransitionDirection(int).
static int DISSOLVE
          Constant specifying a transition style where the page is revealed by gradually dissolves the previous page.
static int FADE
          Constant specifying a transition style where the page is gradually displayed, as the previous page fades away.
static int FLY
          Constant specifying a transition style where page elements that are different from the previous page float in or out as specified by setTransitionMotion(int) to a location that is offscreen (except when setTransitionDirection(int) has been called with NONE.
static int GLITTER
          Constant specifying a transition style where the page is displayed gradually, as wide band moves from one side of the previous page to the other side in the direction specified by setTransitionDirection(int).
static int HORIZONTAL
          Constant specifying that a transition effect occurs horizontally.
static int INWARD
          Constant specifying that a transition effect moves invward.
static int LEFT_TO_RIGHT
          Transition direction constant specifying transition effect that moves at 0 degrees to the left-to-right direction (counting counterclockwise).
static String NONE
          Transition direction constant specifying that page elements different from the previous page do not float but simply scale their size to or from the value specified by setFlyTransitionEndScale(double).
static int OUTWARD
          Constant specifying that a transition effect moves outward.
static int PUSH
          Constant specifying a transition style where the page pushes out the previous page in the direction specified by setTransitionDirection(int).
static int REPLACE
          Constant specifying a transition style with no effect.
static int RIGHT_TO_LEFT
          Transition direction constant specifying transition effect that moves at 180 degrees to the left-to-right direction (counting counterclockwise).
static int SPLIT
          Constant specifying a transition style where two lines sweep across to display the page.
static int TOP_LEFT__TO__BOTTOM_RIGHT
          Transition direction constant specifying transition effect that moves at 315 degrees to the left-to-right direction (counting counterclockwise).
static int TOP_TO_BOTTOM
          Transition direction constant specifying transition effect that moves at 270 degrees to the left-to-right direction (counting counterclockwise).
static int UNCOVER
          Constant specifying a transition style where the page is revealed, as the previous page slides off the direction specified by setTransitionDirection(int).
static int VERTICAL
          Constant specifying that a transition effect occurs vertically.
static int WIPE
          Constant specifying a transition style where a single line sweeps across the screen in the direction specified by setTransitionDirection(int) to revealing the new page.
 
Constructor Summary
PdfPagePresentation()
           
 
Method Summary
 Object clone()
           
 double getFlyTransitionEndScale()
          Returns starting or ending scale at which page elements that are different from the previous page will be scaled during the transition.
 int getTransitionDimension()
          Returns dimension in which a transition occurs.
 int getTransitionDirection()
          Returns angle of the direction in which transition effect moves.
 double getTransitionDuration()
          Returns time (in seconds) taken to display the transition.
 int getTransitionMotion()
          Returns direction of the motion of a transition.
 int getTransitionStyle()
          Returns style of the transition
 boolean isFlyTransitionAreaOpaque()
          Returns whether the area that floats during the transition is opaque.
 void setFlyTransitionAreaOpaque(boolean flyTransitionAreaOpaque)
          Specifies whether the area that floats during the transition needs to be opaque.
 void setFlyTransitionEndScale(double flyTransitionEndScale)
          Specifies starting or ending scale at which page elements that are different from the previous page need to be scaled during the transition.
 void setTransitionDimension(int transitionDimension)
          Specifies dimension in which a transition needs to occur.
 void setTransitionDirection(int transitionDirection)
          Specifies angle of the direction in which transition effect moves.
 void setTransitionDuration(double transitionDuration)
          Specifies time that needs to be taken to display the transition.
 void setTransitionMotion(int transitionMotion)
          Specifies direction of the motion of the transition effect.
 void setTransitionStyle(int transitionStyle)
          Specifies style of the transition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPLIT

public static final int SPLIT
Constant specifying a transition style where two lines sweep across to display the page. Whether the lines sweep horizontally or verically can be specfiied by setTransitionDimension(int). Whether lines move inward or outward can be specified by calling setTransitionMotion(int).

See Also:
Constant Field Values

BLINDS

public static final int BLINDS
Constant specifying a transition style where horizontal or vertical blinds that sweep downward or to the right to display the page. Call setTransitionDimension(int) to whether the blinds have to be horizontal or vertical.

See Also:
Constant Field Values

BOX

public static final int BOX
Constant specifying a transition style where a box that either moves from the edges to the center or otherwise to reveal the page. Call setTransitionMotion(int) to specify how the box moves.

See Also:
Constant Field Values

WIPE

public static final int WIPE
Constant specifying a transition style where a single line sweeps across the screen in the direction specified by setTransitionDirection(int) to revealing the new page.

See Also:
Constant Field Values

DISSOLVE

public static final int DISSOLVE
Constant specifying a transition style where the page is revealed by gradually dissolves the previous page.

See Also:
Constant Field Values

GLITTER

public static final int GLITTER
Constant specifying a transition style where the page is displayed gradually, as wide band moves from one side of the previous page to the other side in the direction specified by setTransitionDirection(int).

See Also:
Constant Field Values

REPLACE

public static final int REPLACE
Constant specifying a transition style with no effect. The page simply replaces the previous page and ignores any value set by setTransitionDuration(double).

See Also:
Constant Field Values

FLY

public static final int FLY
Constant specifying a transition style where page elements that are different from the previous page float in or out as specified by setTransitionMotion(int) to a location that is offscreen (except when setTransitionDirection(int) has been called with NONE.

See Also:
Constant Field Values

PUSH

public static final int PUSH
Constant specifying a transition style where the page pushes out the previous page in the direction specified by setTransitionDirection(int).

See Also:
Constant Field Values

COVER

public static final int COVER
Constant specifying a transition style where the page slides in from the direction specified by setTransitionDirection(int).

See Also:
Constant Field Values

UNCOVER

public static final int UNCOVER
Constant specifying a transition style where the page is revealed, as the previous page slides off the direction specified by setTransitionDirection(int).

See Also:
Constant Field Values

FADE

public static final int FADE
Constant specifying a transition style where the page is gradually displayed, as the previous page fades away.

See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
Constant specifying that a transition effect occurs horizontally.

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Constant specifying that a transition effect occurs vertically.

See Also:
Constant Field Values

INWARD

public static final int INWARD
Constant specifying that a transition effect moves invward.

See Also:
Constant Field Values

OUTWARD

public static final int OUTWARD
Constant specifying that a transition effect moves outward.

See Also:
Constant Field Values

LEFT_TO_RIGHT

public static final int LEFT_TO_RIGHT
Transition direction constant specifying transition effect that moves at 0 degrees to the left-to-right direction (counting counterclockwise).

See Also:
Constant Field Values

BOTTOM_TO_TOP

public static final int BOTTOM_TO_TOP
Transition direction constant specifying transition effect that moves at 90 degrees to the left-to-right direction (counting counterclockwise).

See Also:
Constant Field Values

RIGHT_TO_LEFT

public static final int RIGHT_TO_LEFT
Transition direction constant specifying transition effect that moves at 180 degrees to the left-to-right direction (counting counterclockwise).

See Also:
Constant Field Values

TOP_TO_BOTTOM

public static final int TOP_TO_BOTTOM
Transition direction constant specifying transition effect that moves at 270 degrees to the left-to-right direction (counting counterclockwise).

See Also:
Constant Field Values

TOP_LEFT__TO__BOTTOM_RIGHT

public static final int TOP_LEFT__TO__BOTTOM_RIGHT
Transition direction constant specifying transition effect that moves at 315 degrees to the left-to-right direction (counting counterclockwise).

See Also:
Constant Field Values

NONE

public static final String NONE
Transition direction constant specifying that page elements different from the previous page do not float but simply scale their size to or from the value specified by setFlyTransitionEndScale(double).

See Also:
Constant Field Values
Constructor Detail

PdfPagePresentation

public PdfPagePresentation()
Method Detail

getTransitionStyle

public int getTransitionStyle()
Returns style of the transition

Returns:
constant specifying style of the transition
See Also:
getTransitionStyle()

setTransitionStyle

public void setTransitionStyle(int transitionStyle)
Specifies style of the transition.

Parameters:
transitionStyle - constant specifying style of the transition
See Also:
getTransitionStyle()

getTransitionDuration

public double getTransitionDuration()
Returns time (in seconds) taken to display the transition.

Returns:
time (in seconds) taken to display the transition
See Also:
setTransitionDuration(double)

setTransitionDuration

public void setTransitionDuration(double transitionDuration)
Specifies time that needs to be taken to display the transition.

Parameters:
transitionDuration - time that needs to be taken to display the transition
See Also:
getTransitionDuration()

getTransitionDimension

public int getTransitionDimension()
Returns dimension in which a transition occurs.

Returns:
constant specifying dimension in which a transition occurs
See Also:
setTransitionDimension(int)

setTransitionDimension

public void setTransitionDimension(int transitionDimension)
Specifies dimension in which a transition needs to occur. This setting is only available for BLINDS and SPLIT transitions. Default dimension is HORIZONTAL.

Parameters:
transitionDimension - either HORIZONTAL or VERTICAL
See Also:
getTransitionDimension()

getTransitionMotion

public int getTransitionMotion()
Returns direction of the motion of a transition.

Returns:
constant specifying direction of the motion of a transition
See Also:
getTransitionMotion()

setTransitionMotion

public void setTransitionMotion(int transitionMotion)
Specifies direction of the motion of the transition effect. Default direction is INWARD. This setting applies only to BOX, FLY, and SPLIT.

Parameters:
transitionMotion - either INWARD or OUTWARD
See Also:
getTransitionMotion()

getTransitionDirection

public int getTransitionDirection()
Returns angle of the direction in which transition effect moves.

Returns:
constant specifying angle of the direction
See Also:
setTransitionDirection(int)

setTransitionDirection

public void setTransitionDirection(int transitionDirection)
Specifies angle of the direction in which transition effect moves. This setting is only available for COVER, FLY, GLITTER, PUSH, UNCOVER, and WIPE transitions. Default angle is LEFT_TO_RIGHT.

Parameters:
transitionDirection - constant specifying angle of the direction in which transition effect moves; any one of
See Also:
getTransitionDirection()

isFlyTransitionAreaOpaque

public boolean isFlyTransitionAreaOpaque()
Returns whether the area that floats during the transition is opaque.

Returns:
whether the area that floats is opaque
See Also:
setFlyTransitionAreaOpaque(boolean)

setFlyTransitionAreaOpaque

public void setFlyTransitionAreaOpaque(boolean flyTransitionAreaOpaque)
Specifies whether the area that floats during the transition needs to be opaque.

Parameters:
flyTransitionAreaOpaque - whether the area that floats needs to be opaque

getFlyTransitionEndScale

public double getFlyTransitionEndScale()
Returns starting or ending scale at which page elements that are different from the previous page will be scaled during the transition.

Returns:
starting or ending scale at which page elements that are different from the previous page will be scaled during the transition
See Also:
setFlyTransitionEndScale(double)

setFlyTransitionEndScale

public void setFlyTransitionEndScale(double flyTransitionEndScale)
Specifies starting or ending scale at which page elements that are different from the previous page need to be scaled during the transition. If setTransitionMotion(int) has been called with INWARD, then changes are scaled from normal size times flyTransitionEndScale to 1. If setTransitionMotion(int) has been called with OUTWARD, then changes are scaled from normal size to normal size times flyTransitionEndScale.

Parameters:
flyTransitionEndScale - starting or ending scale at which page elements that are different from the previous page are scaled during the transition

clone

public Object clone()

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com