svn-gvsig-desktop / branches / CqCMSGisPlanet / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfTable.java @ 1932
History | View | Annotate | Download (885 Bytes)
1 |
/*
|
---|---|
2 |
* Created on 05-may-2004
|
3 |
*/
|
4 |
|
5 |
package org.cresques.px.dxf; |
6 |
|
7 |
import java.util.Vector; |
8 |
|
9 |
/**
|
10 |
* Lista (Tabla) de capas.
|
11 |
*
|
12 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>
|
13 |
*/
|
14 |
|
15 |
public class DxfTable { |
16 |
public Vector items = null; |
17 |
public boolean createNotFoundLayers = true; |
18 |
|
19 |
public DxfTable() {
|
20 |
items = new Vector(); |
21 |
} |
22 |
|
23 |
public void add(DxfTableItem layer) { |
24 |
items.add(layer); |
25 |
} |
26 |
|
27 |
public DxfTableItem getByName(String name) { |
28 |
DxfTableItem capa = null;
|
29 |
for (int i=0; i<items.size(); i++) { |
30 |
capa = (DxfTableItem) items.get(i); |
31 |
if (capa.getName().compareToIgnoreCase(name) == 0) |
32 |
return capa;
|
33 |
} |
34 |
if (createNotFoundLayers) {
|
35 |
capa = new DxfLayer(name);
|
36 |
add(capa); |
37 |
} |
38 |
return capa;
|
39 |
} |
40 |
|
41 |
public String toDxfString() { |
42 |
String txt = ""; |
43 |
for (int i=0; i<items.size(); i++) { |
44 |
txt += ((DxfLayer) items.get(i)).toDxfString(); |
45 |
} |
46 |
return txt;
|
47 |
} |
48 |
|
49 |
} |