| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Graphics2Dorg.jfree.pixie.AbstractGraphics2Dorg.jfree.pixie.wmf.WmfGraphics2Dpublic class WmfGraphics2Dextends AbstractGraphics2DMethod Summary | |
void |
|
void |
|
void |
|
Graphics |
|
void |
|
void |
|
boolean |
|
void |
|
void |
|
void |
|
Color |
|
Shape |
|
Composite |
|
GraphicsConfiguration |
|
Font |
|
FontMetrics |
|
FontRenderContext |
|
Paint |
|
Object |
|
RenderingHints |
|
Stroke |
|
AffineTransform |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.pixie.AbstractGraphics2D | |
clearRect, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRenderableImage, drawRoundRect, drawString, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getClipBounds, getColor, hit, rotate, rotate, scale, setClip, setColor, shear, transform, translate, translate | |
public void addRenderingHints(Map hints)
Sets the values of an arbitrary number of preferences for the rendering algorithms. Only values for the rendering hints that are present in the specifiedMapobject are modified. All other preferences not present in the specified object are left unmodified. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Refer to theRenderingHintsclass for definitions of some common keys and values.
- Parameters:
hints- the rendering hints to be set
- See Also:
RenderingHints
public void clip(Shape s)
Intersects the currentClipwith the interior of the specifiedShapeand sets theClipto the resulting intersection. The specifiedShapeis transformed with the currentGraphics2DTransformbefore being intersected with the currentClip. This method is used to make the currentClipsmaller. To make theCliplarger, usesetClip. The user clip modified by this method is independent of the clipping associated with device bounds and visibility. If no clip has previously been set, or if the clip has been cleared usingsetClipwith anullargument, the specifiedShapebecomes the new user clip.
- Parameters:
s- theShapeto be intersected with the currentClip. Ifsisnull, this method clears the currentClip.
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)Copies an area of the component by a distance specified bydxanddy. From the point specified byxandy, this method copies downwards and to the right. To copy an area of the component to the left or upwards, specify a negative value fordxordy. If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component,copyAreawill be unable to copy the associated pixels. The area that is omitted can be refreshed by calling the component'spaintmethod.
- Parameters:
x- the x coordinate of the source rectangle.y- the y coordinate of the source rectangle.width- the width of the source rectangle.height- the height of the source rectangle.dx- the horizontal distance to copy the pixels.dy- the vertical distance to copy the pixels.
public Graphics create()
Creates a newGraphicsobject that is a copy of thisGraphicsobject.
- Returns:
- a new graphics context that is a copy of this graphics context.
public void dispose()
Disposes of this graphics context and releases any system resources that it is using. AGraphicsobject cannot be used afterdisposehas been called. When a Java program runs, a large number ofGraphicsobjects can be created within a short time frame. Although the finalization process of the garbage collector also disposes of the same system resources, it is preferable to manually free the associated resources by calling this method rather than to rely on a finalization process which may not run to completion for a long period of time. Graphics objects which are provided as arguments to thepaintandupdatemethods of components are automatically released by the system when those methods return. For efficiency, programmers should calldisposewhen finished using aGraphicsobject only if it was created directly from a component or anotherGraphicsobject.
- See Also:
Graphics.finalize,Component.paint,Component.update,Component.getGraphics,Graphics.create
public void draw(Shape s)
Strokes the outline of aShapeusing the settings of the currentGraphics2Dcontext. The rendering attributes applied include theClip,Transform,Paint,CompositeandStrokeattributes.
- Parameters:
s- theShapeto be rendered
- See Also:
setStroke(Stroke),setPaint(Paint),Graphics.setColor,WmfGraphics2D,setTransform(AffineTransform),clip(Shape),setClip(Shape),setComposite(Composite)
public boolean drawImage(Image img,
AffineTransform xform,
ImageObserver obs)Renders an image, applying a transform from image space into user space before drawing. The transformation from user space into device space is done with the currentTransformin theGraphics2D. The specified transformation is applied to the image before the transform attribute in theGraphics2Dcontext is applied. The rendering attributes applied include theClip,Transform, andCompositeattributes. Note that no rendering is done if the specified transform is noninvertible.
- Parameters:
img- theImageto be renderedxform- the transformation from image space into user spaceobs- theImageObserverto be notified as more of theImageis converted
- Returns:
trueif theImageis fully loaded and completely rendered;falseif theImageis still being loaded.
- See Also:
WmfGraphics2D,setTransform(AffineTransform),setComposite(Composite),clip(Shape),setClip(Shape)
public void drawRenderedImage(RenderedImage img,
AffineTransform xform)Renders aRenderedImage, applying a transform from image space into user space before drawing. The transformation from user space into device space is done with the currentTransformin theGraphics2D. The specified transformation is applied to the image before the transform attribute in theGraphics2Dcontext is applied. The rendering attributes applied include theClip,Transform, andCompositeattributes. Note that no rendering is done if the specified transform is noninvertible.
- Parameters:
img- the image to be renderedxform- the transformation from image space into user space
- See Also:
WmfGraphics2D,setTransform(AffineTransform),setComposite(Composite),clip(Shape),setClip(Shape)
public void drawString(String s,
float x,
float y)Renders the text specified by the specifiedString, using the currentFontandPaintattributes in theGraphics2Dcontext. The baseline of the first character is at position (x, y) in the User Space. The rendering attributes applied include theClip,Transform,Paint,FontandCompositeattributes. For characters in script systems such as Hebrew and Arabic, the glyphs can be rendered from right to left, in which case the coordinate supplied is the location of the leftmost character on the baseline.
- Parameters:
s- theStringto be renderedx- the x-coordinates where theStringshould be renderedy- the y-coordinates where theStringshould be rendered
- See Also:
setPaint(Paint),Graphics.setColor,Graphics.setFont,setTransform(AffineTransform),setComposite(Composite),setClip(Shape)
public void fill(Shape s)
Fills the interior of aShapeusing the settings of theGraphics2Dcontext. The rendering attributes applied include theClip,Transform,Paint, andComposite.
- Parameters:
s- theShapeto be filled
- See Also:
setPaint(Paint),Graphics.setColor,WmfGraphics2D,setTransform(AffineTransform),setComposite(Composite),clip(Shape),setClip(Shape)
public Color getBackground()
Returns the background color used for clearing a region.
- Returns:
- the current
Graphics2DColor, which defines the background color.
- See Also:
setBackground(Color)
public Shape getClip()
Gets the current clipping area. This method returns the user clip, which is independent of the clipping associated with device bounds and window visibility. If no clip has previously been set, or if the clip has been cleared usingsetClip(null), this method returnsnull.
- Returns:
- a
Shapeobject representing the current clipping area, ornullif no clip is set.
- Since:
- JDK1.1
- See Also:
Graphics.getClipBounds,Graphics.clipRect,Graphics.setClip(int, int, int, int),Graphics.setClip(Shape)
public Composite getComposite()
Returns the currentCompositein theGraphics2Dcontext.
- Returns:
- the current
Graphics2DComposite, which defines a compositing style.
- See Also:
setComposite(Composite)
public GraphicsConfiguration getDeviceConfiguration()
Returns the device configuration associated with thisGraphics2D.
public Font getFont()
Gets the current font.
- Returns:
- this graphics context's current font.
- See Also:
Font,Graphics.setFont
public FontMetrics getFontMetrics(Font f)
Gets the font metrics for the specified font.
- Parameters:
f- the specified font
- Returns:
- the font metrics for the specified font.
- See Also:
Graphics.getFont,FontMetrics,Graphics.getFontMetrics()
public FontRenderContext getFontRenderContext()
Get the rendering context of theFontwithin thisGraphics2Dcontext. TheFontRenderContextencapsulates application hints such as anti-aliasing and fractional metrics, as well as target device specific information such as dots-per-inch. This information should be provided by the application when using objects that perform typographical formatting, such asFontandTextLayout. This information should also be provided by applications that perform their own layout and need accurate measurements of various characteristics of glyphs such as advance and line height when various rendering hints have been applied to the text rendering.
- Returns:
- a reference to an instance of FontRenderContext.
- Since:
- 1.2
- See Also:
FontRenderContext,Font.createGlyphVector,TextLayout
public Paint getPaint()
Returns the currentPaintof theGraphics2Dcontext.
- Returns:
- the current
Graphics2DPaint, which defines a color or pattern.
- See Also:
setPaint(Paint),Graphics.setColor
public Object getRenderingHint(RenderingHints.Key hintKey)
Returns the value of a single preference for the rendering algorithms. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Refer to theRenderingHintsclass for definitions of some common keys and values.
- Parameters:
hintKey- the key corresponding to the hint to get.
- Returns:
- an object representing the value for the specified hint key. Some of the keys and their associated values are defined in the
RenderingHintsclass.
- See Also:
RenderingHints
public RenderingHints getRenderingHints()
Gets the preferences for the rendering algorithms. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Returns all of the hint key/value pairs that were ever specified in one operation. Refer to theRenderingHintsclass for definitions of some common keys and values.
- Returns:
- a reference to an instance of
RenderingHintsthat contains the current preferences.
- See Also:
RenderingHints
public Stroke getStroke()
Returns the currentStrokein theGraphics2Dcontext.
- Returns:
- the current
Graphics2DStroke, which defines the line style.
- See Also:
setStroke(Stroke)
public AffineTransform getTransform()
Returns a copy of the currentTransformin theGraphics2Dcontext.
- Returns:
- the current
AffineTransformin theGraphics2Dcontext.
- See Also:
WmfGraphics2D,setTransform(AffineTransform)
public void setBackground(Color color)
Sets the background color for theGraphics2Dcontext. The background color is used for clearing a region. When aGraphics2Dis constructed for aComponent, the background color is inherited from theComponent. Setting the background color in theGraphics2Dcontext only affects the subsequentclearRectcalls and not the background color of theComponent. To change the background of theComponent, use appropriate methods of theComponent.
- Parameters:
color- the background color that isused in subsequent calls toclearRect
- See Also:
getBackground(),Graphics.clearRect
public void setClip(Shape clip)
Sets the current clipping area to an arbitrary clip shape. Not all objects that implement theShapeinterface can be used to set the clip. The onlyShapeobjects that are guaranteed to be supported areShapeobjects that are obtained via thegetClipmethod and viaRectangleobjects. This method sets the user clip, which is independent of the clipping associated with device bounds and window visibility.
- Parameters:
clip- theShapeto use to set the clip
- Since:
- JDK1.1
- See Also:
Graphics.getClip(),Graphics.clipRect,Graphics.setClip(int, int, int, int)
public void setComposite(Composite comp)
Sets theCompositefor theGraphics2Dcontext. TheCompositeis used in all drawing methods such asdrawImage,drawString,draw, andfill. It specifies how new pixels are to be combined with the existing pixels on the graphics device during the rendering process. If thisGraphics2Dcontext is drawing to aComponenton the display screen and theCompositeis a custom object rather than an instance of theAlphaCompositeclass, and if there is a security manager, itscheckPermissionmethod is called with anAWTPermission("readDisplayPixels")permission.
- Parameters:
comp- theCompositeobject to be used for rendering
- See Also:
Graphics.setXORMode,Graphics.setPaintMode,AlphaComposite,SecurityManager.checkPermission,AWTPermission
public void setFont(Font font)
Sets this graphics context's font to the specified font. All subsequent text operations using this graphics context use this font.
- Parameters:
font- the font.
- See Also:
Graphics.getFont,Graphics.drawString(String, int, int),Graphics.drawBytes(byte[], int, int, int, int),Graphics.drawChars(char[], int, int, int, int)
public void setPaint(Paint paint)
Sets thePaintattribute for theGraphics2Dcontext. Calling this method with anullPaintobject does not have any effect on the currentPaintattribute of thisGraphics2D.
- Parameters:
paint- thePaintobject to be used to generate color during the rendering process, ornull
- See Also:
Graphics.setColor,GradientPaint,TexturePaint
public void setPaintMode()
Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color. This sets the logical pixel operation function to the paint or overwrite mode. All subsequent rendering operations will overwrite the destination with the current color.
public void setRenderingHint(RenderingHints.Key hintKey,
Object hintValue)Sets the value of a single preference for the rendering algorithms. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Refer to theRenderingHintsclass for definitions of some common keys and values.
- Parameters:
hintKey- the key of the hint to be set.hintValue- the value indicating preferences for the specified hint category.
- See Also:
RenderingHints
public void setRenderingHints(Map hints)
Replaces the values of all preferences for the rendering algorithms with the specifiedhints. The existing values for all rendering hints are discarded and the new set of known hints and values are initialized from the specifiedMapobject. Hint categories include controls for rendering quality and overall time/quality trade-off in the rendering process. Refer to theRenderingHintsclass for definitions of some common keys and values.
- Parameters:
hints- the rendering hints to be set
- See Also:
RenderingHints
public void setStroke(Stroke s)
Sets theStrokefor theGraphics2Dcontext.
- Parameters:
s- theStrokeobject to be used to stroke aShapeduring the rendering process
- See Also:
BasicStroke
public void setTransform(AffineTransform Tx)
Sets theTransformin theGraphics2Dcontext.
- Parameters:
Tx- theAffineTransformobject to be used in the rendering process
- See Also:
WmfGraphics2D,AffineTransform
public void setXORMode(Color c1)
Sets the paint mode of this graphics context to alternate between this graphics context's current color and the new specified color. This specifies that logical pixel operations are performed in the XOR mode, which alternates pixels between the current color and a specified XOR color. When drawing operations are performed, pixels which are the current color are changed to the specified color, and vice versa. Pixels that are of colors other than those two colors are changed in an unpredictable but reversible manner; if the same figure is drawn twice, then all pixels are restored to their original values.
- Parameters:
c1- the XOR alternation color