示例#1
0
 /**
  * Finds the Interactive located at the specified pixel position.
  *
  * @param panel the drawing panel
  * @param xpix the x pixel position
  * @param ypix the y pixel position
  * @return the TPoint that is hit, or null
  */
 public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix) {
   boolean highlighted = (track.trackerPanel.getFrameNumber() == getFrameNumber());
   AutoTracker autoTracker = track.trackerPanel.getAutoTracker();
   TrackerPanel trackerPanel = (TrackerPanel) panel;
   setHitRectCenter(xpix, ypix);
   for (int i = 0; i < points.length; i++) {
     if (points[i] == null || Double.isNaN(points[i].getX())) continue;
     if (hitRect.contains(points[i].getScreenPosition(trackerPanel))) {
       if (highlighted && autoTracker.isDrawingKeyFrameFor(track, i)) return null;
       return points[i];
     }
   }
   return null;
 }
示例#2
0
 /**
  * Draws this step.
  *
  * @param panel the drawing panel requesting the drawing
  * @param g the graphics context on which to draw
  */
 public void draw(DrawingPanel panel, Graphics g) {
   if (track.trackerPanel == panel) {
     AutoTracker autoTracker = track.trackerPanel.getAutoTracker();
     if (autoTracker.isInteracting(track)) return;
   }
   TrackerPanel trackerPanel = (TrackerPanel) panel;
   boolean highlighted = (trackerPanel.getFrameNumber() == n);
   if (trackerPanel.autoTracker != null
       && trackerPanel.autoTracker.getWizard().isVisible()
       && trackerPanel.autoTracker.getTrack() == track) {
     highlighted = false;
   }
   getMark(trackerPanel).draw((Graphics2D) g, highlighted);
 }
示例#3
0
 /**
  * Overrides Step draw method.
  *
  * @param panel the drawing panel requesting the drawing
  * @param _g the graphics context on which to draw
  */
 public void draw(DrawingPanel panel, Graphics _g) {
   if (track.trackerPanel == panel) {
     AutoTracker autoTracker = track.trackerPanel.getAutoTracker();
     if (autoTracker.isInteracting(track)) return;
   }
   if (panel instanceof TrackerPanel) {
     TrackerPanel trackerPanel = (TrackerPanel) panel;
     super.draw(trackerPanel, _g);
     Graphics2D g = (Graphics2D) _g;
     if (isLabelVisible()) {
       TextLayout layout = textLayouts.get(trackerPanel);
       if (layout == null) return;
       Point p = getLayoutPosition(trackerPanel);
       Paint gpaint = g.getPaint();
       Font gfont = g.getFont();
       g.setPaint(footprint.getColor());
       g.setFont(textLayoutFont);
       layout.draw(g, p.x, p.y);
       g.setPaint(gpaint);
       g.setFont(gfont);
     }
   }
 }