aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/text/View.java
diff options
context:
space:
mode:
authorMark Wielaard <mark@gcc.gnu.org>2006-01-17 18:09:40 +0000
committerMark Wielaard <mark@gcc.gnu.org>2006-01-17 18:09:40 +0000
commit2127637945ea6b763966398130e0770fa993c860 (patch)
treec976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/javax/swing/text/View.java
parentbcb36c3e02e3bd2843aad1b9888513dfb5d6e337 (diff)
downloadgcc-2127637945ea6b763966398130e0770fa993c860.zip
gcc-2127637945ea6b763966398130e0770fa993c860.tar.gz
gcc-2127637945ea6b763966398130e0770fa993c860.tar.bz2
Imported GNU Classpath 0.20
Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r109831
Diffstat (limited to 'libjava/classpath/javax/swing/text/View.java')
-rw-r--r--libjava/classpath/javax/swing/text/View.java40
1 files changed, 32 insertions, 8 deletions
diff --git a/libjava/classpath/javax/swing/text/View.java b/libjava/classpath/javax/swing/text/View.java
index daab347..b835842 100644
--- a/libjava/classpath/javax/swing/text/View.java
+++ b/libjava/classpath/javax/swing/text/View.java
@@ -447,9 +447,11 @@ public abstract class View implements SwingConstants
protected void updateLayout(DocumentEvent.ElementChange ec,
DocumentEvent ev, Shape shape)
{
- Rectangle b = shape.getBounds();
- if (ec != null)
- preferenceChanged(this, true, true);
+ if (ec != null && shape != null)
+ preferenceChanged(null, true, true);
+ Container c = getContainer();
+ if (c != null)
+ c.repaint();
}
/**
@@ -599,9 +601,9 @@ public abstract class View implements SwingConstants
* Returns the document position that is (visually) nearest to the given
* document position <code>pos</code> in the given direction <code>d</code>.
*
- * @param c the text component
* @param pos the document position
* @param b the bias for <code>pos</code>
+ * @param a the allocation for this view
* @param d the direction, must be either {@link SwingConstants#NORTH},
* {@link SwingConstants#SOUTH}, {@link SwingConstants#WEST} or
* {@link SwingConstants#EAST}
@@ -615,9 +617,31 @@ public abstract class View implements SwingConstants
*
* @throws BadLocationException if <code>pos</code> is not a valid offset in
* the document model
+ * @throws IllegalArgumentException if <code>d</code> is not a valid direction
*/
- public abstract int getNextVisualPositionFrom(JTextComponent c, int pos,
- Position.Bias b, int d,
- Position.Bias[] biasRet)
- throws BadLocationException;
+ public int getNextVisualPositionFrom(int pos, Position.Bias b,
+ Shape a, int d,
+ Position.Bias[] biasRet)
+ throws BadLocationException
+ {
+ int ret = pos;
+ switch (d)
+ {
+ case WEST:
+ ret = pos - 1;
+ break;
+ case EAST:
+ ret = pos + 1;
+ break;
+ case NORTH:
+ // TODO: Implement this
+ break;
+ case SOUTH:
+ // TODO: Implement this
+ break;
+ default:
+ throw new IllegalArgumentException("Illegal value for d");
+ }
+ return ret;
+ }
}