

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in org.netbeans.graph.usersRe: Deleting widgets| From | Sent On | Attachments |
|---|---|---|
| Chris Palmer | May 28, 2007 7:18 am | |
| David Kaspar | May 28, 2007 8:16 am | |
| David Kaspar | May 29, 2007 7:11 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Deleting widgets | Actions... |
|---|---|---|
| From: | David Kaspar (Davi...@Sun.COM) | |
| Date: | May 29, 2007 7:11:42 am | |
| List: | org.netbeans.graph.users | |
Hi Chris,
The issue is in the your label widgets are in mainLayer and not directly under the Scene. Therefore you have an issue in KeyEventLoggerAction.keyPressed method, where you should change: widget.getScene().removeChild(widget); with: widget.remoreFromParent();
There is an "assert" in the Widget.removeChild method but you probably had assertion disabled in runtime. In the future I am going to convert assertions to exceptions, so you will notify the problem immediately.
After the change, it works correctly. The key-events are processed for all widgets. It is because: 1) you have assigned the KeyEventLoggerAction to all widgets, 2) you are using FOCUSED_WIDGET_AND_ITS_CHILDREN event processing type, 3) by default the Scene itself is set as the focused widget.
BTW: for this test you would not need to use ObjectScene at all. Scene would be enough, also you would not need interractionLayer widget as well as LabelEditor class.
Regards, David
David Kaspar wrote:
Hi,
This may be caused by: 1) you have an widget with move-action assigned (or any other which is locking the event processing) 2) you are pressing delete key while the mouse button is still pressed.
Also key-events are processed using a logic specified by Scene.setKeyEventProcessingType - see documentation of possible options.
Also you can use Scene.getPriorActions ().addAction (myKeyEventLoggerAction). These actions are processing an event prior to any other action.
Let me know, if none of the options help you. Please, could you also attach an example where I could reproduce your problem?
Thanks, David
Chris Palmer wrote:
Friends!
It could be my overall implementation.
I have a problem with my KeyEventLoggerAction I am trying to delete the widget from the scene...but it seems my KeyEvenLoggerAction doesn't always fire..... I was wondering if perhaps anyone else has had a problem with this?
It does work occasionally.....if I click the widget quite a bit.....
Chris







