Revision 4306 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultDrawingStatus.java
DefaultDrawingStatus.java | ||
---|---|---|
41 | 41 |
private final Geometry geometry; |
42 | 42 |
private final ISymbol symbol; |
43 | 43 |
private final String text; |
44 |
private final int type; |
|
44 | 45 |
|
45 |
DefaultStatus(Geometry geometry, ISymbol symbol, String text){ |
|
46 |
DefaultStatus(Geometry geometry, ISymbol symbol, String text, int type){
|
|
46 | 47 |
this.geometry = geometry; |
47 | 48 |
this.symbol = symbol; |
48 | 49 |
this.text = text; |
50 |
this.type = type; |
|
49 | 51 |
} |
50 | 52 |
|
51 | 53 |
@Override |
... | ... | |
63 | 65 |
return text; |
64 | 66 |
} |
65 | 67 |
|
68 |
@Override |
|
69 |
public int getType() { |
|
70 |
return type; |
|
71 |
} |
|
72 |
|
|
66 | 73 |
} |
67 | 74 |
|
68 | 75 |
public DefaultDrawingStatus() { |
... | ... | |
86 | 93 |
public List<Geometry> getGeometries() { |
87 | 94 |
return this.geometries; |
88 | 95 |
} |
96 |
|
|
97 |
public Geometry getGeometry() { |
|
98 |
for (Status st : status) { |
|
99 |
if(st.getType() == TYPE_GEOMETRY){ |
|
100 |
return st.getGeometry(); |
|
101 |
} |
|
102 |
} |
|
103 |
return null; |
|
104 |
} |
|
89 | 105 |
|
90 | 106 |
@Override |
91 | 107 |
public List<Status> getStatus() { |
... | ... | |
103 | 119 |
|
104 | 120 |
public void addGeometry(Geometry geometry) { |
105 | 121 |
geometries.add(geometry); |
106 |
status.add(new DefaultStatus(geometry,null,null)); |
|
122 |
status.add(new DefaultStatus(geometry,null,null,TYPE_BUILDING));
|
|
107 | 123 |
} |
108 | 124 |
|
109 | 125 |
public void addStatus(Geometry geometry, ISymbol symbol, String text) { |
126 |
this.addStatus(geometry, symbol, text, TYPE_BUILDING); |
|
127 |
} |
|
128 |
|
|
129 |
public void addStatus(Geometry geometry, ISymbol symbol, String text, int type) { |
|
110 | 130 |
geometries.add(geometry); |
111 |
status.add(new DefaultStatus(geometry,symbol,text)); |
|
131 |
status.add(new DefaultStatus(geometry,symbol,text,type));
|
|
112 | 132 |
} |
113 | 133 |
|
114 | 134 |
public ISymbol getPreviewSymbol() { |
Also available in: Unified diff