Class CubicRotationTransition
- java.lang.Object
-
- org.eclipse.nebula.effects.stw.Transition
-
- org.eclipse.nebula.effects.stw.transitions.CubicRotationTransition
-
public class CubicRotationTransition extends Transition
A cubic rotation effect. Showing two sides of a cube, the cube rotates from one side to the other side.
-
-
Field Summary
Fields Modifier and Type Field Description private double_a1private double_a2private org.eclipse.swt.graphics.Image_bgImageprivate double_destHeightprivate double_destHeight0private double_destHeightV0private double_destWidthprivate double_destWidth0private double_destWidthV0private double_dx1private double_dx2private double_dy1private double_dy2private boolean_flag1private org.eclipse.swt.graphics.ImageData_fromDataprivate int_hprivate int_halfHprivate long_halfTprivate int_halfWprivate org.eclipse.swt.graphics.ImageData_imgDataBufferprivate org.eclipse.swt.graphics.ImageData_imgDataToDrawprivate double_qualityprivate double_ratio1private double_ratio2private double_remainedSizeprivate long_t1private org.eclipse.swt.graphics.ImageData_toDataprivate long_tSqrdprivate double_v0private int_wprivate double_xprivate double_x0private double_x1private double_x2private double_yprivate double_y0private double_y1private double_y2-
Fields inherited from class org.eclipse.nebula.effects.stw.Transition
_fps, _T, _transitionManager, DEFAULT_FPS, DEFAULT_T, DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_UP, IS_LINUX_OS, IS_MAC_OS
-
-
Constructor Summary
Constructors Constructor Description CubicRotationTransition(TransitionManager transitionManager)This constructor creates a CubicRotationTransition with number of frames per second ofTransition.DEFAULT_FPSand total transition time ofTransition.DEFAULT_Tmilliseconds.CubicRotationTransition(TransitionManager transitionManager, long fps, long T)This constructor creates a CubicRotationTransition with number of frames per second offpsand total transition time ofTmilliseconds.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddrawImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image src, org.eclipse.swt.graphics.ImageData srcData, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)Draw an image to a graphics context object.private voiddrawImageData(org.eclipse.swt.graphics.ImageData srcData, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)Draw an image to the image data buffer object that contains all the image data to be drawn to the graphics context object.protected voidendTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)doublegetQuality()Returns a percentage representing the quality of image slicingprivate voidinitImgDataBuffers(org.eclipse.swt.graphics.GC gc, double direction)Initialize the image data buffers, used to draw the transition instead of drawing into the graphics context object directly.protected voidinitTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)voidsetQuality(double quality)Sets the quality of image slicing as a percentage in the interval from 0 to 100 inclusiveprotected voidstepTransition(long t, org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)private booleanuseDataBuffersToDraw()-
Methods inherited from class org.eclipse.nebula.effects.stw.Transition
doEvents, getFPS, getTotalTransitionTime, setFPS, setTotalTransitionTime, start
-
-
-
-
Field Detail
-
_w
private int _w
-
_halfW
private int _halfW
-
_h
private int _h
-
_halfH
private int _halfH
-
_a1
private double _a1
-
_a2
private double _a2
-
_x
private double _x
-
_y
private double _y
-
_x0
private double _x0
-
_y0
private double _y0
-
_v0
private double _v0
-
_flag1
private boolean _flag1
-
_fromData
private org.eclipse.swt.graphics.ImageData _fromData
-
_toData
private org.eclipse.swt.graphics.ImageData _toData
-
_imgDataBuffer
private org.eclipse.swt.graphics.ImageData _imgDataBuffer
-
_imgDataToDraw
private org.eclipse.swt.graphics.ImageData _imgDataToDraw
-
_bgImage
private org.eclipse.swt.graphics.Image _bgImage
-
_halfT
private long _halfT
-
_t1
private long _t1
-
_tSqrd
private long _tSqrd
-
_dy1
private double _dy1
-
_dx1
private double _dx1
-
_dx2
private double _dx2
-
_dy2
private double _dy2
-
_x1
private double _x1
-
_y1
private double _y1
-
_x2
private double _x2
-
_y2
private double _y2
-
_destHeight
private double _destHeight
-
_destWidth
private double _destWidth
-
_destHeight0
private double _destHeight0
-
_destWidth0
private double _destWidth0
-
_destHeightV0
private double _destHeightV0
-
_destWidthV0
private double _destWidthV0
-
_ratio1
private double _ratio1
-
_ratio2
private double _ratio2
-
_remainedSize
private double _remainedSize
-
_quality
private double _quality
-
-
Constructor Detail
-
CubicRotationTransition
public CubicRotationTransition(TransitionManager transitionManager)
This constructor creates a CubicRotationTransition with number of frames per second ofTransition.DEFAULT_FPSand total transition time ofTransition.DEFAULT_Tmilliseconds. It is similar to new CubicRotationTransition(transitionManager,Transition.DEFAULT_FPS,Transition.DEFAULT_T)- Parameters:
transitionManager- the transition manager to be used to manage transitions
-
CubicRotationTransition
public CubicRotationTransition(TransitionManager transitionManager, long fps, long T)
This constructor creates a CubicRotationTransition with number of frames per second offpsand total transition time ofTmilliseconds.- Parameters:
transitionManager- the transition manager to be used to manage transitionsfps- number of frames per secondT- the total time the transition effect will take in milliseconds
-
-
Method Detail
-
initTransition
protected void initTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)- Specified by:
initTransitionin classTransition
-
initImgDataBuffers
private void initImgDataBuffers(org.eclipse.swt.graphics.GC gc, double direction)Initialize the image data buffers, used to draw the transition instead of drawing into the graphics context object directly.- Parameters:
gc- Graphics context where to initialize the background image object.direction- Direction to be used as a reference to initialize the image data buffers.
-
useDataBuffersToDraw
private boolean useDataBuffersToDraw()
- Returns:
- true if the application will use the data buffers to draw the image, false if the buffers won't be used and the image will be drawn directly to the graphics context object instead.
-
drawImage
private void drawImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image src, org.eclipse.swt.graphics.ImageData srcData, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)Draw an image to a graphics context object. The image can be drawn using image data buffers before drawing to the graphics context object, or drawn directly to the graphics context object.- Parameters:
gc- Graphics context object to draw the image to.src- the source image.srcData- image data of the source image.srcX- the x coordinate in the source image to copy fromsrcY- the y coordinate in the source image to copy fromsrcWidth- the width in pixels to copy from the sourcesrcHeight- the height in pixels to copy from the sourcedestX- the x coordinate in the destination to copy todestY- the y coordinate in the destination to copy todestWidth- the width in pixels of the destination rectangledestHeight- the height in pixels of the destination rectangle
-
drawImageData
private void drawImageData(org.eclipse.swt.graphics.ImageData srcData, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)Draw an image to the image data buffer object that contains all the image data to be drawn to the graphics context object.- Parameters:
srcData- image data of the source image.srcX- the x coordinate in the source image to copy fromsrcY- the y coordinate in the source image to copy fromsrcWidth- the width in pixels to copy from the sourcesrcHeight- the height in pixels to copy from the sourcedestX- the x coordinate in the destination to copy todestY- the y coordinate in the destination to copy todestWidth- the width in pixels of the destination rectangledestHeight- the height in pixels of the destination rectangle
-
stepTransition
protected void stepTransition(long t, org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)- Specified by:
stepTransitionin classTransition
-
endTransition
protected void endTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)- Specified by:
endTransitionin classTransition
-
setQuality
public void setQuality(double quality)
Sets the quality of image slicing as a percentage in the interval from 0 to 100 inclusive- Parameters:
quality- is a percentage from 0 to 100 inclusive
-
getQuality
public double getQuality()
Returns a percentage representing the quality of image slicing- Returns:
- a percentage representing the quality of image slicing
-
-