Changeset 1102 for trunk/src/org/apollo/gui/FramePlaybackBarRenderer.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/gui/FramePlaybackBarRenderer.java
r372 r1102 1 1 package org.apollo.gui; 2 2 3 import java.awt.BasicStroke;4 import java.awt.Color;5 import java.awt.Graphics2D;6 import java.awt.Rectangle;7 import java.awt.Stroke;8 3 import java.util.LinkedList; 9 4 import java.util.List; 10 11 import javax.swing.SwingUtilities;12 5 13 6 import org.apollo.audio.ApolloPlaybackMixer; … … 23 16 import org.apollo.util.AudioMath; 24 17 import org.apollo.widgets.FramePlayer; 18 import org.expeditee.core.Colour; 19 import org.expeditee.core.Stroke; 20 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 21 import org.expeditee.gio.EcosystemManager; 22 import org.expeditee.gio.GraphicsManager; 25 23 import org.expeditee.gui.Browser; 26 import org.expeditee.gui.Display IO;24 import org.expeditee.gui.DisplayController; 27 25 import org.expeditee.gui.Frame; 28 import org.expeditee.gui.FrameGraphics;29 26 30 27 /** … … 50 47 51 48 private static final int BAR_STROKE_THICKNESS = 2; 52 private static final Stroke BAR_STROKE = new BasicStroke(BAR_STROKE_THICKNESS);53 private static final Colo r BAR_COLOR = Color.DARK_GRAY;49 private static final Stroke BAR_STROKE = new Stroke(BAR_STROKE_THICKNESS); 50 private static final Colour BAR_COLOR = Colour.DARK_GREY; 54 51 55 52 private static FramePlaybackBarRenderer instance = new FramePlaybackBarRenderer(); … … 121 118 } 122 119 123 FrameGraphics.refresh(true);120 DisplayController.requestRefresh(true); 124 121 125 122 … … 132 129 currentMSPosition = -1; 133 130 pixelPositions.clear(); 134 FrameGraphics.refresh(true);131 DisplayController.requestRefresh(true); 135 132 136 133 break; … … 140 137 } 141 138 142 private void invalidate() { 139 private void invalidate() 140 { 143 141 if (Browser._theBrowser == null) return; 144 142 145 int height = Browser._theBrowser.getHeight();143 int height = EcosystemManager.getGraphicsManager().getWindowSize().getHeight(); 146 144 147 145 for (Integer n : pixelPositions) { 148 FrameGraphics.invalidateArea(new Rectangle(n - 1, 0, BAR_STROKE_THICKNESS + 2, height)); 149 } 150 } 151 152 public void paint(Graphics2D g) { 146 DisplayController.invalidateArea(new AxisAlignedBoxBounds(n - 1, 0, BAR_STROKE_THICKNESS + 2, height)); 147 } 148 } 149 150 public void paint() 151 { 153 152 if (Browser._theBrowser == null) return; 154 153 155 Frame currentFrame = Display IO.getCurrentFrame();154 Frame currentFrame = DisplayController.getCurrentFrame(); 156 155 157 156 if (currentFrame == null || currentFrame.getName() == null || pixelPositionsParent == null || 158 157 !currentFrame.getName().equals(pixelPositionsParent)) return; 159 158 160 int height = Browser._theBrowser.getHeight(); 161 162 g.setColor(BAR_COLOR); 163 g.setStroke(BAR_STROKE); 159 int height = EcosystemManager.getGraphicsManager().getWindowSize().getHeight(); 160 161 GraphicsManager gm = EcosystemManager.getGraphicsManager(); 164 162 165 163 for (Integer n : pixelPositions) { 166 g .drawLine(n, 0, n, height);164 gm.drawLine(n, 0, n, height, BAR_COLOR, BAR_STROKE); 167 165 } 168 166 } … … 193 191 // Notes: the clock will queue a refresh for the frame after this 194 192 // event proccesses ... 195 SwingUtilities.invokeLater(updator);193 EcosystemManager.getMiscManager().runOnGIOThread(updator); 196 194 } 197 195 … … 201 199 * @author Brook Novak 202 200 */ 203 private class PlaybackFrameBarUpdator implements Runnable { 201 private class PlaybackFrameBarUpdator implements Runnable 202 { 204 203 public void run() { 205 204 206 205 if (currentMSPosition == -1 || currentTimeline == null) return; 207 206 208 Frame currentFrame = Display IO.getCurrentFrame();207 Frame currentFrame = DisplayController.getCurrentFrame(); 209 208 210 209 if (currentFrame == null || currentFrame.getName() == null) return;
Note:
See TracChangeset
for help on using the changeset viewer.