dxfExporter
Class DXFExport

java.lang.Object
  extended bydxfExporter.DXFExport

public class DXFExport
extends java.lang.Object

Base class for export to DXF. It is a container for DXF entities which can be loaded from the user data. When the Data are prepared by one of this ways, it can be saved to stream or file in DXF format.
Important: please fill in correctly Data field of corresponding object before adding a new entity. See subclasses DXFLine, DXFEllipse etc. of a superclass DXFFigure.


Field Summary
 java.lang.String AutoCADVer
          Version of AutoCAD DXF which used in this drawing.
 java.util.ArrayList Current
          List of the strings of a this DXF file.
 int DrawingUnits
          Drawing units for AutoCAD DesignCenter blocks:
0= Unitless, 1= Inches, 2= Feet, 3= Miles, 4= Millimeters, 5= Centimeters, 6= Meters, 7= Kilometers, 8= Microinches, 9= Mils, 10= Yards, 11= Angstroms, 12= Nanometers, 13= Microns, 14= Decimeters, 15= Decameters, 16= Hectometers, 17= Gigameters, 18= Astronomical units, 19= Light years, 20= Parsecs.
 
Constructor Summary
DXFExport()
           
 
Method Summary
 void add3DFace(DXFData Dt)
          Adds the 3DFACE entity.
 void add3DPoint(int Code, DXFPoint Pt)
          Adds the DXF point.
 void addArc(DXFData Dt)
          Adds the ARC entity.
 void addBezier(DXFData Dt)
          Adds the Bezier curve as SPLINE entity.
 void addCircle(DXFData Dt)
          Adds the CIRCLE entity.
 void addColor(int Color)
          Adds the DXF 8 bit color.
 void addEllipse(DXFData Dt)
          Adds the ELLIPSE entity.
 void addFloat(int Code, double Value)
          Adds the float value.
 void addHatch(DXFData Dt)
          Adds the HATCH entity.
 void addInt(int Code, int Value)
          Adds the integer value.
 void addLine(DXFData Dt)
          Adds the LINE entity.
 void addLType(java.lang.String Name, float[] Parts)
          Adds a new linetype (LTYPE entity from array of ticks) to LTYPE table.
 void addMText(DXFData Dt)
          Adds the MTEXT entity.
 void addName(DXFFigure Figure, java.lang.String Name, java.lang.String SubName)
          Adds the name of a entity.
 void addPixel(DXFData Dt)
          Adds the POINT entity.
 void addPoint(int Code, DXFPoint Pt)
          Adds the X,Y-coordinates of DXF point.
 void addPolyline(DXFData Dt)
          Adds the LWPOLYLINE entity.
 void addRectangle(DXFData Dt)
          Adds a rectangle as LWPOLYLINE entity with 4 points.
 void addString(int Code, java.lang.String Str)
          Adds the string value.
 void addText(DXFData Dt)
          Adds the TEXT entity.
 void addThickness(DXFData Dt)
          Adds the thickness value.
 void addVertex(DXFPoint Pt)
          Adds the vertex as X,Y-coordinates of DXF point, with code is equal 10 (for a first added coordinate value).
 void beginPoly(DXFFigure Figure)
          Adds the first DXF strings for LWPOLYLINE-type entities.
static DXFData doArcParams(float Top, float Left, float Right, float Bottom, float StartPtX, float StartPtY, float EndPtX, float EndPtY)
           
static DXFData doEllipseParams(float Top, float Left, float Right, float Bottom)
           
protected  void doLimits(DXFPoint Pt)
           
 void finalize()
           
 void saveToFile(java.lang.String FilePath)
          Saves current DXFExport object as a specified DXF file.
 void setCurrentLayer(DXFLayer Lr)
          Setting current layer
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DrawingUnits

public int DrawingUnits
Drawing units for AutoCAD DesignCenter blocks:
0= Unitless, 1= Inches, 2= Feet, 3= Miles, 4= Millimeters, 5= Centimeters, 6= Meters, 7= Kilometers, 8= Microinches, 9= Mils, 10= Yards, 11= Angstroms, 12= Nanometers, 13= Microns, 14= Decimeters, 15= Decameters, 16= Hectometers, 17= Gigameters, 18= Astronomical units, 19= Light years, 20= Parsecs.


AutoCADVer

public java.lang.String AutoCADVer
Version of AutoCAD DXF which used in this drawing.


Current

public java.util.ArrayList Current
List of the strings of a this DXF file.

Constructor Detail

DXFExport

public DXFExport()
Method Detail

addName

public void addName(DXFFigure Figure,
                    java.lang.String Name,
                    java.lang.String SubName)
Adds the name of a entity.

Parameters:
Figure - DXFFigure entity.
Name - The name of a DXF entity.
SubName - The subname of a DXF entity.

addInt

public void addInt(int Code,
                   int Value)
Adds the integer value.

Parameters:
Code - The code of a integer value.
Value - The integer value.

addFloat

public void addFloat(int Code,
                     double Value)
Adds the float value.

Parameters:
Code - The code of a float value.
Value - The float value.

addString

public void addString(int Code,
                      java.lang.String Str)
Adds the string value.

Parameters:
Code - The code of a string value.
Str - The string value.

addPoint

public void addPoint(int Code,
                     DXFPoint Pt)
Adds the X,Y-coordinates of DXF point.

Parameters:
Code - The code for a first added coordinate value.
Pt - The DXFPoint value.

add3DPoint

public void add3DPoint(int Code,
                       DXFPoint Pt)
Adds the DXF point.

Parameters:
Code - The code for a first added coordinate value.
Pt - The DXFPoint value.

addVertex

public void addVertex(DXFPoint Pt)
Adds the vertex as X,Y-coordinates of DXF point, with code is equal 10 (for a first added coordinate value).

Parameters:
Pt - The DXFPoint value.

addColor

public void addColor(int Color)
Adds the DXF 8 bit color.

Parameters:
Color - The color value.

addThickness

public void addThickness(DXFData Dt)
Adds the thickness value.

Parameters:
Dt - The structure DXFData with Thickness value.

beginPoly

public void beginPoly(DXFFigure Figure)
Adds the first DXF strings for LWPOLYLINE-type entities.

Parameters:
Figure - DXFFigure entity.

addPixel

public void addPixel(DXFData Dt)
Adds the POINT entity.

Parameters:
Dt - The specially filled structure DXFData for POINT entity.
See Also:
DXFPixel

addLine

public void addLine(DXFData Dt)
Adds the LINE entity.

Parameters:
Dt - The specially filled structure DXFData for LINE entity.
See Also:
DXFLine

addRectangle

public void addRectangle(DXFData Dt)
Adds a rectangle as LWPOLYLINE entity with 4 points.

Parameters:
Dt - The specially filled structure DXFData for rectangle as LWPOLYLINE entity.
See Also:
DXFRectangle

addPolyline

public void addPolyline(DXFData Dt)
Adds the LWPOLYLINE entity.

Parameters:
Dt - The specially filled structure DXFData for LWPOLYLINE entity.
See Also:
DXFPolyline

addCircle

public void addCircle(DXFData Dt)
Adds the CIRCLE entity.

Parameters:
Dt - The specially filled structure DXFData for CIRCLE entity.
See Also:
DXFEllipse

addEllipse

public void addEllipse(DXFData Dt)
Adds the ELLIPSE entity.

Parameters:
Dt - The specially filled structure DXFData for ELLIPSE entity.
See Also:
DXFEllipse

addArc

public void addArc(DXFData Dt)
Adds the ARC entity.

Parameters:
Dt - The specially filled structure DXFData for ARC entity.
See Also:
DXFArc

addText

public void addText(DXFData Dt)
Adds the TEXT entity.

Parameters:
Dt - The specially filled structure DXFData for TEXT entity.
See Also:
DXFText

addMText

public void addMText(DXFData Dt)
Adds the MTEXT entity.

Parameters:
Dt - The specially filled structure DXFData for MTEXT entity.
See Also:
DXFMText

addHatch

public void addHatch(DXFData Dt)
Adds the HATCH entity.

Parameters:
Dt - The specially filled structure DXFData for HATCH entity.
See Also:
DXFHatch

addBezier

public void addBezier(DXFData Dt)
Adds the Bezier curve as SPLINE entity.

Parameters:
Dt - The specially filled structure DXFData for SPLINE entity.
See Also:
DXFBezier

add3DFace

public void add3DFace(DXFData Dt)
Adds the 3DFACE entity.

Parameters:
Dt - The specially filled structure DXFData for 3DFACE entity.
See Also:
DXF3DFace

addLType

public void addLType(java.lang.String Name,
                     float[] Parts)
Adds a new linetype (LTYPE entity from array of ticks) to LTYPE table.

Parameters:
Name - The name of a new line type.
Parts - The array of ticks for this linetype.

doArcParams

public static DXFData doArcParams(float Top,
                                  float Left,
                                  float Right,
                                  float Bottom,
                                  float StartPtX,
                                  float StartPtY,
                                  float EndPtX,
                                  float EndPtY)

doEllipseParams

public static DXFData doEllipseParams(float Top,
                                      float Left,
                                      float Right,
                                      float Bottom)

doLimits

protected void doLimits(DXFPoint Pt)

setCurrentLayer

public void setCurrentLayer(DXFLayer Lr)
Setting current layer

Parameters:
Lr - Layer object (created before).

saveToFile

public void saveToFile(java.lang.String FilePath)
Saves current DXFExport object as a specified DXF file.

Parameters:
FilePath - The path to saved file (or name of a file).

finalize

public void finalize()