The last missing methods in Swing vs Japi are falling. Here comes
NavigationFilter.getNextVisualPositionFrom(), which was quite trivial.
2006-02-21 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/text/NavigationFilter.java
(getNextVisualPositionFrom): New method.
/Roman
Index: javax/swing/text/NavigationFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/NavigationFilter.java,v
retrieving revision 1.4
diff -u -r1.4 NavigationFilter.java
--- javax/swing/text/NavigationFilter.java 2 Jul 2005 20:32:51 -0000 1.4
+++ javax/swing/text/NavigationFilter.java 21 Feb 2006 14:43:16 -0000
@@ -68,4 +68,31 @@
{
fb.setDot(dot, bias);
}
+
+ /**
+ * Returns the next visual position in the specified direction at which one
+ * would place a caret. The default implementation forwards to the text
+ * component's root view. Subclasses may wish to restrict that more.
+ *
+ * @param c the text component
+ * @param pos the current model position
+ * @param bias the bias of <code>pos</code>
+ * @param dir the direction, one of [EMAIL PROTECTED] javax.swing.SwingConstants#NORTH},
+ * [EMAIL PROTECTED] javax.swing.SwingConstants#SOUTH},
+ * [EMAIL PROTECTED] javax.swing.SwingConstants#WEST} or
+ * [EMAIL PROTECTED] javax.swing.SwingConstants#EAST}
+ * @param retBias the bias of the returned position
+ *
+ * @return the next model location to place the caret
+ *
+ * @throws BadLocationException when <code>pos</code> is not a valid model
+ * position
+ */
+ public int getNextVisualPositionFrom(JTextComponent c, int pos,
+ Position.Bias bias, int dir,
+ Position.Bias[] retBias)
+ throws BadLocationException
+ {
+ return c.getUI().getNextVisualPositionFrom(c, pos, bias, dir, retBias);
+ }
}