Block input

I have

public class StandardSubGraph extends JGoSubGraph


and several of these are added to my document. Each StandardSubGraph
contains other objects - usually JGoIconicNodes. What I’d like to do is
have a method in StandardSubGraph called, say,

public void blockInput()

and this method would prevent all mouse clicks etc from being passed to the components underneath.
In some ways very much like using the GlassPane on a JFrame to block
mouse clicks by setting up the JFrame’s glass pane with a ‘do nothing’
mouse adapter.

Many thanks


It depends on what you want to do.
I guess the general answer is that if you have your StandardSubGraph class implement JGoActionObject, you can have it handle mouse-down/move/up as no-ops. You would use the ActionEnabled property to control whether your class acted that way or normally.
If this implementation isn’t quite right for what you want, there are alternatives, probably involving overriding methods of either JGoArea and/or JGoView.

Thanks for the quick response. I’ve used the JGoActionObject approach
and it works a treat. I’ll try the other approach just for the fun of

Thanks for the tips.