diff options
author | Brad Miller (WPI) <brad@wpi.edu> | 2015-06-03 06:48:15 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@sf36-usfst.sjc.collab.net> | 2015-06-03 06:48:15 -0700 |
commit | 17f51a7aa961b607ab8e2a5012cdfc72ecfaffb6 (patch) | |
tree | 1ba56cdd58e7f06c3bcac470e0ebb200b92b4cb7 | |
parent | d9e0c5c538206553d958e83123fc1384507ec8ed (diff) | |
parent | 8d6c55d9433dc7c4abd3e0f1a2a51da9c9897597 (diff) |
Merge "Fix restoring of saved camera resolution."
-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(); |