|
@@ -47,7 +47,6 @@ import java.awt.font.LineBreakMeasurer;
|
47
|
47
|
import java.awt.font.TextAttribute;
|
48
|
48
|
import java.awt.font.TextHitInfo;
|
49
|
49
|
import java.awt.font.TextLayout;
|
50
|
|
-import java.awt.image.BufferedImage;
|
51
|
50
|
import java.io.IOException;
|
52
|
51
|
import java.net.URL;
|
53
|
52
|
import java.text.AttributedCharacterIterator;
|
|
@@ -92,8 +91,6 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
|
92
|
91
|
private int firstVisibleLine;
|
93
|
92
|
/** Last visible line. */
|
94
|
93
|
private int lastVisibleLine;
|
95
|
|
- /** Cached canvas. */
|
96
|
|
- private BufferedImage buffer;
|
97
|
94
|
/** Background image. */
|
98
|
95
|
private Image backgroundImage;
|
99
|
96
|
/** Config Manager. */
|
|
@@ -139,9 +136,6 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
|
139
|
136
|
@Override
|
140
|
137
|
public void paintComponent(final Graphics graphics) {
|
141
|
138
|
final Graphics2D g = (Graphics2D) graphics;
|
142
|
|
- //if (buffer == null) {
|
143
|
|
- //calc();
|
144
|
|
- //}
|
145
|
139
|
final Map desktopHints = (Map) Toolkit.getDefaultToolkit().
|
146
|
140
|
getDesktopProperty("awt.font.desktophints");
|
147
|
141
|
if (desktopHints != null) {
|
|
@@ -152,14 +146,12 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
|
152
|
146
|
UIUtilities.paintBackground(g, getBounds(), backgroundImage,
|
153
|
147
|
backgroundOption);
|
154
|
148
|
paintOntoGraphics(g);
|
155
|
|
- //g.drawImage(buffer, 0, 0, null);
|
156
|
149
|
}
|
157
|
150
|
|
158
|
151
|
/**
|
159
|
152
|
* Re calculates positions of lines and repaints if required.
|
160
|
153
|
*/
|
161
|
154
|
protected void recalc() {
|
162
|
|
- buffer = null;
|
163
|
155
|
if (isVisible()) {
|
164
|
156
|
repaint();
|
165
|
157
|
}
|
|
@@ -191,21 +183,6 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
|
191
|
183
|
}
|
192
|
184
|
}
|
193
|
185
|
|
194
|
|
- /**
|
195
|
|
- * Calculates the position of the lines and highlights.
|
196
|
|
- */
|
197
|
|
- protected void calc() {
|
198
|
|
- final BufferedImage image = new BufferedImage(getWidth(), getHeight(),
|
199
|
|
- BufferedImage.TYPE_INT_ARGB);
|
200
|
|
- final Graphics2D g = image.createGraphics();
|
201
|
|
-
|
202
|
|
- paintOntoGraphics(g);
|
203
|
|
-
|
204
|
|
- buffer = new BufferedImage(getWidth(), getHeight(),
|
205
|
|
- BufferedImage.TYPE_INT_ARGB);
|
206
|
|
- buffer.createGraphics().drawImage(image, null, null);
|
207
|
|
- }
|
208
|
|
-
|
209
|
186
|
private void paintOntoGraphics(final Graphics2D g) {
|
210
|
187
|
final Map desktopHints = (Map) Toolkit.getDefaultToolkit().
|
211
|
188
|
getDesktopProperty("awt.font.desktophints");
|