viewport.setGatherViewsHere(true);
}
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
+
+ /*
+ * finally if new view has acquired an Overview window (because
+ * Preferences option to open Overview is selected), set its title
+ */
+ OverviewPanel ov = newap.overviewPanel;
+ if (ov != null)
+ {
+ String ttl = getOverviewTitle();
+ ((JInternalFrame) SwingUtilities
+ .getAncestorOfClass(JInternalFrame.class, ov))
+ .setTitle(ttl);
+ }
+
return newap;
}
JInternalFrame frame = new JInternalFrame();
final OverviewPanel overview = new OverviewPanel(alignPanel, showHidden);
frame.setContentPane(overview);
- String overviewTitle = MessageManager
- .formatMessage("label.overview_params", new Object[]
- { this.getTitle() });
- String viewName = alignPanel.getViewName();
- if (viewName != null)
- {
- overviewTitle += (" " + viewName);
- }
+ String overviewTitle = getOverviewTitle();
Desktop.addInternalFrame(frame, overviewTitle, true, frame.getWidth(), frame.getHeight(),
true, true);
frame.pack();
return overview;
}
+ /**
+ * Constructs a title for the Overview window including the alignment window's
+ * title, and view name (if applicable)
+ *
+ * @return
+ */
+ public String getOverviewTitle()
+ {
+ String overviewTitle = MessageManager
+ .formatMessage("label.overview_params", new Object[]
+ { this.getTitle() });
+ String viewName = alignPanel.getViewName();
+ if (viewName != null)
+ {
+ overviewTitle += (" " + viewName);
+ }
+ return overviewTitle;
+ }
+
@Override
public void textColour_actionPerformed()
{
import java.util.StringTokenizer;
import java.util.Vector;
+import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;
import jalview.api.ComplexAlignFile;
import jalview.gui.AlignViewport;
import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
+import jalview.gui.OverviewPanel;
import jalview.json.binding.biojson.v1.ColourSchemeMapper;
import jalview.project.Jalview2XML;
import jalview.schemes.ColourSchemeI;
// that perform queries to find the 'current working alignment'
Desktop.addInternalFrame(alignFrame, title,
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+
+ OverviewPanel ov = alignFrame.alignPanel.getOverviewPanel();
+ if (ov != null)
+ {
+ /*
+ * Overview automatically opened with alignment
+ * - set its title now alignFrame title has been set
+ */
+ String ttl = alignFrame.getOverviewTitle();
+ ((JInternalFrame) SwingUtilities
+ .getAncestorOfClass(JInternalFrame.class, ov))
+ .setTitle(ttl);
+ }
+
}
try