2 messages in org.netbeans.graph.usersOverlapping connections
FromSent OnAttachments
BSE DeveloperMay 21, 2007 11:13 pm.png
David KasparMay 22, 2007 12:59 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Overlapping connectionsActions...
From:BSE Developer (bse.@googlemail.com)
Date:May 21, 2007 11:13:35 pm
List:org.netbeans.graph.users
Attachments:

Hello,

I use a ConnectionWidget with a line width > 1 to connect two widgets. The result is shown in the attached picture. The problem is the overlapping connection into the widgets. The connection should end at the border (beyond) of the widgets. How can I achieve this representation ?

Regards, Bernd

Here is the modified ConnectionDemo code I use to create the picture:

public static void main (String[] args) { Scene scene = new Scene ();

LayerWidget mainLayer = new LayerWidget (scene); scene.addChild(mainLayer);

ImageWidget first = new ImageWidget (scene); first.setImage (Utilities.loadImage ("javaone/resources/a.png")); first.setPreferredLocation(new Point (100, 100)); first.getActions().addAction(ActionFactory.createMoveAction ()); first.setBorder(BorderFactory.createLineBorder(Color.RED, 1)); mainLayer.addChild(first);

ImageWidget second = new ImageWidget (scene); second.setImage (Utilities.loadImage ("javaone/resources/b.png")); second.setPreferredLocation(new Point (300, 200)); second.getActions().addAction(ActionFactory.createMoveAction ()); second.setBorder(BorderFactory.createLineBorder(Color.RED, 3)); mainLayer.addChild(second);

LayerWidget connectionLayer = new LayerWidget (scene); scene.addChild(connectionLayer);

ConnectionWidget connection = new ConnectionWidget (scene); connection.setSourceAnchor(AnchorFactory.createCircularAnchor(first, 32)); connection.setTargetAnchor(AnchorFactory.createCircularAnchor(second, 32)); connection.setStroke(new BasicStroke(5)); connection.setForeground(Color.GREEN);

connectionLayer.addChild(connection);

SceneSupport.show (scene.createView ()); }