public class Tool4Image
extends java.lang.Object
Tool4Image
class provides functions to create an image dynamicly.Modifier and Type | Field and Description |
---|---|
static int |
COORDSYS_CARTESIAN |
static int |
COORDSYS_DIM2 |
static int |
COORDSYS_DIM3 |
static int |
COORDSYS_POLAR |
static int |
COORDSYS_XISY |
static int |
COORDSYS_XNOTY |
int |
x_fac_add |
double |
x_fac_mult |
int |
y_fac_add |
double |
y_fac_mult |
int |
z_fac_add |
double |
z_fac_mult |
Constructor and Description |
---|
Tool4Image(java.awt.Graphics graph,
int coordinate_system,
int coordinate_dimension,
int width,
int height,
boolean make_pic)
The constructor
Tool4Image creates a new instance(object) of the class. |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList |
calc3DCoords(double x,
double y,
double z,
double cx,
double cy)
The Method
calc3DCoords transformation of the cartesian coordinates to 3D. |
java.util.ArrayList |
calcCartesianCoords(double roh,
double theta,
double phi)
The Method
calcCartesianCoords calculation of the cartesian
coordinates with the given polar. |
void |
calcFactors(int type)
The method
calcFactors calculation of the factors to write the lines to the picture formats. |
void |
calcFactors(int type,
boolean is_old_processing)
The method
calcFactors calculation of the factors to write the lines to the picture formats. |
double |
calcXaxisValue(long X)
The Method
calcXaxisValue calculates the value of an x axis point. |
double |
calcYaxisValue(long Y)
The Method
calcYaxisValue calculates the value of an y axis point. |
double |
calcZaxisValue(long Z)
The Method
calcZaxisValue calculates the value of an z axis point. |
void |
deleteAddons()
The method
deleteAddons delete the names of the axis and the max values. |
void |
disposeImage()
The method
disposeImage ends the image class. |
void |
doInitialize()
The method
doInitialize initializes the attributes. |
void |
drawBorder()
The method
drawBorder draws a border. |
void |
drawGraphicName(int x,
int font_size)
The method
drawGraphicName draws the name of the graphic. |
void |
drawGridLines()
The method
drawGridLines draws the grid lines. |
void |
drawGridValues(java.awt.Font font,
int digitx,
int digity,
java.util.Locale locale)
The method
drawGridValues draws the grid values. |
void |
drawGridValues(java.awt.Font font,
int digitx,
int digity,
java.util.Locale locale,
boolean mirror)
The method
drawGridValues draws the grid values. |
void |
drawGridXValues(java.awt.Font font,
int digitx,
java.util.Locale locale)
The method
drawGridXValues draws the grid values of the x axis. |
void |
drawGridYValues(java.awt.Font font,
int digity,
int line,
java.util.Locale locale)
The method
drawGridYValues draws the grid values of the y axis. |
void |
drawGridYValues(java.awt.Font font,
int digity,
int line,
java.util.Locale locale,
boolean mirror)
The method
drawGridYValues draws the grid values of the y axis. |
void |
drawLegend(java.util.ArrayList legends)
The method
drawLegend draws the legends of the graphic. |
void |
drawLines(boolean candelete,
boolean convert_coordinates)
The method
drawLines draw all lines of the line list. |
void |
drawPoints(boolean candelete,
boolean convert_coordinates)
The method
drawPoints draws the points from the line list. |
void |
drawText(boolean candelete,
boolean convert_coordinates)
The method
drawText draws the text labels from the line list. |
java.awt.Graphics |
getGraph()
get field: the current graphics.
|
int |
getGraphicBorder()
get field: graphic_border
|
GraphicParameter |
getGraphicParameters()
get field: the current graphic parameters.
|
java.lang.String |
getHeight()
get field: the width of the image.
|
java.awt.image.BufferedImage |
getImage()
get field: the image.
|
int |
getImageHeight()
get field: image_height
|
int |
getImageWidth()
get field: image_width
|
double |
getMaxX()
get field: max. value of x.
|
double |
getMaxY()
get field: max. value of y.
|
double |
getMaxZ()
get field: max. value of z.
|
double |
getMinX()
get field: min. value of x.
|
double |
getMinY()
get field: min. value of y.
|
double |
getMinZ()
get field: min. value of z.
|
List4ImageLine |
getMousePoint(int x_point,
int y_point,
boolean convert_coordinates)
The method
getMousePoint gets a point with mouse coordinates.. |
java.lang.String |
getWidht()
get field: the width of the image.
|
byte[] |
resizeImage(byte[] xpic,
int max_height,
int max_width)
The method
resizeImage calculates show data for given image. |
void |
saveImage(java.lang.String filepath,
java.lang.String filename)
The method
saveImage stores the image file to the file system. |
void |
saveImage(java.lang.String filepath,
java.lang.String filename,
java.awt.Image im)
The method
saveImage stores the image file to the file system. |
void |
set3DParameter(double rho,
double theta,
double phi,
double distance)
add point to line list.
|
void |
setAxisMaxValues()
add max values to the axis.
|
void |
setAxisMaxValues(double xx2,
double xy2,
double xz2,
double yx2,
double yy2,
double yz2,
double zx2,
double zy2,
double zz2)
add max values to the axis.
|
void |
setAxisNames()
add names to the axis.
|
void |
setAxisNames(double xx2,
double xy2,
double xz2,
double yx2,
double yy2,
double yz2,
double zx2,
double zy2,
double zz2)
add names to the axis.
|
void |
setBackgroundColor(java.awt.Color color)
set field: background_color.
|
void |
setBackgroundColor(int red,
int green,
int blue)
set field: background_color.
|
void |
setGraphicBorder(int border)
set field: graphic_border.
|
void |
setGraphicName(java.lang.String name)
set field: graphic_name.
|
void |
setGraphicParameters()
The Method
setGraphicParameters sets the graphic parameter object. |
void |
setGraphicParameters(GraphicParameter gp)
The Method
setGraphicParameters sets the graphic parameter object. |
void |
setGridWidth(int width)
set field: grid_width.
|
void |
setKoordSystem2D(boolean printit)
set fields of coordinate system 2D.
|
void |
setKoordSystem2D(boolean printit,
double xx1,
double xy1,
double xx2,
double xy2,
double yx1,
double yy1,
double yx2,
double yy2)
set fields of coordinate system 2D.
|
void |
setKoordSystem3D(boolean printit,
double xx1,
double xy1,
double xz1,
double xx2,
double xy2,
double xz2,
double yx1,
double yy1,
double yz1,
double yx2,
double yy2,
double yz2,
double zx1,
double zy1,
double zz1,
double zx2,
double zy2,
double zz2)
set fields of kooridate system 3D.
|
void |
setLine(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
adds line to line list.
|
void |
setLines(java.util.ArrayList input)
set field: contens objects of the class ImageLine: x1 , y1 , x2 , y2.
|
void |
setMinMaxAdjustment(double set)
set field: min_max_adjustment.
|
void |
setPaintColor(java.awt.Color color)
set field: paint_color.
|
void |
setPaintColor(int red,
int green,
int blue)
set field: paint_color.
|
void |
setPoint(double x1,
double y1,
double z1)
add point to line list.
|
void |
setPointSize(int size)
set field: point_size.
|
void |
setXaxisName(java.lang.String name)
set field: x_axis_name.
|
void |
setYaxisName(java.lang.String name)
set field: y_axis_name.
|
void |
setZaxisName(java.lang.String name)
set field: z_axis_name.
|
public static final int COORDSYS_CARTESIAN
public static final int COORDSYS_POLAR
public static final int COORDSYS_DIM2
public static final int COORDSYS_DIM3
public static final int COORDSYS_XISY
public static final int COORDSYS_XNOTY
public double x_fac_mult
public double y_fac_mult
public double z_fac_mult
public int x_fac_add
public int y_fac_add
public int z_fac_add
public Tool4Image(java.awt.Graphics graph, int coordinate_system, int coordinate_dimension, int width, int height, boolean make_pic)
Tool4Image
creates a new instance(object) of the class.graph
- the graphic object.coordinate_system
- the type of the coord system.coordinate_dimension
- the dimension of the coord system.width
- width of the picture.height
- height of the picture.make_pic
- create a picture.public GraphicParameter getGraphicParameters()
public java.awt.Graphics getGraph()
public java.lang.String getWidht()
public java.lang.String getHeight()
public java.awt.image.BufferedImage getImage()
public void setXaxisName(java.lang.String name)
name
- the x axis name.public void setYaxisName(java.lang.String name)
name
- the y axis name.public void setZaxisName(java.lang.String name)
name
- the z axis name.public void setGraphicName(java.lang.String name)
name
- the graphic name.public double getMaxX()
public double getMinX()
public double getMaxY()
public double getMinY()
public double getMaxZ()
public double getMinZ()
public void setMinMaxAdjustment(double set)
set
- the min max adjustment.public void setPointSize(int size)
size
- the point size.public void setGraphicBorder(int border)
border
- the border.public void setGridWidth(int width)
width
- the grid width.public void setBackgroundColor(int red, int green, int blue)
red
- the color value read.green
- the color value green.blue
- the color value blue.public void setBackgroundColor(java.awt.Color color)
color
- the Color.public void setPaintColor(int red, int green, int blue)
red
- the color value read.green
- the color value green.blue
- the color value blue.public void setPaintColor(java.awt.Color color)
color
- the Color.public int getImageHeight()
public int getImageWidth()
public int getGraphicBorder()
public void setKoordSystem2D(boolean printit) throws java.lang.Exception
printit,
- true= print the data immediately.java.lang.Exception
- if errorpublic void setKoordSystem2D(boolean printit, double xx1, double xy1, double xx2, double xy2, double yx1, double yy1, double yx2, double yy2) throws java.lang.Exception
printit,
- true= print the data immediately.xx1
- coordinate x axis.xy1
- coordinate x axis.xx2
- coordinate x axis.xy2
- coordinate x axis.yx1
- coordinate y axis.yy1
- coordinate y axis.yx2
- coordinate y axis.yy2
- coordinate y axis.java.lang.Exception
- if errorpublic void setKoordSystem3D(boolean printit, double xx1, double xy1, double xz1, double xx2, double xy2, double xz2, double yx1, double yy1, double yz1, double yx2, double yy2, double yz2, double zx1, double zy1, double zz1, double zx2, double zy2, double zz2) throws java.lang.Exception
printit,
- true= print the data imediately.xx1
- coordiate x axisi.xy1
- coordiate x axisi.xz1
- coordiate x axisi.xx2
- coordiate x axisi.xy2
- coordiate x axisi.xz2
- coordiate x axisi.yx1
- coordiate y axisi.yy1
- coordiate y axisi.yz1
- coordiate y axisi.yx2
- coordiate y axisi.yy2
- coordiate y axisi.yz2
- coordiate y axisi.zx1
- coordiate z axisi.zy1
- coordiate z axisi.zz1
- coordiate z axisi.zx2
- coordiate z axisi.zy2
- coordiate z axisi.zz2
- coordiate z axisi.java.lang.Exception
- if errorpublic void setLines(java.util.ArrayList input)
input
- points and lines as list.public void setLine(double x1, double y1, double z1, double x2, double y2, double z2)
x1
- coordiate.y1
- coordiate.z1
- coordiate.x2
- coordiate.y2
- coordiate.z2
- coordiate.public void setPoint(double x1, double y1, double z1)
x1
- coordiate.y1
- coordinate.z1
- coordinate.public void set3DParameter(double rho, double theta, double phi, double distance)
rho
- the rho.theta
- the theta.phi
- the phi.distance
- the distance.public void setAxisMaxValues() throws java.lang.Exception
java.lang.Exception
- if errorpublic void setAxisMaxValues(double xx2, double xy2, double xz2, double yx2, double yy2, double yz2, double zx2, double zy2, double zz2) throws java.lang.Exception
xx2
- coordinate.xy2
- coordinate.xz2
- coordinate.yx2
- coordinate.yy2
- coordinate.yz2
- coordinate.zx2
- coordinate.zy2
- coordinate.zz2
- coordinate.java.lang.Exception
- if errorpublic void setAxisNames() throws java.lang.Exception
java.lang.Exception
- if errorpublic void setAxisNames(double xx2, double xy2, double xz2, double yx2, double yy2, double yz2, double zx2, double zy2, double zz2) throws java.lang.Exception
xx2
- coordinate.xy2
- coordinate.xz2
- coordinate.yx2
- coordinate.yy2
- coordinate.yz2
- coordinate.zx2
- coordinate.zy2
- coordinate.zz2
- coordinate.java.lang.Exception
- if errorpublic void doInitialize()
doInitialize
initializes the attributes.public void deleteAddons()
deleteAddons
delete the names of the axis and the max values.public void calcFactors(int type) throws java.lang.Exception
calcFactors
calculation of the factors to write the lines to the picture formats.type
- x=y, x!=yjava.lang.Exception
- if errorpublic void calcFactors(int type, boolean is_old_processing) throws java.lang.Exception
calcFactors
calculation of the factors to write the lines to the picture formats.type
- x=y, x!=yis_old_processing
- true: the old processing.java.lang.Exception
- if errorpublic void setGraphicParameters(GraphicParameter gp)
setGraphicParameters
sets the graphic parameter object.gp
- the external graphic parameters.public void setGraphicParameters()
setGraphicParameters
sets the graphic parameter object.public java.util.ArrayList calcCartesianCoords(double roh, double theta, double phi)
calcCartesianCoords
calculation of the cartesian
coordinates with the given polar.roh
- roh.theta
- theta.phi
- phi.public java.util.ArrayList calc3DCoords(double x, double y, double z, double cx, double cy)
calc3DCoords
transformation of the cartesian coordinates to 3D.x
- coorinate.y
- coordinate.z
- coordinate.cx
- center x.cy
- center y.public double calcXaxisValue(long X)
calcXaxisValue
calculates the value of an x axis point.X
- the X coordinate in pixel.public double calcYaxisValue(long Y)
calcYaxisValue
calculates the value of an y axis point.Y
- the Y coordinate in pixel.public double calcZaxisValue(long Z)
calcZaxisValue
calculates the value of an z axis point.Z
- the Z coordinate in pixel.public void drawLines(boolean candelete, boolean convert_coordinates) throws java.lang.Exception
drawLines
draw all lines of the line list.candelete
- true = delete the line list.convert_coordinates
- true = coordinates conversion with calculated factors.java.lang.Exception
- if errorpublic void drawPoints(boolean candelete, boolean convert_coordinates) throws java.lang.Exception
drawPoints
draws the points from the line list.candelete
- true = delete the line list.convert_coordinates
- true = coordinates conversion with calculated factors.java.lang.Exception
- if errorpublic void drawText(boolean candelete, boolean convert_coordinates) throws java.lang.Exception
drawText
draws the text labels from the line list.candelete
- true = delete the line list.convert_coordinates
- true = coordinates conversion with calculated factors.java.lang.Exception
- if errorpublic void drawBorder()
drawBorder
draws a border.public void drawGridLines()
drawGridLines
draws the grid lines.public void drawGridValues(java.awt.Font font, int digitx, int digity, java.util.Locale locale) throws java.lang.Exception
drawGridValues
draws the grid values.font
- the font for the grid values.digitx
- the digits after the decimal point of the x axis values.digity
- the digits after the decimal point of the y axis values.locale
- the locale for formatting the values.java.lang.Exception
- if errorpublic void drawGridValues(java.awt.Font font, int digitx, int digity, java.util.Locale locale, boolean mirror) throws java.lang.Exception
drawGridValues
draws the grid values.font
- the font for the grid values.digitx
- the digits after the decimal point of the x axis values.digity
- the digits after the decimal point of the y axis values.locale
- the locale for formatting the values.mirror
- mirror the values.java.lang.Exception
- if errorpublic void drawGridXValues(java.awt.Font font, int digitx, java.util.Locale locale) throws java.lang.Exception
drawGridXValues
draws the grid values of the x axis.font
- the font for the grid values.digitx
- the digits after the decimal point of the x axis values.locale
- the locale for formatting the values.java.lang.Exception
- if errorpublic void drawGridYValues(java.awt.Font font, int digity, int line, java.util.Locale locale) throws java.lang.Exception
drawGridYValues
draws the grid values of the y axis.font
- the font for the grid values.digity
- the digits after the decimal point of the y axis values.line
- the line of the value.locale
- the locale for formatting the values.java.lang.Exception
- if errorpublic void drawGridYValues(java.awt.Font font, int digity, int line, java.util.Locale locale, boolean mirror) throws java.lang.Exception
drawGridYValues
draws the grid values of the y axis.font
- the font for the grid values.digity
- the digits after the decimal point of the y axis values.line
- the line of the value.locale
- the locale for formatting the values.mirror
- mirror the values.java.lang.Exception
- if errorpublic void drawGraphicName(int x, int font_size)
drawGraphicName
draws the name of the graphic.x
- the coodination x position of the graphics name.font_size
- the size of the font.public void drawLegend(java.util.ArrayList legends)
drawLegend
draws the legends of the graphic.legends
- the legends list.public void disposeImage()
disposeImage
ends the image class.public byte[] resizeImage(byte[] xpic, int max_height, int max_width) throws java.lang.Exception
resizeImage
calculates show data for given image.xpic
- the image.max_height
- the maximum hight of the image.max_width
- the maximum width of the image.java.lang.Exception
- if errorpublic void saveImage(java.lang.String filepath, java.lang.String filename) throws java.lang.Exception
saveImage
stores the image file to the file system.filepath
- path to file system.filename
- name of image file.java.lang.Exception
- if errorpublic void saveImage(java.lang.String filepath, java.lang.String filename, java.awt.Image im) throws java.lang.Exception
saveImage
stores the image file to the file system.filepath
- path to file system.filename
- name of image file.im
- the image.java.lang.Exception
- if errorpublic List4ImageLine getMousePoint(int x_point, int y_point, boolean convert_coordinates) throws java.lang.Exception
getMousePoint
gets a point with mouse coordinates..x_point
- the mouse x coordinate.y_point
- the mouse y coordinate.convert_coordinates
- true = coordinates conversion with calculated factors.java.lang.Exception
- if error