|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GpadComponent
A gpad component is an object that contains graphical operations to be performed on the Paintlet canvas. The user can run the component and supply parameter values to it by interacting with a Gpad GUI.
The GpadComponent
class is the abstract superclass of
all gpad components.
Gpad components are developed by extending GpadComponent
and implementing initComponent
and runComponent
.
Component parameters are added within initComponent
. Other
initialization normally found in a constructor should be defined here.
Gpad components should not define a constructor.
User-supplied parameter values are obtained in runComponent
.
This is followed by the specification of drawing operations using the
methods of the GpadComponent
class.
The width of the Paintlet canvas is 416 pixels and the height is 388 pixels. The constants GpadParm.WIDTH and GpadParm.HEIGHT should be used to refer to these values.
GpadParm
,
GpadException
,
GpadParmException
,
GpadFilter
,
GpadCurve
,
GpadAnimation
Field Summary | |
GpadParm |
gparm
Container for parameter values. |
boolean |
parameters
Flag indicating whether component has parameters. |
Constructor Summary | |
GpadComponent()
Class constructor. |
Method Summary | |
void |
addParameter(java.lang.String parmName,
int parmType)
Adds a parameter to the component of the specified name and type. |
GpadParm |
getGpadParm()
Retrieves the GpadParm object associated with this
gpad component. |
java.awt.Choice |
getVariableChoice(java.lang.String paramName)
Invoked when a variable parameter type is selected on this component. |
void |
gpAnimate(GpadAnimation gpa)
Runs an animation sequence specified by the GpadAnimation
parameter. |
void |
gpApplyCurve(GpadCurve gpc)
Applies the curve generation specified by the GpadCurve
parameter to the canvas. |
void |
gpApplyFilter(GpadFilter gpf)
Applies the filter operation specified by the GpadFilter
parameter. |
void |
gpBlend(int x,
int y)
Applies a semi-transparent swatch of paint at the point (x,y). |
void |
gpBlendText(java.lang.String s,
int x,
int y,
int w,
boolean jagged)
Draws the specified string with the gpBlend method. |
void |
gpCircle(int x,
int y,
int w,
int h)
Deprecated. Replaced by gpOval |
java.awt.Image |
gpCreateImage(java.awt.image.MemoryImageSource mis)
Returns an Image created from the specified MemoryImageSource . |
void |
gpDrawImage(java.awt.Image img,
int x,
int y)
Draws the specified image with the top-left corner at the point (x,y). |
void |
gpDrawImage(java.awt.Image img,
int x,
int y,
int w,
int h)
Draws the specified image, scaled, with the top-left corner at the point (x,y). |
void |
gpDrawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2)
Draws the specified image, scaled, with as much of the image as is currently available. |
void |
gpDrawImageBrush(java.util.Vector v,
int startPtX,
int startPtY)
Draws the current image brush at the coordinates specified by the collection of points in the vector. |
void |
gpDrawLineMeasuredText(java.text.AttributedString as,
java.awt.Point p,
float wrapWidth)
Draws the AttributedString parameter as a paragraph of text
with a specified wrapping width. |
java.awt.Point |
gpDrawLineMeasuredText(java.text.AttributedString as,
java.awt.Point p,
float wrapWidth,
boolean b)
Deprecated. No replacement |
void |
gpDrawShape(java.awt.Shape s)
Draws the Shape specified by parameter s. |
void |
gpDrawStringCentered(java.lang.String s,
java.awt.Rectangle r)
Draws the text given by the specified string centered in the parameter rectangle. |
void |
gpDrawStringLowerLeft(java.lang.String s,
java.awt.Rectangle r)
Draws the text given by the specified string at the lower left region of the parameter rectangle. |
void |
gpDrawStringLowerRight(java.lang.String s,
java.awt.Rectangle r)
Draws the text given by the specified string at the lower right region of the parameter rectangle. |
void |
gpDrawStringUpperLeft(java.lang.String s,
java.awt.Rectangle r)
Draws the text given by the specified string at the upper left region of the parameter rectangle. |
void |
gpDrawStringUpperRight(java.lang.String s,
java.awt.Rectangle r)
Draws the text given by the specified string at the upper right region of the parameter rectangle. |
void |
gpFillBackground(java.awt.Color c)
Fills the Paintlet canvas with the specified color. |
java.awt.Image |
gpGetCanvasImage()
Returns the canvas Image . |
java.awt.Image |
gpGetImage(java.io.File f)
Returns the specified File parameter as an Image . |
java.awt.Image |
gpGetImageBrush()
Returns the currently selected image brush. |
int |
gpGetImageBrushHeight()
Returns the height of the current image brush. |
int |
gpGetImageBrushWidth()
Returns the width of the current image brush. |
int |
gpGetImageHeight(java.awt.Image img)
Returns the height of the specified image. |
int |
gpGetImageWidth(java.awt.Image img)
Returns the width of the specified image. |
java.awt.geom.Rectangle2D |
gpGetStringBounds(java.lang.String s)
Returns the bounding rectangle of the specified string. |
int |
gpGetStringHeight(java.lang.String s)
Returns the height of the specified string. |
int |
gpGetStringHeight(java.lang.String s,
java.awt.Font f)
Returns the height of the string when drawn in the specified font. |
int |
gpGetStringWidth(java.lang.String s)
Returns the width of the specified string. |
int |
gpGetStringWidth(java.lang.String s,
java.awt.Font f)
Returns the width of the string when drawn in the specified font. |
void |
gpImageBack()
Tiles the canvas with the current image brush. |
void |
gpImageBack(boolean b,
int horz,
int vert)
Tiles the canvas with the current image brush at specified horizontal and vertical intervals. |
void |
gpImageText(java.lang.String s,
int x,
int y)
Draws the specified string with the current image brush. |
void |
gpLine(int x,
int y,
int x1,
int y1)
Draws a line between the points (x,y) and (x1,y1). |
void |
gpOval(int x,
int y,
int w,
int h)
Draws an oval. |
void |
gpPaintImgCircle(java.awt.Point startPt,
java.awt.Point endPt)
Draws a circle using the current image brush. |
void |
gpPaintImgLine(int x1,
int y1,
int x2,
int y2)
Draws a line using the current image brush. |
void |
gpQuadCurve(int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
Draws a quadradic curve from the start point (x1,y1) to the end point (x3,y3) where (x2,y2) is the control point. |
void |
gpRectangle(int x,
int y,
int w,
int h)
Draws a rectangle. |
void |
gpRepaint()
Repaints the entire canvas. |
void |
gpRepaint(int x,
int y,
int w,
int h)
Repaints a region of the canvas. |
void |
gpRestoreDefaults()
Sets Paintlet's rendering variables to their default values. |
void |
gpSaveCanvas(java.lang.String name,
java.awt.Rectangle r)
Deprecated. Replaced by gpSaveCanvasToJPG |
void |
gpSaveCanvasToJPG(java.lang.String name,
java.awt.Rectangle r)
Saves a region of the Paintlet canvas as a JPEG file. |
void |
gpSaveImageToFile(java.io.File f,
java.awt.image.BufferedImage img)
Saves a BufferedImage as a JPEG file. |
void |
gpSaveImageToFile(java.io.File f,
java.awt.image.BufferedImage img,
float saveQuality)
Saves a BufferedImage as a JPEG file with the specified
quality-compression setting. |
void |
gpSaveScaledCanvas(java.lang.String name,
int width,
int height)
Saves a scaled version of the Paintlet canvas as a JPEG file. |
void |
gpSetAntiAlias(boolean b)
Sets rendering to be done with antialiasing when value of parameter b is true. |
void |
gpSetBrushDensity(int i)
Sets the density of the paint brush for the spray operation. |
void |
gpSetBrushWidth(int x)
Sets the width of the paint brush for rendering operations. |
void |
gpSetColor(java.awt.Color c)
Sets the current color to the specified color. |
void |
gpSetFillShape(boolean b)
Deprecated. Replaced by gpSetShapeFill |
void |
gpSetFont(java.awt.Font f)
Sets the font for text rendering. |
void |
gpSetFont(java.lang.String name,
int type,
int size)
Sets the font for text rendering to the Font with the
specified name, style and face. |
void |
gpSetFontHiLite(boolean b)
Text will be drawn with a hilite when the parameter is true. |
void |
gpSetFontHiLite(boolean b,
int size,
java.awt.Color c)
Text will be drawn with a hilite in the specified size and color when the parameter b is true. |
void |
gpSetFontShear(double d)
Deprecated. No replacement |
void |
gpSetGradient(boolean b)
Sets the paint rendering mode to a color gradient when the value of the parameter b is true. |
void |
gpSetGradient(boolean b,
java.awt.Color c1,
java.awt.Color c2)
Sets the paint rendering mode to a gradient of two specified colors when the value of the parameter b is true. |
void |
gpSetGradient(boolean b,
java.awt.Color c1,
java.awt.Color c2,
boolean cyclic)
Sets the paint rendering mode to a cyclic, two-color gradient when the value of the parameters b and cyclic are true. |
void |
gpSetImageBrush(int i)
Sets the current image brush to the specified image. |
void |
gpSetShapeFill(boolean b)
Sets the rendering of shapes to filled when parameter b is true, and drawn when false. |
void |
gpSetText(java.lang.String text,
int x,
int y)
Draws the text specified by the String parameter using the
current font and paint color. |
void |
gpSetTips(java.awt.Image img)
Registers the image to be displayed as a tip. |
void |
gpSetTips(java.lang.String text)
Registers the text to be displayed as a tip. |
void |
gpSetTransparent(boolean b)
Sets the paint rendering mode to transparent when the value of the parameter b is true. |
void |
gpSetTransparent(boolean b,
float f)
Sets the paint rendering mode to a specified transparency when the value of the parameter b is true. |
void |
gpSpray(int x,
int y)
Applies a paint spray to the canvas. |
void |
gpTextBackground(java.lang.String text,
java.lang.String fontName,
int fontType,
int fontSize,
java.awt.Color c)
Tiles the Paintlet canvas with the specified text in the given font. |
abstract void |
initComponent()
An implementation of this abstract method must be
provided when developing a gpad component. |
void |
newBackground(java.awt.Color c)
Deprecated. Replaced by gpFillBackground |
abstract void |
runComponent()
Invoked when the component is run by the user. |
void |
setTipsEnabled(boolean b)
Deprecated. No replacement |
void |
showTips()
Displays the tip that is registered on this component. |
boolean |
showTipsEnabled()
Deprecated. No replacement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public boolean parameters
public GpadParm gparm
GpadParm
Constructor Detail |
public GpadComponent()
Method Detail |
public abstract void initComponent()
abstract
method must be
provided when developing a gpad component. Normally, this method
initializes the component by adding zero or more parameters. Also
performs other initialization normally found in a constructor.
Gpad components should not define a constructor.public abstract void runComponent()
abstract
method must be provided when developing
a gpad component. This method retrieves parameter values, if
any, and executes operations on the Paintlet canvas using
methods of this class.public final void addParameter(java.lang.String parmName, int parmType)
GpadParm
.parmName
- the string that is to be this parameter's nameparmType
- the type of this parameterGpadParm
public final GpadParm getGpadParm()
GpadParm
object associated with this
gpad component. Parameters can be retrieved with this object.
return GpadParm a GpadParm
object with this component's parametersGpadParm.getParmValue(String)
public java.awt.Choice getVariableChoice(java.lang.String paramName)
variable
parameter type is selected on this component.
This method should be overridden by components with variable
parameters. The Choice
object returned contains a list of one
or more String
s. Returns a Choice
object with the
String
null by default.
The argument String
is the name of this parameter. If more
than one variable
parameter is added to this component, the
argument String
is used to determine which Choice
object should be returned.
The returned Choice
object is displayed in the Gpad GUI
when the user selects the variable
type parameter.
paramName
- the name of the variable
type parameterChoice
object containing variable
parameter valuesChoice
public final void gpSetTips(java.lang.String text)
showTips
method is invoked.text
- the string to displaypublic final void gpSetTips(java.awt.Image img)
showTips
method is invoked. Either String
or Image
tips may be registered on a component, but not both.img
- the Image
to displaypublic final void showTips()
JOptionPane
message.gpSetTips(String)
,
gpSetTips(Image)
public final boolean showTipsEnabled()
public final void setTipsEnabled(boolean b)
public final void gpRestoreDefaults()
public final void gpSetColor(java.awt.Color c)
c
- the new colorColor
public final void gpSetGradient(boolean b)
gpSetColor
method.b
- when true paints in two-color gradientgpSetColor(Color)
,
gpSetGradient(boolean,Color,Color)
,
gpSetGradient(boolean,Color,Color,boolean)
public final void gpSetGradient(boolean b, java.awt.Color c1, java.awt.Color c2)
b
- when true paints in two-color gradientc1
- the first color of the color gradientc2
- the second color of the color gradientgpSetGradient(boolean)
,
gpSetGradient(boolean,Color,Color,boolean)
public final void gpSetGradient(boolean b, java.awt.Color c1, java.awt.Color c2, boolean cyclic)
b
- when true paints in two-color gradientc1
- the first color of the color gradientc2
- the second color of the color gradientcyclic
- when true paints in a cyclic gradientgpSetGradient(boolean)
,
gpSetGradient(boolean,Color,Color)
public final void gpSetTransparent(boolean b)
b
- when true paint rendering is transparentgpSetTransparent(boolean,float)
public final void gpSetTransparent(boolean b, float f)
b
- when true paint rendering is transparentf
- the value specifying the transparency of the paintgpSetTransparent(boolean)
public final void gpSetAntiAlias(boolean b)
b
- when true rendering is done with antialiasingpublic final void gpSetFillShape(boolean b)
gpSetShapeFill(boolean)
public final void gpSetShapeFill(boolean b)
b
- when true shape rendering is filled or solidpublic final void gpSetBrushWidth(int x)
x
- the width of the paint brushpublic final void gpSetBrushDensity(int i)
i
- the number of points to spray when gpSpray is invokedgpSpray(int,int)
public final void newBackground(java.awt.Color c)
gpFillBackground(Color)
public final void gpFillBackground(java.awt.Color c)
c
- the background colorpublic final void gpTextBackground(java.lang.String text, java.lang.String fontName, int fontType, int fontSize, java.awt.Color c)
text
- the text tiled on the canvasfontName
- the name of the font to render textfontType
- the type of font to render textfontSize
- the size of the font to render textc
- the top color of the background color gradientpublic final void gpLine(int x, int y, int x1, int y1)
x
- the x coordinate of the first pointy
- the y coordinate of the first pointx1
- the x coordinate of the second pointy1
- the y coordinate of the second pointpublic final void gpCircle(int x, int y, int w, int h)
gpOval(int,int,int,int)
public final void gpOval(int x, int y, int w, int h)
x
- the x coordinate of the upper left corner of the ovaly
- the y coordinate of the upper left corner of the ovalw
- the width of the oval to be drawnh
- the height of the oval to be drawnpublic final void gpRectangle(int x, int y, int w, int h)
x
- the x coordinate of the upper left corner of the rectangley
- the y coordinate of the upper left corner of the rectanglew
- the width of the rectangle to be drawnh
- the height of the rectangle to be drawnpublic final void gpQuadCurve(int x1, int y1, int x2, int y2, int x3, int y3)
x1
- the x coordinate of the start pointy1
- the y coordinate of the start pointx2
- the x coordinate of the control pointy2
- the y coordinate of the control pointx3
- the x coordinate of the end pointy3
- the y coordinate of the end pointpublic final void gpDrawShape(java.awt.Shape s)
Shape
specified by parameter s.s
- the Shape
to drawShape
public final void gpSpray(int x, int y)
x
- the x coordinate of the spray anchor pointy
- the y coordinate of the spray anchor pointgpSetBrushDensity(int)
public final void gpBlend(int x, int y)
x
- the x coordinate of the blend pointy
- the y coordinate of the blend pointgpSetBrushWidth(int)
public final void gpSetText(java.lang.String text, int x, int y)
String
parameter using the
current font and paint color. The baseline of the first character is at
point (x,y).text
- the text to drawx
- the x coordinate of the text anchor pointy
- the y coordinate of the text anchor pointgpDrawLineMeasuredText(AttributedString,Point,float)
,
gpSetFont(Font)
,
gpBlendText(String,int,int,int,boolean)
,
gpImageText(String,int,int)
public final java.awt.Point gpDrawLineMeasuredText(java.text.AttributedString as, java.awt.Point p, float wrapWidth, boolean b)
public final void gpDrawLineMeasuredText(java.text.AttributedString as, java.awt.Point p, float wrapWidth)
AttributedString
parameter as a paragraph of text
with a specified wrapping width. Anchor point for the string is parameter
p. The line-breaking policy is found in LineBreakMeasurer
.as
- the AttributedString
to be drawnp
- the anchor point for the textwrapWidth
- the width that each text line fits toAttributedString
,
LineBreakMeasurer
,
TextLayout
public final void gpDrawStringCentered(java.lang.String s, java.awt.Rectangle r)
s
- the text to drawr
- the rectangular area to center the text withingpDrawStringUpperRight(String,Rectangle)
,
gpDrawStringLowerRight(String,Rectangle)
,
gpDrawStringUpperLeft(String,Rectangle)
,
gpDrawStringLowerLeft(String,Rectangle)
public final void gpDrawStringUpperRight(java.lang.String s, java.awt.Rectangle r)
s
- the text to drawr
- the rectangular area to draw the text withingpDrawStringCentered(String,Rectangle)
,
gpDrawStringLowerRight(String,Rectangle)
,
gpDrawStringUpperLeft(String,Rectangle)
,
gpDrawStringLowerLeft(String,Rectangle)
public final void gpDrawStringLowerRight(java.lang.String s, java.awt.Rectangle r)
s
- the text to drawr
- the rectangular area to draw the text withingpDrawStringCentered(String,Rectangle)
,
gpDrawStringUpperRight(String,Rectangle)
,
gpDrawStringUpperLeft(String,Rectangle)
,
gpDrawStringLowerLeft(String,Rectangle)
public final void gpDrawStringLowerLeft(java.lang.String s, java.awt.Rectangle r)
s
- the text to drawr
- the rectangular area to draw the text withingpDrawStringCentered(String,Rectangle)
,
gpDrawStringUpperRight(String,Rectangle)
,
gpDrawStringLowerRight(String,Rectangle)
,
gpDrawStringUpperLeft(String,Rectangle)
public final void gpDrawStringUpperLeft(java.lang.String s, java.awt.Rectangle r)
s
- the text to drawr
- the rectangular area to draw the text withingpDrawStringCentered(String,Rectangle)
,
gpDrawStringUpperRight(String,Rectangle)
,
gpDrawStringLowerRight(String,Rectangle)
,
gpDrawStringLowerLeft(String,Rectangle)
public final void gpSetFont(java.awt.Font f)
f
- the font objectgpSetFont(String,int,int)
,
Font
public final void gpSetFont(java.lang.String name, int type, int size)
Font
with the
specified name, style and face. All subsequent text operations will
use this font.name
- the font face nametype
- the font style constant from the Font
classsize
- the font sizegpSetFont(java.awt.Font)
,
Font
public final void gpSetFontHiLite(boolean b)
b
- When true, a text hilite will be drawn.gpSetText(String,int,int)
public final void gpSetFontHiLite(boolean b, int size, java.awt.Color c)
b
- When true, a text hilite will be drawn.size
- the size of the text hilitec
- the color of the text hilitegpSetFontHiLite(boolean)
,
gpSetText(String,int,int)
public final void gpSetFontShear(double d)
public final int gpGetStringWidth(java.lang.String s)
s
- the stringgpGetStringWidth(String,Font)
,
gpGetStringHeight(String)
public final int gpGetStringHeight(java.lang.String s)
s
- the stringgpGetStringHeight(String,Font)
,
gpGetStringWidth(String)
public final int gpGetStringWidth(java.lang.String s, java.awt.Font f)
s
- the stringf
- the fontgpGetStringWidth(String)
,
gpGetStringHeight(String,Font)
public final int gpGetStringHeight(java.lang.String s, java.awt.Font f)
s
- the stringf
- the fontgpGetStringHeight(String)
,
gpGetStringWidth(String,Font)
public final java.awt.geom.Rectangle2D gpGetStringBounds(java.lang.String s)
s
- the bounded stringRectangle2D
public final void gpDrawImage(java.awt.Image img, int x, int y)
img
- the image to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointImage
,
gpDrawImage(Image,int,int,int,int)
,
gpDrawImage(Image,int,int,int,int,int,int,int,int)
public final void gpDrawImage(java.awt.Image img, int x, int y, int w, int h)
img
- the image to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointw
- the width of the scaled imageh
- the height of the scaled imageImage
,
gpDrawImage(Image,int,int)
,
gpDrawImage(Image,int,int,int,int,int,int,int,int)
public final void gpDrawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
img
- the image to be drawndx1
- the x coordinate of the first corner of the destination rectangledy1
- the y coordinate of the first corner of the destination rectangledx2
- the x coordinate of the second corner of the destination rectangledy2
- the y coordinate of the second corner of the destination rectanglesx1
- the x coordinate of the first corner of the source rectanglesy1
- the y coordinate of the first corner of the source rectanglesx2
- the x coordinate of the second corner of the source rectanglesy2
- the y coordinate of the second corner of the source rectangleImage
,
gpDrawImage(Image,int,int)
,
gpDrawImage(Image,int,int,int,int)
public final int gpGetImageWidth(java.awt.Image img)
img
- the image to measureImage
public final int gpGetImageHeight(java.awt.Image img)
img
- the image to measureImage
public final int gpGetImageBrushWidth()
gpGetImageBrush()
,
gpSetImageBrush(int)
public final int gpGetImageBrushHeight()
gpGetImageBrush()
,
gpSetImageBrush(int)
public final java.awt.Image gpGetImageBrush()
gpSetImageBrush(int)
,
Image
public final void gpSetImageBrush(int i)
i
- the image numbergpGetImageBrush()
public final void gpDrawImageBrush(java.util.Vector v, int startPtX, int startPtY)
Vector
must contain Point
objects that will be drawn relative
to the starting point (startPtX, startPtY).v
- the vector that contains relative drawing pointsstartPtX
- the x coordinate of the anchor pointstartPtY
- the y coordinate of the anchor pointVector
public final void gpPaintImgCircle(java.awt.Point startPt, java.awt.Point endPt)
startPt
- the point on the circleendPt
- the center point of the circlePoint
,
gpSetImageBrush(int)
public final void gpPaintImgLine(int x1, int y1, int x2, int y2)
x1
- the x coordinate of the first line pointy1
- the y coordinate of the first line pointx2
- the x coordinate of the second line pointy2
- the y coordinate of the second line pointgpSetImageBrush(int)
public final void gpImageText(java.lang.String s, int x, int y)
s
- the textx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointgpSetImageBrush(int)
public final void gpBlendText(java.lang.String s, int x, int y, int w, boolean jagged)
gpBlend
method. The
point (x,y) is the anchor point for the text. The font size is 70. The
string is drawn in an irregular fashion when jagged is true.s
- the textx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointjagged
- when true, text is drawn irregularlygpBlend(int,int)
public final void gpImageBack()
gpSetImageBrush(int)
,
gpImageBack(boolean,int,int)
public final void gpImageBack(boolean b, int horz, int vert)
b
- when true, tiles in serpentine fashionhorz
- the horizontal tiling intervalvert
- the vertical tiling intervalgpSetImageBrush(int)
,
gpImageBack()
public final java.awt.Image gpGetImage(java.io.File f)
File
parameter as an Image
.
The file must be in JPEG or GIF format.f
- the image file to openFile
as an Image
gpCreateImage(MemoryImageSource)
,
File
public final java.awt.Image gpCreateImage(java.awt.image.MemoryImageSource mis)
Image
created from the specified MemoryImageSource
.mis
- the MemoryImageSource
MemoryImageSource
as an Image
gpGetImage(File)
,
MemoryImageSource
,
Image
public final void gpSaveCanvas(java.lang.String name, java.awt.Rectangle r)
gpSaveCanvasToJPG(String,Rectangle)
public final void gpSaveCanvasToJPG(java.lang.String name, java.awt.Rectangle r)
name
- the file namer
- the rectangular region to savepublic final void gpSaveScaledCanvas(java.lang.String name, int width, int height)
name
- the file namew
- the width of the scaled imageh
- the height of the scaled imagegpSaveCanvasToJPG(String,Rectangle)
public void gpSaveImageToFile(java.io.File f, java.awt.image.BufferedImage img)
BufferedImage
as a JPEG file. The image
defined by the parameter img will be saved with the name specified.
in the File
object. If the name parameter does not end
with .jpg it will be appended to the file name.f
- the File
img
- the BufferedImage
to savegpSaveImageToFile(File,BufferedImage,float)
,
File
,
Image
,
BufferedImage
public void gpSaveImageToFile(java.io.File f, java.awt.image.BufferedImage img, float saveQuality)
BufferedImage
as a JPEG file with the specified
quality-compression setting. The image defined by the parameter img will be saved with the name specified
in the File
object. If the name parameter does not end
with .jpg it will be appended to the file name. The saveQuality
values can range from 0.0 to 1.0 with the high value representing the
highest quality and lowest compression.f
- the File
img
- the BufferedImage
to savesaveQuality
- the compression-quality settinggpSaveImageToFile(File,BufferedImage)
,
File
,
Image
,
BufferedImage
public final void gpApplyFilter(GpadFilter gpf)
GpadFilter
parameter. The filter operation can be applied to a specified region
of the canvas through the GpadFilter
parameter. Similarly,
the filter type and strength can also be set.gpf
- the GpadFilter
GpadFilter
public final void gpApplyCurve(GpadCurve gpc)
GpadCurve
parameter to the canvas. Curve type and properties are specified in
the GpadCurve
object.gpc
- the GpadCurve
GpadCurve
public final void gpAnimate(GpadAnimation gpa)
GpadAnimation
parameter. Developers implement the animate
method of the
GpadAnimation
abstract class. The method contains the
timed sequence of drawing operations on the canvas.gpa
- the GpadAnimation
GpadAnimation
,
Thread
public final void gpRepaint()
gpRepaint(int,int,int,int)
public final void gpRepaint(int x, int y, int w, int h)
x
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointw
- the width of the rectangular repaint regionh
- the height of the rectangular repaint regiongpRepaint()
public java.awt.Image gpGetCanvasImage()
Image
. This gives direct access to the
graphics context of the canvas.Image
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |