You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Roger Whitcomb (JIRA)" <ji...@apache.org> on 2011/07/19 02:54:57 UTC

[jira] [Created] (PIVOT-772) Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist

Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist
------------------------------------------------------------------------------------------

                 Key: PIVOT-772
                 URL: https://issues.apache.org/jira/browse/PIVOT-772
             Project: Pivot
          Issue Type: Bug
          Components: wtk
    Affects Versions: 2.0.1
         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
            Reporter: Roger Whitcomb
            Priority: Minor
             Fix For: 2.0.1


If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
java.lang.IndexOutOfBoundsException: ix = 38
        at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
        at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
        at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
        at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414992#comment-13414992 ] 

Sandro Martini commented on PIVOT-772:
--------------------------------------

Hi, thanks for the code block (and sory for the delay) ... but that means this issue is still valid (is it to reopen and reassign to 2.0.3) ?
At the moment we haven't a minimal test for this issue (and could be useful to have), so please tell me ...

Thanks for now.

                
> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin resolved PIVOT-772.
--------------------------------

    Resolution: Fixed

Fixed in rev 1150603

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Magic Xie (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406892#comment-13406892 ] 

Magic Xie commented on PIVOT-772:
---------------------------------

EventQueue.invokeLater(new Runnable() {
	@Override
	public void run() {
	   Bounds b = textArea.getCharacterBounds(textArea.getCharacterCount());
	   textArea.scrollAreaToVisible(b);
      }
});

is that helps?
                
> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin resolved PIVOT-772.
--------------------------------

    Resolution: Fixed

Fixed in rev 1151471

Note that your code needs to change slightly: 

Bounds bounds = logTextArea.getCharacterBounds(textarea.getCharacterCount());
textarea.scrollAreaToVisible(bounds);

Note the absence of the "-1" factor, since we actually want the position of the piece just past the end.


> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071898#comment-13071898 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

Hi Noel,
Just tried it and it seems to work for the normal cases, but if I do a paste into a TextArea the code goes into an infinite loop, eventually leading to StackOverflowError:
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
	at java.awt.Component.repaint(Unknown Source)
	at java.awt.Component.repaint(Unknown Source)
	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.repaint(ApplicationContext.java:414)
	at org.apache.pivot.wtk.Display.repaint(Display.java:97)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2041)
	at org.apache.pivot.wtk.Viewport.repaint(Viewport.java:174)
	at org.apache.pivot.wtk.Component.repaint(Component.java:2000)
	at org.apache.pivot.wtk.Component.repaint(Component.java:1985)
	at org.apache.pivot.wtk.Component.setSize(Component.java:935)
	at org.apache.pivot.wtk.skin.ScrollPaneSkin.layoutHelper(ScrollPaneSkin.java:730)
	at org.apache.pivot.wtk.skin.ScrollPaneSkin.layout(ScrollPaneSkin.java:585)
	at org.apache.pivot.wtk.Component.layout(Component.java:1960)
	at org.apache.pivot.wtk.Container.layout(Container.java:348)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Component.scrollAreaToVisible(Component.java:1831)
	at org.apache.pivot.wtk.skin.TextAreaSkin.scrollCharacterToVisible(TextAreaSkin.java:462)
	at org.apache.pivot.wtk.skin.TextAreaSkin.layout(TextAreaSkin.java:238)
	at org.apache.pivot.wtk.Component.layout(Component.java:1960)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Component.scrollAreaToVisible(Component.java:1831)
	at org.apache.pivot.wtk.skin.TextAreaSkin.scrollCharacterToVisible(TextAreaSkin.java:462)
	at org.apache.pivot.wtk.skin.TextAreaSkin.layout(TextAreaSkin.java:238)
	at org.apache.pivot.wtk.Component.layout(Component.java:1960)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)
	at org.apache.pivot.wtk.Container.layout(Container.java:352)
	at org.apache.pivot.wtk.Component.validate(Component.java:1951)


> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb reopened PIVOT-772:
----------------------------------


See previous comment for reason to reopen.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb updated PIVOT-772:
---------------------------------

    Summary: Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist  (was: Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist)

Changed issue title.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-772) Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb updated PIVOT-772:
---------------------------------

    Attachment: scroll.bxml
                Scroll.java

Just compile and run the test code.  There are three choices: one demonstrate "working" code and two forms of non-working code that throws the exceptions.

Thanks.

> Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist
> ------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067423#comment-13067423 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

Actually the title of the issue is misleading:  the actual exception is coming from "getCharacterBounds" before the "scrollAreaToVisible" even gets called.

> Exceptions thrown when calling scrollAreaToVisible of TextArea when incomplete lines exist
> ------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070590#comment-13070590 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

Thank you, Noel.  It looks perfect now!

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073591#comment-13073591 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

Hi Noel,
Thanks for all your work to fix this.  After the last results I got I was beginning to think it wasn't easily solvable, so .... I will take your latest code and implement the workaround.

Thanks again.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb reopened PIVOT-772:
----------------------------------


Hi Noel,
After some more testing with our real application, there are still some funny things remaining:
1) Often the first time I call "getCharacterBounds" after an arbitrary insert it gets really large Y values:
index: 90, char 0xa, bounds: org.apache.pivot.wtk.Bounds [4,1306;2x16]
index: 123, char 0x2e, bounds: org.apache.pivot.wtk.Bounds [214,116;7x16]
2) It seems to not scroll enough so that by the last line often the last one or more lines are not visible.  This looks to be because the TextArea component height isn't getting updated correctly.  For instance, in this case the Bounds is returning a Y value of 308 (plus line size of 16), but the viewHeight for the TextArea component (during "scrollAreaToVisible") is only returning 280, resulting in an incorrect "scrollTop" calculation:
index: 414, char 0xa, bounds: org.apache.pivot.wtk.Bounds [291,308;2x16]
scrollAreaToVisible: area [291,304,2,16], viewport org.apache.pivot.wtk.Bounds [0,0;523x260]
scrollAreaToVisible: deltaX = 0
scrollAreaToVisible: deltaY = 60
scrollAreaToVisible: viewHeight = 280
scrollAreaToVisible: new scrollTop=20
But, if you take the scrollbar to the bottom end, the final "scrollTop" gets to be (and should be) 84 (which includes the 308 + 16 for that line, plus another 16 for the empty line at the bottom + 4 for ??, or 344 altogether which = 260 + 84).  So, the cumulative error is 64 pixels in this example, which leaves me about 4 lines still scrolled off the bottom.

As you can probably tell, I still don't understand all the calculations involved here.

You can see these errors (a little bit, not as pronounced) using the example code.

I put tracing statements into Component.scrollAreaToVisible to get these results.

Thanks again for your attention to this issue.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb updated PIVOT-772:
---------------------------------

    Attachment: Scroll2.java

Hi Noel,
If you use the new attached "Scroll2.java" and choose "Multiple Lines per Append", you can see the behavior very clearly.  Once it finishes (and the buttons are enabled again), you will see line 34 at the bottom of the TextArea, but if you move the scroll bar down you will see that there are lines 35-38 that are still not visible (and a blank line underneath that as well).  So, even though we are consistently getting the character bounds of the very last character every time, the scroll doesn't quite scroll enough so that by the end we still have five lines that are not visible and could still be scrolled into view with the scroll bar.

Thanks!

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb updated PIVOT-772:
---------------------------------

    Attachment: scroll2.log
                scroll.log

"scroll.log" is the result choosing "Multiple Lines Per Append", and "scroll2.log" is from "Partial Line Per Append".

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073579#comment-13073579 ] 

Noel Grandin commented on PIVOT-772:
------------------------------------

I've backed out my fix for now.

Roger, the only solution that it available to you right now, is too push the scrollAreaToVisible() method call into a new Runnable, which is queued to be run after the TextArea modification. 
That will ensure that the component hierarchy is validated before scrollAreaToVisible() performs it's calculations.

Long-term, I can't see any easy solution, other than documenting this requirement.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071132#comment-13071132 ] 

Noel Grandin commented on PIVOT-772:
------------------------------------

Roger, thanks for being so patient.

Do you have way to make the example code show the error in a more pronounced way - I've tried running it in all 3 modes for quite a while, and I'm not seeing the problem show up?

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin resolved PIVOT-772.
--------------------------------

    Resolution: Fixed
      Assignee: Noel Grandin

Fixed in rev 1149500

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini resolved PIVOT-772.
----------------------------------

    Resolution: Fixed

Resolved by Noel.

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069680#comment-13069680 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

Hi Noel,
   Thanks for looking at this, and indeed now the exceptions are not showing up, but the Bounds values don't look right either.  In particular the "scrollAreaToVisible" doesn't do anything because the Y values of the bounds all appear to be 0 after a while (this is the "Multiple Lines" case):
index=79, bounds=org.apache.pivot.wtk.Bounds [116,19;2x16]
index=81, bounds=org.apache.pivot.wtk.Bounds [4,36;2x16]
index=196, bounds=org.apache.pivot.wtk.Bounds [364,0;2x16]
index=312, bounds=org.apache.pivot.wtk.Bounds [399,0;2x16]
index=431, bounds=org.apache.pivot.wtk.Bounds [413,0;2x16]
index=553, bounds=org.apache.pivot.wtk.Bounds [434,0;2x16]
index=667, bounds=org.apache.pivot.wtk.Bounds [385,0;2x16]
index=784, bounds=org.apache.pivot.wtk.Bounds [406,0;2x16]
index=900, bounds=org.apache.pivot.wtk.Bounds [364,0;2x16]
index=942, bounds=org.apache.pivot.wtk.Bounds [21,0;2x16]

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini reopened PIVOT-772:
----------------------------------


Repened

> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Roger Whitcomb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424995#comment-13424995 ] 

Roger Whitcomb commented on PIVOT-772:
--------------------------------------

@Magic Xie,
Yes, that is the workaround which is necessary.  We implemented this and everything has been working well for us.  Thank you for your concern.
                
> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (PIVOT-772) Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072263#comment-13072263 ] 

Sandro Martini edited comment on PIVOT-772 at 7/28/11 9:09 AM:
---------------------------------------------------------------

Reopened

      was (Author: smartini):
    Repened
  
> Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist
> -----------------------------------------------------------------------------------------
>
>                 Key: PIVOT-772
>                 URL: https://issues.apache.org/jira/browse/PIVOT-772
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JRE 1.6_25 or JRE 1.7 (beta)
>            Reporter: Roger Whitcomb
>            Assignee: Noel Grandin
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Scroll.java, Scroll2.java, scroll.bxml, scroll.log, scroll2.log
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> If partial lines are appended to a TextArea and then "getCharacterBounds" followed by "scrollAreaToVisible" is called, Pivot throws java.lang.IndexOutOfBoundsException from TextAreaSkinParagraphView.getCharacterBounds:
> java.lang.IndexOutOfBoundsException: ix = 38
>         at sun.font.StandardGlyphVector.getGlyphLogicalBounds(Unknown Source)
>         at org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.getCharacterBounds(TextAreaSkinParagraphView.java:393)
>         at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.java:442)
>         at org.apache.pivot.wtk.TextArea.getCharacterBounds(TextArea.java:1243)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira