|
|||||||||
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 | +--quicktime.app.display.DirectGroup
A DirectGroup contains a set of QTDrawable objects that present their visual contents directly to the screen.
Items that overlap screen space will draw over each other and the front object will clip the rear object so that the rear object does not draw in the area occupied by the front object.
When the group is resized the group's items will not be resized or moved but clipped to the new viewing area of the DirectGroup. Doing a setMatrix on a DirectGroup will inherit the default behaviour of the GroupDrawable super class which merely repositions the group - it will not scale, rotate or skew the group or its members. As such the DirectGroup's display area reperesents a viewing area for its members and when this viewing area is changed the user will see more or less of the members that are in the DirectGroup.
This behaves different from the SWCompositor group - where a resize of that group will resize and scale the members of that group.
This behaviour of the DirectGroup allows an application to use the DirectGroup as a clipping area for its members, where the members of the group are not resized. This class can be used to implement a scrolling pane for example. For example an application may have a very large image that it wants to presents only portions of it. If the application used the GraphicsImporterDrawer (GID) as the client of the QTCanvas the image presented by the GID would be scaled to the viewing area of the QTCanvas. However if the client of the canvas was a DirectGroup and the group contained the GID then the DirectGroup would represent the viewing area of the GID. The application could define a MouseController and responder for this DirectGroup that allowed the user to click on the GID member and when dragging the mouse around change the part of the image that the user sees. Thus the GID image is not resized, and the DirectGroup acts as a clipping viewing area to only see a part of the GID member.
A DirectGroup can only be a top-level container object. Currently you cannot embed DirectGroups within other (parent) DirectGroups. The isAppropriate() method returns false for a potential DirectGroup member object. In this case the member won't be added, and the addMember methods will return false. If an application wanted to support this capability they should overide the isAppropriate method to allow these kinds of members.
Fields inherited from class quicktime.app.display.GroupDrawable |
clip, vec |
Fields inherited from class quicktime.app.spaces.SimpleSpace |
containedSpaces, controllersVec, ticklers, timer |
Fields inherited from interface quicktime.app.time.Ticklish |
kScale |
Constructor Summary | |
|
DirectGroup(java.awt.Dimension initialSize,
QDColor bc)
Deprecated. since QTJava 4.0, replaced by DirectGroup |
|
DirectGroup(QDDimension initialSize,
QDColor bc)
Create a new grouped drawable where the members draw directly to the screen. |
protected |
DirectGroup(QDDimension initialSize,
QDColor bc,
int scale,
int period,
Protocol p)
Create a new grouped drawable where the members draw directly to the screen. |
Method Summary | |
boolean |
addMember(java.lang.Object member)
Add a QTDrawable object to the group with the current location of the QTDrawable. |
boolean |
addMember(java.lang.Object member,
int layer)
Add a QTDrawable object to the group based on the current location of the member and the specified layer parametre. |
boolean |
addMember(java.lang.Object member,
int layer,
float xAlign,
float yAlign)
Add a QTDrawable object to the group based on the provided alignment and layer parametres. |
boolean |
isAppropriate(java.lang.Object object)
Returns true if the Object object is an appropriate member of the Space. |
GroupMember |
memberChanged(QTDrawable d)
This tells the group that the position or display size of the drawer has changed and it should recalculate its alignment and clipping based on the new position. |
void |
redrawMember(QTDrawable d,
Region invalidRgn)
This is an optimized drawing method that will only reset the clipping of those objects that are behind the supplied member. |
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. |
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. |
Methods inherited from class quicktime.app.display.GroupDrawable |
getBackgroundClip, getBackgroundColor, getBackLayer, getClip, getDisplayBounds, getFrontLayer, getGroupMember, getGWorld, getInitialSize, getLayerable, getMatrix, getOriginalSize, getTransformable, hitTest, isEmpty, members, redraw, removeMember, setAlignedMemberLocation, setBackgroundColor, setLocation, setMatrix, size |
Methods inherited from class quicktime.app.spaces.SimpleSpace |
addController, addedTo, controllers, finalize, getProtocol, getSource, getTimer, hasMember, 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.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 |
hasMember |
Methods inherited from interface quicktime.app.time.Ticklish |
tickle, timeChanged |
Constructor Detail |
public DirectGroup(java.awt.Dimension initialSize, QDColor bc) throws QTException
initialSize
- the size of the display groupbc
- the background color of the groupDirectGroup(QDDimension,QDColor)
public DirectGroup(QDDimension initialSize, QDColor bc) throws QTException
initialSize
- the size of the display groupbc
- the background color of the groupprotected DirectGroup(QDDimension initialSize, QDColor bc, int scale, int period, Protocol p) throws QTException
initialSize
- the size of the display groupbc
- the background color of the groupscale
- the scale of the space's Timerperiod
- the period of the space's Timerp
- the default Protocol of membersMethod Detail |
public boolean isAppropriate(java.lang.Object object)
In addition to the requirement that the object be some kind of QTDrawable, the object may also NOT be some kind of GroupDrawable. Thus you cannot embed DirectGroup objects in a parent DirectGroup.
isAppropriate
in class SimpleSpace
object
- the Object to testpublic boolean addMember(java.lang.Object member, int layer, float xAlign, float yAlign) throws QTException
drawer
- the QTDrawable object to be addedlayer
- the layer where the drawer will be placedxAlign
- the x position of the drawable within the group - 0 is left, 1 is bounds.width - member.widthyAlign
- the y position of the drawable within the group - 0 is top, 1 is bounds.height - member.heightpublic boolean addMember(java.lang.Object member, int layer) throws QTException
drawer
- the QTDrawable object to be addedlayer
- the layer where the drawer will be placedpublic boolean addMember(java.lang.Object member) throws QTException
addMember
in class SimpleSpace
member
- the member to addpublic void setGWorld(QDGraphics cgp) throws QTException
setGWorld
in class GroupDrawable
cgp
- a QDGraphics objectpublic void setDisplayBounds(QDRect bounds) throws QTException
setDisplayBounds
in class GroupDrawable
bounds
- a QDRect object describing the boundarypublic void redrawMember(QTDrawable d, Region invalidRgn) throws QTException
redrawMember
in class GroupDrawable
d
- the drawable from which to recalculate.invalidRgn
- the invalidRgn that the DirectGroup should redrawpublic void setClip(Region theClip) throws QTException
setClip
in class GroupDrawable
theClip
- a Region that defines the new clipping region.public GroupMember memberChanged(QTDrawable d) throws QTException
memberChanged
in class GroupDrawable
d
- the drawer that has changedpublic boolean setMemberAlignment(QTDrawable d, float xAlign, float yAlign) throws QTException
setMemberAlignment
in class GroupDrawable
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
setMemberLayer
in class GroupDrawable
d
- the group member to resetlayer
- the new layer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |