Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## quicktime.app.display
Class DirectGroup

    java.lang.Object
      |
      +--quicktime.app.spaces.SimpleSpace
            |
            +--quicktime.app.display.GroupDrawable
                  |
                  +--quicktime.app.display.DirectGroup

All Implemented Interfaces:
  Collection, Drawable, DynamicCollection, Listener, QTDisplaySpace, QTDrawable, Space, Ticklish, Transformable

public class DirectGroup
extends GroupDrawable

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

### DirectGroup

    public DirectGroup(java.awt.Dimension initialSize,
                       QDColor bc)
                throws QTException

  Deprecated. since QTJava 4.0, replaced by DirectGroup

  Create a new grouped drawable where the members draw directly to the screen.
  Parameters:
    `initialSize` - the size of the display group
    `bc` - the background color of the group
  See Also:
    `DirectGroup(QDDimension,QDColor)`

### DirectGroup

    public DirectGroup(QDDimension initialSize,
                       QDColor bc)
                throws QTException

  Create a new grouped drawable where the members draw directly to the screen.
  Parameters:
    `initialSize` - the size of the display group
    `bc` - the background color of the group

### DirectGroup

    protected DirectGroup(QDDimension initialSize,
                          QDColor bc,
                          int scale,
                          int period,
                          Protocol p)
                   throws QTException

  Create a new grouped drawable where the members draw directly to the screen.
  Parameters:
    `initialSize` - the size of the display group
    `bc` - the background color of the group
    `scale` - the scale of the space's Timer
    `period` - the period of the space's Timer
    `p` - the default Protocol of members

Method Detail

### isAppropriate

    public boolean isAppropriate(java.lang.Object object)

  Returns true if the Object object is an appropriate member of the Space. To be an appropriate member the object must pass the passProtocol method of the Protocol object of the Space.

  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.

  Overrides:
    `isAppropriate` in class `SimpleSpace`
  Parameters:
    `object` - the Object to test
  Returns:
    true if the object passes the current protocol of the Protocol object of the Space.

### addMember

    public boolean addMember(java.lang.Object member,
                             int layer,
                             float xAlign,
                             float yAlign)
                      throws QTException

  Add a QTDrawable object to the group based on the provided alignment and layer parametres. This method is provided as a convenience method to position a member in the current display space of the Group.
  Parameters:
    `drawer` - the QTDrawable object to be added
    `layer` - the layer where the drawer will be placed
    `xAlign` - the x position of the drawable within the group - 0 is left, 1 is bounds.width - member.width
    `yAlign` - the y position of the drawable within the group - 0 is top, 1 is bounds.height - member.height
  Returns:
    true if the member is appropriate and was added.

### addMember

    public boolean addMember(java.lang.Object member,
                             int layer)
                      throws QTException

  Add a QTDrawable object to the group based on the current location of the member and the specified layer parametre.
  Parameters:
    `drawer` - the QTDrawable object to be added
    `layer` - the layer where the drawer will be placed
  Returns:
    true if the member is appropriate and was added.

### addMember

    public boolean addMember(java.lang.Object member)
                      throws QTException

  Add a QTDrawable object to the group with the current location of the QTDrawable. If the member implements the Layerable interface it will get the layer and assign the layer appropriately. Otherwise, the member will be added with a layer of 1.
  Overrides:
    `addMember` in class `SimpleSpace`
  Parameters:
    `member` - the member to add
  Returns:
    true if the member is appropriate and was added.

### setGWorld

    public void setGWorld(QDGraphics cgp)
                   throws QTException

  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.
  Overrides:
    `setGWorld` in class `GroupDrawable`
  Parameters:
    `cgp` - a QDGraphics object

### setDisplayBounds

    public void setDisplayBounds(QDRect bounds)
                          throws QTException

  This method is called automatically via the QTCanvas object associated with this client to set its boundary.
  Overrides:
    `setDisplayBounds` in class `GroupDrawable`
  Parameters:
    `bounds` - a QDRect object describing the boundary

### redrawMember

    public void redrawMember(QTDrawable d,
                             Region invalidRgn)
                      throws QTException

  This is an optimized drawing method that will only reset the clipping of those objects that are behind the supplied member. It will call memberChanged to do this. It will then only redraw those members who are behind the specified member if and only if the members behind were effected by the changed location of the specified member. The supplied invalidRgn should specify the area that the supplied QTDrawble was located at as this enables this method to determine which members are effected by the changed location of the member.
  Overrides:
    `redrawMember` in class `GroupDrawable`
  Parameters:
    `d` - the drawable from which to recalculate.
    `invalidRgn` - the invalidRgn that the DirectGroup should redraw

### setClip

    public void setClip(Region theClip)
                 throws QTException

  This method allows you to set a Transformable's clipping region.
  Overrides:
    `setClip` in class `GroupDrawable`
  Parameters:
    `theClip` - a Region that defines the new clipping region.

### memberChanged

    public GroupMember memberChanged(QTDrawable d)
                              throws QTException

  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. If the drawer is not a member of the group then null is returned, if it is a member then a GroupMember object is returned that contains the layout characteristics of the drawer.
  Overrides:
    `memberChanged` in class `GroupDrawable`
  Parameters:
    `d` - the drawer that has changed
  Returns:
    the GroupMember object that is associated with that drawer.

### setMemberAlignment

    public boolean setMemberAlignment(QTDrawable d,
                                      float xAlign,
                                      float yAlign)
                               throws QTException

  This will reset an item's alignment and redraw the group.
  Overrides:
    `setMemberAlignment` in class `GroupDrawable`
  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

### setMemberLayer

    public boolean setMemberLayer(QTDrawable member,
                                  int layer)
                           throws QTException

  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.
  Overrides:
    `setMemberLayer` in class `GroupDrawable`
  Parameters:
    `d` - the group member to reset
    `layer` - the new layer
  Returns:
    true if d is a member of the group

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD