Changeset 333
- Timestamp:
- 09/26/08 10:04:49 (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r314 r333 34 34 import org.expeditee.items.XRayable; 35 35 import org.expeditee.items.widgets.WidgetCorner; 36 import org.expeditee.items.widgets.WidgetEdge; 36 37 import org.expeditee.stats.SessionStats; 37 38 … … 1580 1581 toSize.addAll(toSet.getLines()); 1581 1582 } else if (toSet instanceof Line) { 1583 1582 1584 Line line = (Line) toSet; 1583 float current = Math.abs(line.getThickness()); 1584 current = Math.max(current + diff, Item.MINIMUM_THICKNESS); 1585 line.setThickness(current); 1586 FrameGraphics.Repaint(); 1587 return; 1585 1586 if (!(toSet instanceof WidgetEdge) || ((WidgetEdge)toSet).getWidgetSource().isWidgetEdgeThicknessAdjustable()) { 1587 1588 float current = Math.abs(line.getThickness()); 1589 current = Math.max(current + diff, Item.MINIMUM_THICKNESS); 1590 line.setThickness(current); 1591 FrameGraphics.Repaint(); 1592 return; 1593 1594 } 1595 1588 1596 } else { 1589 1597 toSize.add(toSet); … … 1603 1611 1604 1612 if (i.isLineEnd()) { 1605 Collection<Item> allConnected = i.getAllConnected(); 1606 done.addAll(allConnected); 1607 for (Item it : allConnected) { 1608 it.translate(origin, ratio); 1609 it 1610 .setArrowheadLength((float) (it 1611 .getArrowheadLength() * ratio)); 1613 1614 if (!(i instanceof WidgetCorner) || !((WidgetCorner)i).getWidgetSource().isFixedSize()) { // don't size fixed widgets 1615 1616 Collection<Item> allConnected = i.getAllConnected(); 1617 done.addAll(allConnected); 1618 for (Item it : allConnected) { 1619 it.translate(origin, ratio); 1620 it 1621 .setArrowheadLength((float) (it 1622 .getArrowheadLength() * ratio)); 1623 } 1624 i.setThickness((float) (i.getThickness() * ratio)); 1612 1625 } 1613 i.setThickness((float) (i.getThickness() * ratio));1614 1626 } else if (i instanceof XRayable) { 1615 1627 XRayable xRay = (XRayable) i; -
trunk/src/org/expeditee/items/widgets/InteractiveWidget.java
r320 r333 1640 1640 */ 1641 1641 public void setWidgetEdgeThickness(float thickness) { 1642 for (Item i : _expediteeItems) i.setThickness(thickness); 1642 _l1.setThickness(thickness, true); 1643 //for (Item i : _expediteeItems) i.setThickness(thickness); 1643 1644 // Above indirectly invokes setSourceThickness accordingly 1645 } 1646 1647 /** 1648 * Override to dis-allow widget thickness manipulation from the user. 1649 * @return 1650 */ 1651 public boolean isWidgetEdgeThicknessAdjustable() { 1652 return true; 1644 1653 } 1645 1654 … … 1658 1667 1659 1668 public void setSourceThickness(float newThickness, boolean setConnected) { 1660 _textRepresentation.setThickness(newThickness, setConnected);1669 _textRepresentation.setThickness(newThickness, setConnected); 1661 1670 } 1662 1671 -
trunk/src_apollo/org/apollo/gui/FrameRenderPasses.java
r320 r333 13 13 import org.apollo.audio.util.Timeline; 14 14 import org.apollo.items.FramePlaybackLauncher; 15 import org.apollo.items.RecordOverdubLauncher; 15 16 import org.apollo.widgets.LinkedTrack; 16 17 import org.apollo.widgets.SampleRecorder; … … 207 208 helperLinesToPaint.add(iw.getX()); 208 209 } 209 } else if (i instanceof FramePlaybackLauncher ) {210 } else if (i instanceof FramePlaybackLauncher || i instanceof RecordOverdubLauncher) { 210 211 if (helperLinesToPaint == null) 211 212 helperLinesToPaint = new LinkedList<Integer>(); -
trunk/src_apollo/org/apollo/items/FramePlaybackLauncher.java
r315 r333 3 3 import java.awt.BasicStroke; 4 4 import java.awt.Color; 5 import java.awt.GradientPaint; 5 6 import java.awt.Graphics2D; 7 import java.awt.Paint; 6 8 import java.awt.Polygon; 7 9 import java.awt.Stroke; 8 10 11 import org.apollo.ApolloSystem; 9 12 import org.apollo.audio.SampledAudioManager; 10 13 import org.apollo.audio.util.FrameLayoutDaemon; … … 35 38 private static Stroke BORDER_STOKE = new BasicStroke(1.0f); 36 39 40 private static final Color BASE_COLOR = new Color(60, 148, 255); 41 private static final Color HIGHLIGHT_COLOR = new Color(253, 255, 201); 42 43 37 44 public FramePlaybackLauncher() { 38 45 this.setID(getParentOrCurrentFrame().getNextItemID()); … … 57 64 if (Browser._theBrowser == null) return; 58 65 59 g.setColor(Color.LIGHT_GRAY); 66 Paint restore = g.getPaint(); 67 68 if (ApolloSystem.useQualityGraphics) { 69 GradientPaint gp = new GradientPaint( 70 _x + (WIDTH / 2), _y, HIGHLIGHT_COLOR, 71 _x + (WIDTH / 2), _y + HEIGHT - (HEIGHT / 5), BASE_COLOR); 72 g.setPaint(gp); 73 } else { 74 g.setColor(BASE_COLOR); 75 } 76 60 77 g.fillRect((int)_x, (int)_y, WIDTH, HEIGHT); 78 79 g.setPaint(restore); 61 80 62 81 g.setColor(Color.BLACK); -
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.