OmegaT の背景に画像を表示します。
delegator: 上余白の設定に対応
| @@ -37,6 +37,7 @@ | ||
| 37 | 37 | private final float DEFAULT_ALPHA = 0.5f; |
| 38 | 38 | private float alpha = DEFAULT_ALPHA; |
| 39 | 39 | private AlphaComposite alphaComposite = null; |
| 40 | + private int marginTop = 0; | |
| 40 | 41 | |
| 41 | 42 | public void setOpacity(float opacity) { |
| 42 | 43 | this.alpha = opacity; |
| @@ -66,6 +67,10 @@ | ||
| 66 | 67 | this.component = c; |
| 67 | 68 | } |
| 68 | 69 | |
| 70 | + public void setMarginTop(int marginTop) { | |
| 71 | + this.marginTop = marginTop; | |
| 72 | + } | |
| 73 | + | |
| 69 | 74 | public void paintBackground(Graphics g) { |
| 70 | 75 | if (image != null) { |
| 71 | 76 | Graphics2D g2 = (Graphics2D) g.create(); |
| @@ -89,7 +94,7 @@ | ||
| 89 | 94 | if (width > tiledImage.getWidth() || height > tiledImage.getHeight()) { |
| 90 | 95 | tiledImage = createTiledImage(image, width, height); |
| 91 | 96 | } |
| 92 | - g2.drawImage(tiledImage, 0, 0, component); | |
| 97 | + g2.drawImage(tiledImage, 0, marginTop, component); | |
| 93 | 98 | g2.dispose(); |
| 94 | 99 | } |
| 95 | 100 | } |