Revision 10173
trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/DwgObject.java | ||
---|---|---|
46 | 46 |
* |
47 | 47 |
* @author jmorell |
48 | 48 |
*/ |
49 |
public class DwgObject { |
|
49 |
public class DwgObject implements Cloneable{
|
|
50 | 50 |
protected int type; |
51 | 51 |
|
52 | 52 |
protected DwgHandleReference handle; |
... | ... | |
150 | 150 |
} |
151 | 151 |
|
152 | 152 |
//TODO Todo esto no vale si handle puede tomar valor -1 |
153 |
public boolean hasLayerHandle() { |
|
154 |
return this.layerHandle != null; |
|
155 |
} |
|
153 | 156 |
public boolean hasNextHandle() { |
154 | 157 |
return this.nextHandle != null; |
155 | 158 |
} |
... | ... | |
474 | 477 |
DwgObject object; |
475 | 478 |
|
476 | 479 |
switch(handleCode){ |
480 |
// TODO: case 0x2: |
|
481 |
// TODO: case 0x3: |
|
477 | 482 |
case 0x4: |
478 | 483 |
case 0x5: |
479 | 484 |
handle = offset; |
480 | 485 |
break; |
486 |
// TODO: case 0x6: |
|
481 | 487 |
case 0x8: |
482 | 488 |
handle=this.getHandle().getOffset() - 1; |
483 | 489 |
break; |
... | ... | |
488 | 494 |
handle = this.getHandle().getOffset() - offset; |
489 | 495 |
break; |
490 | 496 |
default: |
491 |
System.out.println ("DwgObejct.getDwgSuperEntity: handleCode "+handleCode+" no implementado. offset = "+offset);
|
|
497 |
System.out.println ("DwgObject.getDwgSuperEntity: handleCode "+handleCode+" no implementado. offset = "+offset);
|
|
492 | 498 |
} |
493 | 499 |
if(handle != -1){ |
494 | 500 |
LinkedList objects = this.dwgFile.getDwgObjects(); |
... | ... | |
513 | 519 |
public DwgFile getDwgFile(){ |
514 | 520 |
return this.dwgFile; |
515 | 521 |
} |
522 |
|
|
523 |
public Object clone(){ |
|
524 |
DwgObject obj = new DwgObject(this.index); |
|
525 |
this.fill(obj); |
|
526 |
return obj; |
|
527 |
} |
|
528 |
|
|
529 |
protected void fill(DwgObject obj){ |
|
530 |
|
|
531 |
obj.setColor(color); |
|
532 |
obj.setDwgFile(dwgFile); //Tal vez vaya fuera |
|
533 |
obj.setExtendedData(extendedData); |
|
534 |
obj.setGraphicData(graphicData); |
|
535 |
obj.setGraphicsFlag(graphicsFlag); |
|
536 |
obj.setHandle(handle); |
|
537 |
obj.setLayerHandle(layerHandle); |
|
538 |
obj.setLinetypeFlags(linetypeFlags); |
|
539 |
obj.setLineTypeHandle(lineTypeHandle); |
|
540 |
obj.setLyrByLineType(lyrByLineType); |
|
541 |
obj.setMode(mode); |
|
542 |
obj.setNextHandle(nextHandle); |
|
543 |
obj.setNoLinks(noLinks); |
|
544 |
obj.setNumReactors(numReactors); |
|
545 |
obj.setPlotstyleFlags(plotstyleFlags); |
|
546 |
obj.setPlotStyleHandle(plotStyleHandle); |
|
547 |
obj.setPreviousHandle(previousHandle); |
|
548 |
obj.setSizeInBits(sizeInBits); |
|
549 |
obj.setSubEntityHandle(subEntityHandle); |
|
550 |
obj.setType(type); |
|
551 |
obj.setVersion(version); |
|
552 |
obj.setXDicObjHandle(xDicObjHandle); |
|
553 |
|
|
554 |
} |
|
516 | 555 |
} |
Also available in: Unified diff