Forums

Full Version: Err.. Zone Manager?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hiya...

I have hesitated to post this here because I know Zone Manager (http://goosebumps4all.net/ZoneManager/) is not really being supported... but I guess I have no choice until I become a true Master of Prefuse (MoP)... Tongue

I am customizing the sample SpaceForAll2.java.. in the HereWeGo() method, there is a addControlListener for keyboard events..

Code:
view.addControlListener(new ControlAdapter() {

            public void keyPressed(KeyEvent e) {

               if (e.getKeyCode() == 10) {
                  newZoneShuffleAndCatchPlease();

               }
            }

         });

I tried to add a itemClicked() or itemEntered() method below it, but it doesn't intercept the mouse clicks.

Code:
public void itemClicked(VisualItem item, MouseEvent e) {
            System.out.println("itemClicked()");  // doesn't come here at all!
            if (!SwingUtilities.isLeftMouseButton(e))
               return;
            if (item.canGetString(label)) {
               jlabel1.setText(item.getString(label));
            }
         }

I wonder if anyone can advise me or... give me some tips on what I have overlooked in this case?

Thank you very much... Smile
Upps,

ZoneManager - feels like my sins from the past catching up with me Sad

So first of all after I have looked into it after a few month I must say it is really quite crappy code - so sorry for that.

And on top of that I couldn't even run my own demos.

But anyway the problem you are experiencing comes most likely from
Code:
if (!DragControlFlag)
   setInteractive(GRAPH, null, false);

by which the whole graph is set non-interactive.

You might want to change the DragControlFlag and see if things go better Rolleyes

cheers

martin
Hi Martin!

I have experimented with the setInteractive() before, but they didn't work and I also didn't experiment deep enough.

What I finally did was...

Code:
setInteractive(GRAPH, null, true);
         //setInteractive(EDGES, null, false);
         //setInteractive(NODES, null, false);
         setInteractive(ZoneManager.ZONEAGGREGATES, null, false);

I need to set GRAPH's interactivity boolean value to true, and it works!

Dude, zone manager is a cool piece of work (I still haven't figured out how you make circles)! I couldn't get the AggregateDemo that comes with prefuse to work the way i need.. I have >150 nodes and couple hundred thousands data items/fields to associate those nodes with, the "zones" become overlapped and gave problems with just 30 nodes... (ok, to be fair, it's just a simple demo...) sigh.. but zonemanager is able to scale up with no extra coding Big Grin Big Grin

my skills aren't that fantastic, i admit, and i need to roll a quick proof of concept out of the door... beggars can't be choosers Wink

now i just need to figure out how to force a refresh of my JPanel... sometimes its just a grey colored piece of screen without my jlabel and jtextpanes showing.. hmm.. oh well Smile back to the eclipse drawing board... Tongue

thanks!!!
Oh.. I see that by default, all elements are interactive, setInteractive is like a toggle to turn off the default (ie. by setting to "false") for cases when interactivity is not required.

ahh... light dawns slowly in these eyes... Tongue
Reference URL's