quicktime.app.display
Class GroupDrawable

java.lang.Object
  |
  +--quicktime.app.spaces.SimpleSpace
        |
        +--quicktime.app.display.GroupDrawable
All Implemented Interfaces:
Collection, Drawable, DynamicCollection, Listener, QTDisplaySpace, QTDrawable, Space, Ticklish, Transformable
Direct Known Subclasses:
DirectGroup

Deprecated. since QTJava 6.1

public abstract class GroupDrawable
extends SimpleSpace
implements QTDisplaySpace

This forms the base class for grouping QTDrawable objects within a single display space that is controlled by this group.

QTDrawable are drawn in their layer order (Short.minimum value is frontmost, Short.maximum value is furthest back). You can change a position or size of a member by interacting directly with the QTDrawable member itself but you must notify the group of any changes in the display characteristics of the QTDrawable by calling memberChanged().

QTDrawable members can also be positioned within a GroupDrawable using alignment values. An alignment of 0 will place the member at the top and/or left position. An alignment value of 1 will place the member so that it's bottom and/or right is aligned with the bottom of the GroupDrawable's display space.

To reset the layer of an object you use the QTDrawable's Layerable object. QTDrawable objects do not contain any sense of layering, so the GroupDrawable uses the GroupMember objects to contain the information about a member's layer characteristics.

See Also:
DirectGroup

Field Summary
protected  Region clip
          Deprecated. The current clip region of the group * @deprecated since QTJava 6.1
protected  java.util.Vector vec
          Deprecated. since QTJava 6.1
 
Fields inherited from class quicktime.app.spaces.SimpleSpace
containedSpaces, controllersVec, ticklers, timer
 
Fields inherited from interface quicktime.app.time.Ticklish
kScale
 
Constructor Summary
protected GroupDrawable(java.awt.Dimension initialSize, QDColor bc, int scale, int period, Protocol p)
          Deprecated. since QTJava 4.0
protected GroupDrawable(QDDimension initialSize, QDColor bc, int scale, int period, Protocol p)
          Deprecated. since QTJava 6.1
 
Method Summary
 Region getBackgroundClip()
          Deprecated. since QTJava 6.1
 QDColor getBackgroundColor()
          Deprecated. since QTJava 6.1
 int getBackLayer()
          Deprecated. since QTJava 6.1
 Region getClip()
          Deprecated. since QTJava 6.1
 QDRect getDisplayBounds()
          Deprecated. since QTJava 6.1
 int getFrontLayer()
          Deprecated. since QTJava 6.1
 GroupMember getGroupMember(java.lang.Object member)
          Deprecated. since QTJava 6.1
 QDGraphics getGWorld()
          Deprecated. since QTJava 6.1
 java.awt.Dimension getInitialSize()
          Deprecated. since QTJava 4.0
 Layerable getLayerable(java.lang.Object member)
          Deprecated. since QTJava 6.1
 Matrix getMatrix()
          Deprecated. since QTJava 6.1
 QDDimension getOriginalSize()
          Deprecated. since QTJava 6.1
 Transformable getTransformable(java.lang.Object member)
          Deprecated. since QTJava 6.1
 java.lang.Object hitTest(int x, int y)
          Deprecated. since QTJava 6.1
 boolean isEmpty()
          Deprecated. since QTJava 6.1
abstract  GroupMember memberChanged(QTDrawable d)
          Deprecated. since QTJava 6.1
 java.util.Enumeration members()
          Deprecated. since QTJava 6.1
 void redraw(Region invalidRgn)
          Deprecated. since QTJava 6.1
abstract  void redrawMember(QTDrawable d, Region invalidRgn)
          Deprecated. since QTJava 6.1
 void removeMember(java.lang.Object member)
          Deprecated. since QTJava 6.1
protected  void setAlignedMemberLocation(QTDrawable drawer, float xAlign, float yAlign)
          Deprecated. since QTJava 6.1
 void setBackgroundColor(QDColor col)
          Deprecated. since QTJava 6.1
abstract  void setClip(Region theClip)
          Deprecated. since QTJava 6.1
 void setDisplayBounds(QDRect bounds)
          Deprecated. since QTJava 6.1
 void setGWorld(QDGraphics cgp)
          Deprecated. since QTJava 6.1
 void setLocation(int x, int y)
          Deprecated. since QTJava 6.1
 void setMatrix(Matrix matrix)
          Deprecated. since QTJava 6.1
 boolean setMemberAlignment(QTDrawable d, float xAlign, float yAlign)
          Deprecated. since QTJava 6.1
 boolean setMemberLayer(QTDrawable member, int layer)
          Deprecated. since QTJava 6.1
 int size()
          Deprecated. since QTJava 6.1
 
Methods inherited from class quicktime.app.spaces.SimpleSpace
addController, addedTo, addMember, controllers, finalize, getProtocol, getSource, getTimer, hasMember, isAppropriate, memberAdded, memberRemoved, removeAllControllers, removeAllMembers, removeController, removedFrom, tickle, tickleList, timeChanged
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface quicktime.app.display.QTDisplaySpace
addMember
 
Methods inherited from interface quicktime.app.spaces.Listener
addedTo, removedFrom
 
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
 
Methods inherited from interface quicktime.app.time.Ticklish
tickle, timeChanged
 

Field Detail

clip

protected Region clip
Deprecated. 
The current clip region of the group * @deprecated since QTJava 6.1


vec

protected java.util.Vector vec
Deprecated. since QTJava 6.1

THis vector is used to store the members in. It is kept sorted by layer with the frontmost member in the first slot of the vector.

Constructor Detail

GroupDrawable

protected GroupDrawable(java.awt.Dimension initialSize,
                        QDColor bc,
                        int scale,
                        int period,
                        Protocol p)
                 throws QTException
Deprecated. since QTJava 4.0

Provided for subclasses to create a group drawable.

Parameters:
initialSize - initial size of the Drawable object
bc - the background color
scale - the scale of the Space's Timer
period - the period of the Space's Timer.
p - the Protocol that is enforced on candidate member objects of this group

GroupDrawable

protected GroupDrawable(QDDimension initialSize,
                        QDColor bc,
                        int scale,
                        int period,
                        Protocol p)
                 throws QTException
Deprecated. since QTJava 6.1

Provided for subclasses to create a group drawable.

Parameters:
initialSize - initial size of the Drawable object
bc - the background color
scale - the scale of the Space's Timer
period - the period of the Space's Timer.
p - the Protocol that is enforced on candidate member objects of this group
Method Detail

getGWorld

public QDGraphics getGWorld()
                     throws StdQTException
Deprecated. since QTJava 6.1

QTCanvas calls this method to get the destination QDGraphics of its client.

Specified by:
getGWorld in interface QTDrawable
Returns:
a QDGraphics object or null
StdQTException

setGWorld

public void setGWorld(QDGraphics cgp)
               throws QTException
Deprecated. since QTJava 6.1

QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Specified by:
setGWorld in interface QTDrawable
Parameters:
cgp - a QDGraphics object
QTException

setLocation

public void setLocation(int x,
                        int y)
                 throws QTException
Deprecated. since QTJava 6.1

A convenience method to set the position of a QTDrawable object.

Specified by:
setLocation in interface QTDrawable
Parameters:
x - the new x location
y - the new y location
QTException

setDisplayBounds

public void setDisplayBounds(QDRect bounds)
                      throws QTException
Deprecated. since QTJava 6.1

This method is called automatically via the QTCanvas object associated with this client to set its boundary.

Specified by:
setDisplayBounds in interface Drawable
Parameters:
bounds - a QDRect object describing the boundary
QTException

getDisplayBounds

public QDRect getDisplayBounds()
                        throws StdQTException
Deprecated. since QTJava 6.1

This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.

Specified by:
getDisplayBounds in interface Drawable
Returns:
the display boundary of the client
StdQTException

getBackgroundColor

public QDColor getBackgroundColor()
Deprecated. since QTJava 6.1

Returns the current background colour or null if no background colour.


setBackgroundColor

public void setBackgroundColor(QDColor col)
                        throws QTException
Deprecated. since QTJava 6.1

Sets the background color. This will force a redraw of the Compositor.

QTException

removeMember

public void removeMember(java.lang.Object member)
                  throws QTException
Deprecated. since QTJava 6.1

Remove a QTDrawable object from the Group of drawn items.

Specified by:
removeMember in interface Collection
Specified by:
removeMember in class SimpleSpace
Parameters:
member - the object to remove from the collection
QTException

members

public java.util.Enumeration members()
Deprecated. since QTJava 6.1

Returns an iterator of QTDrawable members that are the items that are currently contained within the DirectGroup.

Specified by:
members in interface Collection
Returns:
an Enumeration

isEmpty

public boolean isEmpty()
Deprecated. since QTJava 6.1

Returns true if the space does not have any members.

Specified by:
isEmpty in interface Collection
Returns:
a boolean

getGroupMember

public GroupMember getGroupMember(java.lang.Object member)
Deprecated. since QTJava 6.1

Returns a GroupMember that contains the specified QTDrawable object or null if the requested item is not a member of this group.

Returns:
a GroupMember that contains the layer and alignment information for the member in this group

size

public int size()
Deprecated. since QTJava 6.1

Returns the number of members in the collection, ie. the collection's size.

Specified by:
size in interface Collection
Returns:
the size of the collection.

memberChanged

public abstract GroupMember memberChanged(QTDrawable d)
                                   throws QTException
Deprecated. since QTJava 6.1

This tells the group that the position or display size of the drawer has changed and it should do whatever actions are appropriate to reestablish the display integrity of the group. If the drawer is not a member of the group then null should be returned, if it is a member then a GroupMember object is returned that contains the layout characteristics of the drawer.

Parameters:
d - the drawer that has changed
Returns:
the GroupMember object that is associated with that drawer.
QTException

redrawMember

public abstract void redrawMember(QTDrawable d,
                                  Region invalidRgn)
                           throws QTException
Deprecated. since QTJava 6.1

An optimized redraw that will redraw only those objects that it needs to based on the fact that the supplied drawer has changed but those behind or in front of it have not.

Parameters:
d - the member of which some display characteristic has changed.
invalidRgn - the Region that has changed as a result of the changes in the specified member. Generally this Region should encompass the area of the Group's display space that was occupied before the member was changed as this call will result in the member itself being redrawn.
QTException

setMemberAlignment

public boolean setMemberAlignment(QTDrawable d,
                                  float xAlign,
                                  float yAlign)
                           throws QTException
Deprecated. since QTJava 6.1

This will reset an item's alignment and redraw the group. Internally the group uses alignment values to recall where an item is in relation to the other members and the group's display space. Upon resize of the group's display space items are layed out in accordance of their alignment settings.

Parameters:
d - the drawer to reposition the alignment
xAlign - the new x alignment value for the member
yAlign - the new y alignemen value for the member
Returns:
true if the drawer is a member of the group
QTException

setMemberLayer

public boolean setMemberLayer(QTDrawable member,
                              int layer)
                       throws QTException
Deprecated. since QTJava 6.1

This sets the layer of the incoming drawable to the new layer. It returns true if the drawable is a member of the group and was reset, false otherwise.

Parameters:
layer - the new layer
Returns:
true if d is a member of the group
QTException

getBackLayer

public int getBackLayer()
Deprecated. since QTJava 6.1

Returns the back most layer of any object in the group.

Specified by:
getBackLayer in interface QTDisplaySpace
Returns:
the current back most layer

getFrontLayer

public int getFrontLayer()
Deprecated. since QTJava 6.1

Returns the current front most layer of any object in the group.

Specified by:
getFrontLayer in interface QTDisplaySpace
Returns:
the current front most layer

getInitialSize

public java.awt.Dimension getInitialSize()
                                  throws QTException
Deprecated. since QTJava 4.0

This method returns the original size before the transformations specified in the returned matrix are applied.

QTException
See Also:
()

getOriginalSize

public QDDimension getOriginalSize()
                            throws QTException
Deprecated. since QTJava 6.1

This method returns the original size before the transformations specified in the returned matrix are applied.

Specified by:
getOriginalSize in interface Transformable
Returns:
the original size of the GroupDrawable
QTException

redraw

public void redraw(Region invalidRgn)
            throws QTException
Deprecated. since QTJava 6.1

QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Specified by:
redraw in interface Drawable
Parameters:
invalidRgn - the invalidRgn that the client should redraw
QTException

getLayerable

public Layerable getLayerable(java.lang.Object member)
Deprecated. since QTJava 6.1

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.

Specified by:
getLayerable in interface QTDisplaySpace
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)
Deprecated. since QTJava 6.1

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.

Specified by:
getTransformable in interface QTDisplaySpace
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.

hitTest

public java.lang.Object hitTest(int x,
                                int y)
                         throws QTException
Deprecated. since QTJava 6.1

Returns the front most object located at the specified x and y pixel location or null if there is no object at the location

Specified by:
hitTest in interface QTDisplaySpace
Parameters:
x - the x pixel to test
y - the y pixel to test
Returns:
front most object or null
QTException

getMatrix

public Matrix getMatrix()
                 throws StdQTException
Deprecated. since QTJava 6.1

This will return the client's current display transformations. A GroupDrawable object does not by default support any transformation but location.

Specified by:
getMatrix in interface Transformable
Returns:
the display transformations of the client
StdQTException

setMatrix

public void setMatrix(Matrix matrix)
               throws QTException
Deprecated. since QTJava 6.1

This method sets the current matrix of the Transformable object to the new matrix. A GroupDrawable object does not by default support any transformation but location.

Specified by:
setMatrix in interface Transformable
Parameters:
matrix - the new location
QTException

getClip

public Region getClip()
               throws QTException
Deprecated. since QTJava 6.1

This method allows you to get the current clipped Region of the Transformable.

Specified by:
getClip in interface QTDrawable
Returns:
the clipping region
QTException

getBackgroundClip

public Region getBackgroundClip()
Deprecated. since QTJava 6.1

This method returns the clip that contains any space within the GroupDrawable that is not drawn upon by one of the members. This region is contains the pixels that will be filled in with the background colour.

Returns:
the background region.

setClip

public abstract void setClip(Region theClip)
                      throws QTException
Deprecated. since QTJava 6.1

This method allows you to set a Transformable's clipping region.

Specified by:
setClip in interface QTDrawable
Parameters:
theClip - a Region that defines the new clipping region.
QTException

setAlignedMemberLocation

protected void setAlignedMemberLocation(QTDrawable drawer,
                                        float xAlign,
                                        float yAlign)
                                 throws QTException
Deprecated. since QTJava 6.1

A helper method that is used to set the location of the member based on the x and y alignment. The alignment values must be between 0 and 1.

Parameters:
drawer - The drawer to locate based on the current size of the GroupDrawable and the alignment values
xAlign - the x alignment
yAlign - the y alignment
QTException