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