Changeset 333 for trunk/src_apollo/org/apollo/widgets
- Timestamp:
- 09/26/08 10:04:49 (16 years ago)
- Location:
- trunk/src_apollo/org/apollo/widgets
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src_apollo/org/apollo/widgets/FramePlayer.java
r315 r333 193 193 updateButtonGUI(); 194 194 updateBorderColor(); 195 setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around 196 setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS); 195 197 196 198 } -
trunk/src_apollo/org/apollo/widgets/LinkedTrack.java
r319 r333 228 228 updateBorderColor(); 229 229 230 setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around 231 setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS); 232 230 233 231 234 } … … 1871 1874 } 1872 1875 1876 @Override 1877 public boolean isWidgetEdgeThicknessAdjustable() { 1878 return false; 1879 } 1880 1881 1873 1882 1874 1883 } -
trunk/src_apollo/org/apollo/widgets/MetronomePlayer.java
r332 r333 119 119 _swingComponent.add(enabledCheckbox); 120 120 121 setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around 122 setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS); 123 121 124 } 122 125 -
trunk/src_apollo/org/apollo/widgets/SampleRecorder.java
r332 r333 42 42 import org.apollo.gui.WaveFormRenderer; 43 43 import org.apollo.io.IconRepository; 44 import org.apollo.items.RecordOverdubLauncher; 44 45 import org.apollo.mvc.Observer; 45 46 import org.apollo.mvc.Subject; … … 94 95 private boolean hasExplicityStopped = false; 95 96 96 private boolean is SelfDestructable= false;97 private boolean isTemporary = false; 97 98 98 99 private final static int BUTTON_HEIGHT = 50; … … 109 110 private final static int RENDER_POINTS_PER_SECOND = 20; // how many points to render each second 110 111 111 private final static String SELF_DESTRUCT_OFF_META = "permanent";112 112 private final static String COUNTDOWN_META = "countdown="; 113 113 114 115 114 public SampleRecorder(Text source, String[] args) { 115 this(source, args, false); 116 } 117 118 public SampleRecorder(Text source, String[] args, boolean isTemporary) { 116 119 super(source, new JPanel(new GridBagLayout()), 117 120 AnimatedSampleGraph.GRAPH_WIDTH + (2 * HORO_SPACING), … … 120 123 COUNTDOWN_SETTINGS_HEIGHT + BUTTON_HEIGHT + LABEL_HEIGHT + AnimatedSampleGraph.GRAPH_HEIGHT + (4 * VERT_SPACING)); 121 124 122 isSelfDestructable = !containsDataTrimmedIgnoreCase(SELF_DESTRUCT_OFF_META); 125 this.isTemporary = isTemporary; 126 123 127 int countdown = getStrippedDataInt(COUNTDOWN_META, 0); 124 128 if (countdown < 0) countdown = 0; … … 200 204 buttonPane.add(stopButton, c); 201 205 202 203 206 // Assemble 204 207 … … 230 233 231 234 setState(WidgetState.Ready, "Ready"); 235 } 236 237 /** 238 * Starts recording with playback... counts down if one is set 239 * 240 */ 241 public void commenceOverdubRecording() { 242 shouldPlayback = true; 243 setState(WidgetState.CountingDown, "Counting down..."); 244 } 245 246 /** 247 * 248 * @param countdown 249 * The countdown in seconds 250 * 251 * @throws IllegalArgumentException 252 * if countdown isn't allowed (due to restraints, i.e. can't be negative) 253 */ 254 public void setCountdown(int countdown) { 255 this.countDownSpinner.setValue(countdown); 232 256 } 233 257 … … 250 274 if (newState == WidgetState.Ready) { 251 275 276 // Self destructable recorders are only temporary.. is returned back to a ready state then 277 // get rid of them completely 278 if (oldState != null && isTemporary) { 279 removeSelf(); 280 } 281 252 282 recordButton.setVisible(true); 253 283 recordSynchedButton.setVisible(true); … … 330 360 } else { 331 361 332 if (is SelfDestructable) {362 if (isTemporary) { 333 363 // Remove this temporary widget 334 364 removeSelf(); … … 360 390 null); 361 391 362 if (is SelfDestructable) {392 if (isTemporary) { 363 393 364 394 targetFrame.addAllItems(trackWidget.getItems()); … … 420 450 List<String> data = new LinkedList<String>(); 421 451 422 if (isSelfDestructable)423 data.add(SELF_DESTRUCT_OFF_META);424 425 452 data.add(COUNTDOWN_META + countDownSpinner.getValue()); 426 453 … … 566 593 } 567 594 568 } else if (e.getSource() == recordButton || e.getSource() == recordSynchedButton) {595 } else if (e.getSource() == recordButton) { 569 596 assert (state == WidgetState.Ready); 570 shouldPlayback = (e.getSource() == recordSynchedButton);597 shouldPlayback = false; 571 598 setState(WidgetState.CountingDown, "Counting down..."); 599 } else if (e.getSource() == recordSynchedButton) { 600 assert (state == WidgetState.Ready); 601 602 Frame target = DisplayIO.getCurrentFrame(); 603 if (target == null) return; 604 605 // Create the launcher 606 607 RecordOverdubLauncher launcher = new RecordOverdubLauncher((Integer)countDownSpinner.getValue()); 608 launcher.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY); 609 610 // Pick it up 611 FrameMouseActions.pickup(launcher); 612 572 613 } 573 614 … … 962 1003 } 963 1004 1005 @Override 1006 public boolean isWidgetEdgeThicknessAdjustable() { 1007 return false; 1008 } 1009 964 1010 } -
trunk/src_apollo/org/apollo/widgets/SampledTrack.java
r331 r333 444 444 // Make sure border color is correct 445 445 updateBorderColor(); 446 setWidgetEdgeThickness(TrackWidgetCommons.PLAYING_TRACK_EDGE_THICKNESS); // TODO: Fix this work around 446 447 setWidgetEdgeThickness(TrackWidgetCommons.STOPPED_TRACK_EDGE_THICKNESS); 447 448 … … 1870 1871 ); 1871 1872 } 1872 1873 } 1873 1874 } 1875 1876 @Override 1877 public boolean isWidgetEdgeThicknessAdjustable() { 1878 return false; 1879 } 1880 1881 1874 1882 1875 1883 }
Note:
See TracChangeset
for help on using the changeset viewer.