How to get JGoLink Ojbect

Hi;
I use newLink in JGoview to create new link from menu bar.

  1. I want to know how to get object of new created link? Do I need to get in the event? Is any better method to create link?

  2. After I make link to curve. The screen did not change.I try to use JGoView to repaint and nothing will happen. I need to change one of node position and link will become curve. Any repaint function?
    Steven

    JGoSelection list = jGoView1.getSelection();<BR>       if (list.getNumObjects() == 2) {<BR>           JGoListPosition pos1 = list.getFirstObjectPos();<BR>           JGoListPosition pos2 = list.getNextObjectPosAtTop(pos1);<BR>           JGoObject node1 = list.getObjectAtPos(pos1);<BR>           JGoObject node2 = list.getObjectAtPos(pos2);
    


if (node1 instanceof MyNode2 &&
node2 instanceof MyNode2) {
jGoView1.newLink(((MyNode2) node1).getPort(),((MyNode2) node2).getPort());
if (beCurved) {
// create curved link
JGoListPosition linkPos = ((MyNode2) node1).getPort().getFirstLinkPos();
if (linkPos != null) {
JGoLink link = ((MyNode2) node1).getPort().getLinkAtPos(linkPos);
link.setCubic(true);
link.setCurviness(curved);
this.repaint();
}
}
}
}

I found solution to create link. But repaint still have problem.

             JGoLabeledLink link = new JGoLabeledLink(((MyNode2) node1).getPort(),((MyNode2) node2).getPort());<BR> <BR>MyNode2) node2).getPort());
             if (beCurved) {<BR>                     link.setCubic(true);<BR>                     link.setCurviness(curved);<BR>                 }<BR>                 jGoView1.getDocument().addObjectAtTail(link);<BR>

Some of the JGoLink or JGoStroke properties just affect how JGoLink.calculateStroke() decides the path of the stroke. So you just need to call JGoLink.calculateStroke().
That method automatically gets called when either port is moved or resized, of course.