+ al = new NodeColorizationActionListener( _color_chooser, node );
+ }
+ String title = "Change the (node and font) color for ";
+ if ( count == 1 ) {
+ title += "one node";
+ }
+ else {
+ title += ( count + " nodes" );
+ }
+ final JDialog dialog = JColorChooser.createDialog( this, title, true, _color_chooser, al, null );
+ setEdited( true );
+ dialog.setVisible( true );
+ }
+
+ final private void colorizeNodes( final Color c,
+ final PhylogenyNode node,
+ final List<PhylogenyNode> additional_nodes ) {
+ _control_panel.setColorBranches( true );
+ if ( _control_panel.getUseVisualStylesCb() != null ) {
+ _control_panel.getUseVisualStylesCb().setSelected( true );
+ }
+ if ( node != null ) {
+ colorizeNodesHelper( c, node );
+ }
+ if ( additional_nodes != null ) {
+ for( final PhylogenyNode n : additional_nodes ) {
+ colorizeNodesHelper( c, n );
+ }
+ }
+ repaint();
+ }
+
+ final private void colorizeSubtree( final Color c,
+ final PhylogenyNode node,
+ final List<PhylogenyNode> additional_nodes ) {
+ _control_panel.setColorBranches( true );
+ if ( _control_panel.getUseVisualStylesCb() != null ) {
+ _control_panel.getUseVisualStylesCb().setSelected( true );
+ }
+ if ( node != null ) {
+ for( final PreorderTreeIterator it = new PreorderTreeIterator( node ); it.hasNext(); ) {
+ it.next().getBranchData().setBranchColor( new BranchColor( c ) );
+ }
+ }
+ if ( additional_nodes != null ) {
+ for( final PhylogenyNode an : additional_nodes ) {
+ for( final PreorderTreeIterator it = new PreorderTreeIterator( an ); it.hasNext(); ) {
+ it.next().getBranchData().setBranchColor( new BranchColor( c ) );
+ }
+ }
+ }
+ repaint();
+ }
+
+ final private void colorSubtree( final PhylogenyNode node ) {
+ if ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) {
+ JOptionPane.showMessageDialog( this,
+ "Cannot colorize subtree in unrooted display type",
+ "Attempt to colorize subtree in unrooted display",
+ JOptionPane.WARNING_MESSAGE );
+ return;