|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.button.ButtonShape
public final class ButtonShape
ButtonShape identifies the shape that is drawn when a button is in a particular state. Shapes can be drawn for each of three button states, Over, Up and Down allowing simple animations to be created when a button is clicked.
A shape is also used to define active area of the button. When defining the active area the outline of the shape defines the boundary of the area, the shape itself is not displayed. The button will only respond to mouse events when the cursor is placed inside the active area.
The order in which shapes are displayed is controlled by the layer number. As with the Flash Player's display list shapes on a layer with a higher number are displayed in front of ones on a layer with a lower number. A coordinate and color transform can also be applied to each shape to change its appearance when it is displayed when the button enters the specified state.
DefineButton
,
DefineButton2
Constructor Summary | |
---|---|
ButtonShape()
Creates am uninitialised ButtonShape object. |
|
ButtonShape(ButtonShape object)
Creates and initialises a ButtonShape object using the values copied from another ButtonShape object. |
|
ButtonShape(SWFDecoder coder,
Context context)
Creates and initialises a ButtonShape object using values encoded in the Flash binary format. |
Method Summary | |
---|---|
ButtonShape |
add(Filter filter)
Add a Filter to the list of Filters that will be applied to the shape. |
ButtonShape |
addState(ButtonState buttonState)
Add the state to the list of states that the shape is displayed for. |
ButtonShape |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
Blend |
getBlend()
Get the Blend that defines how the shape is blended with background shapes that make up the button. |
ColorTransform |
getColorTransform()
Get the colour transform that will be applied to the button. |
List<Filter> |
getFilters()
Get the list of Filters that will be applied to the shape. |
int |
getIdentifier()
Get the unique identifier of the shape that this Button applies to. |
int |
getLayer()
Get the layer that the button will be displayed on. |
Set<ButtonState> |
getState()
Get the list of states that the shape is displayed for. |
CoordTransform |
getTransform()
Get the coordinate transform that will be applied to the button. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
ButtonShape |
setBlend(Blend mode)
Set the Blend that defines how the shape is blended with background shapes that make up the button. |
ButtonShape |
setColorTransform(ColorTransform cxform)
Sets the colour transform that will be applied to the shape to change it's colour. |
ButtonShape |
setFilters(List<Filter> list)
Set the list of Filters that will be applied to the shape. |
ButtonShape |
setIdentifier(int uid)
Sets the unique identifier of the DefineShape, DefineShape2 or DefineShape3 object that defines the appearance of the button when it is in the specified state(s). |
ButtonShape |
setLayer(int aNumber)
Sets the layer in the display list that the shape will be displayed on. |
ButtonShape |
setState(Set<ButtonState> states)
Set the list of states that the shape is displayed for. |
ButtonShape |
setTransform(CoordTransform matrix)
Sets the coordinate transform that will be applied to the shape to change it's appearance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ButtonShape(SWFDecoder coder, Context context) throws IOException
coder
- an SWFDecoder object that contains the encoded Flash data.context
- a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException
- if an error occurs while decoding the data.public ButtonShape()
public ButtonShape(ButtonShape object)
object
- a ButtonShape object from which the values will be
copied.Method Detail |
---|
public Set<ButtonState> getState()
public ButtonShape setState(Set<ButtonState> states)
states
- the list of button states that define when the shape is
displayed.
public ButtonShape addState(ButtonState buttonState)
buttonState
- the state that defines when the shape is displayed.
public int getIdentifier()
public ButtonShape setIdentifier(int uid)
uid
- the unique identifier of the shape object that defines the
shape's appearance. Must be in the range 1..65535.
public int getLayer()
public ButtonShape setLayer(int aNumber)
aNumber
- the number of the layer in the display list where the shape is
drawn. Must be in the range 1..65535.
public CoordTransform getTransform()
public ButtonShape setTransform(CoordTransform matrix)
matrix
- a CoordTransform object that will be applied to the shape.
Must not be null.
public ColorTransform getColorTransform()
public ButtonShape setColorTransform(ColorTransform cxform)
cxform
- a ColorTransform object that will be applied to the shape.
Must not be null, even if the ButtonShape will be added to a
DefineButton object.
public ButtonShape add(Filter filter)
filter
- a Filter to apply to the button shape.
public List<Filter> getFilters()
public ButtonShape setFilters(List<Filter> list)
list
- a list of Filter objects.
public Blend getBlend()
public ButtonShape setBlend(Blend mode)
mode
- the Blend mode for this shape.
public ButtonShape copy()
copy
in interface Copyable<ButtonShape>
public String toString()
toString
in class Object
public int prepareToEncode(Context context)
prepareToEncode
in interface SWFEncodeable
context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder, Context context) throws IOException
encode
in interface SWFEncodeable
coder
- an SWFEncoder object.context
- an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException
- if an error occurs while encoding the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |