类 PostscriptGraphics

java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
weka.gui.visualize.PostscriptGraphics

public class PostscriptGraphics extends Graphics2D
The PostscriptGraphics class extends the Graphics2D class to produce an encapsulated postscript file rather than on-screen display.

Currently only a small (but useful) subset of Graphics methods have been implemented. To handle the ability to Clone a Graphics object, the graphics state of the eps is set from the graphics state of the local PostscriptGraphics before output. To use, create a PostscriptGraphics object, and pass it to the PaintComponent method of a JComponent.

If necessary additional font replacements can be inserted, since some fonts might be displayed incorrectly.

版本:
$Revision: 7059 $
作者:
Dale Fletcher (dale@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • PostscriptGraphics

      public PostscriptGraphics(int width, int height, OutputStream os)
      Constructor Creates a new PostscriptGraphics object, given dimensions and output file.
      参数:
      width - The width of eps in points.
      height - The height of eps in points.
      os - File to send postscript to.
  • 方法详细资料

    • finished

      public void finished()
      Finalizes output file.
    • addPSFontReplacement

      public static void addPSFontReplacement(String replace, String with)
      adds the PS font name to replace and its replacement in the replacement hashtable
      参数:
      replace - the PS font name to replace
      with - the PS font name to replace the font with
    • clearRect

      public void clearRect(int x, int y, int width, int height)
      Draw a filled rectangle with the background color.
      指定者:
      clearRect 在类中 Graphics
      参数:
      x - starting x coord
      y - starting y coord
      width - rectangle width
      height - rectangle height
    • clipRect

      public void clipRect(int x, int y, int width, int height)
      Not implemented
      指定者:
      clipRect 在类中 Graphics
    • copyArea

      public void copyArea(int x, int y, int width, int height, int dx, int dy)
      Not implemented
      指定者:
      copyArea 在类中 Graphics
    • create

      public Graphics create()
      Clone a PostscriptGraphics object
      指定者:
      create 在类中 Graphics
    • dispose

      public void dispose()
      Not implemented
      指定者:
      dispose 在类中 Graphics
    • draw3DRect

      public void draw3DRect(int x, int y, int width, int height, boolean raised)
      Draw an outlined rectangle with 3D effect in current pen color. (Current implementation: draw simple outlined rectangle)
      覆盖:
      draw3DRect 在类中 Graphics2D
      参数:
      x - starting x coord
      y - starting y coord
      width - rectangle width
      height - rectangle height
      raised - True: appear raised, False: appear etched
    • drawArc

      public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
      Not implemented
      指定者:
      drawArc 在类中 Graphics
    • drawBytes

      public void drawBytes(byte[] data, int offset, int length, int x, int y)
      simply calls drawString(String,int,int)
      覆盖:
      drawBytes 在类中 Graphics
      另请参阅:
    • drawChars

      public void drawChars(char[] data, int offset, int length, int x, int y)
      simply calls drawString(String,int,int)
      覆盖:
      drawChars 在类中 Graphics
      另请参阅:
    • drawImage

      public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
      calls drawImage(Image,int,int,int,int,Color,ImageObserver)
      指定者:
      drawImage 在类中 Graphics
      另请参阅:
    • drawImage

      public boolean drawImage(Image img, int x, int y, ImageObserver observer)
      calls drawImage(Image,int,int,Color,ImageObserver) with Color.WHITE as background color
      指定者:
      drawImage 在类中 Graphics
      另请参阅:
    • drawImage

      public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
      PS see http://astronomy.swin.edu.au/~pbourke/geomformats/postscript/ Java http://show.docjava.com:8086/book/cgij/doc/ip/graphics/SimpleImageFrame.java.html
      指定者:
      drawImage 在类中 Graphics
    • drawImage

      public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
      calls drawImage(Image,int,int,int,int,Color,ImageObserver) with the color WHITE as background
      指定者:
      drawImage 在类中 Graphics
      另请参阅:
    • drawImage

      public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
      Not implemented
      指定者:
      drawImage 在类中 Graphics
    • drawImage

      public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
      calls drawImage(Image,int,int,int,int,int,int,int,int,Color,ImageObserver) with Color.WHITE as background color
      指定者:
      drawImage 在类中 Graphics
      另请参阅:
    • drawLine

      public void drawLine(int x1, int y1, int x2, int y2)
      Draw a line in current pen color.
      指定者:
      drawLine 在类中 Graphics
      参数:
      x1 - starting x coord
      y1 - starting y coord
      x2 - ending x coord
      y2 - ending y coord
    • drawOval

      public void drawOval(int x, int y, int width, int height)
      Draw an Oval outline in current pen color.
      指定者:
      drawOval 在类中 Graphics
      参数:
      x - x-axis center of oval
      y - y-axis center of oval
      width - oval width
      height - oval height
    • drawPolygon

      public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
      Not implemented
      指定者:
      drawPolygon 在类中 Graphics
    • drawPolyline

      public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
      Not implemented
      指定者:
      drawPolyline 在类中 Graphics
    • drawRect

      public void drawRect(int x, int y, int width, int height)
      Draw an outlined rectangle in current pen color.
      覆盖:
      drawRect 在类中 Graphics
      参数:
      x - starting x coord
      y - starting y coord
      width - rectangle width
      height - rectangle height
    • drawRoundRect

      public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
      Not implemented
      指定者:
      drawRoundRect 在类中 Graphics
    • drawString

      public void drawString(AttributedCharacterIterator iterator, int x, int y)
      Not implemented
      指定者:
      drawString 在类中 Graphics2D
    • drawString

      public void drawString(String str, int x, int y)
      Draw text in current pen color.
      指定者:
      drawString 在类中 Graphics2D
      参数:
      str - Text to output
      x - starting x coord
      y - starting y coord
    • fill3DRect

      public void fill3DRect(int x, int y, int width, int height, boolean raised)
      Draw a filled rectangle with 3D effect in current pen color. (Current implementation: draw simple filled rectangle)
      覆盖:
      fill3DRect 在类中 Graphics2D
      参数:
      x - starting x coord
      y - starting y coord
      width - rectangle width
      height - rectangle height
      raised - True: appear raised, False: appear etched
    • fillArc

      public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
      Not implemented
      指定者:
      fillArc 在类中 Graphics
    • fillOval

      public void fillOval(int x, int y, int width, int height)
      Draw a filled Oval in current pen color.
      指定者:
      fillOval 在类中 Graphics
      参数:
      x - x-axis center of oval
      y - y-axis center of oval
      width - oval width
      height - oval height
    • fillPolygon

      public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
      Not implemented
      指定者:
      fillPolygon 在类中 Graphics
    • fillPolygon

      public void fillPolygon(Polygon p)
      Not implemented
      覆盖:
      fillPolygon 在类中 Graphics
    • fillRect

      public void fillRect(int x, int y, int width, int height)
      Draw a filled rectangle in current pen color.
      指定者:
      fillRect 在类中 Graphics
      参数:
      x - starting x coord
      y - starting y coord
      width - rectangle width
      height - rectangle height
    • fillRoundRect

      public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
      Not implemented
      指定者:
      fillRoundRect 在类中 Graphics
    • finalize

      public void finalize()
      Not implemented
      覆盖:
      finalize 在类中 Graphics
    • getClip

      public Shape getClip()
      Not implemented
      指定者:
      getClip 在类中 Graphics
    • getClipBounds

      public Rectangle getClipBounds()
      This returns the full current drawing area
      指定者:
      getClipBounds 在类中 Graphics
      返回:
      full drawing area
    • getClipBounds

      public Rectangle getClipBounds(Rectangle r)
      This returns the full current drawing area
      覆盖:
      getClipBounds 在类中 Graphics
      返回:
      full drawing area
    • getClipRect

      public Rectangle getClipRect()
      Not implemented
      覆盖:
      getClipRect 在类中 Graphics
    • getColor

      public Color getColor()
      Get current pen color.
      指定者:
      getColor 在类中 Graphics
      返回:
      current pen color.
    • getFont

      public Font getFont()
      Get current font.
      指定者:
      getFont 在类中 Graphics
      返回:
      current font.
    • getFontMetrics

      public FontMetrics getFontMetrics(Font f)
      Get Font metrics
      指定者:
      getFontMetrics 在类中 Graphics
      参数:
      f - Font
      返回:
      Font metrics.
    • setClip

      public void setClip(int x, int y, int width, int height)
      Not implemented
      指定者:
      setClip 在类中 Graphics
    • setClip

      public void setClip(Shape clip)
      Not implemented
      指定者:
      setClip 在类中 Graphics
    • setColor

      public void setColor(Color c)
      Set current pen color. Default to black if null.
      指定者:
      setColor 在类中 Graphics
      参数:
      c - new pen color.
    • setFont

      public void setFont(Font font)
      Set current font. Default to Plain Courier 11 if null.
      指定者:
      setFont 在类中 Graphics
      参数:
      font - new font.
    • setPaintMode

      public void setPaintMode()
      Not implemented
      指定者:
      setPaintMode 在类中 Graphics
    • setXORMode

      public void setXORMode(Color c1)
      Not implemented
      指定者:
      setXORMode 在类中 Graphics
    • translate

      public void translate(int x, int y)
      Translates the origin of the graphics context to the point (x, y) in the current coordinate system. Modifies this graphics context so that its new origin corresponds to the point (x, y) in this graphics context's original coordinate system. All coordinates used in subsequent rendering operations on this graphics context will be relative to this new origin.
      指定者:
      translate 在类中 Graphics2D
      参数:
      x - the x coordinate.
      y - the y coordinate.
    • getFontRenderContext

      public FontRenderContext getFontRenderContext()
      START overridden Graphics2D methods
      指定者:
      getFontRenderContext 在类中 Graphics2D
    • clip

      public void clip(Shape s)
      指定者:
      clip 在类中 Graphics2D
    • getStroke

      public Stroke getStroke()
      指定者:
      getStroke 在类中 Graphics2D
    • getBackground

      public Color getBackground()
      指定者:
      getBackground 在类中 Graphics2D
    • setBackground

      public void setBackground(Color c)
      指定者:
      setBackground 在类中 Graphics2D
    • getComposite

      public Composite getComposite()
      指定者:
      getComposite 在类中 Graphics2D
    • getPaint

      public Paint getPaint()
      指定者:
      getPaint 在类中 Graphics2D
    • getTransform

      public AffineTransform getTransform()
      指定者:
      getTransform 在类中 Graphics2D
    • setTransform

      public void setTransform(AffineTransform at)
      指定者:
      setTransform 在类中 Graphics2D
    • transform

      public void transform(AffineTransform at)
      指定者:
      transform 在类中 Graphics2D
    • shear

      public void shear(double d1, double d2)
      指定者:
      shear 在类中 Graphics2D
    • scale

      public void scale(double d1, double d2)
      指定者:
      scale 在类中 Graphics2D
    • rotate

      public void rotate(double d1, double d2, double d3)
      指定者:
      rotate 在类中 Graphics2D
    • rotate

      public void rotate(double d1)
      指定者:
      rotate 在类中 Graphics2D
    • translate

      public void translate(double d1, double d2)
      指定者:
      translate 在类中 Graphics2D
    • getRenderingHints

      public RenderingHints getRenderingHints()
      指定者:
      getRenderingHints 在类中 Graphics2D
    • addRenderingHints

      public void addRenderingHints(Map m)
      指定者:
      addRenderingHints 在类中 Graphics2D
    • setRenderingHints

      public void setRenderingHints(Map m)
      指定者:
      setRenderingHints 在类中 Graphics2D
    • getRenderingHint

      public Object getRenderingHint(RenderingHints.Key key)
      指定者:
      getRenderingHint 在类中 Graphics2D
    • setRenderingHint

      public void setRenderingHint(RenderingHints.Key key, Object o)
      指定者:
      setRenderingHint 在类中 Graphics2D
    • setStroke

      public void setStroke(Stroke s)
      指定者:
      setStroke 在类中 Graphics2D
    • setPaint

      public void setPaint(Paint p)
      指定者:
      setPaint 在类中 Graphics2D
    • setComposite

      public void setComposite(Composite c)
      指定者:
      setComposite 在类中 Graphics2D
    • getDeviceConfiguration

      public GraphicsConfiguration getDeviceConfiguration()
      指定者:
      getDeviceConfiguration 在类中 Graphics2D
    • hit

      public boolean hit(Rectangle r, Shape s, boolean onstroke)
      指定者:
      hit 在类中 Graphics2D
    • fill

      public void fill(Shape s)
      指定者:
      fill 在类中 Graphics2D
    • drawGlyphVector

      public void drawGlyphVector(GlyphVector gv, float f1, float f2)
      指定者:
      drawGlyphVector 在类中 Graphics2D
    • drawString

      public void drawString(AttributedCharacterIterator aci, float f1, float f2)
      指定者:
      drawString 在类中 Graphics2D
    • drawString

      public void drawString(String str, float x, float y)
      指定者:
      drawString 在类中 Graphics2D
    • drawRenderableImage

      public void drawRenderableImage(RenderableImage ri, AffineTransform at)
      指定者:
      drawRenderableImage 在类中 Graphics2D
    • drawRenderedImage

      public void drawRenderedImage(RenderedImage ri, AffineTransform af)
      指定者:
      drawRenderedImage 在类中 Graphics2D
    • drawImage

      public void drawImage(BufferedImage bi, BufferedImageOp bio, int i1, int i2)
      指定者:
      drawImage 在类中 Graphics2D
    • drawImage

      public boolean drawImage(Image im, AffineTransform at, ImageObserver io)
      指定者:
      drawImage 在类中 Graphics2D
    • draw

      public void draw(Shape s)
      指定者:
      draw 在类中 Graphics2D