harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r478497 - in /harmony/enhanced/classlib/trunk/modules/swing: make/ src/main/java/common/javax/swing/text/ src/test/api/java/common/javax/swing/text/
Date Thu, 23 Nov 2006 07:25:10 GMT
Author: mloenko
Date: Wed Nov 22 23:25:09 2006
New Revision: 478497

URL: http://svn.apache.org/viewvc?view=rev&rev=478497
Log:
applied patch for HARMONY-2212
[classlib][swing] Caret is positioned incorrectly with mouse in JTextField with RTL component
orientation

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainViewI18N_LineViewTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl Wed Nov 22 23:25:09
2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm Wed Nov 22 23:25:09
2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl Wed Nov 22
23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm Wed Nov 22
23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl Wed Nov 22
23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm Wed Nov 22
23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl Wed Nov
22 23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm Wed Nov
22 23:25:09 2006
@@ -25,9 +25,7 @@
 javax/swing/text/InternationalFormatterTest.java
 javax/swing/text/ParagraphViewTest.java
 javax/swing/text/PlainViewI18N_LayoutTest.java
-javax/swing/text/PlainViewI18N_LineViewTest.java
 javax/swing/text/PlainViewI18N_LineView_UpdateTest.java
-javax/swing/text/PlainViewI18N_VisualPositionTest.java
 javax/swing/text/StringContentTest.java
 javax/swing/text/StringContentTest_CommonTests.java
 javax/swing/text/StyleConstantsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java
Wed Nov 22 23:25:09 2006
@@ -50,6 +50,7 @@
             super(element, start, end);
         }
 
+        @Override
         public Shape modelToView(final int pos, final Shape shape,
                                  final Bias bias)
             throws BadLocationException {
@@ -74,6 +75,7 @@
                     1, paintParams.metrics.getHeight());
         }
 
+        @Override
         public int viewToModel(final float x, final float y,
                                final Shape shape, final Bias[] biasReturn) {
             biasReturn[0] = Position.Bias.Forward;
@@ -152,6 +154,7 @@
             super(element, start, end);
         }
 
+        @Override
         public Shape modelToView(final int pos, final Shape shape,
                                  final Bias bias) throws BadLocationException {
             final int start = getStartOffset();
@@ -172,6 +175,7 @@
                     1, paintParams.metrics.getHeight());
         }
 
+        @Override
         public int viewToModel(final float x, final float y,
                                final Shape shape, final Bias[] biasReturn) {
             biasReturn[0] = Position.Bias.Forward;
@@ -215,14 +219,17 @@
             } catch (BadLocationException e) { }
         }
 
+        @Override
         public int getEndOffset() {
             return end.getOffset();
         }
 
+        @Override
         public int getStartOffset() {
             return start.getOffset();
         }
 
+        @Override
         public float getAlignment(final int axis) {
             return ALIGN_LEFT;
         }
@@ -241,6 +248,7 @@
             return paintParams.buffer;
         }
 
+        @Override
         public float getPreferredSpan(final int axis) {
             if (axis == Y_AXIS) {
                 return paintParams.metrics.getHeight();
@@ -256,6 +264,7 @@
             return cachedWidth;
         }
 
+        @Override
         public void paint(final Graphics g, final Shape shape) {
             Rectangle bounds = shape.getBounds();
 
@@ -266,6 +275,7 @@
                      - paintParams.metrics.getDescent());
         }
 
+        @Override
         protected int drawSelectedText(final Graphics g,
                                        final int x, final int y,
                                        final int start, final int end)
@@ -275,6 +285,7 @@
                             x, y, start, end);
         }
 
+        @Override
         protected int drawUnselectedText(final Graphics g,
                                          final int x, final int y,
                                          final int start, final int end)
@@ -284,6 +295,7 @@
                             x, y, start, end);
         }
 
+        @Override
         public void preferenceChanged(final View child,
                                       final boolean width,
                                       final boolean height) {
@@ -293,12 +305,14 @@
             super.preferenceChanged(child, width, height);
         }
 
+        @Override
         public void insertUpdate(final DocumentEvent event,
                                  final Shape shape,
                                  final ViewFactory factory) {
             preferenceChanged(this, true, false);
         }
 
+        @Override
         public void removeUpdate(final DocumentEvent event,
                                  final Shape shape,
                                  final ViewFactory factory) {
@@ -314,10 +328,12 @@
             super(element, X_AXIS);
         }
 
+        @Override
         public float getAlignment(final int axis) {
             return ALIGN_LEFT;
         }
 
+        @Override
         public void paint(final Graphics g, final Shape shape) {
             TextKit textKit = getTextKit();
 
@@ -330,12 +346,14 @@
             super.paint(g, shape);
         }
 
+        @Override
         protected boolean updateChildren(final ElementChange change,
                                          final DocumentEvent event,
                                          final ViewFactory factory) {
             return false;
         }
 
+        @Override
         protected SizeRequirements
             calculateMinorAxisRequirements(final int axis,
                                            final SizeRequirements r) {
@@ -348,6 +366,7 @@
 
         int accumulatedWidth;
 
+        @Override
         protected SizeRequirements
             calculateMajorAxisRequirements(final int axis,
                                            final SizeRequirements r) {
@@ -355,13 +374,7 @@
             return super.calculateMajorAxisRequirements(axis, r);
         }
 
-        protected boolean isAfter(final int x, final int y,
-                                  final Rectangle innerAlloc) {
-            final int lastIndex = getViewCount() - 1;
-            return x > getOffset(X_AXIS, lastIndex)
-                       + getSpan(X_AXIS, lastIndex);
-        }
-
+        @Override
         protected void loadChildren(final ViewFactory factory) {
             updateChildren();
         }
@@ -384,12 +397,14 @@
             }
         }
 
+        @Override
         public void insertUpdate(final DocumentEvent event,
                                  final Shape shape,
                                  final ViewFactory factory) {
             updateView(event, shape);
         }
 
+        @Override
         public void removeUpdate(final DocumentEvent event,
                                  final Shape shape,
                                  final ViewFactory factory) {
@@ -404,7 +419,7 @@
             Element bidiRoot = doc.getBidiRootElement();
             final int startIndex = bidiRoot.getElementIndex(startOffset);
             final int endIndex   = bidiRoot.getElementIndex(endOffset);
-            List views = new ArrayList();
+            List<View> views = new ArrayList<View>();
             for (int i = startIndex; i <= endIndex
                                      && startOffset < endOffset; i++) {
                 Element bidi = bidiRoot.getElement(i);
@@ -422,8 +437,7 @@
                 startOffset = child.getEndOffset();
                 views.add(child);
             }
-            replace(0, getViewCount(),
-                    (View[])views.toArray(new View[views.size()]));
+            replace(0, getViewCount(), views.toArray(new View[views.size()]));
         }
     }
 
@@ -439,15 +453,18 @@
         super(element, Y_AXIS);
     }
 
+    @Override
     public ViewFactory getViewFactory() {
         return lineFactory;
     }
 
+    @Override
     public void paint(final Graphics g, final Shape shape) {
         paintParams.updateFields();
         super.paint(g, shape);
     }
 
+    @Override
     public void setSize(final float width, final float height) {
         paintParams.conditionalUpdateMetrics();
         super.setSize(width, height);
@@ -462,21 +479,25 @@
         return paintParams.nextTabStop(x);
     }
 
+    @Override
     public float getMaximumSpan(final int axis) {
         paintParams.conditionalUpdateMetrics();
         return super.getMaximumSpan(axis);
     }
 
+    @Override
     public float getMinimumSpan(final int axis) {
         paintParams.conditionalUpdateMetrics();
         return super.getMinimumSpan(axis);
     }
 
+    @Override
     public float getPreferredSpan(final int axis) {
         paintParams.conditionalUpdateMetrics();
         return super.getPreferredSpan(axis);
     }
 
+    @Override
     public void insertUpdate(final DocumentEvent event,
                              final Shape shape,
                              final ViewFactory factory) {
@@ -484,6 +505,7 @@
     }
 
 
+    @Override
     public void removeUpdate(final DocumentEvent event,
                              final Shape shape,
                              final ViewFactory factory) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainViewI18N_LineViewTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainViewI18N_LineViewTest.java?view=diff&rev=478497&r1=478496&r2=478497
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainViewI18N_LineViewTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/PlainViewI18N_LineViewTest.java
Wed Nov 22 23:25:09 2006
@@ -23,6 +23,7 @@
 
 import java.awt.Container;
 import java.awt.FontMetrics;
+import java.awt.Rectangle;
 
 import javax.swing.JTextArea;
 import javax.swing.SwingTestCase;
@@ -44,6 +45,7 @@
             textArea = new JTextArea(doc);
         }
 
+        @Override
         public Container getContainer() {
             return textArea;
         }
@@ -219,6 +221,20 @@
         checkChild(view.getView(2), offset, offset + RTLLength + 1); // +newLine
     }
 
+    public void testIsAfter() throws Exception {
+        // Regression for HARMONY-2212
+        if (!isHarmony()) {
+            return;
+        }
+
+        view = parent.new LineView(root.getElement(0));
+        view.loadChildren(null);
+        assertEquals(1, view.getViewCount());
+
+        assertFalse(view.isAfter(31, 10, new Rectangle(30, 5, 5, 10)));
+    }
+
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 



Mime
View raw message