IndexOutOfBoundsException in [message #172870] |
Mon, 21 March 2005 23:21 |
Eclipse User |
|
|
|
Originally posted by: p.clark.mindspring.com
In certain situations I am seeing an exception when drawing a connector
from one figure to another in my GEF drawing. The exception seems to be
coming from the GEF and draw2d. This only occurs when I am attempting
to reconnect an existing connection and happens while I am moving the
end of the connector.
I have been looking at this for some time and can't seem to find the
root cause. I haven't found anything in the news group. Please let me
know if anyone has any ideas or additional information is necessary.
Here is the stack trace:
!ENTRY org.eclipse.ui 4 0 Mar 21, 2005 17:08:00.525
!MESSAGE Index: 3, Size: 3
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at org.eclipse.draw2d.geometry.PointList.getPoint(PointList.jav a:183)
at
org.eclipse.draw2d.BendpointLocator.getReferencePoint(Bendpo intLocator.java:56)
at org.eclipse.draw2d.AbstractLocator.relocate(AbstractLocator. java:103)
at org.eclipse.gef.handles.AbstractHandle.validate(AbstractHand le.java:208)
at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
at
org.eclipse.draw2d.FreeformLayeredPane.validate(FreeformLaye redPane.java:122)
at
org.eclipse.draw2d.FreeformViewport$FreeformViewportLayout.c alculatePreferredSize(FreeformViewport.java:28)
at
org.eclipse.draw2d.AbstractLayout.getPreferredSize(AbstractL ayout.java:93)
at
org.eclipse.draw2d.AbstractHintLayout.getPreferredSize(Abstr actHintLayout.java:86)
at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:648)
at org.eclipse.draw2d.ScrollPaneSolver.solve(ScrollPaneSolver.j ava:75)
at org.eclipse.draw2d.FigureCanvas.layoutViewport(FigureCanvas. java:222)
at org.eclipse.draw2d.FigureCanvas.access$4(FigureCanvas.java:2 20)
at
org.eclipse.draw2d.FigureCanvas$3.notifyValidating(FigureCan vas.java:185)
at org.eclipse.draw2d.UpdateManager.fireValidating(UpdateManage r.java:93)
at
org.eclipse.draw2d.DeferredUpdateManager.validateFigures(Def erredUpdateManager.java:233)
at
org.eclipse.draw2d.DeferredUpdateManager.performUpdate(Defer redUpdateManager.java:137)
at
org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run(D eferredUpdateManager.java:62)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:106)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:2749)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2434)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
at
com.fastrieve.eclipse.plugin.FastrieveAdminApplication.run(F astrieveAdminApplication.java:28)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
at org.eclipse.core.launcher.Main.run(Main.java:644)
at org.eclipse.core.launcher.Main.main(Main.java:628)
Thanks,
Patrick
|
|
|
Re: IndexOutOfBoundsException in [message #173022 is a reply to message #172870] |
Tue, 22 March 2005 15:00 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Try hard to reproduce in the logic example. That way we can reproduce it
and debug.
It looks like the number of bends in the connection might be changing as you
drag the connection around, and the bendpoint editpolicy for some reason is
not rebuilding its handles when this occurs. Therefore, it ends up with a
handle referencing a bend index which is too large.
the policy should track the "points" property of the connection, and refresh
its handles if the number of points changes.
"Patrick Clark" <p.clark@mindspring.com> wrote in message
news:d1npkm$r9e$1@news.eclipse.org...
> In certain situations I am seeing an exception when drawing a connector
> from one figure to another in my GEF drawing. The exception seems to be
> coming from the GEF and draw2d. This only occurs when I am attempting to
> reconnect an existing connection and happens while I am moving the end of
> the connector.
>
> I have been looking at this for some time and can't seem to find the root
> cause. I haven't found anything in the news group. Please let me know if
> anyone has any ideas or additional information is necessary.
>
> Here is the stack trace:
> !ENTRY org.eclipse.ui 4 0 Mar 21, 2005 17:08:00.525
> !MESSAGE Index: 3, Size: 3
> !STACK 0
> java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
> at org.eclipse.draw2d.geometry.PointList.getPoint(PointList.jav a:183)
> at
> org.eclipse.draw2d.BendpointLocator.getReferencePoint(Bendpo intLocator.java:56)
> at org.eclipse.draw2d.AbstractLocator.relocate(AbstractLocator. java:103)
> at
> org.eclipse.gef.handles.AbstractHandle.validate(AbstractHand le.java:208)
> at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
> at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
> at
> org.eclipse.draw2d.FreeformLayeredPane.validate(FreeformLaye redPane.java:122)
> at
> org.eclipse.draw2d.FreeformViewport$FreeformViewportLayout.c alculatePreferredSize(FreeformViewport.java:28)
> at
> org.eclipse.draw2d.AbstractLayout.getPreferredSize(AbstractL ayout.java:93)
> at
> org.eclipse.draw2d.AbstractHintLayout.getPreferredSize(Abstr actHintLayout.java:86)
> at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:648)
> at org.eclipse.draw2d.ScrollPaneSolver.solve(ScrollPaneSolver.j ava:75)
> at org.eclipse.draw2d.FigureCanvas.layoutViewport(FigureCanvas. java:222)
> at org.eclipse.draw2d.FigureCanvas.access$4(FigureCanvas.java:2 20)
> at
> org.eclipse.draw2d.FigureCanvas$3.notifyValidating(FigureCan vas.java:185)
> at org.eclipse.draw2d.UpdateManager.fireValidating(UpdateManage r.java:93)
> at
> org.eclipse.draw2d.DeferredUpdateManager.validateFigures(Def erredUpdateManager.java:233)
> at
> org.eclipse.draw2d.DeferredUpdateManager.performUpdate(Defer redUpdateManager.java:137)
> at
> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run(D eferredUpdateManager.java:62)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:106)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:2749)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2434)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
> at
> com.fastrieve.eclipse.plugin.FastrieveAdminApplication.run(F astrieveAdminApplication.java:28)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
> at org.eclipse.core.launcher.Main.run(Main.java:644)
> at org.eclipse.core.launcher.Main.main(Main.java:628)
>
> Thanks,
> Patrick
|
|
|
Re: IndexOutOfBoundsException in [message #173036 is a reply to message #173022] |
Tue, 22 March 2005 16:53 |
Eclipse User |
|
|
|
Originally posted by: p.clark.mindspring.com
Thanks for the guidance. I was able to track it down to the problem
section of code.
In my ConnectionEditPart (extends AbstractConnectionEditPart)
createEditPolicies I was installing the following edit policy :
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new
PartConnectionSelectionHandlesEditPolicy());
When I comment that line out, I no longer have the problem. This was
probably due to an improperly extended SelectionHandlesEditPolicy. Here
is the policy
public class PartConnectionSelectionHandlesEditPolicy extends
SelectionHandlesEditPolicy {
public PartConnectionSelectionHandlesEditPolicy() {
super();
}
protected List createSelectionHandles() {
List list = new ArrayList();
ConnectionEditPart connPart = (ConnectionEditPart) getHost();
PointList points = getConnection().getPoints();
for (int i = 0; i < points.size() - 2; i++) {
BendpointHandle handle = new BendpointCreationHandle(connPart, 0,
new BendpointLocator(getConnection(), i + 1));
list.add(handle);
}
return list;
}
protected Connection getConnection() {
return (Connection) getHostFigure();
}
}
Thanks,
Patrick
Randy Hudson wrote:
> Try hard to reproduce in the logic example. That way we can reproduce it
> and debug.
>
> It looks like the number of bends in the connection might be changing as you
> drag the connection around, and the bendpoint editpolicy for some reason is
> not rebuilding its handles when this occurs. Therefore, it ends up with a
> handle referencing a bend index which is too large.
>
> the policy should track the "points" property of the connection, and refresh
> its handles if the number of points changes.
>
> "Patrick Clark" <p.clark@mindspring.com> wrote in message
> news:d1npkm$r9e$1@news.eclipse.org...
>
>>In certain situations I am seeing an exception when drawing a connector
>>from one figure to another in my GEF drawing. The exception seems to be
>>coming from the GEF and draw2d. This only occurs when I am attempting to
>>reconnect an existing connection and happens while I am moving the end of
>>the connector.
>>
>>I have been looking at this for some time and can't seem to find the root
>>cause. I haven't found anything in the news group. Please let me know if
>>anyone has any ideas or additional information is necessary.
>>
>>Here is the stack trace:
>>!ENTRY org.eclipse.ui 4 0 Mar 21, 2005 17:08:00.525
>>!MESSAGE Index: 3, Size: 3
>>!STACK 0
>>java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
>>at org.eclipse.draw2d.geometry.PointList.getPoint(PointList.jav a:183)
>>at
>> org.eclipse.draw2d.BendpointLocator.getReferencePoint(Bendpo intLocator.java:56)
>>at org.eclipse.draw2d.AbstractLocator.relocate(AbstractLocator. java:103)
>>at
>> org.eclipse.gef.handles.AbstractHandle.validate(AbstractHand le.java:208)
>>at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
>>at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
>>at
>> org.eclipse.draw2d.FreeformLayeredPane.validate(FreeformLaye redPane.java:122)
>>at
>> org.eclipse.draw2d.FreeformViewport$FreeformViewportLayout.c alculatePreferredSize(FreeformViewport.java:28)
>>at
>> org.eclipse.draw2d.AbstractLayout.getPreferredSize(AbstractL ayout.java:93)
>>at
>> org.eclipse.draw2d.AbstractHintLayout.getPreferredSize(Abstr actHintLayout.java:86)
>>at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:648)
>>at org.eclipse.draw2d.ScrollPaneSolver.solve(ScrollPaneSolver.j ava:75)
>>at org.eclipse.draw2d.FigureCanvas.layoutViewport(FigureCanvas. java:222)
>>at org.eclipse.draw2d.FigureCanvas.access$4(FigureCanvas.java:2 20)
>>at
>> org.eclipse.draw2d.FigureCanvas$3.notifyValidating(FigureCan vas.java:185)
>>at org.eclipse.draw2d.UpdateManager.fireValidating(UpdateManage r.java:93)
>>at
>> org.eclipse.draw2d.DeferredUpdateManager.validateFigures(Def erredUpdateManager.java:233)
>>at
>> org.eclipse.draw2d.DeferredUpdateManager.performUpdate(Defer redUpdateManager.java:137)
>>at
>> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run(D eferredUpdateManager.java:62)
>>at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>at
>> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:106)
>>at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:2749)
>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2434)
>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
>>at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
>>at
>> com.fastrieve.eclipse.plugin.FastrieveAdminApplication.run(F astrieveAdminApplication.java:28)
>>at
>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
>>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>at java.lang.reflect.Method.invoke(Method.java:324)
>>at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
>>at org.eclipse.core.launcher.Main.run(Main.java:644)
>>at org.eclipse.core.launcher.Main.main(Main.java:628)
>>
>>Thanks,
>>Patrick
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03242 seconds