org.kabeja.dxf
Class DXFDocument

java.lang.Object
  extended by org.kabeja.dxf.DXFDocument

public class DXFDocument
extends java.lang.Object

Author:
Field Summary
static double DEFAULT_MARGIN
           
static java.lang.String PROPERTY_ENCODING
           
 
Constructor Summary
DXFDocument()
           
 
Method Summary
 void addDXFBlock(DXFBlock block)
           
 void addDXFDimensionStyle(DXFDimensionStyle style)
           
 void addDXFEntity(DXFEntity entity)
           
 void addDXFHatchPattern(DXFHatchPattern pattern)
          Adds a DXFHatchPattern to the document.
 void addDXFLayer(DXFLayer layer)
           
 void addDXFLineType(DXFLineType ltype)
           
 void addDXFObject(DXFObject obj)
           
 void addDXFView(DXFView view)
           
 void addDXFViewport(DXFViewport viewport)
           
 void addDXStyle(DXFStyle style)
           
 boolean containsDXFLayer(java.lang.String layerName)
          Returns true if the document contains the specified layer.
 Bounds getBounds()
          Returns the bounds of this document
 Bounds getBounds(boolean onModelspace)
          Returns the bounds of this document
 DXFBlock getDXFBlock(java.lang.String name)
           
 java.util.Iterator getDXFBlockIterator()
           
 DXFDimensionStyle getDXFDimensionStyle(java.lang.String name)
           
 java.util.Iterator getDXFDimensionStyleIterator()
           
 DXFEntity getDXFEntityByID(java.lang.String id)
          Gets the
 DXFHatchPattern getDXFHatchPattern(java.lang.String id)
           
 java.util.Iterator getDXFHatchPatternIterator()
           
 DXFHeader getDXFHeader()
           
 DXFLayer getDXFLayer(java.lang.String key)
          Returns the specified layer.
 java.util.Iterator getDXFLayerIterator()
           
 DXFLineType getDXFLineType(java.lang.String name)
           
 java.util.Iterator getDXFLineTypeIterator()
           
 DXFObject getDXFObjectByID(java.lang.String id)
           
 java.util.List getDXFObjectsByType(java.lang.String type)
           
 DXFStyle getDXFStyle(java.lang.String name)
           
 java.util.Iterator getDXFStyleIterator()
           
 java.util.Iterator getDXFViewIterator()
           
 java.util.Iterator getDXFViewportIterator()
           
 double getHeight()
          Deprecated. use getBounds().getHeight() instead
 java.lang.String getProperty(java.lang.String key)
           
 DXFDictionary getRootDXFDictionary()
          Returns the root dictionary.
 double getWidth()
          Deprecated. use getBounds().getWidth() instead
 boolean hasProperty(java.lang.String key)
           
 void removeDXFLayer(java.lang.String id)
           
 void removeDXFViewport(DXFViewport viewport)
           
 void removeDXFViewport(int index)
           
 void setDXFHeader(DXFHeader header)
           
 void setProperty(java.lang.String key, java.lang.String value)
           
 void setRootDXFDictionary(DXFDictionary root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_ENCODING

public static java.lang.String PROPERTY_ENCODING

DEFAULT_MARGIN

public static final double DEFAULT_MARGIN
See Also:
Constant Field Values
Constructor Detail

DXFDocument

public DXFDocument()
Method Detail

addDXFLayer

public void addDXFLayer(DXFLayer layer)

getDXFLayer

public DXFLayer getDXFLayer(java.lang.String key)
Returns the specified layer.

Parameters:
key - The layer id
Returns:
the layer or if not found the default layer (layer "0")

containsDXFLayer

public boolean containsDXFLayer(java.lang.String layerName)
Returns true if the document contains the specified layer.

Parameters:
layerName - the layer name
Returns:
true - if the document contains the layer, otherwise false

getDXFLayerIterator

public java.util.Iterator getDXFLayerIterator()
Returns:
the iterator over all DXFLayer of this document

addDXFLineType

public void addDXFLineType(DXFLineType ltype)

getDXFLineType

public DXFLineType getDXFLineType(java.lang.String name)

getDXFLineTypeIterator

public java.util.Iterator getDXFLineTypeIterator()
Returns:
the iterator over all DXFLineTypes

addDXFEntity

public void addDXFEntity(DXFEntity entity)

addDXFBlock

public void addDXFBlock(DXFBlock block)

getDXFBlock

public DXFBlock getDXFBlock(java.lang.String name)

getDXFBlockIterator

public java.util.Iterator getDXFBlockIterator()
Returns:
the iterator over all DXFBlocks

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)

getProperty

public java.lang.String getProperty(java.lang.String key)

hasProperty

public boolean hasProperty(java.lang.String key)

getBounds

public Bounds getBounds()
Returns the bounds of this document

Returns:

getBounds

public Bounds getBounds(boolean onModelspace)
Returns the bounds of this document

Returns:

getHeight

public double getHeight()
Deprecated. use getBounds().getHeight() instead

Returns:

getWidth

public double getWidth()
Deprecated. use getBounds().getWidth() instead

Returns:

getDXFHeader

public DXFHeader getDXFHeader()

setDXFHeader

public void setDXFHeader(DXFHeader header)

addDXFDimensionStyle

public void addDXFDimensionStyle(DXFDimensionStyle style)

getDXFDimensionStyle

public DXFDimensionStyle getDXFDimensionStyle(java.lang.String name)

getDXFDimensionStyleIterator

public java.util.Iterator getDXFDimensionStyleIterator()

addDXStyle

public void addDXStyle(DXFStyle style)

getDXFStyle

public DXFStyle getDXFStyle(java.lang.String name)

getDXFStyleIterator

public java.util.Iterator getDXFStyleIterator()

removeDXFLayer

public void removeDXFLayer(java.lang.String id)

addDXFViewport

public void addDXFViewport(DXFViewport viewport)

getDXFViewportIterator

public java.util.Iterator getDXFViewportIterator()

removeDXFViewport

public void removeDXFViewport(DXFViewport viewport)

removeDXFViewport

public void removeDXFViewport(int index)

addDXFView

public void addDXFView(DXFView view)

getDXFViewIterator

public java.util.Iterator getDXFViewIterator()

addDXFObject

public void addDXFObject(DXFObject obj)

getRootDXFDictionary

public DXFDictionary getRootDXFDictionary()
Returns the root dictionary.

Returns:
the root DXFDictionray

setRootDXFDictionary

public void setRootDXFDictionary(DXFDictionary root)

getDXFObjectsByType

public java.util.List getDXFObjectsByType(java.lang.String type)

getDXFObjectByID

public DXFObject getDXFObjectByID(java.lang.String id)
Parameters:
id, - the ID of the object
Returns:
the object

getDXFEntityByID

public DXFEntity getDXFEntityByID(java.lang.String id)
Gets the

Parameters:
id - of the
Returns:
the
See Also:
with the specified ID., DXFEntity, with the specified ID or null if there is no, with the specified ID

addDXFHatchPattern

public void addDXFHatchPattern(DXFHatchPattern pattern)
Adds a DXFHatchPattern to the document.

Parameters:
pattern -

getDXFHatchPatternIterator

public java.util.Iterator getDXFHatchPatternIterator()
Returns:
java.util.Iterator over all DXFHatchPattern of the document

getDXFHatchPattern

public DXFHatchPattern getDXFHatchPattern(java.lang.String id)
Parameters:
ID - of the pattern (also called pattern name)
Returns:
the DXFHatchPattern or null