Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfLayerList.java @ 2

History | View | Annotate | Download (714 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 DxfLayerList {
16
        public Vector layers = null;
17
        public boolean createNotFoundLayers = true;
18
        
19
        public DxfLayerList() {
20
                layers = new Vector();
21
        }
22
        
23
        public void add(DxfLayer layer) {
24
                layers.add(layer);
25
        }
26
        
27
        public DxfLayer getByName(String name) {
28
                DxfLayer capa = null;
29
                for (int i=0; i<layers.size(); i++) {
30
                        capa = (DxfLayer) layers.get(i);
31
                        if (capa.name.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
}