I developed two applets one that allows an admin person to modify graphs and one that only allows users to view graphs . With the read only applet I want the user to be able to still drag the nodes in the JGoView however for some reason it is not allowing me to drag the nodes. Most of the code is very similar to the first applet.
MyJGoView view = new MyJGoView();
jSplitPane_leftRight.setRightComponent(view);
jSplitPane_leftRight.setLeftComponent(jgoOverview);
In my void jGoView_WorkFlow_viewChanged(JGoViewEvent e) method of MyJGoView class the method is never notified whenever I click in the view. I might have overlooked something trivial and I was hoping someone could shed some light.
A JGoViewListener has to implement the “viewChanged” method. How is it you can name it “jGoView_WorkFlow_viewChanged”? Are you sure that whatever is calling your method is really a JGoViewListener, and that it has been added as a listener by calling JGoView.addViewListener?
Ok this is what I have
MyJGoView extends JGoView implements JGoViewListener{
…
addViewListener(this);
…
public void viewChanged(JGoViewEvent e)
{
jGoView_WorkFlow_viewChanged(e);
}
My viewChanged is being called whenever I scroll however its not being called when I try to drag objects i.e. nodes
How did you make that applet “read-only”?
I was in the process of making it read only. Like I explained earlier all I wanted was to allow the user to drag nodes. So I basically made a copy of my other applet with most of the features removed. Up to yesterday I was able to drag nodes however now I can no longer do that. Im not sure if I somehow removed some code that now has made it this way. I was hoping that maybe you would be able to point out what coding or lack of it that would make a jgoview no longer respond to users draging on nodes
Well, there’s setMouseEnabled(false), but that’s unlikely.
Or setInternalMouseActions(DnDConstants.ACTION_NONE).
Or you could make everything not Selectable [JGoObject.setSelectable(false)], or have pickDocObject return null.
Or everything could be not Draggable [JGoObject.setDraggable(false)].
Or the layer of the selected object could be not Modifiable [JGoLayer.setModifiable(false)].
I suppose there are other methods you might have overridden to disable dragging, but that gets increasingly unlikely.
Any solution to this?
I’m also looking to disable all modification except dragging nodes.
If you want things to be draggable, you should probably call:
JGoView.setInternalMouseActions(DndConstants.ACTION_MOVE)