Changeset 1102 for trunk/src/org/apollo/gui/SampledTrackGraphView.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/gui/SampledTrackGraphView.java
r1007 r1102 1 1 package org.apollo.gui; 2 2 3 import java.awt.BasicStroke; 3 4 import java.awt.Color; 4 5 import java.awt.Event; … … 10 11 import java.awt.Point; 11 12 import java.awt.Rectangle; 12 import java.awt.Stroke;13 13 import java.awt.event.ComponentEvent; 14 14 import java.awt.event.ComponentListener; 15 import java.awt.image.BufferedImage;16 15 import java.util.LinkedList; 17 16 import java.util.List; … … 31 30 import org.apollo.mvc.Subject; 32 31 import org.apollo.mvc.SubjectChangedEvent; 32 import org.expeditee.core.Image; 33 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 34 import org.expeditee.gio.swing.SwingConversions; 35 import org.expeditee.gio.swing.SwingMiscManager; 33 36 import org.expeditee.gui.Browser; 34 import org.expeditee.gui. FrameGraphics;37 import org.expeditee.gui.DisplayController; 35 38 36 39 /** … … 59 62 60 63 private WaveFormRenderProccessingUnit.WaveFormRenderTask renderTask = null; 61 private BufferedImage backBuffer = null; // Shared resource64 private Image backBuffer = null; // Shared resource 62 65 private int bufferWidth = -1; // cached from backBuffer - so don't have to lock 63 66 private int bufferHeight = -1; // cached from backBuffer - so don't have to lock … … 67 70 private int timescaleFrameLength = 0; // in frames 68 71 69 private final Font RENDER_MESSAGE_FONT = new Font("Arial", Font. ITALIC | Font.BOLD, 14);72 private final Font RENDER_MESSAGE_FONT = new Font("Arial", Font.BOLD | Font.ITALIC, 14); 70 73 71 74 private boolean alwaysFullViewOn = false; … … 80 83 81 84 /** The stroke used for drawing graph bars. E.G: The selection Start bar. */ 82 public static final Stroke GRAPH_BAR_STROKE = Strokes.SOLID_1;85 public static final BasicStroke GRAPH_BAR_STROKE = SwingConversions.toSwingStroke(Strokes.SOLID_1); 83 86 public static final int GRAPH_BAR_NWIDTH = 1; 84 87 … … 139 142 this, 140 143 0, 0, 141 Browser._theBrowser.getContentPane());144 SwingMiscManager.getIfUsingSwingGraphicsManager().getContentPane()); 142 145 } 143 146 … … 339 342 340 343 if (x >= 0 && x <= viewWidth) { // is the playback position in view? 341 FrameGraphics.invalidateArea(new Rectangle(344 DisplayController.invalidateArea(new AxisAlignedBoxBounds( 342 345 x + expediteePosition.x, 343 346 expediteePosition.y, … … 356 359 357 360 if (x >= 0 && x <= viewWidth) { // is the playback position in view? 358 FrameGraphics.invalidateArea(new Rectangle(361 DisplayController.invalidateArea(new AxisAlignedBoxBounds( 359 362 x + expediteePosition.x , 360 363 expediteePosition.y, … … 565 568 566 569 renderTask = null; // must be on swing thread because could be painting 567 if (backBuffer != null) backBuffer. flush();570 if (backBuffer != null) backBuffer.releaseImage(); 568 571 backBuffer = null; // must be on swing thread because could be painting 569 572 } … … 605 608 606 609 // Create new sized buffer 607 backBuffer = new BufferedImage( 610 backBuffer = Image.createImage(width, height); 611 /* backBuffer = new BufferedImage( 608 612 width, 609 613 height, 610 614 BufferedImage.TYPE_BYTE_INDEXED, 611 ApolloColorIndexedModels.graphIndexColorModel); 615 ApolloColorIndexedModels.graphIndexColorModel);*/ 612 616 } 613 617 } … … 624 628 ); 625 629 626 // Wait for invalidation recom endation messages630 // Wait for invalidation recommendation messages 627 631 renderTask.addObserver(this); 628 632 … … 693 697 synchronized(backBuffer) { 694 698 695 g.drawImage( backBuffer,699 g.drawImage(SwingMiscManager.getIfUsingSwingImageManager().getInternalImage(backBuffer), 696 700 0, 697 701 0, 698 702 getWidth(), 699 getHeight(), 703 getHeight(), 700 704 null); 701 705 … … 709 713 // No need to synchronize waveformBuffer because there is no thread accessing it, 710 714 // and a new render thread is always created on this thread. 711 g.drawImage( backBuffer,715 g.drawImage(SwingMiscManager.getIfUsingSwingImageManager().getInternalImage(backBuffer), 712 716 0, 713 717 0, 714 718 getWidth(), 715 getHeight(), 719 getHeight(), 716 720 null); 717 721 … … 919 923 * 920 924 */ 921 public interface EffecientInvalidator { 925 public interface EffecientInvalidator 926 { 922 927 public void onGraphDirty(SampledTrackGraphView graph, Rectangle dirty); 923 928 } 924 929 925 public Color getBackColor() { 930 public Color getBackColor() 931 { 926 932 return backColor; 927 933 } … … 935 941 * 936 942 */ 937 public void setBackColor(Color backColor, Color highlights) { 943 public void setBackColor(Color backColor, Color highlights) 944 { 938 945 setBackColor(backColor, highlights, true); 939 946 } … … 949 956 * Doesnt invalidate if the color has not changed. 950 957 */ 951 public void setBackColor(Color backColor, Color highlights, boolean invalidate) { 958 public void setBackColor(Color backColor, Color highlights, boolean invalidate) 959 { 952 960 if (backColor == null) throw new NullPointerException("backColor"); 953 961 if (this.backColor != backColor || backColorHighlights != highlights) {
Note:
See TracChangeset
for help on using the changeset viewer.