*/
class SwingComponent {
+ // ------------------------------------------------------------------------
+ // Variables --------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* If true, use triple buffering when drawing to a JFrame.
*/
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.
*
}
}
- /**
- * 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.
*
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.
*/