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