1 21 22 package org.armedbear.j; 23 24 import java.awt.Image ; 25 import java.awt.Rectangle ; 26 27 public final class ImageLine extends AbstractLine implements Line 28 { 29 private Image image; 30 private final int imageHeight; 31 private final int imageWidth; 32 private final int height; 33 private final Rectangle rect; 34 35 public ImageLine(Image image, Rectangle r) 36 { 37 this.image = image; 38 rect = new Rectangle (r); 39 height = Math.max(r.height, Display.getCharHeight());; 40 imageHeight = r.height; 41 imageWidth = r.width; 42 } 43 44 public final Image getImage() 45 { 46 return image; 47 } 48 49 public final Rectangle getRect() 50 { 51 return rect; 52 } 53 54 public final int getImageHeight() 55 { 56 return imageHeight; 57 58 } 59 60 public final int getImageWidth() 61 { 62 return imageWidth; 63 } 64 65 public final int getHeight() 66 { 67 return height; 68 } 69 70 public final int getWidth() 71 { 72 return getImageWidth(); 73 } 74 75 public final int flags() 76 { 77 return 0; 78 } 79 80 public final void setFlags(int flags) 81 { 82 } 83 84 public String getText() 85 { 86 return null; 87 } 88 89 public final void setText(String s) 90 { 91 } 92 93 public final char charAt(int i) 94 { 95 return '\0'; 96 } 97 98 public final String substring(int beginIndex) 99 { 100 return null; 101 } 102 103 public final String substring(int beginIndex, int endIndex) 104 { 105 return null; 106 } 107 108 public final String trim() 109 { 110 return null; 111 } 112 113 public final int length() 114 { 115 return 0; 116 } 117 118 public final byte[] getBytes(String encoding) 119 { 120 return null; 121 } 122 123 public final boolean isBlank() 124 { 125 return false; 126 } 127 128 public final void flushImage() 129 { 130 if (image != null) { 131 image.flush(); 132 image = null; 133 } 134 } 135 136 protected void finalize() throws Throwable 137 { 138 flushImage(); 139 super.finalize(); 140 } 141 } 142 | Popular Tags |