com.flagstone.transform
Class TabOrder

java.lang.Object
  extended by com.flagstone.transform.TabOrder
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class TabOrder
extends Object
implements MovieTag

The TabOrder class is used to set the tabbing order of text fields, movie clips and buttons visible on the display list.

The objects are referenced by the number of the layer on which they displayed rather than the unique identifier. This differs from the other classes in the framework but it does allow objects creating at run-time by ActionScript statements to be referenced.


Field Summary
static int MAX_TAB
          The highest index when defining an objects tab order.
 
Constructor Summary
TabOrder(int level, int idx)
          Construct a TabOrder object that set the tab order for the object on the display list at the specified layer.
TabOrder(SWFDecoder coder)
          Creates and initialises a TabOrder object using values encoded in the Flash binary format.
TabOrder(TabOrder object)
          Creates and initialises a TabOrder object using the values copied from another TabOrder object.
 
Method Summary
 TabOrder copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 int getIndex()
          Get the index of the object in the tabbing order.
 int getLayer()
          Get the layer number which contains the object assigned to the tabbing order.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setIndex(int idx)
          Sets the index of the object in the tabbing order.
 void setLayer(int level)
          Sets the layer number which contains the object assigned to the tabbing order.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_TAB

public static final int MAX_TAB
The highest index when defining an objects tab order.

See Also:
Constant Field Values
Constructor Detail

TabOrder

public TabOrder(SWFDecoder coder)
         throws IOException
Creates and initialises a TabOrder object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

TabOrder

public TabOrder(int level,
                int idx)
Construct a TabOrder object that set the tab order for the object on the display list at the specified layer.

Parameters:
level - the layer number which contains the object assigned to the tabbing order. Must be in the range 1..65535.
idx - the index of the object in the tabbing order. Must be in the range 0..65535.

TabOrder

public TabOrder(TabOrder object)
Creates and initialises a TabOrder object using the values copied from another TabOrder object.

Parameters:
object - a TabOrder object from which the values will be copied.
Method Detail

getLayer

public int getLayer()
Get the layer number which contains the object assigned to the tabbing order.

Returns:
the layer number.

setLayer

public void setLayer(int level)
Sets the layer number which contains the object assigned to the tabbing order.

Parameters:
level - the layer number. Must be in the range 1..65535.

getIndex

public int getIndex()
Get the index of the object in the tabbing order.

Returns:
the order in which the object will get keyboard focus.

setIndex

public void setIndex(int idx)
Sets the index of the object in the tabbing order.

Parameters:
idx - the index in the tabbing order. Must be in the range 0..65535.

copy

public TabOrder copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.