AWTVideoSize

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.tv.media
Class AWTVideoSize

    java.lang.Object
      javax.tv.media.AWTVideoSize

    public class AWTVideoSize

extends Object

`AWTVideoSize` is a data holder that represents the position, scaling, and clipping of a JMF Player, as controlled via an AWTVideoSizeControl. All coordinates are expressed in the same coordinate space as AWT components. Because background video might be larger than the addressible AWT area, some of the positions might be negative.

An AWTVideoSize represents a transformation of video where the video is first positioned, then scaled, and then clipped. A rectangle (in the screen's coordinate system) of the source video is translated, scaled and clipped to fit within a rectangle specified in the screen's coordinate system.

Version:
  1.12, 08/06/00
See Also:
  `AWTVideoSizeControl`

Constructor Summary
`AWTVideoSize(Rectangle source, Rectangle dest)` Constructs a new `AWTVideoSize` instance.

Method Summary
`boolean` | `equals(Object other)` Compares this `AWTVideoSize` with the given object for equality.
`Rectangle` | `getDestination()` Return a copy of the rectangle representing where the video is to be displayed, in the coordinate system of the screen.
`Rectangle` | `getSource()` Return a copy of the rectangle representing the portion of the source video to display, in the coordinate system of the screen.
`float` | `getXScale()` Give the scaling factor applied to the video in the horizontal dimension, i.e., `getDestination().width / getSource().width`.
`float` | `getYScale()` Give the scaling factor applied to the video in the vertical dimension, i.e., `getDestination().height / getSource().height`.
`int` | `hashCode()` Generates a hash code value for this `AWTVideoSize`.
`String` | `toString()` Returns a string representation of this `AWTVideoSize` and its values.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AWTVideoSize

    public AWTVideoSize(Rectangle source,
                        Rectangle dest)

  Constructs a new `AWTVideoSize` instance. This `AWTVideoSize` represents a transformation where the rectangle `source` in the source video is scaled and clipped to be within the rectangle `dest`.

  The instance of AWTVideoSize created with this constructor will not maintain a reference to either of the constructor's parameters.

  Parameters:
    `source` - The rectangle representing the portion of the source video to display, in the coordinate system of the screen.
    `dest` - The rectangle representing where the video is to be displayed, in the coordinate system of the screen.

Method Detail

### getSource

    public Rectangle getSource()

  Return a copy of the rectangle representing the portion of the source video to display, in the coordinate system of the screen.

  Returns:
    The source `Rectangle`.

### getDestination

    public Rectangle getDestination()

  Return a copy of the rectangle representing where the video is to be displayed, in the coordinate system of the screen.

  Returns:
    The destination `Rectangle`.

### getXScale

    public float getXScale()

  Give the scaling factor applied to the video in the horizontal dimension, i.e., `getDestination().width / getSource().width`.

  Returns:
    The horizontal scaling factor applied to the video.

### getYScale

    public float getYScale()

  Give the scaling factor applied to the video in the vertical dimension, i.e., `getDestination().height / getSource().height`.

  Returns:
    The vertical scaling factor applied to the video.

### hashCode

    public int hashCode()

  Generates a hash code value for this `AWTVideoSize`. Two `AWTVideoSize` instances for which `AWTVideoSize.equals()` is `true` will have identical hash code values.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    The hashcode value for this `AWTVideoSize`.
  See Also:
    `Object.equals(java.lang.Object)`, `Hashtable`

### equals

    public boolean equals(Object other)

  Compares this `AWTVideoSize` with the given object for equality. Returns `true` if and only if the given object is also of type `AWTVideoSize` and contains data members equal to those of this `AWTVideoSize`
  Overrides:
    `equals` in class `Object`
  Parameters:
    `other` - The object with which to test for equality.
  Returns:
    `true` if the two AWTVideoSize instances are equal; `false` otherwise.
  See Also:
    `Object.hashCode()`, `Hashtable`

### toString

    public String toString()

  Returns a string representation of this `AWTVideoSize` and its values.

  Overrides:
    `toString` in class `Object`
  Returns:
    A string representation of this object.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD