[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20050608: IDV - Mirror Displays




Inquiry: I need to display the contents of a mapviewmanager on two panels 
within the same JFrame.  Swing does not let you do this since only one instance 
of a Swing component is allowed in the heiarcy.

The MapViewManager does not create new instances of the GUI Component on calls 
like getContents() and getComponent() only returns the refernce of the existing 
component instance.

What is a good solution to this problem?

1.  I tried using MapViewManager.getContents.printall(), but the VisAD display 
component does not show up.  I was going to render the image of the display 
MapViewManager on a new instance of a JPanel.  I don't need to interact with it 
just view it so this would be fine.


The other thought I had would be to use the collab features and create another 
mapviewmanager that just mirrors an existing mapviewmanager.  This would be the 
best solution, but don\\\'t know this part of the code at all.  Some hints and 
sample code to get me started would be a great help.


Hi Sean,
You're right a swing component cannot be in two places at once. You could have two mapviewmanagers that are coupled together. The only problem is that they each have their own set of DisplayControls so, assuming you want the same displays in each you would have to create paired displays.
To couple two ViewManagers together simply set , on each ViewManager:
setShareViews(true)
and
setShareGroup(some_unique_string_for_the_pair)

Now, projections and viewpoint changes will automatically be shared. This is how we do the
twoviewskin, fourviewskin, etc.


-Jeff