quicktime.app.display
Interface QTDisplaySpace

All Superinterfaces:
Collection, Drawable, DynamicCollection, Listener, QTDrawable, Space, Ticklish, Transformable
All Known Implementing Classes:
GroupDrawable, SWCompositor

public interface QTDisplaySpace
extends QTDrawable, Space

This interface defines the minimum API that a QTDisplay space provides. That is, a QTDisplaySpace is some kind of QTDrawable so can be set as a client for a QTCanvas.

As a display space is by definition a collection of objects that have some kind of visual appearance, the display space must manage (or its contained objects) the layering of those objects within the visual presentation of the space. As such, this interface provides an API for retrieving the current front and back most layers of its members, and a way of retrieving the Layerable object for a member that allow the member to both get and set its Layer within the display space. Also a member can be added to the display space specifying the layer at which it should be added. The lower a layer (or z) value the more frontmost the object is displayed at. The backmost layer of a QTDisplaySpace is Short.MAX_VALUE.

Members of display spaces may or may not know about their position and two Dimensional display matrix. As such the QTDisplaySpace also provides an API for retrieving a member's Transformable interface that allows a member to get and set its display matrix.

See Also:
Transformable, Layerable

Fields inherited from interface quicktime.app.time.Ticklish
kScale
 
Method Summary
 boolean addMember(java.lang.Object member, int layer)
          Adds a member to the QTDisplaySpace at the specified layer.
 int getBackLayer()
          Returns the layer of the backmost member in the display space.
 int getFrontLayer()
          Returns the layer of the frontmost member in the display space.
 Layerable getLayerable(java.lang.Object member)
          Returns the Layerable object for a member (or null if the Object is not a member) that allows the application to get and set the layer of a member.
 Transformable getTransformable(java.lang.Object member)
          Returns the Transformable object that represents the member in the DisplaySpace.
 java.lang.Object hitTest(int x, int y)
          Return the frontmost object that is located at the specified coordinates.
 
Methods inherited from interface quicktime.app.display.QTDrawable
getClip, getGWorld, setClip, setGWorld, setLocation
 
Methods inherited from interface quicktime.app.display.Drawable
getDisplayBounds, redraw, setDisplayBounds
 
Methods inherited from interface quicktime.app.spaces.Listener
addedTo, removedFrom
 
Methods inherited from interface quicktime.app.image.Transformable
getMatrix, getOriginalSize, setMatrix
 
Methods inherited from interface quicktime.app.spaces.Space
addController, controllers, getSource, getTimer, removeController, tickleList
 
Methods inherited from interface quicktime.app.spaces.DynamicCollection
getProtocol
 
Methods inherited from interface quicktime.app.spaces.Collection
addMember, hasMember, isAppropriate, isEmpty, members, removeMember, size
 
Methods inherited from interface quicktime.app.time.Ticklish
tickle, timeChanged
 

Method Detail

getFrontLayer

public int getFrontLayer()
                  throws QTException
Returns the layer of the frontmost member in the display space.
Returns:
an int

getBackLayer

public int getBackLayer()
                 throws QTException
Returns the layer of the backmost member in the display space.
Returns:
an int

getLayerable

public Layerable getLayerable(java.lang.Object member)
Returns the Layerable object for a member (or null if the Object is not a member) that allows the application to get and set the layer of a member. This may or may not be the member itself, depending both on the type of the object of the member and the manner in which the QTDisplaySpace handles the Layer property of its members.
Parameters:
member - the member
Returns:
a Layerable object to interact with the display layer of a member.

getTransformable

public Transformable getTransformable(java.lang.Object member)
Returns the Transformable object that represents the member in the DisplaySpace. The Transformable object allows the application to get and set the TwoD display characteristics of a member (position, size, rotation, skewing, perspective). If the Object is not a member of the Space this returns null. This may or may not return the member itself, based on the type of the member and how the Space deals with the two dimensional placement and display of its members.
Parameters:
member - the member of Space for which the Transformable object should be returned.
Returns:
a Transformable object that allows the application to manipulate the two d display characteristics of the member or null if the object is not a member.

addMember

public boolean addMember(java.lang.Object member,
                         int layer)
                  throws QTException
Adds a member to the QTDisplaySpace at the specified layer. If the member is not an appropriate type of object for the Space this method returns false and the member is not added.
Parameters:
member - the member to add to the Display Space
layer - the layer of the member when added.
Returns:
true if the member was appropriate and was added to the space, otherwise false

hitTest

public java.lang.Object hitTest(int x,
                                int y)
                         throws QTException
Return the frontmost object that is located at the specified coordinates. Hit test coordinates will take into account the location of the space thus if the space is at 50, 50 and an object is located in the top,left of the space then the hit test coords for the first pixel of this object is 50, 50.
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
an Object at that coordinate or null if no object at specified coordinate