Changeset 1102 for trunk/src/org/apollo/items/RecordOverdubLauncher.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/items/RecordOverdubLauncher.java
r489 r1102 1 1 package org.apollo.items; 2 3 import java.awt.Color;4 import java.awt.GradientPaint;5 import java.awt.Graphics2D;6 import java.awt.Paint;7 import java.awt.Polygon;8 import java.awt.Stroke;9 2 10 3 import org.apollo.ApolloSystem; … … 12 5 import org.apollo.io.IconRepository; 13 6 import org.apollo.widgets.SampleRecorder; 7 import org.expeditee.core.Colour; 8 import org.expeditee.core.Dimension; 9 import org.expeditee.core.Fill; 10 import org.expeditee.core.GradientFill; 11 import org.expeditee.core.Point; 12 import org.expeditee.core.Stroke; 13 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 14 import org.expeditee.core.bounds.Bounds; 15 import org.expeditee.gio.EcosystemManager; 16 import org.expeditee.gio.GraphicsManager; 14 17 import org.expeditee.gui.Browser; 15 import org.expeditee.gui.Display IO;18 import org.expeditee.gui.DisplayController; 16 19 import org.expeditee.gui.Frame; 17 20 import org.expeditee.items.Item; … … 23 26 private static int WIDTH = 80; 24 27 private static int HEIGHT = 80; 25 private static Stroke BORDER_ST OKE = Strokes.SOLID_1;28 private static Stroke BORDER_STROKE = Strokes.SOLID_1; 26 29 private int countdown; 27 30 28 private static final Colo r BASE_COLOR = new Color(255, 100, 100);29 private static final Colo r HIGHLIGHT_COLOR = new Color(253, 255, 201);31 private static final Colour BASE_COLOR = Colour.FromRGB255(255, 100, 100); 32 private static final Colour HIGHLIGHT_COLOR = Colour.FromRGB255(253, 255, 201); 30 33 31 34 public RecordOverdubLauncher(int countdown) { … … 49 52 50 53 @Override 51 public void paint( Graphics2D g) {54 public void paint() { 52 55 if (Browser._theBrowser == null) return; 53 56 54 Paint restore = g.getPaint();57 GraphicsManager g = EcosystemManager.getGraphicsManager(); 55 58 59 Fill fill = null; 56 60 if (ApolloSystem.useQualityGraphics) { 57 GradientPaint gp = new GradientPaint( 58 _x + (WIDTH / 2), _y, HIGHLIGHT_COLOR, 59 _x + (WIDTH / 2), _y + HEIGHT - (HEIGHT / 5), BASE_COLOR); 60 g.setPaint(gp); 61 Point fromPoint = new Point(_x + (WIDTH / 2), _y); 62 Point toPoint = new Point(_x + (WIDTH / 2), _y + HEIGHT - (HEIGHT / 5)); 63 fill = new GradientFill(HIGHLIGHT_COLOR, fromPoint, BASE_COLOR, toPoint); 61 64 } else { 62 g.setColor(BASE_COLOR);65 fill = new Fill(BASE_COLOR); 63 66 } 64 67 65 g.fillRect((int)_x, (int)_y, WIDTH, HEIGHT); 68 Point topLeft = new Point((int)_x, (int)_y); 69 Dimension size = new Dimension(WIDTH, HEIGHT); 70 g.drawRectangle(topLeft, size, 0.0, fill, Colour.BLACK, BORDER_STROKE, null); 66 71 67 g.setPaint(restore); 72 /*IconRepository.getIcon("recordplay.png").paintIcon( 73 Browser._theBrowser.getContentPane(), g, getX() + 25, getY() + 25);*/ 68 74 69 g.setColor(Color.BLACK); 70 g.setStroke(BORDER_STOKE); 71 g.drawRect((int)_x, (int)_y, WIDTH, HEIGHT); 72 73 IconRepository.getIcon("recordplay.png").paintIcon( 74 Browser._theBrowser.getContentPane(), g, getX() + 25, getY() + 25); 75 g.drawImage(IconRepository.getIcon("recordplay.png"), new Point(getX() + 25, getY() + 25)); 75 76 76 77 } … … 92 93 93 94 @Override 94 public void updatePolygon() { 95 96 _poly = new Polygon(); 97 98 int x = (int)_x; 99 int y = (int)_y; 100 101 _poly.addPoint(x, y); 102 _poly.addPoint(x + WIDTH, y); 103 _poly.addPoint(x + WIDTH, y + HEIGHT); 104 _poly.addPoint(x, y + HEIGHT); 105 95 public Bounds updateBounds() 96 { 97 return new AxisAlignedBoxBounds((int) _x, (int) _y, WIDTH, HEIGHT); 106 98 } 107 99 … … 128 120 parent.removeItem(this); 129 121 130 Frame currentFrame = Display IO.getCurrentFrame();122 Frame currentFrame = DisplayController.getCurrentFrame(); 131 123 132 124 if (currentFrame != null) {
Note:
See TracChangeset
for help on using the changeset viewer.