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 138836 - Problems with the validation of Scenes
Summary: Problems with the validation of Scenes
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-02 16:38 UTC by yoshtec
Modified: 2010-04-01 14:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase with the error (3.59 KB, text/plain)
2008-07-02 16:39 UTC, yoshtec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yoshtec 2008-07-02 16:38:18 UTC
The validation of scenes behaves differently if the scene has already generated a view or not. 

The attached test cases (Junit/main method) reconstruct this behavior.
Comment 1 yoshtec 2008-07-02 16:39:20 UTC
Created attachment 63831 [details]
Testcase with the error
Comment 2 David Kaspar 2008-08-12 15:25:18 UTC
This issue can be easily worked around by changing order of layers.

The Test1.java code has:
public ErrorScene(){
	addChild(conLayer);
	addChild(objLayer);
}
If it would be changed to:
public ErrorScene(){
	addChild(objLayer);
	addChild(conLayer);
}
then it would be working correctly. It is because of ConnectionWidget(Edges) validation depends on LabelWidget
(Nodes/Pins) validation. Since the validation is done from first layer to the last layer, then it is necessary to have
the Nodes and Pins first and the connection in the other layer.

Since the easy workaround exists, lowering the priority to P3. Still keeping the issue open since ideally the library
should stand this - it should just do the validation in two passes...

Note that the Test1.java has an issue in it:
The main() method is starting two Threads to work with the Scene. It is not correct. The Swing framework and Visual
Library are single-thread libraries i.e. you can work with then from AWT-thread only. Therefore change the new
Thread(...) lines to SwingUtilities.invokeLater(...).