diff options
-rw-r--r-- | smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java index a2258cf..f9ba47d 100644 --- a/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java +++ b/smartdashboard/src/edu/wpi/first/smartdashboard/gui/elements/WebcamViewerExtension.java @@ -30,7 +30,7 @@ public class WebcamViewerExtension extends StaticWidget implements Runnable { public static final String NAME = "USB Webcam Viewer"; public final IntegerProperty fpsProperty = new IntegerProperty(this, "FPS", 30); - public final MultiProperty sizeProperty = new MultiProperty(this, "Size"); + public final MultiProperty sizeProperty; private final static int PORT = 1180; private final static byte[] MAGIC_NUMBERS = { 0x01, 0x00, 0x00, 0x00 }; @@ -46,16 +46,19 @@ public class WebcamViewerExtension extends StaticWidget implements Runnable { private Socket socket; private Thread thread; - - /** {@inheritDoc} */ - @Override - public void init() { - setPreferredSize(new Dimension(320, 240)); - + public WebcamViewerExtension() { + super(); + sizeProperty = new MultiProperty(this, "Size"); sizeProperty.add("640x480", SIZE_640x480); sizeProperty.add("320x240", SIZE_320x240); sizeProperty.add("160x120", SIZE_160x120); sizeProperty.setDefault("640x480"); + } + + /** {@inheritDoc} */ + @Override + public void init() { + setPreferredSize(new Dimension(320, 240)); this.thread = new Thread(this); this.thread.start(); |