From 7cc10bde2ebe22ad9c9f85e9d1de40f46a35b14d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Oct 2010 05:04:57 +0200 Subject: RectangleReadOnly clonable; Make strings more readable --- .../javax/media/nativewindow/util/Dimension.java | 2 +- .../classes/javax/media/nativewindow/util/Point.java | 2 +- .../javax/media/nativewindow/util/Rectangle.java | 2 +- .../media/nativewindow/util/RectangleReadOnly.java | 18 +++++++++--------- .../javax/media/nativewindow/util/SurfaceSize.java | 2 +- src/newt/classes/com/jogamp/newt/ScreenMode.java | 2 +- src/newt/classes/com/jogamp/newt/util/MonitorMode.java | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java index f7826c6eb..86e1b8d28 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java @@ -74,7 +74,7 @@ public class Dimension implements Cloneable, DimensionReadOnly { } public String toString() { - return new String("Dimension["+width+" x "+height+"]"); + return new String(width+" x "+height); } public boolean equals(Object obj) { diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java index 1ece49ffb..76f1d69c5 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java @@ -74,7 +74,7 @@ public class Point implements Cloneable, PointReadOnly { } public String toString() { - return new String("Point[" + x + " / " + y + "]"); + return new String( x + " / " + y ); } public void setX(int x) { this.x = x; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java index 015a78a32..f4808929b 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java @@ -81,7 +81,7 @@ public class Rectangle implements Cloneable, RectangleReadOnly { } public String toString() { - return new String("Rect["+x+"/"+y+" "+width+"x"+height+"]"); + return new String("[ "+x+" / "+y+" "+width+" x "+height+" ]"); } } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleReadOnly.java b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleReadOnly.java index 9ffa07373..81a5a9f86 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleReadOnly.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleReadOnly.java @@ -29,7 +29,15 @@ package javax.media.nativewindow.util; /** Immutable Rectangle interface */ -public interface RectangleReadOnly { +public interface RectangleReadOnly extends Cloneable { + + int getHeight(); + + int getWidth(); + + int getX(); + + int getY(); /** * Checks whether two rect objects are equal. Two instances @@ -41,14 +49,6 @@ public interface RectangleReadOnly { */ boolean equals(Object obj); - int getHeight(); - - int getWidth(); - - int getX(); - - int getY(); - int hashCode(); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java index 2973f5a86..294fa2d13 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java @@ -64,7 +64,7 @@ public class SurfaceSize implements Cloneable { } public final String toString() { - return new String("SurfaceSize["+resolution+" x "+bitsPerPixel+" bpp]"); + return new String("[ "+resolution+" x "+bitsPerPixel+" bpp ]"); } /** diff --git a/src/newt/classes/com/jogamp/newt/ScreenMode.java b/src/newt/classes/com/jogamp/newt/ScreenMode.java index 8fb5aabb8..c89fda597 100644 --- a/src/newt/classes/com/jogamp/newt/ScreenMode.java +++ b/src/newt/classes/com/jogamp/newt/ScreenMode.java @@ -142,7 +142,7 @@ public class ScreenMode implements Cloneable { } public final String toString() { - return "ScreenMode[" + getMonitorMode() + ", " + rotation + " degr]"; + return "[ " + getMonitorMode() + ", " + rotation + " degr ]"; } /** diff --git a/src/newt/classes/com/jogamp/newt/util/MonitorMode.java b/src/newt/classes/com/jogamp/newt/util/MonitorMode.java index f24416469..1f4de082d 100644 --- a/src/newt/classes/com/jogamp/newt/util/MonitorMode.java +++ b/src/newt/classes/com/jogamp/newt/util/MonitorMode.java @@ -73,7 +73,7 @@ public class MonitorMode implements Cloneable { } public final String toString() { - return new String("MonitorMode["+surfaceSize+" x "+refreshRate+" Hz, "+screenSizeMM+" [mm]x[mm]]"); + return new String("[ "+surfaceSize+" x "+refreshRate+" Hz, "+screenSizeMM+" mm ]"); } /** -- cgit v1.2.3