?? dummygraphics2d.java
字號:
/* ==================================================================== Copyright 2004 Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.==================================================================== */package org.apache.poi.hssf.usermodel;import java.awt.*;import java.awt.geom.AffineTransform;import java.awt.image.BufferedImage;import java.awt.image.BufferedImageOp;import java.awt.image.ImageObserver;import java.awt.image.RenderedImage;import java.awt.image.renderable.RenderableImage;import java.awt.font.GlyphVector;import java.awt.font.FontRenderContext;import java.util.Map;import java.text.AttributedCharacterIterator;public class DummyGraphics2d extends Graphics2D{ BufferedImage img; private Graphics2D g2D; public DummyGraphics2d() { img = new BufferedImage(1000, 1000, 2); g2D = (Graphics2D)img.getGraphics(); } public void addRenderingHints(Map hints) { System.out.println( "addRenderingHinds(Map):" ); System.out.println( " hints = " + hints ); g2D.addRenderingHints( hints ); } public void clip(Shape s) { System.out.println( "clip(Shape):" ); System.out.println( " s = " + s ); g2D.clip( s ); } public void draw(Shape s) { System.out.println( "draw(Shape):" ); System.out.println( "s = " + s ); g2D.draw( s ); } public void drawGlyphVector(GlyphVector g, float x, float y) { System.out.println( "drawGlyphVector(GlyphVector, float, float):" ); System.out.println( "g = " + g ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); g2D.drawGlyphVector( g, x, y ); } public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) { System.out.println( "drawImage(BufferedImage, BufferedImageOp, x, y):" ); System.out.println( "img = " + img ); System.out.println( "op = " + op ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); g2D.drawImage( img, op, x, y ); } public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { System.out.println( "drawImage(Image,AfflineTransform,ImageObserver):" ); System.out.println( "img = " + img ); System.out.println( "xform = " + xform ); System.out.println( "obs = " + obs ); return g2D.drawImage( img, xform, obs ); } public void drawRenderableImage(RenderableImage img, AffineTransform xform) { System.out.println( "drawRenderableImage(RenderableImage, AfflineTransform):" ); System.out.println( "img = " + img ); System.out.println( "xform = " + xform ); g2D.drawRenderableImage( img, xform ); } public void drawRenderedImage(RenderedImage img, AffineTransform xform) { System.out.println( "drawRenderedImage(RenderedImage, AffineTransform):" ); System.out.println( "img = " + img ); System.out.println( "xform = " + xform ); g2D.drawRenderedImage( img, xform ); } public void drawString(AttributedCharacterIterator iterator, float x, float y) { System.out.println( "drawString(AttributedCharacterIterator):" ); System.out.println( "iterator = " + iterator ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); g2D.drawString( iterator, x, y ); }// public void drawString(AttributedCharacterIterator iterator,// int x, int y)// {// g2D.drawString( iterator, x, y );// } public void drawString(String s, float x, float y) { System.out.println( "drawString(s,x,y):" ); System.out.println( "s = " + s ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); g2D.drawString( s, x, y ); }// public void drawString(String str, int x, int y)// {// g2D.drawString( str, x, y );// } public void fill(Shape s) { System.out.println( "fill(Shape):" ); System.out.println( "s = " + s ); g2D.fill( s ); }// public void fill3DRect(int x, int y, int width, int height,// boolean raised) {// g2D.fill3DRect( x, y, width, height, raised );// } public Color getBackground() { System.out.println( "getBackground():" ); return g2D.getBackground(); } public Composite getComposite() { System.out.println( "getComposite():" ); return g2D.getComposite(); } public GraphicsConfiguration getDeviceConfiguration() { System.out.println( "getDeviceConfiguration():" ); return g2D.getDeviceConfiguration(); } public FontRenderContext getFontRenderContext() { System.out.println( "getFontRenderContext():" ); return g2D.getFontRenderContext(); } public Paint getPaint() { System.out.println( "getPaint():" ); return g2D.getPaint(); } public Object getRenderingHint(RenderingHints.Key hintKey) { System.out.println( "getRenderingHint(RenderingHints.Key):" ); System.out.println( "hintKey = " + hintKey ); return g2D.getRenderingHint( hintKey ); } public RenderingHints getRenderingHints() { System.out.println( "getRenderingHints():" ); return g2D.getRenderingHints(); } public Stroke getStroke() { System.out.println( "getStroke():" ); return g2D.getStroke(); } public AffineTransform getTransform() { System.out.println( "getTransform():" ); return g2D.getTransform(); } public boolean hit(Rectangle rect, Shape s, boolean onStroke) { System.out.println( "hit(Rectangle, Shape, onStroke):" ); System.out.println( "rect = " + rect ); System.out.println( "s = " + s ); System.out.println( "onStroke = " + onStroke ); return g2D.hit( rect, s, onStroke ); } public void rotate(double theta) { System.out.println( "rotate(theta):" ); System.out.println( "theta = " + theta ); g2D.rotate( theta ); } public void rotate(double theta, double x, double y) { System.out.println( "rotate(double,double,double):" ); System.out.println( "theta = " + theta ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); g2D.rotate( theta, x, y ); } public void scale(double sx, double sy) { System.out.println( "scale(double,double):" ); System.out.println( "sx = " + sx ); System.out.println( "sy" ); g2D.scale( sx, sy ); } public void setBackground(Color color) { System.out.println( "setBackground(Color):" ); System.out.println( "color = " + color ); g2D.setBackground( color ); } public void setComposite(Composite comp) { System.out.println( "setComposite(Composite):" ); System.out.println( "comp = " + comp ); g2D.setComposite( comp ); } public void setPaint( Paint paint ) { System.out.println( "setPain(Paint):" ); System.out.println( "paint = " + paint ); g2D.setPaint( paint ); } public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) { System.out.println( "setRenderingHint(RenderingHints.Key, Object):" ); System.out.println( "hintKey = " + hintKey ); System.out.println( "hintValue = " + hintValue ); g2D.setRenderingHint( hintKey, hintValue ); } public void setRenderingHints(Map hints) { System.out.println( "setRenderingHints(Map):" ); System.out.println( "hints = " + hints ); g2D.setRenderingHints( hints ); } public void setStroke(Stroke s) { System.out.println( "setStroke(Stoke):" ); System.out.println( "s = " + s ); g2D.setStroke( s ); } public void setTransform(AffineTransform Tx) { System.out.println( "setTransform():" ); System.out.println( "Tx = " + Tx ); g2D.setTransform( Tx ); } public void shear(double shx, double shy) { System.out.println( "shear(shx, dhy):" ); System.out.println( "shx = " + shx ); System.out.println( "shy = " + shy ); g2D.shear( shx, shy ); } public void transform(AffineTransform Tx) { System.out.println( "transform(AffineTransform):" ); System.out.println( "Tx = " + Tx ); g2D.transform( Tx ); } public void translate(double tx, double ty) { System.out.println( "translate(double, double):" ); System.out.println( "tx = " + tx ); System.out.println( "ty = " + ty ); g2D.translate( tx, ty ); }// public void translate(int x, int y)// {// g2D.translate( x, y );// } public void clearRect(int x, int y, int width, int height) { System.out.println( "clearRect(int,int,int,int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.clearRect( x, y, width, height ); } public void clipRect(int x, int y, int width, int height) { System.out.println( "clipRect(int, int, int, int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.clipRect( x, y, width, height ); } public void copyArea(int x, int y, int width, int height, int dx, int dy) { System.out.println( "copyArea(int,int,int,int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.copyArea( x, y, width, height, dx, dy ); } public Graphics create() { System.out.println( "create():" ); return g2D.create(); } public Graphics create(int x, int y, int width, int height) { System.out.println( "create(int,int,int,int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); return g2D.create( x, y, width, height ); } public void dispose() { System.out.println( "dispose():" ); g2D.dispose(); } public void draw3DRect(int x, int y, int width, int height, boolean raised) { System.out.println( "draw3DRect(int,int,int,int,boolean):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); System.out.println( "raised = " + raised ); g2D.draw3DRect( x, y, width, height, raised ); } public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { System.out.println( "drawArc(int,int,int,int,int,int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height );
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -