001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package java.awt;
019:
020: import java.awt.font.GlyphVector;
021: import java.awt.font.FontRenderContext;
022: import java.awt.geom.AffineTransform;
023: import java.awt.image.BufferedImage;
024: import java.awt.image.BufferedImageOp;
025: import java.awt.image.ImageObserver;
026: import java.awt.image.RenderedImage;
027: import java.awt.image.renderable.RenderableImage;
028: import java.text.AttributedCharacterIterator;
029: import java.util.Map;
030:
031: public abstract class Graphics2D extends Graphics {
032: protected Graphics2D() {
033: super ();
034: }
035:
036: public abstract void addRenderingHints(Map<?, ?> hints);
037:
038: public abstract void clip(Shape s);
039:
040: public abstract void draw(Shape s);
041:
042: public abstract void drawGlyphVector(GlyphVector g, float x, float y);
043:
044: public abstract void drawImage(BufferedImage img,
045: BufferedImageOp op, int x, int y);
046:
047: public abstract boolean drawImage(Image img, AffineTransform xform,
048: ImageObserver obs);
049:
050: public abstract void drawRenderableImage(RenderableImage img,
051: AffineTransform xform);
052:
053: public abstract void drawRenderedImage(RenderedImage img,
054: AffineTransform xform);
055:
056: public abstract void drawString(
057: AttributedCharacterIterator iterator, float x, float y);
058:
059: @Override
060: public abstract void drawString(
061: AttributedCharacterIterator iterator, int x, int y);
062:
063: public abstract void drawString(String s, float x, float y);
064:
065: @Override
066: public abstract void drawString(String str, int x, int y);
067:
068: public abstract void fill(Shape s);
069:
070: public abstract Color getBackground();
071:
072: public abstract Composite getComposite();
073:
074: public abstract GraphicsConfiguration getDeviceConfiguration();
075:
076: public abstract FontRenderContext getFontRenderContext();
077:
078: public abstract Paint getPaint();
079:
080: public abstract Object getRenderingHint(RenderingHints.Key key);
081:
082: public abstract RenderingHints getRenderingHints();
083:
084: public abstract Stroke getStroke();
085:
086: public abstract AffineTransform getTransform();
087:
088: public abstract boolean hit(Rectangle rect, Shape s,
089: boolean onStroke);
090:
091: public abstract void rotate(double theta);
092:
093: public abstract void rotate(double theta, double x, double y);
094:
095: public abstract void scale(double sx, double sy);
096:
097: public abstract void setBackground(Color color);
098:
099: public abstract void setComposite(Composite comp);
100:
101: public abstract void setPaint(Paint paint);
102:
103: public abstract void setRenderingHint(RenderingHints.Key key,
104: Object value);
105:
106: public abstract void setRenderingHints(Map<?, ?> hints);
107:
108: public abstract void setStroke(Stroke s);
109:
110: public abstract void setTransform(AffineTransform Tx);
111:
112: public abstract void shear(double shx, double shy);
113:
114: public abstract void transform(AffineTransform Tx);
115:
116: public abstract void translate(double tx, double ty);
117:
118: @Override
119: public abstract void translate(int x, int y);
120:
121: @Override
122: public void fill3DRect(int x, int y, int width, int height,
123: boolean raised) {
124: // According to the spec, color should be used instead of paint,
125: // so Graphics.fill3DRect resets paint and
126: // it should be restored after the call
127: Paint savedPaint = getPaint();
128: super .fill3DRect(x, y, width, height, raised);
129: setPaint(savedPaint);
130: }
131:
132: @Override
133: public void draw3DRect(int x, int y, int width, int height,
134: boolean raised) {
135: // According to the spec, color should be used instead of paint,
136: // so Graphics.draw3DRect resets paint and
137: // it should be restored after the call
138: Paint savedPaint = getPaint();
139: super.draw3DRect(x, y, width, height, raised);
140: setPaint(savedPaint);
141: }
142: }
|