Пример #1
0
 public void paint(Graphics2D g, Rectangle layerBounds, boolean commit) {
   if (shape == null || stack == null) {
     return;
   }
   int full = 6;
   int half = 3;
   Rectangle2D.Double scratch = new Rectangle2D.Double(0, 0, full, full);
   g.setStroke(new BasicStroke(1F));
   int max = ((Adjustable) shape).getControlPointCount();
   double[] d = new double[max * 2];
   ((Adjustable) shape).getControlPoints(d);
   Point p = layer.getSurface().getLocation();
   for (int i = 0; i < d.length; i += 2) {
     d[i] -= p.x;
     d[i + 1] -= p.y;
     scratch.x = d[i] - half;
     scratch.y = d[i + 1] - half;
     g.setColor(Color.WHITE);
     g.fill(scratch);
     g.setColor(Color.BLACK);
     g.draw(scratch);
     if (cpoint != null && cpoint.getX() == d[i] && cpoint.getY() == d[i + 1]) {
       scratch.x -= 3;
       scratch.y -= 3;
       scratch.width += 6;
       scratch.height += 6;
       g.setColor(Color.YELLOW);
       g.draw(scratch);
     }
   }
 }