root / branches / v2_0_0_prep / libraries / libDXF / src / org / gvsig / dxf / px / dxf / DxfTableItem.java @ 29630
History | View | Annotate | Download (4.12 KB)
1 |
/*
|
---|---|
2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 |
*
|
4 |
* Copyright (C) 2004-5.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* cresques@gmail.com
|
23 |
*/
|
24 |
package org.gvsig.dxf.px.dxf; |
25 |
|
26 |
import org.gvsig.dxf.io.DxfGroup; |
27 |
|
28 |
|
29 |
/**
|
30 |
* La clase DxfTableItem representa una entrada de una tabla en un fichero DXF.
|
31 |
* Classe repr?sentant une table fichier DXF.
|
32 |
* @author Michael Michaud
|
33 |
* @documentation jmorell
|
34 |
*/
|
35 |
public class DxfTableItem { |
36 |
public final static DxfGroup ENDTAB = new DxfGroup(0, "ENDTAB"); |
37 |
public final static DxfGroup APPID = new DxfGroup(0, "APPID"); |
38 |
public final static DxfGroup DIMSTYLE = new DxfGroup(0, "DIMSTYLE"); |
39 |
public final static DxfGroup LAYER = new DxfGroup(0, "LAYER"); |
40 |
public final static DxfGroup LTYPE = new DxfGroup(0, "LTYPE"); |
41 |
public final static DxfGroup STYLE = new DxfGroup(0, "STYLE"); |
42 |
public final static DxfGroup UCS = new DxfGroup(0, "UCS"); |
43 |
public final static DxfGroup VIEW = new DxfGroup(0, "VIEW"); |
44 |
public final static DxfGroup VPORT = new DxfGroup(0, "VPORT"); |
45 |
private String name; |
46 |
public int flags = 0; |
47 |
|
48 |
/**
|
49 |
* Constructor de DxfTableItem.
|
50 |
* @param name, nombre de la entrada de la tabla.
|
51 |
* @param flags, estado.
|
52 |
*/
|
53 |
public DxfTableItem(String name, int flags) { |
54 |
this.name = name;
|
55 |
this.flags = flags;
|
56 |
} |
57 |
|
58 |
/**
|
59 |
* Devuelve el nombre de la entrada de la tabla.
|
60 |
* @return String
|
61 |
*/
|
62 |
public String getName() { |
63 |
return name;
|
64 |
} |
65 |
|
66 |
/**
|
67 |
* Establece el nombre de la entrada de la tabla.
|
68 |
* @param name, nombre.
|
69 |
*/
|
70 |
public void setName(String name) { |
71 |
this.name = name;
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* Devuelve el estado.
|
76 |
* @return int
|
77 |
*/
|
78 |
public int getFlags() { |
79 |
return flags;
|
80 |
} |
81 |
|
82 |
/**
|
83 |
* Establece el estado.
|
84 |
* @param flags
|
85 |
*/
|
86 |
public void setFlags(int flags) { |
87 |
this.flags = flags;
|
88 |
} |
89 |
|
90 |
/**
|
91 |
* Devuelve true si el estado es 1.
|
92 |
* @return boolean
|
93 |
*/
|
94 |
public boolean getFlag1() { |
95 |
return ((flags & 1) == 1); |
96 |
} |
97 |
|
98 |
/**
|
99 |
* Devuelve true si el estado es 2.
|
100 |
* @return boolean
|
101 |
*/
|
102 |
public boolean getFlag2() { |
103 |
return ((flags & 2) == 2); |
104 |
} |
105 |
|
106 |
/**
|
107 |
* Devuelve true si el estado es 4.
|
108 |
* @return boolean
|
109 |
*/
|
110 |
public boolean getFlag4() { |
111 |
return ((flags & 4) == 4); |
112 |
} |
113 |
|
114 |
/**
|
115 |
* Devuelve true si el estado es 8.
|
116 |
* @return boolean
|
117 |
*/
|
118 |
public boolean getFlag8() { |
119 |
return ((flags & 8) == 8); |
120 |
} |
121 |
|
122 |
/**
|
123 |
* Devuelve true si el estado es 16.
|
124 |
* @return boolean
|
125 |
*/
|
126 |
public boolean getFlag16() { |
127 |
return ((flags & 16) == 16); |
128 |
} |
129 |
|
130 |
/**
|
131 |
* Devuelve true si el estado es 32.
|
132 |
* @return boolean
|
133 |
*/
|
134 |
public boolean getFlag32() { |
135 |
return ((flags & 32) == 32); |
136 |
} |
137 |
|
138 |
/**
|
139 |
* Devuelve true si el estado es 64.
|
140 |
* @return boolean
|
141 |
*/
|
142 |
public boolean getFlag64() { |
143 |
return ((flags & 64) == 64); |
144 |
} |
145 |
|
146 |
/**
|
147 |
* Devuelve true si el estado es 128.
|
148 |
* @return boolean
|
149 |
*/
|
150 |
public boolean getFlag128() { |
151 |
return ((flags & 128) == 128); |
152 |
} |
153 |
|
154 |
/**
|
155 |
* Permite la escritura de entidades DxfTableItem en un fichero DXF2000.
|
156 |
* @return String, la cadena que se escribir? en el fichero con la informaci?n
|
157 |
* del DxfTableItem.
|
158 |
*/
|
159 |
public String toDxfString() { |
160 |
return DxfGroup.toString(2, name) + DxfGroup.toString(70, flags); |
161 |
} |
162 |
} |