|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.TransitionContext
public final class TransitionContext
The TransitionContext class contains all the necessary data to uniquely
describe a transition animation between two screens. An instance of this
class represents one of the following five types of standard animations:
TransitionContext.TRANSITION_FADE
,
TransitionContext.TRANSITION_SLIDE
,
TransitionContext.TRANSITION_WIPE
,
TransitionContext.TRANSITION_ZOOM
, and
TransitionContext.TRANSITION_NONE
.
Each animation type supports a set of attributes that allow its behavior to be customized. More animation types or attributes may be exposed in the future. The following table lists the attributes supported by each type of animation, their valid values, and their default values:
A fade-in transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_IN
) animates
a screen from 0% opacity to 100% opacity. A fade-out transition
(TransitionContext.ATTR_KIND
= TransitionContext.KIND_OUT
) animates a screen from 100% opacity
to 0% opacity.
A slide-in transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_IN
) starts
with the screen outside the bounds of the display and moves it into view.
A slide-out transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_OUT
) starts with
the screen at its current position and moves it off the display. The
direction attribute controls which path the screen takes as it enters or
leaves the display. The style attribute indicates if the incoming screen
slides over the outgoing screen (TransitionContext.ATTR_STYLE
= TransitionContext.STYLE_OVER
)
or if it displaces the outgoing screen as it moves so they both animate
(TransitionContext.ATTR_STYLE
= TransitionContext.STYLE_PUSH
).
A wipe-in transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_IN
) starts with
the screen hidden and animates the clipping region to fully reveal it. A
wipe-out transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_OUT
) starts with the
screen being visible and collapses the clipping region until the screen is
completely hidden. The direction attribute controls which way the clipping
region expands/contracts.
A zoom-in transition (TransitionContext.ATTR_KIND
= TransitionContext.KIND_IN
) scales the
screen image from a size greater/less than 100% to 100%. A zoom-out transition
(TransitionContext.ATTR_KIND
= TransitionContext.KIND_OUT
) scales the screen image from 100% to
a size greater/less than 100%. The scale attribute (TransitionContext.ATTR_SCALE
)
indicates the percentage of the screen's original size to zoom to/from.
The none transition indicates no animation should occur. It is useful because you can setup a screen transition rule that applies to several screens and use the none transition to exclude a particular screen from this rule.
Field Summary | ||
---|---|---|
static int |
ATTR_DIRECTION
Attribute that indicates the path of movement for an animation. |
|
static int |
ATTR_DURATION
Attribute that controls the elapsed time of the transition animation in milliseconds. |
|
static int |
ATTR_KIND
Attribute that indicates whether the incoming or outgoing screen is animated. |
|
static int |
ATTR_SCALE
Attribute that controls the percentage of the screen's original size to zoom to/from. |
|
static int |
ATTR_STYLE
Attribute for the slide transition that controls whether the outgoing screen also animates or not. |
|
static int |
DIRECTION_DOWN
Value for the direction attribute indicating that movement should occur to downwards. |
|
static int |
DIRECTION_LEFT
Value for the direction attribute indicating that movement should occur to the left. |
|
static int |
DIRECTION_RIGHT
Value for the direction attribute indicating that movement should occur to the right. |
|
static int |
DIRECTION_UP
Value for the direction attribute indicating that movement should occur to upwards. |
|
static int |
KIND_IN
Value for the kind attribute that indicates the screen that is pushed or exposed is animated. |
|
static int |
KIND_OUT
Value for the kind attribute that indicates the screen that is popped or hidden is animated. |
|
static int |
STYLE_OVER
Value for the style attribute indicating that the incoming screen slides over the outgoing screen. |
|
static int |
STYLE_PUSH
Value for the style attribute indicating that the incoming screen pushes the outgoing screen off the display. |
|
static int |
TRANSITION_FADE
Constant for a fade transition. |
|
static int |
TRANSITION_NONE
Constant for no transition. |
|
static int |
TRANSITION_SLIDE
Constant for a slide transition. |
|
static int |
TRANSITION_WIPE
Constant for a wipe transition. |
|
static int |
TRANSITION_ZOOM
Constant for a zoom transition. |
Constructor Summary | ||
---|---|---|
TransitionContext(int transitionId)
Creates a new TransitionContext object that represents the specified transition type. |
Method Summary | ||
---|---|---|
void |
clearAllAttributes()
Clears previously set values for all attributes. |
|
void |
clearAttribute(int attrId)
Clears a previously set value for the specified attribute. |
|
IntEnumeration |
enumAttributes()
Returns the id's of all attributes set for this transition. |
|
Object |
getAttribute(int attrId)
Retrieves the value previously set for the specified attribute of this transition. |
|
int |
getAttributeCount()
Returns the number of attributes set for this transition. |
|
int |
getIntAttribute(int attrId)
Retrieves the integer value previously set for the specified attribute of this transition. |
|
int |
getTransitionId()
Returns the transition type represented by this context. |
|
boolean |
isAttributeSet(int attrId)
Checks if the specified attribute is set. |
|
void |
setAttribute(int attrId,
Object attrValue)
Sets a value for the specified attribute of the transition. |
|
void |
setIntAttribute(int attrId,
int attrValue)
Sets an integer value for the specified attribute of the transition. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TRANSITION_FADE
TransitionContext.ATTR_DURATION
and
TransitionContext.ATTR_KIND
.
public static final int TRANSITION_SLIDE
TransitionContext.ATTR_DURATION
,
TransitionContext.ATTR_KIND
,
TransitionContext.ATTR_DIRECTION
, and
TransitionContext.ATTR_STYLE
.
public static final int TRANSITION_WIPE
TransitionContext.ATTR_DURATION
,
TransitionContext.ATTR_KIND
, and
TransitionContext.ATTR_DIRECTION
.
public static final int TRANSITION_ZOOM
TransitionContext.ATTR_DURATION
,
TransitionContext.ATTR_KIND
, and
TransitionContext.ATTR_SCALE
.
public static final int TRANSITION_NONE
public static final int ATTR_DURATION
public static final int ATTR_KIND
TransitionContext.KIND_IN
and
TransitionContext.KIND_OUT
.
public static final int ATTR_DIRECTION
TransitionContext.DIRECTION_LEFT
,
TransitionContext.DIRECTION_RIGHT
,
TransitionContext.DIRECTION_UP
, and
TransitionContext.DIRECTION_DOWN
.
public static final int ATTR_STYLE
TransitionContext.STYLE_PUSH
and
TransitionContext.STYLE_OVER
.
public static final int ATTR_SCALE
public static final int KIND_IN
public static final int KIND_OUT
public static final int DIRECTION_LEFT
public static final int DIRECTION_RIGHT
public static final int DIRECTION_UP
public static final int DIRECTION_DOWN
public static final int STYLE_PUSH
public static final int STYLE_OVER
Constructor Detail |
---|
public TransitionContext(int transitionId)
TransitionContext.TRANSITION_FADE
,
TransitionContext.TRANSITION_SLIDE
,
TransitionContext.TRANSITION_WIPE
,
TransitionContext.TRANSITION_ZOOM
, and
TransitionContext.TRANSITION_NONE
.
transitionId
- The id of the transition this context should
represent.Method Detail |
---|
public int getTransitionId()
public int getAttributeCount()
public IntEnumeration enumAttributes()
public boolean isAttributeSet(int attrId)
attrId
- The unique id of the attribute to check.
public Object getAttribute(int attrId)
attrId
- The unique id of the attribute to retrieve.
IllegalArgumentException
- Thrown if no value was previously
set.public int getIntAttribute(int attrId)
attrId
- The unique id of the attribute to retrieve.
IllegalArgumentException
- Thrown if no value was previously
set or the value is not an integer.public void setAttribute(int attrId, Object attrValue)
attrId
- The unique id of the attribute to set.attrValue
- The value to set for the attribute.
IllegalArgumentException
- Thrown if value is null.public void setIntAttribute(int attrId, int attrValue)
attrId
- The unique id of the attribute to set.attrValue
- The integer value to set for the attribute.public void clearAttribute(int attrId)
attrId
- The unique id of the attribute to clear.public void clearAllAttributes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal