Okay, that seems to fix it. Thank you.
Roger Whitcomb | Architect, Engineering | [email protected]| Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA <http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C +Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67 7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr> | +1 650-587-5596 | fax: +1 650-587-5550 From: Greg Brown [mailto:[email protected]] Sent: Thursday, October 21, 2010 11:33 AM To: [email protected] Subject: Re: Exception with Pivot 2.0 I just checked in an update that should resolve this. Can you give it a shot and let me know how it goes? Thanks. G On Oct 21, 2010, at 1:20 PM, Roger L. Whitcomb wrote: The code in TextArea.java at around line 852 looks like this: public int getParagraphAt(int index) { if (index < 0 || index > characterCount) { throw new IndexOutOfBoundsException(); } int paragraphIndex = paragraphs.getLength() - 1; Paragraph paragraph = paragraphs.get(paragraphIndex); while (paragraph.offset > index) { paragraph = paragraphs.get(--paragraphIndex); } return paragraphIndex; } So, the "paragraphs" list is likely empty (with an empty text area), so "paragraphs.getLength()" returns 0 and "paragraphIndex" then becomes -1... Roger Whitcomb | Architect, Engineering | [email protected]| Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA <http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C +Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67 7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr> | +1 650-587-5596 | fax: +1 650-587-5550 From: Roger L. Whitcomb [mailto:[email protected]] Sent: Thursday, October 21, 2010 10:02 AM To: [email protected] Subject: Exception with Pivot 2.0 Hi, I'm getting the exception below with the latest (yesterday) head revs of Pivot 2.0, but I'm not getting the same error with 1.5.2. Maybe this is something else I've not considered in the migration, but it is just from an empty TextArea, so it seems like a bug. Anyway, this is the code snippet (in a .wtkx file in 1.5.2 and a .bxml in 2.0): <Border title=" QUERY " preferredWidth="700" preferredHeight="400" styles="{color:'#404040', titleColor:'#000000', thickness:2, cornerRadii:20, padding:8, backgroundColor:'#E8E8E8'}"> <content> <BoxPane orientation="vertical"> <ScrollPane> <view> <TextArea preferredWidth="650" preferredHeight="160"/> </view> </ScrollPane> . . . And this is the exception I get when I click on the TabPane that encloses this: java.lang.IndexOutOfBoundsException: index -1 out of bounds. at org.apache.pivot.collections.ArrayList.verifyIndexBounds(ArrayList.java: 577) at org.apache.pivot.collections.ArrayList.get(ArrayList.java:346) at org.apache.pivot.wtk.TextArea.getParagraphAt(TextArea.java:852) at org.apache.pivot.wtk.skin.TextAreaSkin.getCharacterBounds(TextAreaSkin.j ava:407) at org.apache.pivot.wtk.skin.TextAreaSkin.scrollCharacterToVisible(TextArea Skin.java:422) at org.apache.pivot.wtk.skin.TextAreaSkin.focusedChanged(TextAreaSkin.java: 1105) at org.apache.pivot.wtk.Component$ComponentStateListenerList.focusedChanged (Component.java:386) at org.apache.pivot.wtk.Component.setFocused(Component.java:2373) at org.apache.pivot.wtk.Component.setFocusedComponent(Component.java:2441) at org.apache.pivot.wtk.Component.requestFocus(Component.java:2385) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.Container.requestFocus(Container.java:470) at org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin.selectedIndexChanged(Te rraTabPaneSkin.java:1569) at org.apache.pivot.wtk.TabPane$TabPaneSelectionListenerList.selectedIndexC hanged(TabPane.java:244) at org.apache.pivot.wtk.TabPane.setSelectedIndex(TabPane.java:332) at org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin$2.selectionChanged(Terr aTabPaneSkin.java:572) at org.apache.pivot.wtk.ButtonGroup$ButtonGroupListenerList.selectionChange d(ButtonGroup.java:46) at org.apache.pivot.wtk.ButtonGroup.setSelection(ButtonGroup.java:128) at org.apache.pivot.wtk.Button.setState(Button.java:469) at org.apache.pivot.wtk.Button.setSelected(Button.java:432) at org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin$TabButton.press(TerraTa bPaneSkin.java:128) at org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin$TabButtonSkin.mouseClic k(TerraTabPaneSkin.java:386) at org.apache.pivot.wtk.Component$ComponentMouseButtonListenerList.mouseCli ck(Component.java:483) at org.apache.pivot.wtk.Component.mouseClick(Component.java:2801) at org.apache.pivot.wtk.Container.mouseUp(Container.java:774) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.Container.mouseUp(Container.java:759) at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processMouseEvent(Ap plicationContext.java:909) at java.awt.Component.processEvent(Unknown Source) at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processEvent(Applica tionContext.java:709) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Any thoughts? Am I missing something I should be doing to better initialize the TextArea?? Thanks. Roger Whitcomb Architect, Engineering Ingres Corporation [email protected] PHONE +1 650.587.5596 FAX +1 650.587.5550 www.ingres.com <http://www.ingres.com/> This transmission is confidential and intended solely for the use of the recipient named above. It may contain confidential, proprietary, or legally privileged information. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, disclosure or distribution is strictly prohibited. If you have received this transmission in error, please contact the sender by reply e-mail and delete the original transmission and all copies from your system.
