summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/sun/javafx
diff options
context:
space:
mode:
authortrembovetski <[email protected]>2009-08-20 10:27:52 -0700
committertrembovetski <[email protected]>2009-08-20 10:27:52 -0700
commit7bed517f4ebf9323b1ee96d6194579792ed5dfd9 (patch)
tree9d340f8b025ac027dc3c86aeb393f41bdcfe992b /src/newt/classes/com/sun/javafx
parent70cbd526250d20b2aaf2fbf996a7b5fcfe4837f0 (diff)
newt: additional insets support for GL and AWT Window
Diffstat (limited to 'src/newt/classes/com/sun/javafx')
-rw-r--r--src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java20
-rw-r--r--src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java4
2 files changed, 23 insertions, 1 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java
index a425386a3..b3908d759 100644
--- a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java
@@ -47,6 +47,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import com.sun.javafx.newt.Window;
+import java.awt.Insets;
import javax.media.nativewindow.*;
import javax.media.nativewindow.awt.*;
@@ -159,9 +160,26 @@ public class AWTWindow extends Window {
/** An AWT event on setSize() would bring us in a deadlock situation, hence invokeLater() */
runOnEDT(false, new Runnable() {
public void run() {
- frame.setSize(width, height);
+ Insets insets = frame.getInsets();
+ frame.setSize(width + insets.left + insets.right,
+ height + insets.top + insets.bottom);
+ }
+ });
+ }
+
+ public com.sun.javafx.newt.Insets getInsets() {
+ final int insets[] = new int[] { 0, 0, 0, 0 };
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ Insets frameInsets = frame.getInsets();
+ insets[0] = frameInsets.top;
+ insets[1] = frameInsets.left;
+ insets[2] = frameInsets.bottom;
+ insets[3] = frameInsets.right;
}
});
+ return new com.sun.javafx.newt.
+ Insets(insets[0],insets[1],insets[2],insets[3]);
}
public void setPosition(final int x, final int y) {
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
index 9f4454681..c5e625186 100644
--- a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
@@ -339,6 +339,10 @@ public class GLWindow extends Window implements GLAutoDrawable {
window.setPosition(x, y);
}
+ public Insets getInsets() {
+ return window.getInsets();
+ }
+
public boolean setFullscreen(boolean fullscreen) {
return window.setFullscreen(fullscreen);
}