Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Delete Shape Node. (Read 5501 times)
SandeepGowda
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Jan 6th, 2009
Delete Shape Node.
Mar 11th, 2009 at 2:48pm
Print Post  
HI,
  Can we delete Shape Node using Delete key in keyboard and even handle the delete shape node event.

regards
sandeep
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete Shape Node.
Reply #1 - Mar 11th, 2009 at 3:25pm
Print Post  
Hi,

Del should delete the selected items, unless you have called DiagramView.setDelKeyAction(DelKeyAction.None).

Stoyan
  
Back to top
 
IP Logged
 
SandeepGowda
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Jan 6th, 2009
Re: Delete Shape Node.
Reply #2 - Apr 15th, 2009 at 8:58am
Print Post  
Hi Stoyo,

i have not used any Method as such, then also i am not able to delete Shape Node using Del key from KeyBoard.

i have created a DiagramView instance as below and set dome Properties.

m_mainDiagramView = new DiagramView();
m_mainDiagramView.setCursor(Cursor.getDefaultCursor());
m_mainDiagramView.setBehavior(Behavior.DrawLinks);
// only to be added if User Holds ALT-key from Keyword for Scrol.
m_mainDiagramView.setBehavior(Behavior.Pan);

Can you please help me.

regards
Sandeep
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete Shape Node.
Reply #3 - Apr 15th, 2009 at 10:53am
Print Post  
Does it work on your system if you run the JDiagDemo example, select a node and press Del? If it works in the demo, then something in your application prevents Del from reaching to the DiagramView control. Check if there isn't some menu item whose shortcut key is set to Del, or if some other control does not steal the keyboard focus.

Regards
Stoyan
  
Back to top
 
IP Logged
 
SandeepGowda
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Jan 6th, 2009
Re: Delete Shape Node.
Reply #4 - Apr 15th, 2009 at 2:39pm
Print Post  
Hi Stoyo,
   i faced rare/unique way of Deleting of Shape Node in My application . ie.. If i Move/resize the Shape node,then only i was able to delete using Del key Word.

Use Case: I will Drag and Drop ShapeNode on to actual Diagram View. I am not able to  to delete Node using Del Keyword.
But if i just Move/Re size the Node, then i will be able to delete.

Can you please help me where i would have made mistake.

regards
Sandeep.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete Shape Node.
Reply #5 - Apr 15th, 2009 at 3:28pm
Print Post  
Hi Sandeep,

In its MouseDown handler the view sets the keyboard focus to itself, so probably that's why Del works while you drag an item, but seems some other control gets the focus when you release the mouse button. Try printing periodically KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() to System.out to see which control has the focus.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SandeepGowda
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 50
Joined: Jan 6th, 2009
Re: Delete Shape Node.
Reply #6 - Apr 16th, 2009 at 12:59pm
Print Post  
Hi Stoyo,

com.mindfusion.diagramming.
DiagramView[,0,0,5670x3326,alignmentX=0.0
,alignmentY=0.0,border=,flags=16777225,
maximumSize=,minimumSize=,preferredSize=].

on Selection of Shape Node, above content is printed as per KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getFocusOwner();

Can you help me where i would have missed.

regards
Sandeep.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete Shape Node.
Reply #7 - Apr 16th, 2009 at 2:17pm
Print Post  
Yep, the focus should be there when the node is selected. The interesting thing is where it goes after the mouse button is released. Try printing that from a timer event.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint