This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 98129 - GraphPinScene: update pinInputEges and pinOutputEdges
Summary: GraphPinScene: update pinInputEges and pinOutputEdges
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-17 01:03 UTC by Joelle Lam
Modified: 2010-04-01 14:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joelle Lam 2007-03-17 01:03:45 UTC
In GraphPinScene, when attachEdgeTargetAnchor or attachEdgeSourceAnchor is
called, the oldTargetPin and oldSourcePin should be removed from the private
HashMap pinInputEdges and pinOutputEdges respectively.

I am writing a renamePin method for my implementation of GraphPinScene.  It
would seem natural to:
1) addPin newName
2) attachEdgeTargetAnchor(edge, oldName, newName0) for all Target Edges
3)attachEdgeSourcAnchor(edge, oldName, newName) for all Source Edges
4) remove  oldName
This doesn't work because upon removing, since the edges are still associated
with the new pin there are problems.

Temporary workaround.
1) addPin newName
2) removePin newName
3) attachEdgeTargetAnchor(edge, oldName, newName0) for all Target Edges
4) attachEdgeSourcAnchor(edge, oldName, newName) for all Source Edges
Comment 1 David Kaspar 2007-03-19 16:25:29 UTC
BTW: objects in GraphScene/GraphPinScene were meant to be unique identifiers of
objects and originally have not been designed to be renamed.

The problem is that the renaming (or I would say "replacing") does not have that
easy semantics.

Therefore the question is whether the semantics of the "replacePin" should be:
1) to replace particular pin in internal structures or
2) to replace particular pin in internal structures and all the attachPinWidget,
attachEdgeSourceAnchor and attachEdgeTargetAnchor methods and therefore firing all.

Maybe this option can be passed as an input argument of replacePin method. The
easiest way is to implement the 2. case only.

Probably it would be good to introduce replaceNode and replaceEdge methods as well.

What is your opinion?