|
@@ -22,17 +22,18 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.ui_swing.textpane;
|
24
|
24
|
|
|
25
|
+import static com.google.common.base.Preconditions.checkArgument;
|
|
26
|
+
|
25
|
27
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
26
|
28
|
import com.dmdirc.interfaces.WindowModel;
|
27
|
29
|
import com.dmdirc.interfaces.config.ConfigChangeListener;
|
28
|
30
|
import com.dmdirc.ui.messages.CachingDocument;
|
29
|
|
-import com.dmdirc.ui.messages.IRCDocument;
|
30
|
|
-import com.dmdirc.ui.messages.IRCDocumentListener;
|
|
31
|
+import com.dmdirc.ui.messages.Document;
|
|
32
|
+import com.dmdirc.ui.messages.DocumentListener;
|
31
|
33
|
import com.dmdirc.ui.messages.LinePosition;
|
32
|
34
|
import com.dmdirc.ui.messages.Styliser;
|
33
|
35
|
import com.dmdirc.util.StringUtils;
|
34
|
36
|
import com.dmdirc.util.URLBuilder;
|
35
|
|
-
|
36
|
37
|
import java.awt.Adjustable;
|
37
|
38
|
import java.awt.Color;
|
38
|
39
|
import java.awt.Point;
|
|
@@ -46,7 +47,6 @@ import java.awt.event.MouseMotionAdapter;
|
46
|
47
|
import java.awt.event.MouseMotionListener;
|
47
|
48
|
import java.awt.event.MouseWheelEvent;
|
48
|
49
|
import java.awt.event.MouseWheelListener;
|
49
|
|
-
|
50
|
50
|
import javax.swing.BoundedRangeModel;
|
51
|
51
|
import javax.swing.DefaultBoundedRangeModel;
|
52
|
52
|
import javax.swing.JComponent;
|
|
@@ -54,16 +54,13 @@ import javax.swing.JLabel;
|
54
|
54
|
import javax.swing.JLayer;
|
55
|
55
|
import javax.swing.JScrollBar;
|
56
|
56
|
import javax.swing.SwingConstants;
|
57
|
|
-
|
58
|
57
|
import net.miginfocom.swing.MigLayout;
|
59
|
58
|
|
60
|
|
-import static com.google.common.base.Preconditions.checkArgument;
|
61
|
|
-
|
62
|
59
|
/**
|
63
|
60
|
* Styled, scrollable text pane.
|
64
|
61
|
*/
|
65
|
62
|
public final class TextPane extends JComponent implements MouseWheelListener,
|
66
|
|
- AdjustmentListener, IRCDocumentListener, ConfigChangeListener {
|
|
63
|
+ AdjustmentListener, DocumentListener, ConfigChangeListener {
|
67
|
64
|
|
68
|
65
|
/** A version number for this class. */
|
69
|
66
|
private static final long serialVersionUID = 5;
|
|
@@ -72,7 +69,7 @@ public final class TextPane extends JComponent implements MouseWheelListener,
|
72
|
69
|
/** Canvas object, used to draw text. */
|
73
|
70
|
private final TextPaneCanvas canvas;
|
74
|
71
|
/** IRCDocument. */
|
75
|
|
- private final IRCDocument document;
|
|
72
|
+ private final Document document;
|
76
|
73
|
/** Parent window. */
|
77
|
74
|
private final WindowModel window;
|
78
|
75
|
/** Indicator to show whether new lines have been added. */
|
|
@@ -487,7 +484,7 @@ public final class TextPane extends JComponent implements MouseWheelListener,
|
487
|
484
|
*
|
488
|
485
|
* @return This TextPane's IRC document
|
489
|
486
|
*/
|
490
|
|
- public IRCDocument getDocument() {
|
|
487
|
+ public Document getDocument() {
|
491
|
488
|
return document;
|
492
|
489
|
}
|
493
|
490
|
|