Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic using doubleclick event on link throws error ? (Read 2855 times)
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
using doubleclick event on link throws error ?
Feb 20th, 2009 at 7:15am
Print Post  
Hi stoyan,

             I have gone through one of the demos provided with JDiagram. In one example on double clicking a link enable a dialog to set the link lable.
             When I am trying to do same as following,
public void onLinkDblClicked(LinkEvent e)
{

DiagramLink arrow = e.getLink();
String newText = JOptionPane.showInputDialog(
this, "Enter arrow text", arrow.getText());
arrow.setText(newText);
}
      
it throws exception as,

java.lang.ClassCastException: com.mindfusion.diagramming.DiagramLink cannot be cast to com.mindfusion.diagramming.InplaceEditable

Thank you.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using doubleclick event on link throws error ?
Reply #1 - Feb 20th, 2009 at 10:02am
Print Post  
Hi Jay,

Are you using the version from this thread now?
http://mindfusion.eu/Forum/YaBB.pl?board=jdiag_disc;action=display;num=123373245...

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


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
Re: using doubleclick event on link throws error ?
Reply #2 - Feb 20th, 2009 at 10:26am
Print Post  
hi stoyan,
        
            Sorry i had not checked that reply, so i was using old version.  Now i am using that version and it is allowing inplace label editing for links.

I have followin questions regarding this feature;
           
1.  Can we disable inplace lable editing for a specific node.
2. How to change the border color for the inplace label editing box.
3. How Can i use a dialog instead of inplace editing on link double click.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using doubleclick event on link throws error ?
Reply #3 - Feb 20th, 2009 at 10:43am
Print Post  
Hi Jay,

1, 3) DiagramView.setAllowInplaceEdit(false), and call DiagramView.beginEdit() from the doubleClicked event only for items you want enabled for editing.

2) Handle the enterInplaceEditMode event. It gives you a reference to the JTextArea used for inplace editing, and you can customize it as you see fit.

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


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
Re: using doubleclick event on link throws error ?
Reply #4 - Feb 20th, 2009 at 11:14am
Print Post  
hi Stoyan,

            Thank you again, it worked for me.
 

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