------=_Part_28233_5369804.1188050127712
Content-Disposition: inline
Thanks. Which graph sources are you talking about? do you mean the graph
examples?I could not reach all examples, only the first few.
I have been trying handling selection of widgets the way you told me
(implementing my own selectprovider). I'm still confused.Could you send me
the
code fragment of selectprovider implementation
class ?and any code
related to the properties window. That'd be very helpful.
About that AssertionError exception. I do not think the reason could be that
the edge does not exist, cause I call addEdge(edge) before I all
setSourceEdge(edge,source). I think the problem is with the source node. In
attachNodeWidget method, I
store every added widget along with its node,
with the widget as a key. Inside isSource(sourcewidget) method, I get the
node whose sourcewidget is sent a parameter. I doubt that the
error might b=
e
wrote in
message : protected Widget attachNodeWidget(MyNode node) {
IconNodeWidget widget =3D new IconNodeWidget(this);
widget.setImage(node.getImage());
widget.setLabel(node.getname());
mainLayer.addChild(widget);
map.put(widget, node); //single-click, the
event isn't consumed:
widget.getActions().addAction(createSelectAction());
widget.createActions(ACTION_SELECT).addAction(moveAction);
widget.createActions(ACTION_CONNECT).addAction(connectAction);
//double-click, the event is consumed while double-clicking only:
widget.getLabelWidget().getActions().addAction(editorAction);
return widget;
}
protected Widget attachEdgeWidget(String edge) {
ConnectionWidget connection =3D new ConnectionWidget(this);
connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
connection.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
connection.getActions().addAction(createObjectHoverAction());
connection.getActions().addAction(createSelectAction());
int eractionLayer.addChild(connection);
return connection;
}
protected void attachEdgeSourceAnchor (String edge, MyNode
oldSourceNode, MyNode sourceNode) {
Widget w =3D sourceNode !=3D
null ? findWidget(sourceNode) : null;
((ConnectionWidget) findWidget(edge)).setSourceAnchor(
AnchorFactory.createRectangularAnchor(w));
}
protected void attachEdgeTargetAnchor (String edge, MyNode
oldTargetNode, MyNode
target Node) {
Widget w =3D targetNode !=3D null ? findWidget(targetNode) : null;
((ConnectionWidget) findWidget(edge)).setTargetAnchor(
AnchorFactory.createRectangularAnchor(w));
}
class SceneConnectProvider implements ConnectProvider {
private MyNode source =3D null;
private MyNode target =3D null;
public boolean isSourceWidget(Widget sourceWidget) {
source=3D(MyNode) map.get(sourceWidget);
return true;
}
public boolean hasCustomTargetWidgetResolver(Scene scene) {
return false;
}
public Widget resolveTargetWidget(Scene scene, Point sceneLocation)
{
return null;
}
public void createConnection(Widget sourceWidget, Widget
targetWidget) {
String edge =3D "edge"+edgeCounter++;
addEdge(edge);
source=3D(MyNode) map.get(sourceWidget);
setEdgeSource(edge, source);
setEdgeTarget(edge, target);
}
public ConnectorState isTargetWidget(Widget sourceWidget, Widget
targetWidget) {
target=3D(MyNode)map.get(targetWidget);
if (target !=3D null)
return ConnectorState.ACCEPT;
return ConnectorState.REJECT;
}
private int edgeCounter=3D0
}
Wessam
wrote in message:
I found that checking out the graph sources from the repository to be wel=
l
worth the effort, as you can inspect the sources yourself. If you are
going
to be doing much development, then I strongly suggest that you do so too.
The web pages document how to download only the sources necessary for
graphs.
Looking at the sources, I see that setEdgeSource() has two assert
statements. The first is if the source node (widget) doesn't exist in
the
scene, and the second is if the edge doesn't exist. Without knowing th=
e
line number of your assertion, I can not say which you are encountering.
Peter
>From: "Wessam Abd Rabo" <wessam.abdrabo@xxxxxxxxxxx>
>Reply-To: nbdev@xxxxxxxxxxx
>To: nbdev@xxxxxxxxxxx, users@xxxxxxxxxxx, "David Kaspar"
><David.Kaspar@xxxxxxxxxxx>, "David Van Couvering" <david@xxxxxxxxxxx>,
>epple@xxxxxxxxxxx, "Trey Spiva" <Leonard.Spiva@xxxxxxxxxxx>, "Jim Davidson"
><Jim.Davidson@xxxxxxxxxxx>, joelle.lam@xxxxxxxxxxx
>Subject: [nbdev] AssertionError Exception
>Date: Sat, 25 Aug 2007 03:36:28 +0300
>
>Hi,
>
>I get an AssertionError exeption on creating a connection between 2
>IconNodeWidgets in a graphscene using Visual Library2. It is specificall=
y
>in
>setEdgeSource() method. Does anyone know what could be causing this
>exception to be thrown?
>
>Thanks in advance,
>
>Wessam
_________________________________________________________________
Now you can see trouble=85before he arrives
http://newlivehotmail.com/?ocid=3DTXT_TAGHM_migration_HM_viral_protection=
_0507
------=_Part_28233_5369804.1188050127712
Content-Disposition: inline
<div>Thanks. Which graph sources are you talking about? do you mean the gra=
ph examples?I couldn't reach all examples, only the first few.
</div>
<div>I've been trying handling selection of widgets the way you told me=
(implementing my own selectprovider). I'm still confused.Could you sen=
d me the code fragment of selectprovider implementation class?and any =
code related to the properties window. That'd be very helpful.
</div>
<div>
</div>
<div>About that AssertionError exception. I don't think the reason coul=
d be that the edge doesn't exist, cause I call addEdge(edge) before I a=
ll setSourceEdge(edge,source). I think the problem is with the source node.=
In attachNodeWidget method, I store every added widget along with its node=
, with the widget as a key. Inside isSource(sourcewidget) method, I g=
et the node whose sourcewidget is sent a parameter. I doubt that the e=
rror might be in this section but i'm not sure. Next is part of &n=
wrote in message:
</div>
<div>
</div>
<div><br>
<p> protected Widget attachNodeWidget(MyNode node) {
<br> &=
nbsp; IconNodeWidget widget =3D new IconNodeWidget(this);
<br> &n=
bsp; widget.setImage(node.getImage());
<br> widget.setLabe=
l(node.getname());
<br> mainLayer.addChild(widget);&=
nbsp; =20
<br> map.put(widget, node);
<br> &n=
bsp;
</p>
<p> //single-click, the event isn't consumed:
<br> &=
nbsp; widget.getActions().addAction(createSelectAction());
<br> =
<br> widget.createActions(ACTION_SELECT).add=
Action(moveAction);
<br>
<br> widg=
et.createActions
(ACTION_CONNECT).addAction(connectAction);
<br>  =
; //double-click, the event is consumed while double-clicking only:
<br>&nbs=
p; widget.getLabelWidget().getActions().addAction(editorAction)=
;
<br>
<br> return widget;
</p>
<p> }
</p>
<p> protected Widget attachEdgeWidget(String edge) {
<br>&=
nbsp;
<br> Conn=
ectionWidget connection =3D new ConnectionWidget(this);
<br> &nbs=
p;
<br> c=
onnection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
<br>
connection.setEndPointShape(Poin=
tShape.SQUARE_FILLED_BIG);
<br> co=
nnection.getActions().addAction(createObjectHoverAction());
<br> =
connection.getActions().addAction(createSele=
ctAction());
<br>  =
; =20
interactionLayer.addChild(connection);
<br> &nb=
sp; return connection;
<br> }
</p>
<p> protected void attachEdgeSourceAnchor (String edge, M=
yNode oldSourceNode, MyNode sourceNode) {
<br> =
<br> Widget w =
=3D sourceNode !=3D null ? findWidget(sourceNode) : null;
<br> &n=
bsp; ((ConnectionWidget) findWidget(edge)).setSourc=
eAnchor(
AnchorFactory.createRectangularAnchor(w));
<br> }
</p>
<p> protected void attachEdgeTargetAnchor (String edge, M=
yNode oldTargetNode, MyNode targetNode) {
<br> =
Widget w =3D targetNode !=3D null ? findWidget(targetNod=
e) : null;
<br> ((ConnectionWidget=
) findWidget(edge)).setTargetAnchor(
AnchorFactory.createRectangularAnchor(w));
<br> }
</p>
<p> class SceneConnectProvider implements ConnectProvider {
<br> &=
nbsp;
<br>  =
; private MyNode source =3D null;
<br> &n=
bsp; private MyNode target =3D null;
<br>  =
;
<br> public boolean=
isSourceWidget(Widget sourceWidget) {
<br> sour=
ce=3D(MyNode) map.get(sourceWidget);
<br=
return true;<br>
&nb=
sp; }
<br> =
<br> public boolean hasCustomTar=
getWidgetResolver(Scene scene) {
<br> &nb=
sp; return false;
<br> =
}
<br>
<br> =
public Widget resolveTargetWidget(Scene scene, Point sce=
neLocation) {
<br> &nbs=
p; return null;
<br> }
<br>&n=
bsp;
<br> =
public void createConnection(Widget sourceWidget, Widget targe=
tWidget) {
<br> Stri=
ng edge =3D "edge"+edgeCounter++;
<br> &nbs=
p;
<font color=3D"#ff0000"> addEdge(edge=
);
<br> so=
urce=3D(MyNode) map.get(sourceWidget);
<br> &nb=
sp; setEdgeSource(edge, source);
<br> &nb=
sp; setEdgeTarget(edg=
e, target);
<br></font> }
<br> &nbs=
p;
<br> p=
ublic ConnectorState isTargetWidget(Widget sourceWidget, Widget targetWidge=
t) {
<br> target=3D(MyN=
ode)map.get(targetWidget);
<br> &nb=
sp; if (target !=3D null)
<br> &nbs=
p; &=
nbsp; return=20
ConnectorState.ACCEPT;
<br> &=
nbsp; return ConnectorState.REJECT;
<br> =
}
<br> private =
int edgeCounter=3D0
<br> }
</p>
<p>Wessam
<br></p></div>
<div><span class=3D"gmail_quote">On 8/25/07,
<b class=3D"gmail_sendername">=
Peter Blemel
</b> <
<a href=3D"mailto:pblemel@xxxxxxxxxxx">pblemel@xxxxxxxxxxx=
wrote in message:
</span>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I found that checking out th=
e graph sources from the repository to be well
<br>worth the effort, as you =
can inspect the sources yourself. If you are going
<br>to be doing much development, then I strongly suggest that you do so to=
o.
<br>The web pages document how to download only the sources necessary for=
<br>graphs.
<br><br>Looking at the sources, I see that setEdgeSource() has t=
wo assert
<br>statements. The first is if the source node (widget) does n=
ot exist in the
<br>scene, and the second is if the edge doesn't exist.&nbs=
p; Without knowing the
<br>line number of your assertion, I can't =
say which you are encountering.
<br><br>Peter
<br><br><br><br><br><br>>From: "Wessam Abd Rabo" =
<
<a href=3D"mailto:wessam.abdrabo@xxxxxxxxxxx">wessam.abdrabo@xxxxxxxxxxx
</a=
><br>
>Reply-To:
<a href=3D"mailto:nbdev@xxxxxxxxxxx">nbdev@xxxxxxxxxxx=
.org
</a>
<br>>To:
<a href=3D"mailto:nbdev@xxxxxxxxxxx">nbdev@xxxxxxxxxxx
</a=
, <a href=3D"mailto:users@xxxxxxxxxxx">
users@xxxxxxxxxxx
</a>=
, "David Kaspar"
<br>><
<a href=3D"mailto:David.Kaspar@xxxxxxxxxxx=
m">
David.Kaspar@xxxxxxxxxxx
</a>>, "David Van Couvering" <
<a href=
=3D"mailto:david@xxxxxxxxxxx">david@xxxxxxxxxxx
</a>>,
<br>>
<=
a href=3D"mailto:epple@xxxxxxxxxxx">epple@xxxxxxxxxxx
</a>, "Trey Spi=
va" <
<a href=3D"mailto:Leonard.Spiva@xxxxxxxxxxx">Leonard.Spiva@xxxxxxxxxxx
</a>>, &qu=
ot;Jim Davidson"
<br>><
<a href=3D"mailto:Jim.Davidson@xxxxxxxxxxx">Ji=
m.Davidson@xxxxxxxxxxx
</a>>,
<a href=3D"mailto:joelle.lam@xxxxxxxxxxx">joelle.la=
m@xxxxxxxxxxx
</a><br>>Subject: [nbdev] AssertionError Exception
<br>>Date: Sat, 25 =
Aug 2007 03:36:28 +0300
<br>>
<br>>Hi,
<br>>
<br>>I get an Assertio=
nError exeption on creating a connection between 2
<br>>IconNodeWidgets i=
n a graphscene using Visual Library2. It is specifically
<br>>in
<br>>setEdgeSource() method. Does anyone know what could be ca=
using this
<br>>exception to be thrown?
<br>>
<br>>Thanks in advance,=
<br>>
<br>>Wessam
<br><br>_____________________________________________=
____________________
<br>Now you can see trouble=85before he arrives
<br><a href=3D"http://newliv=
ehotmail.com/?ocid=3DTXT_TAGHM_migration_HM_viral_protection_0507">http://n=
ewlivehotmail.com/?ocid=3DTXT_TAGHM_migration_HM_viral_protection_0507
</a><=
br></blockquote>
</div><br>
------=_Part_28233_5369804.1188050127712--