Several views of the same model?

Is it possible to have several JGoViews displaying the same JGoDocument?

Is it possible to display several JGoDocuments in the same JGoView?

I’m trying to build a gui for a business logic editor.
A logic “configuration” should be composed of several graphs.

I would like to have a JGoDocument for each graph displayed and editable in a JGoView and at the same time in another window have another JGoView displaying all grapghs.

At the moment I have one JGoView for each “view” and one JGODocument in each. The sub-graph-views have a JGoDocument with JGOIconicNodes wrapping my logical Nodes. The total-view has a JGOSubGraph for each sub-graph and each subgraph has a JGoIconicNode wrapping the same logic Node.

This works but there is a lot of duplicate JGoIconicNodes and if there already exist some sort of MVC capabilities allowing several view/controllers I would like to use that instead of building my own …

Best Regards,

Yes. Either create the JGoView using the constructor that takes a JGoDocument, or just call JGoView.setDocument.

Not at the same time.
I suggest you try putting the contents of each of your existing documents into separate layers of a single JGoDocument. Or if you are using two layers in each document now, typically one for links and one for nodes, you could hold them in pairs of layers in the merged document.
Then you can decide for each JGoView which layers to display. Override JGoView.getFirstLayer, getLastLayer, getNextLayer, and getPrevLayer to return the desired layers. The standard behavior will show all of the layers.
Note that JGo does not have a “pure” model-view-controller design. So some things, such as the bounding rectangle for each JGoObject, are not easily able to be made different for different views. Making it easier to specify which layers can be seen in a view, and in what order, is a future enhancement. But you can do it with those method overrides.