aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-01-15 03:26:27 +0100
committerSven Gothel <[email protected]>2020-01-15 03:26:27 +0100
commitf56adf14deadd4ee8f434ea1293e27bcafdf2a90 (patch)
tree1aac2b29acbd458d3e47ac130aeecbcabae3ab47 /src/newt/classes/com/jogamp
parent85b332e0954af4afc9225eb84d758bee834dc497 (diff)
NEWT.Window: Add 'StringBuilder append(StringBuilder sb)' supporting building custom efficient presentations
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java9
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java13
2 files changed, 20 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 99089d3d7..a5c0711df 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -1048,6 +1048,15 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur
void runOnEDTIfAvail(boolean wait, final Runnable task);
+ /**
+ * Appends this class string representation to the given {@link StringBuilder} instance
+ * @param sb given instance where this class string representation is added to
+ * @return the given {@link StringBuilder} for chaining
+ */
+ StringBuilder append(StringBuilder sb);
+
+ @Override
+ String toString();
//
// WindowListener
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 569780311..b448b725d 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -535,9 +535,18 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
+ public final StringBuilder append(final StringBuilder sb) {
+ sb.append("NEWT-GLWindow[ \n\tHelper: " + helper + ", \n\tDrawable: " + drawable +
+ ", \n\tContext: " + context + ", \n\tWindow: ");
+ window.append(sb);
+ // sb.append(", \n\tFactory: "+factory);
+ sb.append("]");
+ return sb;
+ }
+
+ @Override
public final String toString() {
- return "NEWT-GLWindow[ \n\tHelper: " + helper + ", \n\tDrawable: " + drawable +
- ", \n\tContext: " + context + ", \n\tWindow: "+window+ /** ", \n\tFactory: "+factory+ */ "]";
+ return append(new StringBuilder()).toString();
}
@Override