svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libDwg / src / org / gvsig / dwg / lib / readers / v1314 / DwgBlockReader1314.java @ 28969
History | View | Annotate | Download (1.23 KB)
1 |
/*
|
---|---|
2 |
* Created on 25-ene-2007 by azabala
|
3 |
*
|
4 |
*/
|
5 |
package org.gvsig.dwg.lib.readers.v1314; |
6 |
|
7 |
import java.util.List; |
8 |
|
9 |
import org.gvsig.dwg.lib.CorruptedDwgEntityException; |
10 |
import org.gvsig.dwg.lib.DwgObject; |
11 |
import org.gvsig.dwg.lib.DwgUtil; |
12 |
import org.gvsig.dwg.lib.objects.DwgBlock; |
13 |
|
14 |
|
15 |
/**
|
16 |
* @author alzabord
|
17 |
*
|
18 |
* TODO To change the template for this generated type comment go to
|
19 |
* Window - Preferences - Java - Code Style - Code Templates
|
20 |
*/
|
21 |
public class DwgBlockReader1314 extends AbstractDwg1314Reader{ |
22 |
|
23 |
/* (non-Javadoc)
|
24 |
* @see com.iver.cit.jdwglib.dwg.readers.IDwgObjectReader#readSpecificObj(int[], int, com.iver.cit.jdwglib.dwg.DwgObject)
|
25 |
*/
|
26 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) throws RuntimeException, CorruptedDwgEntityException { |
27 |
if(! (dwgObj instanceof DwgBlock)) |
28 |
throw new RuntimeException("ArcReader 14 solo puede leer DwgBlock"); |
29 |
DwgBlock blk = (DwgBlock) dwgObj; |
30 |
int bitPos = offset;
|
31 |
bitPos = headTailReader.readObjectHeader(data, offset, blk ); |
32 |
|
33 |
List val = DwgUtil.getTextString(data, bitPos);
|
34 |
bitPos = ((Integer) val.get(0)).intValue(); |
35 |
String name = (String) val.get(1); |
36 |
blk.setName(name); |
37 |
|
38 |
bitPos = headTailReader.readObjectTailer(data, bitPos, blk); |
39 |
} |
40 |
|
41 |
} |