17 package com.generalrobotix.ui.view.tdview;
27 @SuppressWarnings(
"serial")
32 private static final Dimension[] imageSize_ =
34 new Dimension(320, 240),
35 new Dimension(640, 480),
36 new Dimension(800, 600),
38 private static final double[] playbackRate_ =
39 new double[] { 4, 2, 1, 0.5, 0.25 };
40 private static final String[] playbackRateString_ =
41 new String[] {
"x 4",
"x 2",
"x 1",
"x 1/2",
"x 1/4" };
59 imSizeCombo_ =
new JComboBox(_makeSizeStrings(imageSize_));
60 playbackRateCombo_ =
new JComboBox(playbackRateString_);
61 playbackRateCombo_.setSelectedIndex(2);
62 frameRateField_ =
new JTextField(
"10");
63 startTimeField_ =
new JTextField(
"0.0");
64 endTimeField_ =
new JTextField(String.format(
"%.5f", endTime));
65 logEndTime_ = endTime;
67 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.fileName"), fileInput_, MULTILINE_CAPTION,
true);
68 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.imageSize"), imSizeCombo_, MULTILINE_CAPTION,
true);
69 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.playRate"), playbackRateCombo_, MULTILINE_CAPTION,
true);
70 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.frameRate"), frameRateField_, MULTILINE_CAPTION,
true);
71 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.startTime"), startTimeField_, INLINE_CAPTION,
true);
72 addInputComponent(
MessageBundle.
get(
"RecordingDialog.label.endTime"), endTimeField_, INLINE_CAPTION,
true);
73 setInputAreaWidth(300);
79 startTime = Double.parseDouble(startTimeField_.getText());
80 }
catch (NumberFormatException e){
91 endTime = Double.parseDouble(endTimeField_.getText());
92 }
catch (NumberFormatException e){
95 if(endTime > logEndTime_)
96 endTime = logEndTime_;
105 return new Dimension(imageSize_[imSizeCombo_.getSelectedIndex()]);
109 return playbackRate_[playbackRateCombo_.getSelectedIndex()];
113 return Integer.parseInt(frameRateField_.getText());
117 String[] sizeString =
new String[size.length];
118 for (
int i = 0;
i < size.length;
i ++) {
119 StringBuffer
buf =
new StringBuffer();
120 buf.append(size[
i].
width);
123 sizeString[
i] = buf.toString();
static final String get(String key)
JComboBox playbackRateCombo_
String [] _makeSizeStrings(Dimension[] size)
png_infop png_uint_32 * width
static Activator getDefault()
RecordingDialog(Frame owner, double endTime)
png_infop png_uint_32 png_uint_32 * height
JTextField frameRateField_
JTextField startTimeField_