// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
getControlPanel().showWhole();
}
- void addPhylogenyInNewTab( final Phylogeny phy,
- final Configuration config,
- final String default_name,
- final String full_path ) {
+ public void addPhylogenyInNewTab( final Phylogeny phy,
+ final Configuration config,
+ final String default_name,
+ final String full_path ) {
final TreePanel treepanel = new TreePanel( phy, config, this );
getControlPanel().phylogenyAdded( config );
treepanel.setControlPanel( getControlPanel() );
treegraphic_scroll_pane_panel.add( treegraphic_scroll_pane, BorderLayout.CENTER );
_treegraphic_scroll_pane_panels.add( treegraphic_scroll_pane_panel );
_treegraphic_scroll_panes.add( treegraphic_scroll_pane );
- getTabbedPane().addTab( name,
- null,
- treegraphic_scroll_pane_panel,
- Util.createDescriptionForTab( phy, full_path ) );
+ getTabbedPane().addTab( name, null, treegraphic_scroll_pane_panel, "" );
getTabbedPane().setSelectedIndex( getTabbedPane().getTabCount() - 1 );
getControlPanel().showWhole();
}
JScrollPane getCurrentScrollPane() {
if ( _treegraphic_scroll_panes.size() > 0 ) {
- final int selected = _tabbed_pane.getSelectedIndex();
+ final int selected = getTabbedPane().getSelectedIndex();
if ( selected >= 0 ) {
return _treegraphic_scroll_panes.get( selected );
}
}
JPanel getCurrentScrollPanePanel() {
- final int selected = _tabbed_pane.getSelectedIndex();
+ final int selected = getTabbedPane().getSelectedIndex();
if ( selected >= 0 ) {
return _treegraphic_scroll_pane_panels.get( selected );
}
}
int getCurrentTabIndex() {
- final int selected = _tabbed_pane.getSelectedIndex();
+ final int selected = getTabbedPane().getSelectedIndex();
if ( selected >= 0 ) {
return selected;
}
}
}
- TreePanel getCurrentTreePanel() {
+ void setTitleOfSelectedTab( final String title ) {
+ final int selected = getTabbedPane().getSelectedIndex();
+ if ( selected >= 0 ) {
+ getTabbedPane().setTitleAt( selected, title );
+ }
+ }
+
+ public TreePanel getCurrentTreePanel() {
final int selected = getTabbedPane().getSelectedIndex();
if ( selected >= 0 ) {
return _treepanels.get( selected );
_tabbed_pane.addChangeListener( new ChangeListener() {
// This method is called whenever the selected tab changes
+ @Override
public void stateChanged( final ChangeEvent evt ) {
final JTabbedPane pane = ( JTabbedPane ) evt.getSource();
getControlPanel().tabChanged();