X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingComponent.java;h=4b0b2b4d079bc2f8b9d43bbc7ad10ab268852438;hb=43ad7b6c509c45c8f261e77ea059c10fed8c9f1c;hp=84e147263476050530bfed776a948d3a9fcb8e76;hpb=42873e30bf487bc0b695d60652dba44f82185dbb;p=fanfix.git diff --git a/src/jexer/backend/SwingComponent.java b/src/jexer/backend/SwingComponent.java index 84e1472..4b0b2b4 100644 --- a/src/jexer/backend/SwingComponent.java +++ b/src/jexer/backend/SwingComponent.java @@ -52,10 +52,52 @@ import javax.swing.JFrame; */ class SwingComponent { + // ------------------------------------------------------------------------ + // Variables -------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * If true, use triple buffering when drawing to a JFrame. */ - public static boolean tripleBuffer = false; + public static boolean tripleBuffer = true; + + /** + * The frame reference, if we are drawing to a JFrame. + */ + private JFrame frame; + + /** + * The component reference, if we are drawing to a JComponent. + */ + private JComponent component; + + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ + + /** + * Construct using a JFrame. + * + * @param frame the JFrame to draw to + */ + public SwingComponent(final JFrame frame) { + this.frame = frame; + setupFrame(); + } + + /** + * Construct using a JComponent. + * + * @param component the JComponent to draw to + */ + public SwingComponent(final JComponent component) { + this.component = component; + setupComponent(); + } + + // ------------------------------------------------------------------------ + // SwingComponent --------------------------------------------------------- + // ------------------------------------------------------------------------ /** * Get the BufferStrategy object needed for triple-buffering. @@ -73,16 +115,6 @@ class SwingComponent { } } - /** - * The frame reference, if we are drawing to a JFrame. - */ - private JFrame frame; - - /** - * The component reference, if we are drawing to a JComponent. - */ - private JComponent component; - /** * Get the JFrame reference. * @@ -101,26 +133,6 @@ class SwingComponent { return component; } - /** - * Construct using a JFrame. - * - * @param frame the JFrame to draw to - */ - public SwingComponent(final JFrame frame) { - this.frame = frame; - setupFrame(); - } - - /** - * Construct using a JComponent. - * - * @param component the JComponent to draw to - */ - public SwingComponent(final JComponent component) { - this.component = component; - setupComponent(); - } - /** * Setup to render to an existing JComponent. */