private Hashtable<String, BufferedImage> _image_map;
private static Map<String, String> _lineage_to_rank_map;
- MainPanel() {
- }
-
public MainPanel( final Configuration configuration, final MainFrame parent ) {
if ( configuration == null ) {
throw new IllegalArgumentException( "configuration is null" );
getControlPanel().showWhole();
}
+ MainPanel() {
+ }
+
public void addPhylogenyInNewTab( final Phylogeny phy,
final Configuration config,
final String default_name,
getControlPanel().showWhole();
}
+ @Override
+ public void componentHidden( final ComponentEvent e ) {
+ // Do nothing.
+ }
+
+ @Override
+ public void componentMoved( final ComponentEvent e ) {
+ // Do nothing.
+ }
+
+ @Override
+ public void componentResized( final ComponentEvent e ) {
+ if ( getCurrentTreePanel() != null ) {
+ getCurrentTreePanel().updateOvSettings();
+ getCurrentTreePanel().updateOvSizes();
+ }
+ }
+
+ @Override
+ public void componentShown( final ComponentEvent e ) {
+ // Do nothing.
+ }
+
+ public ControlPanel getControlPanel() {
+ return _control_panel;
+ }
+
+ public Set<Long> getCopiedAndPastedNodes() {
+ return _copied_and_pasted_nodes;
+ }
+
+ public TreePanel getCurrentTreePanel() {
+ final int selected = getTabbedPane().getSelectedIndex();
+ if ( selected >= 0 ) {
+ return _treepanels.get( selected );
+ }
+ else {
+ if ( _treepanels.size() == 1 ) {
+ return _treepanels.get( 0 );
+ }
+ else {
+ return null;
+ }
+ }
+ }
+
+ public Options getOptions() {
+ return _mainframe.getOptions();
+ }
+
+ public JTabbedPane getTabbedPane() {
+ return _tabbed_pane;
+ }
+
+ public TreeFontSet getTreeFontSet() {
+ return _fontset;
+ }
+
+ public void setArrowCursor() {
+ setCursor( TreePanel.ARROW_CURSOR );
+ repaint();
+ }
+
+ public void setCopiedAndPastedNodes( final Set<Long> node_ids ) {
+ _copied_and_pasted_nodes = node_ids;
+ }
+
+ public void setWaitCursor() {
+ setCursor( TreePanel.WAIT_CURSOR );
+ repaint();
+ }
+
void addPhylogenyInPanel( final Phylogeny phy, final Configuration config ) {
final TreePanel treepanel = new TreePanel( phy, config, this );
getControlPanel().phylogenyAdded( config );
}
}
- @Override
- public void componentHidden( final ComponentEvent e ) {
- // Do nothing.
- }
-
- @Override
- public void componentMoved( final ComponentEvent e ) {
- // Do nothing.
- }
-
- @Override
- public void componentResized( final ComponentEvent e ) {
- if ( getCurrentTreePanel() != null ) {
- getCurrentTreePanel().updateOvSettings();
- getCurrentTreePanel().updateOvSizes();
- }
- }
-
- @Override
- public void componentShown( final ComponentEvent e ) {
- // Do nothing.
- }
-
Configuration getConfiguration() {
return _configuration;
}
- public ControlPanel getControlPanel() {
- return _control_panel;
- }
-
- public Set<Long> getCopiedAndPastedNodes() {
- return _copied_and_pasted_nodes;
- }
-
Phylogeny getCurrentPhylogeny() {
if ( getCurrentTreePanel() == null ) {
return null;
}
}
- 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 );
- }
- else {
- if ( _treepanels.size() == 1 ) {
- return _treepanels.get( 0 );
- }
- else {
- return null;
- }
- }
- }
-
Phylogeny getCutOrCopiedTree() {
return _cut_or_copied_tree;
}
- MainFrame getMainFrame() {
- return _mainframe;
+ synchronized Hashtable<String, BufferedImage> getImageMap() {
+ return _image_map;
}
- public Options getOptions() {
- return _mainframe.getOptions();
+ MainFrame getMainFrame() {
+ return _mainframe;
}
Phylogeny getPhylogeny( final int index ) {
return getCurrentScrollPane().getViewport().getExtentSize();
}
- public JTabbedPane getTabbedPane() {
- return _tabbed_pane;
- }
-
TreeColorSet getTreeColorSet() {
return _colorset;
}
- public TreeFontSet getTreeFontSet() {
- return _fontset;
- }
-
List<TreePanel> getTreePanels() {
return _treepanels;
}
add( _tabbed_pane, BorderLayout.CENTER );
}
- public void setArrowCursor() {
- setCursor( TreePanel.ARROW_CURSOR );
- repaint();
+ void setCutOrCopiedTree( final Phylogeny cut_or_copied_tree ) {
+ _cut_or_copied_tree = cut_or_copied_tree;
}
- public void setCopiedAndPastedNodes( final Set<Long> node_ids ) {
- _copied_and_pasted_nodes = node_ids;
+ synchronized void setImageMap( final Hashtable<String, BufferedImage> image_map ) {
+ _image_map = image_map;
}
- void setCutOrCopiedTree( final Phylogeny cut_or_copied_tree ) {
- _cut_or_copied_tree = cut_or_copied_tree;
+ void setTitleOfSelectedTab( final String title ) {
+ final int selected = getTabbedPane().getSelectedIndex();
+ if ( selected >= 0 ) {
+ getTabbedPane().setTitleAt( selected, title );
+ }
}
void setTreeColorSet( final TreeColorSet colorset ) {
void setupTreeGraphic( final Configuration config_settings, final ControlPanel control ) {
control.setSpeciesColors( config_settings.getSpeciesColors() );
+ control.setSequenceColors( config_settings.getSequenceColors() );
control.setAnnotationColors( config_settings.getAnnotationColors() );
RenderableDomainArchitecture.setColorMap( config_settings.getDomainColors() );
}
- public void setWaitCursor() {
- setCursor( TreePanel.WAIT_CURSOR );
- repaint();
- }
-
void terminate() {
for( final TreePanel atvtreepanel : _treepanels ) {
atvtreepanel.removeAllEditNodeJFrames();
}
}
- synchronized void setImageMap( final Hashtable<String, BufferedImage> image_map ) {
- _image_map = image_map;
- }
-
- synchronized Hashtable<String, BufferedImage> getImageMap() {
- return _image_map;
- }
-
public synchronized static Map<String, String> getLineageToRankMap() {
if ( _lineage_to_rank_map == null ) {
_lineage_to_rank_map = new HashMap<String, String>();