root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / FLabel.java @ 379
History | View | Annotate | Download (3.7 KB)
1 |
/* Generated by Together */
|
---|---|
2 |
package com.iver.cit.gvsig.fmap.core; |
3 |
|
4 |
import com.iver.cit.gvsig.fmap.ViewPort; |
5 |
import com.iver.cit.gvsig.fmap.drivers.shp.SHP; |
6 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
7 |
|
8 |
import org.geotools.geometry.Geometry; |
9 |
|
10 |
import java.awt.Graphics2D; |
11 |
import java.awt.Rectangle; |
12 |
import java.awt.geom.AffineTransform; |
13 |
import java.awt.geom.PathIterator; |
14 |
import java.awt.geom.Point2D; |
15 |
import java.awt.geom.Rectangle2D; |
16 |
|
17 |
|
18 |
/**
|
19 |
* DOCUMENT ME!
|
20 |
*
|
21 |
* @author Vicente Caballero Navarro
|
22 |
*/
|
23 |
public class FLabel implements FShape { |
24 |
private String text; |
25 |
private boolean scaled; |
26 |
private FPoint2D pos;
|
27 |
private int height; |
28 |
|
29 |
/**
|
30 |
* Crea un nuevo FLabel.
|
31 |
*
|
32 |
* @param text DOCUMENT ME!
|
33 |
* @param scaled DOCUMENT ME!
|
34 |
* @param pos DOCUMENT ME!
|
35 |
* @param height DOCUMENT ME!
|
36 |
*/
|
37 |
public FLabel(String text, boolean scaled, FPoint2D pos, int height) { |
38 |
this.text = text;
|
39 |
this.scaled = scaled;
|
40 |
this.pos = pos;
|
41 |
this.height = height;
|
42 |
} |
43 |
public void transform(AffineTransform at) |
44 |
{ |
45 |
at.transform(pos.p,pos.p); |
46 |
} |
47 |
/**
|
48 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#draw(java.awt.Graphics2D,
|
49 |
* ViewPort, FStyle2D)
|
50 |
*/
|
51 |
public void draw(Graphics2D g, ViewPort vp, FStyle2D symbol) { |
52 |
} |
53 |
|
54 |
/**
|
55 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry()
|
56 |
*/
|
57 |
public Geometry toJTSGeometry() {
|
58 |
return null; |
59 |
} |
60 |
|
61 |
/**
|
62 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#createLabels(int, boolean)
|
63 |
*/
|
64 |
public IGeometry[] createLabels(int position, boolean duplicates) { |
65 |
return null; |
66 |
} |
67 |
|
68 |
/* (non-Javadoc)
|
69 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#intersects(java.awt.geom.Rectangle2D)
|
70 |
*/
|
71 |
public boolean intersects(Rectangle2D r) { |
72 |
// TODO Auto-generated method stub
|
73 |
return false; |
74 |
} |
75 |
|
76 |
/* (non-Javadoc)
|
77 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D()
|
78 |
*/
|
79 |
public Rectangle2D getBounds2D() { |
80 |
// TODO Auto-generated method stub
|
81 |
return new Rectangle2D.Double(pos.p.getX(), pos.p.getY(), 0, 0); |
82 |
} |
83 |
|
84 |
/**
|
85 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getGeometryType()
|
86 |
*/
|
87 |
public int getGeometryType() { |
88 |
return FShape.TEXT;
|
89 |
} |
90 |
|
91 |
/**
|
92 |
* @see com.iver.cit.gvsig.fmap.core.FShape#getShapeType()
|
93 |
*/
|
94 |
public int getShapeType() { |
95 |
return FShape.TEXT;
|
96 |
} |
97 |
|
98 |
/**
|
99 |
* @see java.awt.Shape#contains(double, double)
|
100 |
*/
|
101 |
public boolean contains(double x, double y) { |
102 |
if ((x == pos.p.getX()) || (y == pos.p.getY()))
|
103 |
return true; |
104 |
else
|
105 |
return false; |
106 |
} |
107 |
|
108 |
/**
|
109 |
* @see java.awt.Shape#contains(double, double, double, double)
|
110 |
*/
|
111 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
112 |
return false; |
113 |
} |
114 |
|
115 |
/**
|
116 |
* @see java.awt.Shape#intersects(double, double, double, double)
|
117 |
*/
|
118 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
119 |
return false; |
120 |
} |
121 |
|
122 |
/**
|
123 |
* @see java.awt.Shape#getBounds()
|
124 |
*/
|
125 |
public Rectangle getBounds() { |
126 |
return new Rectangle((int) pos.p.getX(), (int) pos.p.getY(), 0, 0); |
127 |
} |
128 |
|
129 |
/**
|
130 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D)
|
131 |
*/
|
132 |
public boolean contains(Point2D arg0) { |
133 |
return false; |
134 |
} |
135 |
|
136 |
/**
|
137 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D)
|
138 |
*/
|
139 |
public boolean contains(Rectangle2D arg0) { |
140 |
return false; |
141 |
} |
142 |
|
143 |
/**
|
144 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform)
|
145 |
*/
|
146 |
public PathIterator getPathIterator(AffineTransform at) { |
147 |
return new FPointIterator(pos.p,at); |
148 |
} |
149 |
|
150 |
/**
|
151 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double)
|
152 |
*/
|
153 |
public PathIterator getPathIterator(AffineTransform at, double arg1) { |
154 |
return new FPointIterator(pos.p,at); |
155 |
} |
156 |
} |