4 messages in org.netbeans.graph.usersCan't get LabelWidget painted on top ...
FromSent OnAttachments
Ruben LagunaApr 30, 2009 3:01 pm 
Ruben LagunaApr 30, 2009 3:10 pm 
Ruben LagunaMay 1, 2009 12:56 am 
Ruben LagunaMay 7, 2009 11:48 pm 
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:Can't get LabelWidget painted on top of ConnectionWidgetActions
From:Ruben Laguna (rube@gmail.com)
Date:Apr 30, 2009 3:10:00 pm
List:org.netbeans.graph.users

Hi,

I have a GraphScene with two LayerWidgets mainLayer where I put all the LabelWidgets and connectionLayer where I have the ConnectionWidgets.

mainLayer = new LayerWidget(this); addChild(mainLayer); connectionLayer = new LayerWidget(this); addChild(connectionLayer); mainLayer.bringToFront(); this.getActions().addAction(ActionFactory.createZoomAction());

My problem is that in certain graph the lines are painted over the labelwidget making difficult to read the label.

See the following image for an example

[image: 20090430-mp1fn6j3kka869caaejw1achu3.jpg]

When I try to change the order of the LayerWidget (either changing the order of the addChild calls or invoking mainLayer.bringToFront()) I get the following exception when trying to show the GraphScene. It seems that connectionLayer has to be always on top of mainLayer. Have anybody any idea on how to solve/workaround this?

java.lang.IllegalStateException: Widget (org.netbeans.api.visual.widget.LabelWidget@10014f0) was not added into the scene

at org.netbeans.api.visual.anchor.Anchor.getRelatedSceneLocation(Anchor.java:213)

at org.netbeans.modules.visual.anchor.RectangularAnchor.compute(RectangularAnchor.java:111)

at org.netbeans.modules.visual.router.DirectRouter.routeConnection(DirectRouter.java:65)

at org.netbeans.api.visual.widget.ConnectionWidget.calculateRouting(ConnectionWidget.java:527)

at org.netbeans.modules.visual.layout.ConnectionWidgetLayout.layout(ConnectionWidgetLayout.java:109)

at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1350)

at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)

at org.netbeans.api.visual.widget.LayerWidget.layout(LayerWidget.java:86)

at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)

at org.netbeans.api.visual.widget.Scene.layoutScene(Scene.java:312)

at org.netbeans.api.visual.widget.Scene.validate(Scene.java:393)

at org.netbeans.api.visual.widget.SceneComponent.addNotify(SceneComponent.java:92)

at java.awt.Container.addImpl(Container.java:1039)

at java.awt.Container.add(Container.java:896)

at com.rubenlaguna.modules.mainmodule.GraphTopComponent.setDotFile(GraphTopComponent.java:80)

at com.rubenlaguna.modules.mainmodule.DotOpenSupport.createCloneableTopComponent(DotOpenSupport.java:31)

at org.openide.windows.CloneableOpenSupport.openCloneableTopComponent(CloneableOpenSupport.java:197)

at org.openide.windows.CloneableOpenSupport$1.run(CloneableOpenSupport.java:98)

at org.openide.util.Mutex.doEvent(Mutex.java:1335)

at org.openide.util.Mutex.writeAccess(Mutex.java:452)

at org.openide.windows.CloneableOpenSupport.open(CloneableOpenSupport.java:95)

at org.openide.actions.OpenAction.performAction(OpenAction.java:81)

at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:589)

at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)

at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:585)

at org.openide.explorer.view.TreeView$PopupSupport.mouseClicked(TreeView.java:1515)

at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)

at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)

at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)

at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)

at java.awt.Component.processMouseEvent(Component.java:6137)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

at java.awt.Component.processEvent(Component.java:5899)

at java.awt.Container.processEvent(Container.java:2023)

at java.awt.Component.dispatchEventImpl(Component.java:4501)

at java.awt.Container.dispatchEventImpl(Container.java:2081)

at java.awt.Component.dispatchEvent(Component.java:4331)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3974)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)

at java.awt.Container.dispatchEventImpl(Container.java:2067)

at java.awt.Window.dispatchEventImpl(Window.java:2458)

at java.awt.Component.dispatchEvent(Component.java:4331)

[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)