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 addressable 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.
AWTVideoSizeControl
Constructor and Description |
---|
AWTVideoSize(Rectangle source,
Rectangle dest)
Constructs a new
AWTVideoSize instance. |
Modifier and Type | Method and Description |
---|---|
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. |
public AWTVideoSize(Rectangle source, Rectangle dest)
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.
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.public Rectangle getSource()
Rectangle
.public Rectangle getDestination()
Rectangle
.public float getXScale()
getDestination().width / getSource().width
.public float getYScale()
getDestination().height / getSource().height
.public int hashCode()
AWTVideoSize
.
Two AWTVideoSize
instances for which
AWTVideoSize.equals()
is true
will
have identical hash code values.hashCode
in class Object
AWTVideoSize
.Object.equals(java.lang.Object)
,
Hashtable
public boolean equals(Object other)
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
.equals
in class Object
other
- The object with which to test for equality.true
if the two AWTVideoSize instances are
equal; false
otherwise.Object.hashCode()
,
Hashtable
Copyright © 2013 CableLabs. All Rights Reserved.