// Now, generate the graph or tree or textarea that we want to display on the right
if (frame!=null) frame.setTitle(makeVizTitle());
switch (currentMode) {
case Tree: {
final VizTree t = new VizTree(myState.getOriginalInstance().originalA4, makeVizTitle(), fontSize);
final JScrollPane scroll = OurUtil.scrollpane(t, Color.BLACK, Color.WHITE, new OurBorder(true, false, true, false));
scroll.addFocusListener(new FocusListener() {
public final void focusGained(FocusEvent e) { t.requestFocusInWindow(); }
public final void focusLost(FocusEvent e) { }
});
content = scroll;
break;
}
case XML: {
content=getTextComponent(xmlFileName);
break;
}
default: {
if (myGraphPanel==null) myGraphPanel=new VizGraphPanel(myState, currentMode == VisualizerMode.DOT);
else {myGraphPanel.seeDot(currentMode==VisualizerMode.DOT); myGraphPanel.remakeAll();}
}
content=myGraphPanel;
}
// Now that we've re-constructed "content", let's set its font size
if (currentMode != VisualizerMode.Tree) {
content.setFont(OurUtil.getVizFont().deriveFont((float)fontSize));
content.invalidate();
content.repaint();
content.validate();
}
// Now, display them!
final Box instanceTopBox = Box.createHorizontalBox();
instanceTopBox.add(toolbar);
final JPanel instanceArea = new JPanel(new BorderLayout());
instanceArea.add(instanceTopBox, BorderLayout.NORTH);
instanceArea.add(content, BorderLayout.CENTER);
instanceArea.setVisible(true);
if (!Util.onMac()) { instanceTopBox.setBackground(background); instanceArea.setBackground(background); }
JComponent left = null;
if (settingsOpen==1) {
if (myCustomPanel==null) myCustomPanel = new VizCustomizationPanel(splitpane,myState); else myCustomPanel.remakeAll();
left = myCustomPanel;
} else if (settingsOpen>1) {
if (myEvaluatorPanel==null)
myEvaluatorPanel = new OurConsole(evaluator, true,
"The ", true, "Alloy Evaluator ", false,
"allows you to type\nin Alloy expressions and see their values.\nFor example, ", true,
"univ", false, " shows the list of all atoms.\n(You can press UP and DOWN to recall old inputs).\n");
try { evaluator.compute(new File(xmlFileName)); } catch(Exception ex) { } // exception should not happen
left = myEvaluatorPanel;
left.setBorder(new OurBorder(false, false, false, false));
}
if (frame!=null && frame.getContentPane()==splitpane) lastDividerPosition=splitpane.getDividerLocation();
splitpane.setRightComponent(instanceArea);
splitpane.setLeftComponent(left);
if (left!=null) {