class PrintInstance
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
instancesPrinted
Stores the index of the subInstance to be printed.
|
private Material |
material
The material the printInstance represents.
|
private Printer |
printer |
private int |
selected
The index of the active subInstance.
|
private java.util.ArrayList<Shape> |
shapes
The list of unplaced shapes of the material represented by the printInstance
|
private java.util.ArrayList<PrintSubInstance> |
subInstances
The subInstances of the printInstance.
|
Constructor and Description |
---|
PrintInstance(Shape shape,
Material material)
Constructs a new printInstance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addShape(Shape shape)
Adds a shape to the list of unplaced shapes of the printInstance
|
(package private) void |
addSubInstance()
Add a new subInstance to this printInstance.
|
(package private) java.lang.String |
checkOverlap()
This method checks whether placed shapes in its subInstances overlap.
|
(package private) boolean |
checkPlacedShapes()
This method checks whether there is a subInstances with placed shapes.
|
(package private) Material |
getMaterial()
Returns the material the printInstance represents.
|
(package private) int |
getNumberOfSubInstances()
Returns the number of subInstances the printInstance possesses.
|
(package private) java.util.ArrayList<Shape> |
getPlacedShapes()
Returns a list of shapes that have been placed in the active subInstance.
|
(package private) int |
getSelectedSubInstance()
Returns the index of the subInstance which is active.
|
private int |
getSubInstanceIndex(PrintSubInstance selected)
Returns the index of the subInstance belonging to the printInstance.
|
(package private) java.util.ArrayList<Shape> |
getUnplacedShapes()
Returns a list of shapes that not have been placed within the printInstance.
|
(package private) void |
placeShape(Shape shape)
Places a shape on the active subInstance.
|
(package private) void |
print()
Initiates the laser cutting process.
|
(package private) void |
printNext()
Initiates the cutting of the next subInstance.
|
(package private) void |
printSVG(java.io.File thePath)
Prints all the subInstances (plates) as an SVG.
|
(package private) void |
selectSubInstance(PrintSubInstance selected)
Sets which subInstance is active by its index.
|
(package private) void |
setActiveSubInstance(int index)
Sets which subInstance is active by its index.
|
(package private) void |
setDPI(int dpi)
Sets the DPI setting to be used.
|
(package private) void |
setLaserCutter(LaserCutter cutter,
java.lang.String ipAddress)
Sets which laser setter to be used and its address.
|
void |
setPrinter(Printer printer) |
(package private) void |
unplaceShape(Shape shape)
Unplaces a shape from the active subInstance.
|
private java.util.ArrayList<Shape> shapes
private java.util.ArrayList<PrintSubInstance> subInstances
private Material material
private int selected
private int instancesPrinted
private Printer printer
PrintInstance(Shape shape, Material material)
shape
- The shapes belonging to the printInstance.
The shapes have the material and thickness the printInstance represents.material
- The material the printInstance represents.
The type of the material and the thickness are entailed in this parameter.void addShape(Shape shape)
shape
- The shape to be added as unplaced shapejava.util.ArrayList<Shape> getUnplacedShapes()
java.util.ArrayList<Shape> getPlacedShapes()
Material getMaterial()
void placeShape(Shape shape)
shape
- Shape to be placedvoid unplaceShape(Shape shape)
shape
- The shape to be unplaced.void selectSubInstance(PrintSubInstance selected)
selected
- The subInstance to be activeprivate int getSubInstanceIndex(PrintSubInstance selected)
selected
- The subInstance from which the index is to be returned.
The subInstance should belong to the printInstance.void print()
void printNext()
void printSVG(java.io.File thePath)
thePath
- The path to where the SVG files should be stored.public void setPrinter(Printer printer)
int getNumberOfSubInstances()
void addSubInstance()
void setActiveSubInstance(int index)
index
- The index of the to be active subInstanceint getSelectedSubInstance()
boolean checkPlacedShapes()
java.lang.String checkOverlap()
void setLaserCutter(LaserCutter cutter, java.lang.String ipAddress)
cutter
- The laser cutter to be used for laser cutting.ipAddress
- The address of the laser cutter to be used for laser cutting.
Can be an IP address or a port.void setDPI(int dpi)
dpi
- The DPI setting to be used for laser cutting.