svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfInsert.java @ 84
History | View | Annotate | Download (2.59 KB)
1 |
package org.cresques.px.dxf; |
---|---|
2 |
|
3 |
import java.awt.Graphics2D; |
4 |
import java.awt.geom.Point2D; |
5 |
import org.cresques.geo.Projection; |
6 |
import org.cresques.geo.ReProjection; |
7 |
import org.cresques.geo.ViewPort; |
8 |
import org.cresques.px.Extent; |
9 |
import java.util.Vector; |
10 |
|
11 |
public class DxfInsert extends DxfEntity { |
12 |
|
13 |
Point2D pt;
|
14 |
String blockName;
|
15 |
Point2D scaleFactor;
|
16 |
double rotAngle;
|
17 |
DxfBlock block = new DxfBlock(proj);
|
18 |
Vector blkList;
|
19 |
boolean blockFound = false; |
20 |
|
21 |
public DxfInsert(Projection proj, DxfLayer layer) {
|
22 |
super(proj, layer);
|
23 |
extent = new Extent();
|
24 |
} |
25 |
|
26 |
public Point2D getPt() { |
27 |
return pt;
|
28 |
} |
29 |
|
30 |
public double getRotAngle() { |
31 |
return rotAngle;
|
32 |
} |
33 |
|
34 |
public Point2D getScaleFactor() { |
35 |
return scaleFactor;
|
36 |
} |
37 |
|
38 |
public boolean getBlockFound() { |
39 |
return blockFound;
|
40 |
} |
41 |
|
42 |
public void setBlockFound(boolean found) { |
43 |
blockFound = found; |
44 |
} |
45 |
|
46 |
public boolean encuentraBloque(String blockName) { |
47 |
int i = 0; |
48 |
while (i<blkList.size() && blockFound == false) { |
49 |
//System.out.println("encuentraBloque: ((DxfBlock)blkList.get(i)).getBlkName() = " + ((DxfBlock)blkList.get(i)).getBlkName());
|
50 |
//System.out.println("encuentraBloque: blockName = " + blockName);
|
51 |
if (((DxfBlock)blkList.get(i)).getBlkName().equals(blockName)) {
|
52 |
//System.out.println("encuentraBloque: Bloque " + i + " encontrado.");
|
53 |
block = (DxfBlock)blkList.get(i); |
54 |
blockFound = true;
|
55 |
} else {
|
56 |
//System.out.println("encuentraBloque: Bloque " + blockName + " no encontrado");
|
57 |
blockFound = false;
|
58 |
} |
59 |
i++; |
60 |
} |
61 |
return blockFound;
|
62 |
} |
63 |
|
64 |
public DxfLayer getDxfLayer() {
|
65 |
return layer;
|
66 |
} |
67 |
|
68 |
public void setBlkList(Vector blkList) { |
69 |
this.blkList = blkList;
|
70 |
} |
71 |
|
72 |
public DxfBlock getDxfBlock() {
|
73 |
return block;
|
74 |
} |
75 |
|
76 |
public void setPt(Point2D pt) { |
77 |
this.pt = pt;
|
78 |
extent.add(pt); |
79 |
} |
80 |
|
81 |
public void setBlockName(String blockName) { |
82 |
this.blockName = blockName;
|
83 |
} |
84 |
|
85 |
public String getBlockName() { |
86 |
return blockName;
|
87 |
} |
88 |
|
89 |
public void setScaleFactor(Point2D scaleFactor) { |
90 |
this.scaleFactor = scaleFactor;
|
91 |
} |
92 |
|
93 |
public void setRotAngle(double rotAngle) { |
94 |
this.rotAngle = rotAngle;
|
95 |
} |
96 |
|
97 |
/* (non-Javadoc)
|
98 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString()
|
99 |
*/
|
100 |
public String toDxfString() { |
101 |
// TODO Auto-generated method stub
|
102 |
return ""; |
103 |
} |
104 |
|
105 |
/* (non-Javadoc)
|
106 |
* @see org.cresques.px.dxf.DxfEntity#reProject(org.cresques.geo.ReProjection)
|
107 |
*/
|
108 |
public void reProject(ReProjection rp) { |
109 |
// TODO Auto-generated method stub
|
110 |
|
111 |
} |
112 |
|
113 |
/* (non-Javadoc)
|
114 |
* @see org.cresques.px.Drawable#draw(java.awt.Graphics2D, org.cresques.geo.ViewPort)
|
115 |
*/
|
116 |
public void draw(Graphics2D g, ViewPort vp) { |
117 |
// TODO Auto-generated method stub
|
118 |
|
119 |
} |
120 |
|
121 |
} |