Package org.eclipse.draw2d
Class PrinterGraphics
java.lang.Object
org.eclipse.draw2d.Graphics
org.eclipse.draw2d.ScaledGraphics
org.eclipse.draw2d.PrinterGraphics
A scalable graphics object used to print to a printer.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.draw2d.ScaledGraphics
ScaledGraphics.State
-
Field Summary
Fields inherited from class org.eclipse.draw2d.Graphics
LINE_CUSTOM, LINE_DASH, LINE_DASHDOT, LINE_DASHDOTDOT, LINE_DOT, LINE_SOLID
-
Constructor Summary
ConstructorsConstructorDescriptionPrinterGraphics
(Graphics g, Printer p) Creates a new PrinterGraphics with Graphics g, using Printer p -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this object, releasing any resources.void
Draws the given Image at the location (x,y).void
Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas.void
setLineAttributes
(LineAttributes attributes) Overridden to translate dashes to printer specific values.Methods inherited from class org.eclipse.draw2d.ScaledGraphics
clipPath, clipRect, drawArc, drawFocus, drawLine, drawOval, drawPath, drawPoint, drawPolygon, drawPolygon, drawPolyline, drawPolyline, drawRectangle, drawRoundRectangle, drawString, drawText, drawText, drawTextLayout, fillArc, fillGradient, fillOval, fillPath, fillPolygon, fillPolygon, fillRectangle, fillRoundRectangle, fillString, fillText, getAbsoluteScale, getAdvanced, getAlpha, getAntialias, getBackgroundColor, getClip, getFillRule, getFont, getFontMetrics, getForegroundColor, getInterpolation, getLineAttributes, getLineCap, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, getTextAntialias, getXORMode, popState, pushState, restoreState, rotate, scale, setAdvanced, setAlpha, setAntialias, setBackgroundColor, setBackgroundPattern, setClip, setClip, setFillRule, setFont, setForegroundColor, setForegroundPattern, setInterpolation, setLineCap, setLineDash, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setTextAntialias, setXORMode, translate, translate
Methods inherited from class org.eclipse.draw2d.Graphics
drawArc, drawFocus, drawImage, drawImage, drawLine, drawOval, drawRectangle, drawString, drawText, drawText, drawTextLayout, fillArc, fillGradient, fillOval, fillRectangle, fillString, fillText, scale, shear, translate
-
Constructor Details
-
PrinterGraphics
Creates a new PrinterGraphics with Graphics g, using Printer p- Parameters:
g
- Graphics object to draw withp
- Printer to print to
-
-
Method Details
-
dispose
public void dispose()Description copied from class:Graphics
Disposes this object, releasing any resources.- Overrides:
dispose
in classScaledGraphics
- See Also:
-
drawImage
Description copied from class:Graphics
Draws the given Image at the location (x,y).- Overrides:
drawImage
in classScaledGraphics
- Parameters:
srcImage
- the Imagex
- the x coordinatey
- the y coordinate- See Also:
-
drawImage
public void drawImage(Image srcImage, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th) Description copied from class:Graphics
Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas. The section of the image bounded by the rectangle (x1,y1,w1,h1) is copied to the section of the canvas bounded by the rectangle (x2,y2,w2,h2). If these two sizes are different, scaling will occur.- Overrides:
drawImage
in classScaledGraphics
- Parameters:
srcImage
- the imagesx
- the x coordinate of the sourcesy
- the y coordinate of the sourcesw
- the width of the sourcesh
- the height of the sourcetx
- the x coordinate of the destinationty
- the y coordinate of the destinationtw
- the width of the destinationth
- the height of the destination- See Also:
-
setLineAttributes
Overridden to translate dashes to printer specific values.- Overrides:
setLineAttributes
in classScaledGraphics
- Parameters:
attributes
- the line attributes- See Also:
-