diff options
Diffstat (limited to 'src/nativewindow/classes/javax/media')
3 files changed, 52 insertions, 15 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java index d5cc048a1..f8596bc74 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java @@ -181,7 +181,7 @@ public interface NativeSurface extends SurfaceUpdatedListener { * Returns the width of the client area excluding insets (window decorations) in pixel units. * @return width of the client area in pixel units * @see NativeWindow#getWindowWidth() - * @see #getWindowUnitXY(int[], int[]) + * @see #convertToWindowUnits(int[]) */ public int getSurfaceWidth(); @@ -189,25 +189,25 @@ public interface NativeSurface extends SurfaceUpdatedListener { * Returns the height of the client area excluding insets (window decorations) in pixel units. * @return height of the client area in pixel units * @see NativeWindow#getWindowHeight() - * @see #getWindowUnitXY(int[], int[]) + * @see #convertToWindowUnits(int[]) */ public int getSurfaceHeight(); /** - * Converts the given pixel units into window units. - * @param result int[2] storage for the result, may be equal to pixelUnitXY (in-place) - * @param pixelUnitXY int[2] x- and y-coord values in pixel units - * @return result int[2] storage for chaining holding the converted values + * Converts the given pixel units into window units <i>in place</i>. + * @param pixelUnitsAndResult int[2] storage holding the pixel units for the x- and y-coord to convert + * and the resulting values. + * @return result int[2] storage pixelUnitsAndResult for chaining holding the converted values */ - public int[] getWindowUnitXY(int[] result, final int[] pixelUnitXY); + public int[] convertToWindowUnits(final int[] pixelUnitsAndResult); /** - * Converts the given window units into pixel units. - * @param result int[2] storage for the result, may be equal to windowUnitXY (in-place) - * @param windowUnitXY int[2] x- and y-coord values in window units - * @return result int[2] storage for chaining holding the converted values + * Converts the given window units into pixel units <i>in place</i>. + * @param windowUnitsAndResult int[2] storage holding the window units for the x- and y-coord to convert + * and the resulting values. + * @return result int[2] storage windowUnitsAndResult for chaining holding the converted values */ - public int[] getPixelUnitXY(int[] result, final int[] windowUnitXY); + public int[] convertToPixelUnits(final int[] windowUnitsAndResult); /** * Returns the graphics configuration corresponding to this window. diff --git a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java index 39e316856..1a13b050a 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java +++ b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java @@ -39,14 +39,19 @@ public interface UpstreamSurfaceHook { public void destroy(ProxySurface s); /** Returns the width of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */ - public int getPixelWidth(ProxySurface s); + public int getSurfaceWidth(ProxySurface s); /** Returns the height of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */ - public int getPixelHeight(ProxySurface s); + public int getSurfaceHeight(ProxySurface s); /** * {@link UpstreamSurfaceHook} w/ mutable size, allowing it's {@link ProxySurface} user to resize. */ public interface MutableSize extends UpstreamSurfaceHook { - public void setPixelSize(int width, int height); + /** + * Resizes the upstream surface. + * @param width new width in pixel units + * @param height new height in pixel units + */ + public void setSurfaceSize(int width, int height); } } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java index 331c1388e..e544118d0 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java @@ -106,22 +106,54 @@ public class Point implements Cloneable, PointImmutable { public final void setX(int x) { this.x = x; } public final void setY(int y) { this.y = y; } + /** + * Translate this instance's x- and y-components, + * i.e. add the values of the given delta point to them. + * @param pd delta point + * @return this instance for scaling + */ public final Point translate(Point pd) { x += pd.x ; y += pd.y ; return this; } + /** + * Translate this instance's x- and y-components, + * i.e. add the given deltas to them. + * @param dx delta for x + * @param dy delta for y + * @return this instance for scaling + */ public final Point translate(int dx, int dy) { x += dx ; y += dy ; return this; } + /** + * Scale this instance's x- and y-components, + * i.e. multiply them by the given scale factors. + * @param sx scale factor for x + * @param sy scale factor for y + * @return this instance for scaling + */ public final Point scale(int sx, int sy) { x *= sx ; y *= sy ; return this; } + /** + * Inverse scale this instance's x- and y-components, + * i.e. divide them by the given scale factors. + * @param sx inverse scale factor for x + * @param sy inverse scale factor for y + * @return this instance for scaling + */ + public final Point scaleInv(int sx, int sy) { + x /= sx ; + y /= sy ; + return this; + } } |