diff options
author | Sven Gothel <[email protected]> | 2015-08-10 16:16:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-10 16:16:13 +0200 |
commit | 2d837a7a7130702ad36b694875613fae77c7ef06 (patch) | |
tree | f9027493d91511e9f799a852d3058d9fb29f9645 /src/nativewindow | |
parent | 1e4bfc26e2f220e046f42f7d26c05e4971bc509d (diff) |
Bug 1188, Bug 1186: NEWT Window: Support non-resizable, minimize, maximize, alwaysOnBottom and sticky/all-desktop (Part 1)
Change also implements Bug 1186: 'NEWT Window: Use a Bitfield holding all state flags and expose it accordingly',
since it is essential for an efficient implementation.
Part 1:
- Bug 1186
- Using Bitfield, holding public (Window) and private state bits/mask
- Bug 1188
- Window adds:
- [is|set]AlwaysOnBottom(..),
- [is|set]Resizable(..),
- [is|set]Sticky(..),
- [is|set]Maximized(..),
- isChildWindow(),
- Full implementation for X11
- TODO: Implement for OSX and Windows
- Manual tests:
- TestGearsES2NEWT, TestGearsES2NEWTSimple and TestGearsES2NewtCanvasAWT
utilize new NewtDemoListener, which has a key-listener to perform
all [new] actions. See source code of NewtDemoListener.
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java b/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java index 33a1955e8..9b4d7ec68 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java @@ -46,6 +46,9 @@ public class Rectangle implements Cloneable, RectangleImmutable { this.width=width; this.height=height; } + public Rectangle(final RectangleImmutable s) { + set(s); + } @Override public Object cloneMutable() { @@ -82,6 +85,12 @@ public class Rectangle implements Cloneable, RectangleImmutable { this.width = s.width; this.height = s.height; } + public final void set(final RectangleImmutable s) { + this.x = s.getX(); + this.y = s.getY(); + this.width = s.getWidth(); + this.height = s.getHeight(); + } public final void setX(final int x) { this.x = x; } public final void setY(final int y) { this.y = y; } public final void setWidth(final int width) { this.width = width; } @@ -196,6 +205,7 @@ public class Rectangle implements Cloneable, RectangleImmutable { } } { + // FIXME: Invalid, position needs to be compared differently final int sq = x*y; final int xsq = d.getX()*d.getY(); |