All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class WBMPcreator.WBMPfile

java.lang.Object
    |
    +----WBMPcreator.WBMPfile

public class WBMPfile
extends java.lang.Object
Author:
Max Jury Krainov

Variable Index

 o APPEND_MODE_CONTINUOUS
A constant value used to append string to a bitmap.
 o APPEND_MODE_DIVISION
A constant value used to append string to a bitmap.
 o LINE_CHAIN3_1
Line will look like a chain line with 3-point long lines and 1-point spaces
 o LINE_CHAIN3_2
Line will look like a chain line with 3-point long lines and 2-point spaces
 o LINE_INT2_1
Line will look like a group of 2-point intervals lying on a single line and having 1-point space between intervals.
 o LINE_INT2_2
Line will look like a group of 2-point intervals lying on a single line and having 2-point space between intervals.
 o LINE_INT3_2
Line will look like a group of 3-point intervals lying on a single line and having 2-point space between intervals.
 o LINE_POINT1
All points of a line will be drawn with 1 point interval
 o LINE_POINT2
All points of a line will be drawn with 2 points interval
 o LINE_POINT3
All points of a line will be drawn with 3 points interval
 o MIX_MODE_AND
A constant value used for mixing bitmaps.
 o MIX_MODE_NOT
A constant value used for mixing bitmaps.
 o MIX_MODE_OR
A constant value used for mixing bitmaps.
 o MIX_MODE_XOR
A constant value used for mixing bitmaps.

Constructor Index

 o WBMPfile()
empty constructor
 o WBMPfile(int, int)
this constructor creates the blank WBMP file.
 o WBMPfile(int, int, int[][])
this constructor creates the WBMP file.
 o WBMPfile(String)
constructor with the filename
 o WBMPfile(String, int)
Method to create WBMPfile instance from WEB This will help much in creating images based on the images stored somewhere in the Internet.

Method Index

 o createWBMPFile()
Method to create the new WBMPfile filled with white.
 o destroyWBMPFile()
Removes the WBMPfile instance from memory.
 o draw3DRect(int, int, int, int, boolean, boolean)
Method to draw a 3D rectangle.
 o drawArc(int, int, int, int, int, int)
Method drawing the arc with the following parameters:
 o drawCircle(int, int, int, int, boolean)
Method to draw a circle.
 o drawLine(int, int, int, int)
Method to draw a line on the lower layer (current layer).
 o drawOval(int, int, int, int, boolean)
Method to draw oval with the selected length and width
 o drawPoint(int, int, int)
Method to draw a point with the selected color at the coordinates X, Y.
 o drawRect(int, int, int, int, boolean)
Method to draw a rectangle.
 o drawSpecialLine(int, int, int, int, int, int)
Method to draw a special line.
 o drawString(String, int, int, Font)
Method to draw text on the current layer.
 o getElementAt(int, int)
this int returns the value of the desired point
 o getRectArea(WBMPDimension)
Method to get a piece of an image.
 o getStream()
Method to get PrintStream representation of a WBMPfile.
 o getString()
This method returns java.lang.String representation of a WBMPfile.
 o getWBMPLength()
Gets the length of the image.
 o getWBMPpic()
Method to let user obtain point arrays without delay.
idea by Borut Fabjan
 o getWBMPWidth()
Gets the width of the image.
 o invertWBMPImage()
This method inverts image so that all black pixels turn into white and vice versa.
 o mix(WBMPfile, int)
this function mixes the given picture with the current.
 o mix(WBMPfile, int, int, int)
this function mixes the given picture with the current.
 o openWBMPFile(String)
Method to read WBMPfile from the disk and to create a WBMPfile instance in memory.
 o printWBMPImage()
Method to put WBMP image's contents to the screen.
 o rotate(int)
Method to rotate a WBMP image.
 o saveWBMP2File(String)
method to save WBMPfile instance to a file with the given filename.
 o setElementAt(int, int, int)
this void assigns value to the given cell
 o setWBMPLength(int)
Sets the new length of the image.
 o setWBMPWidth(int)
Sets the new width of the image.
 o writeToOutputStream(OutputStream)
Method to write WBMPimage into the given stream.

Field Detail

 o MIX_MODE_XOR
public static final int MIX_MODE_XOR
          A constant value used for mixing bitmaps. XOR mode
 o MIX_MODE_AND
public static final int MIX_MODE_AND
          A constant value used for mixing bitmaps. AND mode
 o MIX_MODE_OR
public static final int MIX_MODE_OR
          A constant value used for mixing bitmaps. OR mode
 o MIX_MODE_NOT
public static final int MIX_MODE_NOT
          A constant value used for mixing bitmaps. NOT mode
 o APPEND_MODE_DIVISION
public static final int APPEND_MODE_DIVISION
          A constant value used to append string to a bitmap. Currently not used.
 o APPEND_MODE_CONTINUOUS
public static final int APPEND_MODE_CONTINUOUS
          A constant value used to append string to a bitmap. Currently not used.
 o LINE_POINT1
public static final int LINE_POINT1
          All points of a line will be drawn with 1 point interval
 o LINE_POINT2
public static final int LINE_POINT2
          All points of a line will be drawn with 2 points interval
 o LINE_POINT3
public static final int LINE_POINT3
          All points of a line will be drawn with 3 points interval
 o LINE_INT2_1
public static final int LINE_INT2_1
          Line will look like a group of 2-point intervals lying on a single line and having 1-point space between intervals.
 o LINE_INT2_2
public static final int LINE_INT2_2
          Line will look like a group of 2-point intervals lying on a single line and having 2-point space between intervals.
 o LINE_INT3_2
public static final int LINE_INT3_2
          Line will look like a group of 3-point intervals lying on a single line and having 2-point space between intervals.
 o LINE_CHAIN3_1
public static final int LINE_CHAIN3_1
          Line will look like a chain line with 3-point long lines and 1-point spaces
 o LINE_CHAIN3_2
public static final int LINE_CHAIN3_2
          Line will look like a chain line with 3-point long lines and 2-point spaces

Constructor Detail

 o WBMPfile
public WBMPfile()
          empty constructor
 o WBMPfile
public WBMPfile(java.lang.String filename)
          constructor with the filename
 o WBMPfile
public WBMPfile(int length,
                int width)
          this constructor creates the blank WBMP file.
Parameters:
length - the length of a WBMP file in pixels
width - the width of a WBMP image in pixels
 o WBMPfile
public WBMPfile(int length,
                int width,
                int picData[][])
          this constructor creates the WBMP file.
Parameters:
length - the length of a WBMP file in pixels
width - the width of a WBMP image in pixels
picData - the array of points of a WBMP file
 o WBMPfile
public WBMPfile(java.lang.String url,
                int port)
          Method to create WBMPfile instance from WEB This will help much in creating images based on the images stored somewhere in the Internet.
Parameters:
url - the URL of a wbmp file. MUST be with "http://" or another beginning.
port - port for the URL (for HTTP it is 80)

Method Detail

 o setWBMPLength
public void setWBMPLength(int newLength)
          Sets the new length of the image.
 o getWBMPLength
public int getWBMPLength()
          Gets the length of the image.
 o setWBMPWidth
public void setWBMPWidth(int newWidth)
          Sets the new width of the image.
 o getWBMPWidth
public int getWBMPWidth()
          Gets the width of the image.
 o createWBMPFile
public void createWBMPFile()
          Method to create the new WBMPfile filled with white. NOTE: length and width must be specified before!
 o destroyWBMPFile
public void destroyWBMPFile()
          Removes the WBMPfile instance from memory.
 o setElementAt
public void setElementAt(int X,
                         int Y,
                         int value)
          this void assigns value to the given cell
 o getElementAt
public int getElementAt(int X,
                        int Y)
          this int returns the value of the desired point
 o saveWBMP2File
public void saveWBMP2File(java.lang.String filename)
          method to save WBMPfile instance to a file with the given filename.
Parameters:
filename - the filename of a resulting image.
 o openWBMPFile
public WBMPfile openWBMPFile(java.lang.String filename)
          Method to read WBMPfile from the disk and to create a WBMPfile instance in memory.
Parameters:
filename - the name of a file to be read.
 o printWBMPImage
public void printWBMPImage()
          Method to put WBMP image's contents to the screen. White color is substituted with 1, black color is substituted with 0.
 o invertWBMPImage
public void invertWBMPImage()
          This method inverts image so that all black pixels turn into white and vice versa. Sometimes it may be useful.
 o mix
public WBMPfile mix(WBMPfile layer1,
                    int mixMode)
          this function mixes the given picture with the current. Assuming the resolution to be the same
Parameters:
layer1 - the upper layer (the given picture)
mixMode - the way to mix the pictures
 o mix
public WBMPfile mix(WBMPfile layer1,
                    int mixMode,
                    int X,
                    int Y)
          this function mixes the given picture with the current. Assuming the resolutions different
Parameters:
layer1 - the upper layer (the given picture)
mixMode - the way to mix the pictures
X - the upper left X coordinate of the lower layer
Y - the upper left Y coorinate of the lower layer
 o drawString
public void drawString(java.lang.String text,
                       int X,
                       int Y,
                       java.awt.Font inFont)
          Method to draw text on the current layer.
Parameters:
text - the text to be drawn
X - the lower left X coordinate of the layer
Y - the lower left Y coordinate of the layer

NOTE that it can work on Java version 1.2 and higher platforms.

 o drawLine
public void drawLine(int x_1,
                     int y_1,
                     int x_2,
                     int y_2)
          Method to draw a line on the lower layer (current layer).
Parameters:
x_1 - X coordinate of FROM point
y_1 - Y coordinate of FROM point
x_2 - X coordinate of TO point
y_2 - Y coordinate of TO point

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms

 o drawOval
public void drawOval(int x,
                     int y,
                     int length,
                     int width,
                     boolean isFilled)
          Method to draw oval with the selected length and width
Parameters:
x - X coordinate of left upper corner
y - Y coordinate of left upper corner
length - length of the oval
width - width of the oval
isFilled - fills (true) or not (false) the oval

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms

 o drawPoint
public void drawPoint(int x,
                      int y,
                      int color)
          Method to draw a point with the selected color at the coordinates X, Y.
Parameters:
x - X coordinate of a point
y - Y coordinate of a point
color - the color of a point. NOTE! Due to WAP phones support only b&w picture mode, it's better to use 1 and 0 colors.
 o drawRect
public void drawRect(int x,
                     int y,
                     int length,
                     int width,
                     boolean isFilled)
          Method to draw a rectangle.
Parameters:
x - X coordinate of upper left corner of a rectangle
y - Y coordinate of upper left corner of a rectangle
length - length of a rectangle
width - width of a rectangle
isFilled - fills (true) or not (false) the rectangle

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms

 o draw3DRect
public void draw3DRect(int x,
                       int y,
                       int length,
                       int width,
                       boolean isFilled,
                       boolean isRaised)
          Method to draw a 3D rectangle.
Parameters:
x - X coordinate of upper left corner of a 3D rectangle
y - Y coordinate of upper left corner of a 3D rectangle
length - length of a 3D rectangle
width - width of a 3D rectangle
isFilled - fills (true) or not (false) a 3D rectangle
isRaised - is the border raised? true/false

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms

 o drawArc
public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
          Method drawing the arc with the following parameters:
Parameters:
x - the X coordinate of the left upper point of a rectangle containing the arc
y - the X coordinate of the left upper point of a rectangle containing the arc
width - the width of a rectangle containing the arc
height - the height of a rectangle containing the arc
startAngle - refer to java.awt.Graphics for details
arcAngle - refer to java.awt.Graphics for details

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms

 o getString
public java.lang.String getString()
          This method returns java.lang.String representation of a WBMPfile. This may be useful for storing WBMP pictures in any database and for simplifying the work with it.
The output format is quite the same as WBMP. The only difference is that saveWBMP2File() writes the file to the disk and this metod returns a string available fo any future use.
See Also:
WBMPcreator.WBMPfile#saveWBMP2File()
 o rotate
public WBMPfile rotate(int angle)
          Method to rotate a WBMP image. The result is also WBMP image with other dimensions: length of WBMP image turns into width and v.v. This is true for odd values of angle variable
Parameters:
angle - an integer representing quantity of Pi/2 rotations in positive direction (mathematicians will understand me :-|). I.e. if angle equals 0 then the image remains the same. If angle is even then dimensions also remain the same and if it is equal to n*4 where n is an integer then the picture returned is equal to current. Odd values of angle modify dimensions.
 o getRectArea
public WBMPfile getRectArea(WBMPDimension area)
          Method to get a piece of an image.
Parameters:
area - a dimension
See Also:
WBMPcreator.WBMPDimension#WBMPDimension()
 o getStream
public java.io.PrintStream getStream()
          Method to get PrintStream representation of a WBMPfile.
 o getWBMPpic
public int[][] getWBMPpic()
          Method to let user obtain point arrays without delay.
idea by Borut Fabjan
 o writeToOutputStream
public boolean writeToOutputStream(java.io.OutputStream os)
          Method to write WBMPimage into the given stream.
idea by Max Krainov (the author)
Parameters:
os - the OutputStream where data should be written
Returns:
true if the operation succeeded;
false otherwise.
 o drawCircle
public void drawCircle(int x,
                       int y,
                       int radius,
                       int color,
                       boolean isFilled)
          Method to draw a circle. It can also run on Java 1.0 platform as well as on the 1.1 Java platform.
Parameters:
x - the centre point x axis coordinate
y - the centre point y axis coordinate
radius - the radius of a circle
color - the color of a circle
isFilled - is the circle filled
 o drawSpecialLine
public void drawSpecialLine(int x1,
                            int y1,
                            int x2,
                            int y2,
                            int line_type,
                            int color)
          Method to draw a special line. It can also run on Java 1.0 platform as well as on the 1.1 Java platform.
Parameters:
x1 - the first point x axis coordinate
y1 - the first point y axis coordinate
x2 - the second point x axis coordinate
y2 - the second point y axis coordinate
line_type - the type of a special line
color - the color of a line

All Packages  Class Hierarchy  This Package  Previous  Next  Index