|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.spaces.SimpleSpace | +--quicktime.app.display.GroupDrawable
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.
DirectGroup
Field Summary | |
protected Region |
clip
The current clip region of the group |
protected java.util.Vector |
vec
THis vector is used to store the members in. |
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)
Provided for subclasses to create a group drawable. |
Method Summary | |
Region |
getBackgroundClip()
This method returns the clip that contains any space within the GroupDrawable that is not drawn upon by one of the members. |
QDColor |
getBackgroundColor()
Returns the current background colour or null if no background colour. |
int |
getBackLayer()
Returns the back most layer of any object in the group. |
Region |
getClip()
This method allows you to get the current clipped Region of the Transformable. |
QDRect |
getDisplayBounds()
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie. |
int |
getFrontLayer()
Returns the current front most layer of any object in the group. |
GroupMember |
getGroupMember(java.lang.Object member)
Returns a GroupMember that contains the specified QTDrawable object or null if the requested item is not a member of this group. |
QDGraphics |
getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client. |
java.awt.Dimension |
getInitialSize()
Deprecated. since QTJava 4.0 |
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. |
Matrix |
getMatrix()
This will return the client's current display transformations. |
QDDimension |
getOriginalSize()
This method returns the original size before the transformations specified in the returned matrix are applied. |
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)
Returns the front most object located at the specified x and y pixel location or null if there is no object at the location |
boolean |
isEmpty()
Returns true if the space does not have any members. |
abstract GroupMember |
memberChanged(QTDrawable d)
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. |
java.util.Enumeration |
members()
Returns an iterator of QTDrawable members that are the items that are currently contained within the DirectGroup. |
void |
redraw(Region invalidRgn)
QTCanvas calls this method when the client should redraw itself. |
abstract void |
redrawMember(QTDrawable d,
Region invalidRgn)
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. |
void |
removeMember(java.lang.Object member)
Remove a QTDrawable object from the Group of drawn items. |
protected void |
setAlignedMemberLocation(QTDrawable drawer,
float xAlign,
float yAlign)
A helper method that is used to set the location of the member based on the x and y alignment. |
void |
setBackgroundColor(QDColor col)
Sets the background color. |
abstract void |
setClip(Region theClip)
This method allows you to set a Transformable's clipping region. |
void |
setDisplayBounds(QDRect bounds)
This method is called automatically via the QTCanvas object associated with this client to set its boundary. |
void |
setGWorld(QDGraphics cgp)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. |
void |
setLocation(int x,
int y)
A convenience method to set the position of a QTDrawable object. |
void |
setMatrix(Matrix matrix)
This method sets the current matrix of the Transformable object to the new matrix. |
boolean |
setMemberAlignment(QTDrawable d,
float xAlign,
float yAlign)
This will reset an item's alignment and redraw the group. |
boolean |
setMemberLayer(QTDrawable member,
int layer)
This sets the layer of the incoming drawable to the new layer. |
int |
size()
Returns the number of members in the collection, ie. |
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 |
protected Region clip
protected java.util.Vector vec
Constructor Detail |
protected GroupDrawable(java.awt.Dimension initialSize, QDColor bc, int scale, int period, Protocol p) throws QTException
initialSize
- initial size of the Drawable objectbc
- the background colorscale
- the scale of the Space's Timerperiod
- the period of the Space's Timer.p
- the Protocol that is enforced on candidate member objects of this groupprotected GroupDrawable(QDDimension initialSize, QDColor bc, int scale, int period, Protocol p) throws QTException
initialSize
- initial size of the Drawable objectbc
- the background colorscale
- the scale of the Space's Timerperiod
- the period of the Space's Timer.p
- the Protocol that is enforced on candidate member objects of this groupMethod Detail |
public QDGraphics getGWorld() throws StdQTException
getGWorld
in interface QTDrawable
public void setGWorld(QDGraphics cgp) throws QTException
setGWorld
in interface QTDrawable
cgp
- a QDGraphics objectpublic void setLocation(int x, int y) throws QTException
setLocation
in interface QTDrawable
x
- the new x locationy
- the new y locationpublic void setDisplayBounds(QDRect bounds) throws QTException
setDisplayBounds
in interface Drawable
bounds
- a QDRect object describing the boundarypublic QDRect getDisplayBounds() throws StdQTException
getDisplayBounds
in interface Drawable
bounds
- a QDRect object describing the boundarypublic QDColor getBackgroundColor()
public void setBackgroundColor(QDColor col) throws QTException
public void removeMember(java.lang.Object member) throws QTException
removeMember
in interface Collection
removeMember
in class SimpleSpace
QTDrawable
- drawer the item to removepublic java.util.Enumeration members()
members
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public GroupMember getGroupMember(java.lang.Object member)
drawer
- the QTDrawable object to search for.public int size()
size
in interface Collection
public abstract GroupMember memberChanged(QTDrawable d) throws QTException
d
- the drawer that has changedpublic abstract void redrawMember(QTDrawable d, Region invalidRgn) throws QTException
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.public boolean setMemberAlignment(QTDrawable d, float xAlign, float yAlign) throws QTException
d
- the drawer to reposition the alignmentxAlign
- the new x alignment value for the memberyAlign
- the new y alignemen value for the memberpublic boolean setMemberLayer(QTDrawable member, int layer) throws QTException
d
- the group member to resetlayer
- the new layerpublic int getBackLayer()
getBackLayer
in interface QTDisplaySpace
public int getFrontLayer()
getFrontLayer
in interface QTDisplaySpace
public java.awt.Dimension getInitialSize() throws QTException
()
public QDDimension getOriginalSize() throws QTException
getOriginalSize
in interface Transformable
public void redraw(Region invalidRgn) throws QTException
redraw
in interface Drawable
canv
- the QTCanvas that is doing the drawinginvalidRgn
- the invalidRgn that the client should redrawpublic Layerable getLayerable(java.lang.Object member)
getLayerable
in interface QTDisplaySpace
member
- the memberpublic Transformable getTransformable(java.lang.Object member)
getTransformable
in interface QTDisplaySpace
member
- the member of Space for which the Transformable object should be returned.public java.lang.Object hitTest(int x, int y) throws QTException
hitTest
in interface QTDisplaySpace
x
- the x pixel to testy
- the y pixel to testpublic Matrix getMatrix() throws StdQTException
getMatrix
in interface Transformable
public void setMatrix(Matrix matrix) throws QTException
setMatrix
in interface Transformable
matrix
- the new locationpublic Region getClip() throws QTException
getClip
in interface QTDrawable
public Region getBackgroundClip()
public abstract void setClip(Region theClip) throws QTException
setClip
in interface QTDrawable
theClip
- a Region that defines the new clipping region.protected void setAlignedMemberLocation(QTDrawable drawer, float xAlign, float yAlign) throws QTException
drawer
- The drawer to locate based on the current size of the GroupDrawable and the alignment valuesxAlign
- the x alignmentyAlign
- the y alignment
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |