- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/apollo/gui/EditableSampledTrackGraphView.java
r355 r1102 1 1 package org.apollo.gui; 2 2 3 import java.awt.Color;4 3 import java.awt.Graphics; 5 4 import java.awt.Graphics2D; 6 5 import java.awt.Point; 7 import java.awt.Rectangle;8 6 import java.awt.event.KeyEvent; 9 7 import java.awt.event.KeyListener; … … 23 21 import org.apollo.util.TrackNameCreator; 24 22 import org.apollo.widgets.SampledTrack; 23 import org.expeditee.core.Colour; 24 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 25 import org.expeditee.gio.gesture.StandardGestureActions; 26 import org.expeditee.gio.swing.SwingConversions; 27 import org.expeditee.gio.swing.SwingMiscManager; 25 28 import org.expeditee.gui.Browser; 26 import org.expeditee.gui.Display IO;29 import org.expeditee.gui.DisplayController; 27 30 import org.expeditee.gui.Frame; 28 import org.expeditee.gui.FrameGraphics;29 import org.expeditee.gui.FrameMouseActions;30 31 import org.expeditee.gui.FreeItems; 31 32 import org.expeditee.items.Item; … … 52 53 private boolean selectAllOnDoubleClick = false; 53 54 54 public static final Colo r SELECTION_BACKING_COLOR_SELECT_ONLY = Color.BLACK;55 private static final Colo r SELECTION_BACKING_COLOR_SELECT_AND_COPY = Color.GREEN;55 public static final Colour SELECTION_BACKING_COLOR_SELECT_ONLY = Colour.BLACK; 56 private static final Colour SELECTION_BACKING_COLOR_SELECT_AND_COPY = Colour.GREEN; 56 57 57 58 private static final int SELECTION_MODE_SELECT_ONLY = 1; … … 215 216 } 216 217 217 FrameGraphics.refresh(true);218 DisplayController.requestRefresh(true); 218 219 219 220 } … … 289 290 assert(copiedAudioRegion != null); 290 291 291 Frame targetFrame = Display IO.getCurrentFrame();292 Frame targetFrame = DisplayController.getCurrentFrame(); 292 293 if (targetFrame != null) { 293 294 … … 307 308 assert(Browser._theBrowser != null); 308 309 309 // A work round for getting the widget into fre space centered on cursor310 // A workaround for getting the widget into free space centred on cursor 310 311 Point p = e.getLocationOnScreen(); 311 SwingUtilities.convertPointFromScreen(p, Browser._theBrowser.getContentPane());312 SwingUtilities.convertPointFromScreen(p, SwingMiscManager.getIfUsingSwingGraphicsManager().getContentPane()); 312 313 twidget.setPosition(p.x - (twidget.getWidth() / 2), p.y - (twidget.getHeight() / 2)); 313 314 314 315 for (Item i : twidget.getItems()) { 315 i.setOffset( new Point(316 (i.getX() - Display IO.getMouseX()) + (twidget.getWidth() / 2),317 (i.getY() - FrameMouseActions.getY()) + (twidget.getHeight() / 2)318 )) ;316 i.setOffset(SwingConversions.fromSwingPoint(new Point( 317 (i.getX() - DisplayController.getMouseX()) + (twidget.getWidth() / 2), 318 (i.getY() - DisplayController.getMouseY()) + (twidget.getHeight() / 2) 319 ))); 319 320 } 320 321 321 322 // Put the new widget into free space 322 FrameMouseActions.pickup(twidget.getItems());323 StandardGestureActions.pickup(twidget.getItems()); 323 324 324 325 } … … 399 400 400 401 @Override 401 public void paint(Graphics g) { 402 public void paint(Graphics g) 403 { 402 404 super.paint(g); 403 405 … … 416 418 } 417 419 418 g.setColor(Color.RED); 419 g.drawLine( 420 x, 421 0, 422 x, 423 getHeight()); 420 g.setColor(SwingConversions.toSwingColor(Colour.RED)); 421 g.drawLine(x, 0, x, getHeight()); 424 422 425 423 } … … 432 430 private void paintLock(Graphics g) { 433 431 if (isPlaying()) { 434 IconRepository.getIcon("lock.png").paintIcon(null,432 /*IconRepository.getIcon("lock.png").paintIcon(null, 435 433 g, 436 434 getWidth() - LOCK_ICON_CORNER_OFFSET, 437 LOCK_ICON_CORNER_OFFSET - 16); 435 LOCK_ICON_CORNER_OFFSET - 16);*/ 436 437 g.drawImage(SwingMiscManager.getIfUsingSwingImageManager().getInternalImage(IconRepository.getIcon("lock.png")), 438 getWidth() - LOCK_ICON_CORNER_OFFSET, 439 LOCK_ICON_CORNER_OFFSET - 16, 440 null); 438 441 } 439 442 } … … 442 445 Point exp = getExpediteePoint(); 443 446 if (exp != null) { 444 FrameGraphics.invalidateArea(new Rectangle(447 DisplayController.invalidateArea(new AxisAlignedBoxBounds( 445 448 exp.x + getWidth() - LOCK_ICON_CORNER_OFFSET, 446 449 exp.y + LOCK_ICON_CORNER_OFFSET - 16, … … 505 508 506 509 color = (selectionMode == SELECTION_MODE_SELECT_ONLY) ? 507 SELECTION_BACKING_COLOR_SELECT_ONLY : SELECTION_BACKING_COLOR_SELECT_AND_COPY; 510 SwingConversions.toSwingColor(SELECTION_BACKING_COLOR_SELECT_ONLY) : 511 SwingConversions.toSwingColor(SELECTION_BACKING_COLOR_SELECT_AND_COPY); 508 512 super.paint(g); 509 513 }
Note:
See TracChangeset
for help on using the changeset viewer.