Example #1
0
 /**
  * Clones this Step.
  *
  * @return a clone of this step
  */
 public Object clone() {
   try {
     Step step = (Step) super.clone();
     step.points = new TPoint[points.length];
     step.screenPoints = new Point[points.length];
     step.marks = new HashMap<TrackerPanel, Mark>();
     return step;
   } catch (CloneNotSupportedException ex) {
     ex.printStackTrace();
   }
   return null;
 }
Example #2
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);
     }
   }
 }