public class PrintablePattern
extends java.lang.Object
implements java.awt.print.Printable
Modifier and Type | Field and Description |
---|---|
protected int |
gheight
The graphical dimensions of a key value pair
|
protected int |
gwidth
The graphical dimensions of a key value pair
|
protected int |
height
In case the pattern should be represented as a matrix, its measures can be
defined by setting its width and height
|
protected java.lang.String |
outputFileName
file name of the pattern if exported to post script
|
protected boolean |
printAsLattice
export pattern as a lattice
|
protected int |
width
In case the pattern should be represented as a matrix, its measures can be
defined by setting its width and height
|
Constructor and Description |
---|
PrintablePattern()
Standard constructor
|
PrintablePattern(java.awt.image.BufferedImage imageFile,
double treshold)
Constructor for instantiation of a pattern object.
|
PrintablePattern(java.lang.String[] patt)
Constructor for instantiation of a pattern object
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
get(java.lang.Integer key)
Converts Integer in Double.
|
protected java.lang.Double |
get(int x,
int y)
Recalculates data position from a matrix format to a lattice format
|
int |
getGheight()
Returns the graphical height for one entity (key - value pair) of PrintablePattern
|
int |
getGwidth()
Returns the graphical width for one entity (key - value pair) of PrintablePattern
|
int |
getHeight()
In case PrintablePattern is represented as a matrix the method returns the matrix
height
|
java.lang.String |
getOutputFileName()
Returns file name of the exported file
|
boolean |
getPrintAsLattice()
Returns whether the pattern should be exported as a lattice or a matrix.
|
int |
getWidth()
In case PrintablePattern is represented as a matrix the method returns the matrix
width
|
void |
print()
Exports the pattern to a postscript file.
|
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex) |
void |
saveAsLattice(java.lang.String patternBarValue)
Exports the pattern to a postscript file as a Lattice
|
void |
set(java.lang.Integer key,
java.lang.Double value)
Sets a value for a key
|
void |
setGheight(int gheight1)
Sets the graphical height for one entity (key - value pair) of PrintablePattern
|
void |
setGwidth(int _gwidth)
Sets the graphical width for one entity (key - value pair) of PrintablePattern
|
void |
setHeight(int _height)
In case PrintablePattern is represented as a matrix the method sets the matrix height
|
void |
setOutputFileName(java.lang.String _outputFileName)
Sets file name of the exported file
|
void |
setPrintAsLattice(boolean _printAsLattice)
Sets whether the pattern should be exported as a lattice or a matrix.
|
void |
setWidth(int _width)
In case PrintablePattern is represented as a matrix the method sets the matrix width
|
java.lang.String |
toString() |
protected int width
protected int height
protected int gwidth
protected int gheight
protected java.lang.String outputFileName
protected boolean printAsLattice
public PrintablePattern(java.lang.String[] patt)
patt
- String array, of which its index represents the key and the data
found at the index the value of the key - value pair representing a
pattern.public PrintablePattern(java.awt.image.BufferedImage imageFile, double treshold)
imageFile
- -
the image the data is taken fromtreshold
- -
simple treshold for data valuespublic PrintablePattern()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void set(java.lang.Integer key, java.lang.Double value)
key
- -
identification for a sitevalue
- -
sites valuepublic java.lang.Double get(java.lang.Integer key)
key
- -
identification for a sitepublic int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex) throws java.awt.print.PrinterException
print
in interface java.awt.print.Printable
java.awt.print.PrinterException
Printable.print(java.awt.Graphics,
java.awt.print.PageFormat, int)
protected java.lang.Double get(int x, int y)
public void print()
public java.lang.String getOutputFileName()
public void setOutputFileName(java.lang.String _outputFileName)
_outputFileName
- the output to setpublic int getHeight()
public void setHeight(int _height)
_height
- of the matrix which represents this patternpublic int getWidth()
public void setWidth(int _width)
_width
- of the matrix which represents this patternpublic int getGheight()
public void setGheight(int gheight1)
gheight1
- the gheight to setpublic int getGwidth()
public void setGwidth(int _gwidth)
_gwidth
- -
the gwidth to setpublic void saveAsLattice(java.lang.String patternBarValue)
patternBarValue
- public boolean getPrintAsLattice()
public void setPrintAsLattice(boolean _printAsLattice)
_printAsLattice
- if true the pattern will be exported as a lattice, if false the
pattern will be exported as a matrix