0001: package org.uispec4j.interception.toolkit;
0002:
0003: import sun.awt.image.SunVolatileImage;
0004:
0005: import javax.swing.*;
0006: import java.awt.*;
0007: import java.awt.event.PaintEvent;
0008: import java.awt.font.FontRenderContext;
0009: import java.awt.font.GlyphVector;
0010: import java.awt.geom.AffineTransform;
0011: import java.awt.geom.Rectangle2D;
0012: import java.awt.image.*;
0013: import java.awt.image.renderable.RenderableImage;
0014: import java.awt.peer.*;
0015: import java.text.AttributedCharacterIterator;
0016: import java.util.HashMap;
0017: import java.util.Map;
0018:
0019: /**
0020: * Contains a set of empty peer class designed to keep the UISpec peer implementation clean.
0021: */
0022: ///CLOVER:OFF
0023: public final class Empty {
0024:
0025: public static final Insets NULL_INSETS = new Insets(0, 0, 0, 0);
0026: public static final Dimension NULL_DIMENSION = new Dimension(50, 50);
0027: public static final Rectangle NULL_RECTANGLE = new Rectangle(50, 50);
0028: public static final GraphicsConfiguration NULL_GRAPHICS_CONFIGURATION = new DummyGraphicsConfiguration();
0029: public static final GraphicsDevice NULL_GRAPHICS_DEVICE = new DummyGraphicsDevice();
0030: public static final Graphics2D NULL_GRAPHICS_2D = new DummyGraphics2D();
0031: public static final ColorModel NULL_COLOR_MODEL = new DummyColorModel();
0032: public static final Point NULL_POINT = new Point(0, 0);
0033: public static final Image NULL_IMAGE = new DummyImage();
0034: public static final Font NULL_FONT = new JLabel().getFont();
0035: public static final FontMetrics NULL_FONT_METRICS;
0036: public static final VolatileImage NULL_VOLATILE_IMAGE = new DummyVolatileImage();
0037: public static final AffineTransform NULL_AFFINE_TRANSFORM = new AffineTransform();
0038: public static final int DEFAULT_HEIGHT = 50;
0039: public static final Paint NULL_PAINT = new DummyPaint();
0040: public static final PaintContext NULL_PAINT_CONTEXT = new DummyPaintContext();
0041: public static final ImageProducer NULL_IMAGE_PRODUCER = new DummyImageProducer();
0042: public static final Composite NULL_COMPOSITE = new DummyComposite();
0043: public static final CompositeContext NULL_COMPOSITE_CONTEXT = new DummyCompositeContext();
0044: public static final Stroke NULL_STROKE = new DummyStroke();
0045: public static final Icon NULL_ICON = new DummyIcon();
0046:
0047: public static final RobotPeer NULL_ROBOT = new DummyRobotPeer();
0048: public static final DummyLightweightPeer NULL_LIGHTWEIGHT_PEER = new DummyLightweightPeer();
0049: public static final DummyPanelPeer NULL_PANEL_PEER = new DummyPanelPeer();
0050: public static final DummyCanvasPeer NULL_CANVAS_PEER = new DummyCanvasPeer();
0051:
0052: static {
0053: NULL_FONT_METRICS = new DummyFontMetrics(NULL_FONT);
0054: }
0055:
0056: private Empty() {
0057: }
0058:
0059: static class WindowPeeer implements WindowPeer {
0060: public void toBack() {
0061: }
0062:
0063: public void updateAlwaysOnTop() {
0064: }
0065:
0066: public void updateFocusableWindowState() {
0067: }
0068:
0069: public boolean requestWindowFocus() {
0070: return false;
0071: }
0072:
0073: public void toFront() {
0074: }
0075:
0076: public void beginLayout() {
0077: }
0078:
0079: public void beginValidate() {
0080: }
0081:
0082: public void endLayout() {
0083: }
0084:
0085: public void endValidate() {
0086: }
0087:
0088: public Insets getInsets() {
0089: return NULL_INSETS;
0090: }
0091:
0092: public Insets insets() {
0093: return NULL_INSETS;
0094: }
0095:
0096: public boolean isPaintPending() {
0097: return false;
0098: }
0099:
0100: public void cancelPendingPaint(int x, int y, int w, int h) {
0101: }
0102:
0103: public void restack() {
0104: }
0105:
0106: public boolean isRestackSupported() {
0107: return false;
0108: }
0109:
0110: public boolean canDetermineObscurity() {
0111: return false;
0112: }
0113:
0114: public int checkImage(Image img, int w, int h, ImageObserver o) {
0115: return 0;
0116: }
0117:
0118: public void coalescePaintEvent(PaintEvent e) {
0119: }
0120:
0121: public void createBuffers(int numBuffers,
0122: BufferCapabilities caps) throws AWTException {
0123: }
0124:
0125: public Image createImage(ImageProducer producer) {
0126: return NULL_IMAGE;
0127: }
0128:
0129: public Image createImage(int width, int height) {
0130: return NULL_IMAGE;
0131: }
0132:
0133: public VolatileImage createVolatileImage(int width, int height) {
0134: return NULL_VOLATILE_IMAGE;
0135: }
0136:
0137: public void destroyBuffers() {
0138: }
0139:
0140: public void reparent(ContainerPeer newContainer) {
0141: }
0142:
0143: public boolean isReparentSupported() {
0144: return false;
0145: }
0146:
0147: public void layout() {
0148: }
0149:
0150: public Rectangle getBounds() {
0151: return NULL_RECTANGLE;
0152: }
0153:
0154: public void disable() {
0155: }
0156:
0157: public void dispose() {
0158: }
0159:
0160: public void enable() {
0161: }
0162:
0163: public void flip(BufferCapabilities.FlipContents flipAction) {
0164: }
0165:
0166: public Image getBackBuffer() {
0167: return NULL_IMAGE;
0168: }
0169:
0170: public ColorModel getColorModel() {
0171: return NULL_COLOR_MODEL;
0172: }
0173:
0174: public FontMetrics getFontMetrics(Font font) {
0175: return NULL_FONT_METRICS;
0176: }
0177:
0178: public Graphics getGraphics() {
0179: return NULL_GRAPHICS_2D;
0180: }
0181:
0182: public GraphicsConfiguration getGraphicsConfiguration() {
0183: return NULL_GRAPHICS_CONFIGURATION;
0184: }
0185:
0186: public Point getLocationOnScreen() {
0187: return NULL_POINT;
0188: }
0189:
0190: public Dimension getMinimumSize() {
0191: return NULL_DIMENSION;
0192: }
0193:
0194: public Dimension getPreferredSize() {
0195: return NULL_DIMENSION;
0196: }
0197:
0198: public Toolkit getToolkit() {
0199: return UISpecToolkit.instance();
0200: }
0201:
0202: public void handleEvent(AWTEvent e) {
0203: }
0204:
0205: public boolean handlesWheelScrolling() {
0206: return false;
0207: }
0208:
0209: public void hide() {
0210: }
0211:
0212: public boolean isFocusable() {
0213: return false;
0214: }
0215:
0216: public boolean isObscured() {
0217: return false;
0218: }
0219:
0220: public Dimension minimumSize() {
0221: return NULL_DIMENSION;
0222: }
0223:
0224: public void paint(Graphics g) {
0225: }
0226:
0227: public Dimension preferredSize() {
0228: return NULL_DIMENSION;
0229: }
0230:
0231: public boolean prepareImage(Image img, int w, int h,
0232: ImageObserver o) {
0233: return false;
0234: }
0235:
0236: public void print(Graphics g) {
0237: }
0238:
0239: public void setBounds(int x, int y, int width, int height,
0240: int op) {
0241: }
0242:
0243: public void repaint(long tm, int x, int y, int width, int height) {
0244: }
0245:
0246: public boolean requestFocus(Component lightweightChild,
0247: boolean temporary, boolean focusedWindowChangeAllowed,
0248: long time) {
0249: return false;
0250: }
0251:
0252: public void reshape(int x, int y, int width, int height) {
0253: }
0254:
0255: public void setBackground(Color c) {
0256: }
0257:
0258: public void setBounds(int x, int y, int width, int height) {
0259: }
0260:
0261: public void setEnabled(boolean b) {
0262: }
0263:
0264: public void setFont(Font f) {
0265: }
0266:
0267: public void setForeground(Color c) {
0268: }
0269:
0270: public void setVisible(boolean b) {
0271: }
0272:
0273: public void show() {
0274: }
0275:
0276: public void updateCursorImmediately() {
0277: }
0278: }
0279:
0280: static class FramePeer extends Empty.WindowPeeer implements
0281: java.awt.peer.FramePeer {
0282: public int getState() {
0283: return 0;
0284: }
0285:
0286: public void setState(int state) {
0287: }
0288:
0289: public void setResizable(boolean resizeable) {
0290: }
0291:
0292: public void setIconImage(Image im) {
0293: }
0294:
0295: public void setMenuBar(MenuBar mb) {
0296: }
0297:
0298: public void setMaximizedBounds(Rectangle bounds) {
0299: }
0300:
0301: public void setBoundsPrivate(int x, int y, int width, int height) {
0302: }
0303:
0304: public void setTitle(String title) {
0305: }
0306: }
0307:
0308: static class DialogPeer extends Empty.WindowPeeer implements
0309: java.awt.peer.DialogPeer {
0310: public void setResizable(boolean resizeable) {
0311: }
0312:
0313: public void setTitle(String title) {
0314: }
0315: }
0316:
0317: private static class DummyRobotPeer implements RobotPeer {
0318:
0319: public void keyPress(int keycode) {
0320: }
0321:
0322: public void keyRelease(int keycode) {
0323: }
0324:
0325: public void mousePress(int buttons) {
0326: }
0327:
0328: public void mouseRelease(int buttons) {
0329: }
0330:
0331: public void mouseWheel(int wheelAmt) {
0332: }
0333:
0334: public int getRGBPixel(int x, int y) {
0335: return 0;
0336: }
0337:
0338: public void mouseMove(int x, int y) {
0339: }
0340:
0341: public int[] getRGBPixels(Rectangle bounds) {
0342: return new int[0];
0343: }
0344: }
0345:
0346: static class DummyGraphicsConfiguration extends
0347: GraphicsConfiguration {
0348: public BufferedImage createCompatibleImage(int width, int height) {
0349: return new BufferedImage(width, height, 0);
0350: }
0351:
0352: public BufferedImage createCompatibleImage(int width,
0353: int height, int transparency) {
0354: return new BufferedImage(width, height, 0);
0355: }
0356:
0357: public VolatileImage createCompatibleVolatileImage(int width,
0358: int height) {
0359: return new SunVolatileImage(this , width, height);
0360: }
0361:
0362: public VolatileImage createCompatibleVolatileImage(int width,
0363: int height, int transparency) {
0364: return NULL_VOLATILE_IMAGE;
0365: }
0366:
0367: public Rectangle getBounds() {
0368: return NULL_RECTANGLE;
0369: }
0370:
0371: public ColorModel getColorModel() {
0372: return NULL_COLOR_MODEL;
0373: }
0374:
0375: public ColorModel getColorModel(int transparency) {
0376: return NULL_COLOR_MODEL;
0377: }
0378:
0379: public AffineTransform getDefaultTransform() {
0380: return NULL_AFFINE_TRANSFORM;
0381: }
0382:
0383: public GraphicsDevice getDevice() {
0384: return NULL_GRAPHICS_DEVICE;
0385: }
0386:
0387: public AffineTransform getNormalizingTransform() {
0388: return NULL_AFFINE_TRANSFORM;
0389: }
0390: }
0391:
0392: static class DummyColorModel extends ColorModel {
0393: public DummyColorModel(int bits) {
0394: super (bits);
0395: }
0396:
0397: public DummyColorModel() {
0398: super (128);
0399: }
0400:
0401: public int getAlpha(int pixel) {
0402: return 0;
0403: }
0404:
0405: public int getBlue(int pixel) {
0406: return 0;
0407: }
0408:
0409: public int getGreen(int pixel) {
0410: return 0;
0411: }
0412:
0413: public int getRed(int pixel) {
0414: return 0;
0415: }
0416: }
0417:
0418: private static class DummyImage extends Image {
0419:
0420: public void flush() {
0421: }
0422:
0423: public Graphics getGraphics() {
0424: return NULL_GRAPHICS_2D;
0425: }
0426:
0427: public int getHeight(ImageObserver observer) {
0428: return DEFAULT_HEIGHT;
0429: }
0430:
0431: public int getWidth(ImageObserver observer) {
0432: return DEFAULT_HEIGHT;
0433: }
0434:
0435: public ImageProducer getSource() {
0436: return NULL_IMAGE_PRODUCER;
0437: }
0438:
0439: public Object getProperty(String name, ImageObserver observer) {
0440: return "";
0441: }
0442: }
0443:
0444: private static class DummyVolatileImage extends VolatileImage {
0445: public static final ImageCapabilities CAPABILITIES = new ImageCapabilities(
0446: false);
0447: public static final BufferedImage IMAGE = new BufferedImage(50,
0448: 50, BufferedImage.TYPE_INT_RGB);
0449:
0450: public BufferedImage getSnapshot() {
0451: return IMAGE;
0452: }
0453:
0454: public int getWidth() {
0455: return DEFAULT_HEIGHT;
0456: }
0457:
0458: public int getHeight() {
0459: return DEFAULT_HEIGHT;
0460: }
0461:
0462: public Graphics2D createGraphics() {
0463: return NULL_GRAPHICS_2D;
0464: }
0465:
0466: public int validate(GraphicsConfiguration gc) {
0467: return 0;
0468: }
0469:
0470: public boolean contentsLost() {
0471: return false;
0472: }
0473:
0474: public ImageCapabilities getCapabilities() {
0475: return CAPABILITIES;
0476: }
0477:
0478: public int getWidth(ImageObserver observer) {
0479: return DEFAULT_HEIGHT;
0480: }
0481:
0482: public int getHeight(ImageObserver observer) {
0483: return DEFAULT_HEIGHT;
0484: }
0485:
0486: public Object getProperty(String name, ImageObserver observer) {
0487: return "";
0488: }
0489: }
0490:
0491: private static class DummyFontMetrics extends FontMetrics {
0492: public static final int[] WIDTHS = new int[256];
0493:
0494: public DummyFontMetrics(Font font) {
0495: super (font);
0496: }
0497:
0498: public int[] getWidths() {
0499: return WIDTHS;
0500: }
0501:
0502: public int stringWidth(String str) {
0503: return 0;
0504: }
0505: }
0506:
0507: abstract static class DummyComponentPeer implements ComponentPeer {
0508:
0509: public void destroyBuffers() {
0510: }
0511:
0512: public void disable() {
0513: }
0514:
0515: public void dispose() {
0516: }
0517:
0518: public void enable() {
0519: }
0520:
0521: public void hide() {
0522: }
0523:
0524: public void updateCursorImmediately() {
0525: }
0526:
0527: public boolean canDetermineObscurity() {
0528: return false;
0529: }
0530:
0531: public boolean handlesWheelScrolling() {
0532: return false;
0533: }
0534:
0535: public boolean isFocusable() {
0536: return false;
0537: }
0538:
0539: public boolean isObscured() {
0540: return false;
0541: }
0542:
0543: public void reshape(int x, int y, int width, int height) {
0544: }
0545:
0546: public void setBounds(int x, int y, int width, int height) {
0547: }
0548:
0549: public void repaint(long tm, int x, int y, int width, int height) {
0550: }
0551:
0552: public void setEnabled(boolean b) {
0553: }
0554:
0555: public void setVisible(boolean b) {
0556: }
0557:
0558: public void handleEvent(AWTEvent e) {
0559: }
0560:
0561: public void createBuffers(int numBuffers,
0562: BufferCapabilities caps) throws AWTException {
0563: }
0564:
0565: public void flip(BufferCapabilities.FlipContents flipAction) {
0566: }
0567:
0568: public void setBackground(Color c) {
0569: }
0570:
0571: public void setForeground(Color c) {
0572: }
0573:
0574: public boolean requestFocus(Component lightweightChild,
0575: boolean temporary, boolean focusedWindowChangeAllowed,
0576: long time) {
0577: return false;
0578: }
0579:
0580: public Dimension getMinimumSize() {
0581: return NULL_DIMENSION;
0582: }
0583:
0584: public Dimension getPreferredSize() {
0585: return NULL_DIMENSION;
0586: }
0587:
0588: public Dimension minimumSize() {
0589: return NULL_DIMENSION;
0590: }
0591:
0592: public Dimension preferredSize() {
0593: return NULL_DIMENSION;
0594: }
0595:
0596: public void setFont(Font f) {
0597: }
0598:
0599: public Graphics getGraphics() {
0600: return NULL_GRAPHICS_2D;
0601: }
0602:
0603: public void paint(Graphics g) {
0604: }
0605:
0606: public void print(Graphics g) {
0607: }
0608:
0609: public GraphicsConfiguration getGraphicsConfiguration() {
0610: return NULL_GRAPHICS_CONFIGURATION;
0611: }
0612:
0613: public Image getBackBuffer() {
0614: return NULL_IMAGE;
0615: }
0616:
0617: public Image createImage(int width, int height) {
0618: return NULL_IMAGE;
0619: }
0620:
0621: public Point getLocationOnScreen() {
0622: return NULL_POINT;
0623: }
0624:
0625: public Toolkit getToolkit() {
0626: return Toolkit.getDefaultToolkit();
0627: }
0628:
0629: public void coalescePaintEvent(PaintEvent e) {
0630: }
0631:
0632: public ColorModel getColorModel() {
0633: return NULL_COLOR_MODEL;
0634: }
0635:
0636: public VolatileImage createVolatileImage(int width, int height) {
0637: return NULL_VOLATILE_IMAGE;
0638: }
0639:
0640: public FontMetrics getFontMetrics(Font font) {
0641: return NULL_FONT_METRICS;
0642: }
0643:
0644: public Image createImage(ImageProducer producer) {
0645: return NULL_IMAGE;
0646: }
0647:
0648: public int checkImage(Image img, int w, int h, ImageObserver o) {
0649: return 0;
0650: }
0651:
0652: public boolean prepareImage(Image img, int w, int h,
0653: ImageObserver o) {
0654: return false;
0655: }
0656: }
0657:
0658: private static class DummyContainerPeer extends DummyComponentPeer
0659: implements ContainerPeer {
0660: public void beginLayout() {
0661: }
0662:
0663: public void beginValidate() {
0664: }
0665:
0666: public void endLayout() {
0667: }
0668:
0669: public void endValidate() {
0670: }
0671:
0672: public boolean isPaintPending() {
0673: return false;
0674: }
0675:
0676: public void cancelPendingPaint(int x, int y, int w, int h) {
0677: }
0678:
0679: public void restack() {
0680: }
0681:
0682: public boolean isRestackSupported() {
0683: return false;
0684: }
0685:
0686: public Insets getInsets() {
0687: return NULL_INSETS;
0688: }
0689:
0690: public Insets insets() {
0691: return NULL_INSETS;
0692: }
0693:
0694: public void setBounds(int x, int y, int width, int height,
0695: int op) {
0696: }
0697:
0698: public void reparent(ContainerPeer newContainer) {
0699: }
0700:
0701: public boolean isReparentSupported() {
0702: return false;
0703: }
0704:
0705: public void layout() {
0706: }
0707:
0708: public Rectangle getBounds() {
0709: return NULL_RECTANGLE;
0710: }
0711:
0712: public void show() {
0713: }
0714: }
0715:
0716: private static class DummyLightweightPeer extends
0717: DummyContainerPeer implements LightweightPeer {
0718: public void show() {
0719: }
0720: }
0721:
0722: private static class DummyPanelPeer extends DummyContainerPeer
0723: implements PanelPeer {
0724: }
0725:
0726: private static class DummyCanvasPeer extends DummyContainerPeer
0727: implements CanvasPeer {
0728:
0729: }
0730:
0731: private static class DummyGraphicsDevice extends GraphicsDevice {
0732: public static final GraphicsConfiguration[] CONFIGURATION = new GraphicsConfiguration[0];
0733:
0734: public int getType() {
0735: return 0;
0736: }
0737:
0738: public GraphicsConfiguration getDefaultConfiguration() {
0739: return NULL_GRAPHICS_CONFIGURATION;
0740: }
0741:
0742: public GraphicsConfiguration[] getConfigurations() {
0743: return CONFIGURATION;
0744: }
0745:
0746: public String getIDstring() {
0747: return "id";
0748: }
0749: }
0750:
0751: private static class DummyGraphics2D extends Graphics2D {
0752:
0753: public void rotate(double theta) {
0754: }
0755:
0756: public void scale(double sx, double sy) {
0757: }
0758:
0759: public void shear(double shx, double shy) {
0760: }
0761:
0762: public void translate(double tx, double ty) {
0763: }
0764:
0765: public void rotate(double theta, double x, double y) {
0766: }
0767:
0768: public void dispose() {
0769: }
0770:
0771: public void setPaintMode() {
0772: }
0773:
0774: public void translate(int x, int y) {
0775: }
0776:
0777: public void clearRect(int x, int y, int width, int height) {
0778: }
0779:
0780: public void clipRect(int x, int y, int width, int height) {
0781: }
0782:
0783: public void drawLine(int x1, int y1, int x2, int y2) {
0784: }
0785:
0786: public void drawOval(int x, int y, int width, int height) {
0787: }
0788:
0789: public void fillOval(int x, int y, int width, int height) {
0790: }
0791:
0792: public void fillRect(int x, int y, int width, int height) {
0793: }
0794:
0795: public void setClip(int x, int y, int width, int height) {
0796: }
0797:
0798: public void copyArea(int x, int y, int width, int height,
0799: int dx, int dy) {
0800: }
0801:
0802: public void drawArc(int x, int y, int width, int height,
0803: int startAngle, int arcAngle) {
0804: }
0805:
0806: public void drawRoundRect(int x, int y, int width, int height,
0807: int arcWidth, int arcHeight) {
0808: }
0809:
0810: public void fillArc(int x, int y, int width, int height,
0811: int startAngle, int arcAngle) {
0812: }
0813:
0814: public void fillRoundRect(int x, int y, int width, int height,
0815: int arcWidth, int arcHeight) {
0816: }
0817:
0818: public void drawPolygon(int xPoints[], int yPoints[],
0819: int nPoints) {
0820: }
0821:
0822: public void drawPolyline(int xPoints[], int yPoints[],
0823: int nPoints) {
0824: }
0825:
0826: public void fillPolygon(int xPoints[], int yPoints[],
0827: int nPoints) {
0828: }
0829:
0830: public Color getColor() {
0831: return Color.BLACK;
0832: }
0833:
0834: public void setColor(Color c) {
0835: }
0836:
0837: public void setXORMode(Color c1) {
0838: }
0839:
0840: public Font getFont() {
0841: return NULL_FONT;
0842: }
0843:
0844: public void setFont(Font font) {
0845: }
0846:
0847: public Graphics create() {
0848: return NULL_GRAPHICS_2D;
0849: }
0850:
0851: public Rectangle getClipBounds() {
0852: return NULL_RECTANGLE;
0853: }
0854:
0855: public Shape getClip() {
0856: return NULL_RECTANGLE;
0857: }
0858:
0859: public void setClip(Shape clip) {
0860: }
0861:
0862: public Color getBackground() {
0863: return Color.WHITE;
0864: }
0865:
0866: public void setBackground(Color color) {
0867: }
0868:
0869: public Composite getComposite() {
0870: return NULL_COMPOSITE;
0871: }
0872:
0873: public void setComposite(Composite comp) {
0874: }
0875:
0876: public GraphicsConfiguration getDeviceConfiguration() {
0877: return NULL_GRAPHICS_CONFIGURATION;
0878: }
0879:
0880: public Paint getPaint() {
0881: return NULL_PAINT;
0882: }
0883:
0884: public void setPaint(Paint paint) {
0885: }
0886:
0887: public RenderingHints getRenderingHints() {
0888: return new RenderingHints(new HashMap());
0889: }
0890:
0891: public void clip(Shape s) {
0892: }
0893:
0894: public void draw(Shape s) {
0895: }
0896:
0897: public void fill(Shape s) {
0898: }
0899:
0900: public Stroke getStroke() {
0901: return NULL_STROKE;
0902: }
0903:
0904: public void setStroke(Stroke s) {
0905: }
0906:
0907: public FontRenderContext getFontRenderContext() {
0908: return new FontRenderContext(NULL_AFFINE_TRANSFORM, false,
0909: false);
0910: }
0911:
0912: public void drawGlyphVector(GlyphVector g, float x, float y) {
0913: }
0914:
0915: public AffineTransform getTransform() {
0916: return NULL_AFFINE_TRANSFORM;
0917: }
0918:
0919: public void setTransform(AffineTransform Tx) {
0920: }
0921:
0922: public void transform(AffineTransform Tx) {
0923: }
0924:
0925: public void drawString(String s, float x, float y) {
0926: }
0927:
0928: public void drawString(String str, int x, int y) {
0929: }
0930:
0931: public void drawString(AttributedCharacterIterator iterator,
0932: float x, float y) {
0933: }
0934:
0935: public void drawString(AttributedCharacterIterator iterator,
0936: int x, int y) {
0937: }
0938:
0939: public FontMetrics getFontMetrics(Font f) {
0940: return NULL_FONT_METRICS;
0941: }
0942:
0943: public boolean drawImage(Image img, int dx1, int dy1, int dx2,
0944: int dy2, int sx1, int sy1, int sx2, int sy2,
0945: ImageObserver observer) {
0946: return false;
0947: }
0948:
0949: public boolean drawImage(Image img, int x, int y, int width,
0950: int height, ImageObserver observer) {
0951: return false;
0952: }
0953:
0954: public boolean drawImage(Image img, int x, int y,
0955: ImageObserver observer) {
0956: return false;
0957: }
0958:
0959: public boolean drawImage(Image img, int dx1, int dy1, int dx2,
0960: int dy2, int sx1, int sy1, int sx2, int sy2,
0961: Color bgcolor, ImageObserver observer) {
0962: return false;
0963: }
0964:
0965: public boolean drawImage(Image img, int x, int y, int width,
0966: int height, Color bgcolor, ImageObserver observer) {
0967: return false;
0968: }
0969:
0970: public boolean drawImage(Image img, int x, int y,
0971: Color bgcolor, ImageObserver observer) {
0972: return false;
0973: }
0974:
0975: public void addRenderingHints(Map hints) {
0976: }
0977:
0978: public void setRenderingHints(Map hints) {
0979: }
0980:
0981: public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
0982: return false;
0983: }
0984:
0985: public void drawRenderedImage(RenderedImage img,
0986: AffineTransform xform) {
0987: }
0988:
0989: public void drawRenderableImage(RenderableImage img,
0990: AffineTransform xform) {
0991: }
0992:
0993: public void drawImage(BufferedImage img, BufferedImageOp op,
0994: int x, int y) {
0995: }
0996:
0997: public Object getRenderingHint(RenderingHints.Key hintKey) {
0998: return RenderingHints.KEY_ALPHA_INTERPOLATION;
0999: }
1000:
1001: public void setRenderingHint(RenderingHints.Key hintKey,
1002: Object hintValue) {
1003: }
1004:
1005: public boolean drawImage(Image img, AffineTransform xform,
1006: ImageObserver obs) {
1007: return false;
1008: }
1009: }
1010:
1011: public static class DummyPaint implements Paint {
1012:
1013: public PaintContext createContext(ColorModel cm,
1014: Rectangle deviceBounds, Rectangle2D userBounds,
1015: AffineTransform xform, RenderingHints hints) {
1016: return NULL_PAINT_CONTEXT;
1017: }
1018:
1019: public int getTransparency() {
1020: return 0;
1021: }
1022: }
1023:
1024: public static class DummyPaintContext implements PaintContext {
1025:
1026: public void dispose() {
1027: }
1028:
1029: public ColorModel getColorModel() {
1030: return NULL_COLOR_MODEL;
1031: }
1032:
1033: public Raster getRaster(int x, int y, int w, int h) {
1034: return Raster.createBandedRaster(0, 0, 0, 0, NULL_POINT);
1035: }
1036: }
1037:
1038: public static class DummyImageProducer implements ImageProducer {
1039: public void addConsumer(ImageConsumer ic) {
1040: }
1041:
1042: public boolean isConsumer(ImageConsumer ic) {
1043: return false;
1044: }
1045:
1046: public void removeConsumer(ImageConsumer ic) {
1047: }
1048:
1049: public void requestTopDownLeftRightResend(ImageConsumer ic) {
1050: }
1051:
1052: public void startProduction(ImageConsumer ic) {
1053: }
1054: }
1055:
1056: public static class DummyComposite implements Composite {
1057:
1058: public CompositeContext createContext(ColorModel srcColorModel,
1059: ColorModel dstColorModel, RenderingHints hints) {
1060: return NULL_COMPOSITE_CONTEXT;
1061: }
1062: }
1063:
1064: public static class DummyCompositeContext implements
1065: CompositeContext {
1066:
1067: public void dispose() {
1068: }
1069:
1070: public void compose(Raster src, Raster dstIn,
1071: WritableRaster dstOut) {
1072: }
1073: }
1074:
1075: public static class DummyStroke implements Stroke {
1076: public Shape createStrokedShape(Shape p) {
1077: return NULL_RECTANGLE;
1078: }
1079: }
1080:
1081: public static class DummyIcon implements Icon {
1082:
1083: public void paintIcon(Component c, Graphics g, int x, int y) {
1084: }
1085:
1086: public int getIconWidth() {
1087: return 0;
1088: }
1089:
1090: public int getIconHeight() {
1091: return 0;
1092: }
1093: }
1094: }
|