svn-gvsig-desktop / trunk / extensions / extCAD / src / com / iver / cit / gvsig / gui / cad / snapping / AbstractSnapper.java @ 5261
History | View | Annotate | Download (922 Bytes)
1 |
package com.iver.cit.gvsig.gui.cad.snapping; |
---|---|
2 |
|
3 |
import java.awt.Color; |
4 |
import java.awt.Graphics; |
5 |
import java.awt.geom.Point2D; |
6 |
|
7 |
public abstract class AbstractSnapper implements ISnapper { |
8 |
|
9 |
protected Point2D snapPoint = null; |
10 |
public void setSnapPoint(Point2D snapPoint) { |
11 |
this.snapPoint = snapPoint;
|
12 |
|
13 |
} |
14 |
|
15 |
/* (non-Javadoc)
|
16 |
* @see com.iver.cit.gvsig.gui.cad.snapping.ISnapper#draw(java.awt.Graphics, java.awt.geom.Point2D)
|
17 |
*/
|
18 |
public void draw(Graphics g, Point2D pPixels) { |
19 |
g.setColor(Color.ORANGE);
|
20 |
g.drawRect((int) (pPixels.getX() - 6), |
21 |
(int) (pPixels.getY() - 6), 12, 12); |
22 |
g.drawRect((int) (pPixels.getX() - 3), |
23 |
(int) (pPixels.getY() - 3), 6, 6); |
24 |
g.setColor(Color.MAGENTA);
|
25 |
g.drawRect((int) (pPixels.getX() - 4), |
26 |
(int) (pPixels.getY() - 4), 8, 8); |
27 |
} |
28 |
|
29 |
/* (non-Javadoc)
|
30 |
* @see com.iver.cit.gvsig.gui.cad.snapping.ISnapper#getPriority()
|
31 |
*/
|
32 |
public int getPriority() |
33 |
{ |
34 |
return 0; |
35 |
} |
36 |
|
37 |
} |