Пример #1
0
 public StickingPolygon generateStickingBorder(
     int x, int y, int width, int height) { // LME: define the polygon on which relations stick on
   StickingPolygon p = new StickingPolygon();
   p.addPoint(new Point(x, y));
   p.addPoint(new Point(x + width, y));
   p.addPoint(new Point(x + width, y + height));
   p.addPoint(new Point(x, y + height), true);
   return p;
 }
Пример #2
0
 public final void drawStickingPolygon(Graphics2D g2) { // LME: draw the sticking polygon
   StickingPolygon poly =
       this.generateStickingBorder(0, 0, this.getWidth() - 1, this.getHeight() - 1);
   if (poly != null) {
     Color c = g2.getColor();
     Stroke s = g2.getStroke();
     g2.setColor(this._selectedColor);
     g2.setStroke(Constants.getStroke(1, 1));
     poly.draw(g2);
     g2.setColor(c);
     g2.setStroke(s);
   }
 }
Пример #3
0
 @Override
 public StickingPolygon generateStickingBorder(int x, int y, int width, int height) {
   int size_3d = 10;
   StickingPolygon p = new StickingPolygon();
   p.addPoint(new Point(x, y + size_3d));
   p.addPoint(new Point(x, y + height));
   p.addPoint(new Point(x + width - size_3d, y + height));
   p.addPoint(new Point(x + width, y + height - size_3d));
   p.addPoint(new Point(x + width, y));
   p.addPoint(new Point(x + size_3d, y), true);
   return p;
 }
Пример #4
0
 @Override
 public StickingPolygon generateStickingBorder(int x, int y, int width, int height) {
   StickingPolygon p = new StickingPolygon();
   p.addLine(new Point(x + width / 2, y + textHeight), new Point(x + width / 2, y + height));
   return p;
 }