DirectRasterGraphics.java 2.18 KB
Newer Older
1
/* Copyright (C) 2000, 2003  Free Software Foundation
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

   This file is part of libgcj.

This software is copyrighted work licensed under the terms of the
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
details.  */

package gnu.awt.j2d;

import java.awt.Color;
import java.awt.Image;
import java.awt.Shape;
import java.awt.Rectangle;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.image.Raster;
import java.awt.image.ImageObserver;

/**
 * Interface for a simple pixel based backend graphics object that
 * does not handle translation/transforms, curves, nor advanced
 * compositing.
 */
public interface DirectRasterGraphics extends Cloneable
{
30
  void dispose();
31
  
32
  void setColor(Color color);
33
  
34
  void setPaintMode();
35
  
36
  void setXORMode(Color altColor);
37
  
38
  void setFont(Font font);
39
  
40
  FontMetrics getFontMetrics(Font font);
41 42
  
  // supports rects, multi-rects and polygons
43
  void setClip(Shape clip);
44
  
45
  void copyArea(int x, int y, int width, int height,
46 47
		       int dx, int dy);
  
48
  void drawLine(int x1, int y1, int x2, int y2);
49
  
50
  void drawRect(int x, int y, int width, int height);
51
  
52
  void fillRect(int x, int y, int width, int height);
53
  
54
  void drawArc(int x, int y, int width, int height,
55 56
		      int startAngle, int arcAngle);
  
57
  void fillArc(int x, int y, int width, int height,
58 59
		      int startAngle, int arcAngle);
  
60
  void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
61
  
62
  void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
63
  
64
  void fillPolygon(int[] xPoints, int[] yPoints, int nPoints,
65
			  int translateX, int translateY);
66
  
67
  void drawString(String str, int x, int y);
68
  
69
  boolean drawImage(Image image, int x, int y,
70 71 72 73 74 75 76
			   ImageObserver observer);

  /**
   * Map the data for screen pixels in the requested bounds to a
   * raster object.  This gives read/write access to the screen
   * pixels, allowing neat alpha and composite tricks.
   */
77
  MappedRaster mapRaster(Rectangle bounds);
78 79 80 81
  
  /**
   * Detach previously mapped pixel data from a raster object.
   */
82
  void unmapRaster(MappedRaster mappedRaster);
83
  
84
  Object clone();
85
}