flash.display
Class DisplayObject

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by flash.events.EventDispatcher
          extended by flash.display.DisplayObject
Direct Known Subclasses:
Bitmap, InteractiveObject, Shape

public class DisplayObject
extends EventDispatcher

Implementation of flash.display.DisplayObject


Field Summary
static EventType ADDED
          Dispatched when a display object is added to the display list.
static EventType ADDED_TO_STAGE
          Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.
static EventType ENTERFRAME
          Dispatched when the playhead is entering a new frame.
static EventType REMOVED
          Dispatched when a display object is about to be removed from the display list.
static EventType REMOVED_FROM_STAGE
          Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.
static EventType RENDER
          Dispatched when the display list is about to be updated and rendered.
 
Fields inherited from class flash.events.EventDispatcher
ACTIVATE, DEACTIVATE
 
Constructor Summary
protected DisplayObject()
           
 
Method Summary
 double getAlpha()
          Indicates the alpha transparency value of the object specified.
 BlendMode getBlendMode()
          A value from the BlendMode class that specifies which blend mode to use.
 Rectangle getBounds(DisplayObject targetCoordinateSpace)
          Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
 boolean getCacheAsBitmap()
          If set to true, Flash Player or Adobe AIR caches an internal bitmap representation of the display object.
 com.google.gwt.core.client.JsArray<BitmapFilter> getFilters()
          An indexed array that contains each filter object currently associated with the display object.
 int getHeight()
          Indicates the height of the display object, in pixels.
 LoaderInfo getLoaderInfo()
          Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
 DisplayObject getMask()
          The calling display object is masked by the specified mask object.
 double getMouseX()
          [read-only] Indicates the x coordinate of the mouse position, in pixels.
 double getMouseY()
          Indicates the y coordinate of the mouse position, in pixels.
 String getName()
          Indicates the instance name of the DisplayObject.
 DisplayObjectContainer getParent()
          Indicates the DisplayObjectContainer object that contains this display object.
 Rectangle getRect(DisplayObject targetCoordinateSpace)
          Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
 DisplayObject getRoot()
          For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure e represented by that SWF file.
 double getRotation()
          Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
 Rectangle getScale9Grid()
          The current scaling grid that is in effect.
 double getScaleX()
          Indicates the horizontal scale (percentage) of the object as applied from the registration point.
 double getScaleY()
          Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
 Rectangle getScrollRect()
          The scroll rectangle bounds of the display object.
 Stage getStage()
          The Stage of the display object.
 Transform getTransform()
          An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
 int getWidth()
          Indicates the width of the display object, in pixels.
 double getX()
          Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
 double getY()
          Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
 Point globalToLocal(Point point)
          Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.
 boolean hitTestObject(DisplayObject obj)
          Evaluates the display object to see if it overlaps or intersects with the obj display object.
 boolean hitTestPoint(double x, double y, boolean shapeFlag)
          Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
 Point localToGlobal(Point point)
          Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
 void setAlpha(double alpha)
           
 void setBlendMode(BlendMode blendMode)
           
 void setCacheAsBitmap(boolean cache)
           
 void setFilters(com.google.gwt.core.client.JsArray<BitmapFilter> filters)
           
 void setHeight(int height)
           
 void setMask(DisplayObject mask)
           
 void setName(String name)
           
 void setRotation(double rotation)
           
 void setScale9Grid(Rectangle scale9Grid)
           
 void setScaleX(double scaleX)
           
 void setScaleY(double scaleY)
           
 void setScrollRect(Rectangle scrollRect)
           
 void setTransform(float m00, float m01, float m10, float m11, float tx, float ty)
           
 void setTransform(Transform transform)
           
 void setVisible(boolean visible)
           
 void setWidth(int width)
           
 void setX(double x)
           
 void setY(double y)
           
 boolean visible()
          Whether or not the display object is visible.
 
Methods inherited from class flash.events.EventDispatcher
addEventListener, create, dispatchEvent, hasEventListener, removeEventListener, willTrigger
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADDED

public static final EventType ADDED
Dispatched when a display object is added to the display list.


ADDED_TO_STAGE

public static final EventType ADDED_TO_STAGE
Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.


ENTERFRAME

public static final EventType ENTERFRAME
Dispatched when the playhead is entering a new frame.


REMOVED

public static final EventType REMOVED
Dispatched when a display object is about to be removed from the display list.


REMOVED_FROM_STAGE

public static final EventType REMOVED_FROM_STAGE
Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.


RENDER

public static final EventType RENDER
Dispatched when the display list is about to be updated and rendered.

Constructor Detail

DisplayObject

protected DisplayObject()
Method Detail

getAlpha

public final double getAlpha()
Indicates the alpha transparency value of the object specified.


setAlpha

public final void setAlpha(double alpha)

getBlendMode

public final BlendMode getBlendMode()
A value from the BlendMode class that specifies which blend mode to use.

Returns:

setBlendMode

public final void setBlendMode(BlendMode blendMode)

getCacheAsBitmap

public final boolean getCacheAsBitmap()
If set to true, Flash Player or Adobe AIR caches an internal bitmap representation of the display object.

Returns:

setCacheAsBitmap

public final void setCacheAsBitmap(boolean cache)

getFilters

public final com.google.gwt.core.client.JsArray<BitmapFilter> getFilters()
An indexed array that contains each filter object currently associated with the display object.


setFilters

public final void setFilters(com.google.gwt.core.client.JsArray<BitmapFilter> filters)

getHeight

public final int getHeight()
Indicates the height of the display object, in pixels.

Returns:

setHeight

public final void setHeight(int height)

getLoaderInfo

public final LoaderInfo getLoaderInfo()
Returns a LoaderInfo object containing information about loading the file to which this display object belongs.

Returns:

getMask

public final DisplayObject getMask()
The calling display object is masked by the specified mask object.


setMask

public final void setMask(DisplayObject mask)

getMouseX

public final double getMouseX()
[read-only] Indicates the x coordinate of the mouse position, in pixels.

Returns:

getMouseY

public final double getMouseY()
Indicates the y coordinate of the mouse position, in pixels.

Returns:

getName

public final String getName()
Indicates the instance name of the DisplayObject.


setName

public final void setName(String name)

getParent

public final DisplayObjectContainer getParent()
Indicates the DisplayObjectContainer object that contains this display object.


getRoot

public final DisplayObject getRoot()
For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure e represented by that SWF file.

Returns:

getRotation

public final double getRotation()
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.

Returns:

setRotation

public final void setRotation(double rotation)

getScale9Grid

public final Rectangle getScale9Grid()
The current scaling grid that is in effect.

Returns:

setScale9Grid

public final void setScale9Grid(Rectangle scale9Grid)

getScaleX

public final double getScaleX()
Indicates the horizontal scale (percentage) of the object as applied from the registration point.

Returns:

setScaleX

public final void setScaleX(double scaleX)

getScaleY

public final double getScaleY()
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.

Returns:

setScaleY

public final void setScaleY(double scaleY)

getScrollRect

public final Rectangle getScrollRect()
The scroll rectangle bounds of the display object.

Returns:

setScrollRect

public final void setScrollRect(Rectangle scrollRect)

getStage

public final Stage getStage()
The Stage of the display object.

Returns:

getTransform

public final Transform getTransform()
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.

Returns:

setTransform

public final void setTransform(Transform transform)

setTransform

public final void setTransform(float m00,
                               float m01,
                               float m10,
                               float m11,
                               float tx,
                               float ty)
Parameters:
m00 -
m01 -
m10 -
m11 -
ty -
tx -

visible

public final boolean visible()
Whether or not the display object is visible.

Returns:

setVisible

public final void setVisible(boolean visible)

getWidth

public final int getWidth()
Indicates the width of the display object, in pixels.

Returns:

setWidth

public final void setWidth(int width)
Parameters:
width -

getX

public final double getX()
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.

Returns:

getY

public final double getY()
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.

Returns:

setX

public final void setX(double x)

setY

public final void setY(double y)

getBounds

public final Rectangle getBounds(DisplayObject targetCoordinateSpace)
Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.


getRect

public final Rectangle getRect(DisplayObject targetCoordinateSpace)
Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.

Parameters:
targetCoordinateSpace -
Returns:

globalToLocal

public final Point globalToLocal(Point point)
Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.

Parameters:
point -
Returns:

hitTestObject

public final boolean hitTestObject(DisplayObject obj)
Evaluates the display object to see if it overlaps or intersects with the obj display object.

Parameters:
obj -
Returns:

hitTestPoint

public final boolean hitTestPoint(double x,
                                  double y,
                                  boolean shapeFlag)
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.

Parameters:
x -
y -
shapeFlag -
Returns:

localToGlobal

public final Point localToGlobal(Point point)
Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.

Parameters:
point -
Returns:


Copyright © 2012. All Rights Reserved.