summaryrefslogtreecommitdiff
path: root/libjava/javax/swing/text/View.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/javax/swing/text/View.java')
-rw-r--r--libjava/javax/swing/text/View.java45
1 files changed, 43 insertions, 2 deletions
diff --git a/libjava/javax/swing/text/View.java b/libjava/javax/swing/text/View.java
index 6c5a9c296dd..730753a342b 100644
--- a/libjava/javax/swing/text/View.java
+++ b/libjava/javax/swing/text/View.java
@@ -161,8 +161,49 @@ public abstract class View implements SwingConstants
public View createFragment(int p0, int p1)
{
- // The default implementation doesnt support fragmentation.
+ // The default implementation doesn't support fragmentation.
return this;
- }
+ }
+
+ public int getStartOffset()
+ {
+ return elt.getStartOffset();
+ }
+
+ public int getEndOffset()
+ {
+ return elt.getEndOffset();
+ }
+
+ public Shape getChildAllocation(int index, Shape a)
+ {
+ return null;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public int getViewIndex(float x, float y, Shape allocation)
+ {
+ return -1;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public String getToolTipText(float x, float y, Shape allocation)
+ {
+ int index = getViewIndex(x, y, allocation);
+
+ if (index < -1)
+ return null;
+
+ Shape childAllocation = getChildAllocation(index, allocation);
+
+ if (childAllocation.getBounds().contains(x, y))
+ return getView(index).getToolTipText(x, y, childAllocation);
+
+ return null;
+ }
}