new Color( 140, 140, 140 ), // branch_length_color
new Color( 255, 255, 255 ), // branch_color
new Color( 255, 255, 255 ), // box_color
- new Color( 255, 255, 0 ), // collapesed_fill_color
+ new Color( 255, 255, 255 ), // collapesed_fill_color
new Color( 0, 255, 0 ), // found_color 0
new Color( 255, 0, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 1 + 2
new Color( 140, 140, 140 ), // branch_length_color
new Color( 255, 255, 255 ), // branch_color
new Color( 255, 255, 255 ), // box_color
- new Color( 255, 255, 0 ), // collapesed_fill_color
+ new Color( 255, 255, 255 ), // collapesed_fill_color
new Color( 0, 255, 0 ), // found_color 0
new Color( 255, 0, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 1 + 2
new Color( 140, 140, 140 ), // branch_length_color
new Color( 240, 240, 240 ), // branch_color
new Color( 140, 140, 140 ), // box_color
- new Color( 140, 140, 140 ), // collapesed_fill_color
+ new Color( 240, 240, 240 ), // collapesed_fill_color
new Color( 255, 0, 0 ), // found_color 0
new Color( 0, 255, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 1 + 2
new Color( 0, 100, 0 ), // branch_length_color
new Color( 0, 155, 0 ), // branch_color
new Color( 0, 255, 0 ), // box_color
- new Color( 0, 255, 0 ), // collapesed_fill_color
+ new Color( 0, 155, 0 ), // collapesed_fill_color
new Color( 255, 0, 0 ), // found_color 0
new Color( 0, 255, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 1 + 2
new Color( 70, 70, 0 ), // branch_length_color
new Color( 0, 20, 200 ), // branch_color
new Color( 0, 20, 200 ), // box_color
- new Color( 255, 255, 0 ), // collapesed_fill_color
+ new Color( 0, 20, 200 ), // collapesed_fill_color
new Color( 0, 255, 0 ), // found_color 0
new Color( 255, 0, 0 ), // found_color 1
new Color( 0, 0, 255 ), // found_color 0 + 1
new Color( 200, 200, 200 ), // branch_length_color
new Color( 0, 255, 255 ), // branch_color
new Color( 0, 255, 255 ), // box_color
- new Color( 255, 255, 0 ), // collapesed_fill_color
+ new Color( 0, 255, 255 ), // collapesed_fill_color
new Color( 0, 255, 0 ), // found_color 0
new Color( 0, 0, 255 ), // found_color 1
new Color( 0, 255, 255 ), // found_color 0 + 1
new Color( 255, 200, 0 ), // branch_length_color
new Color( 255, 200, 0 ), // branch_color
new Color( 255, 200, 0 ), // box_color
- new Color( 255, 255, 255 ), // collapesed_fill_color
+ new Color( 255, 200, 0 ), // collapesed_fill_color
new Color( 255, 255, 0 ), // found_color 0
new Color( 0, 255, 255 ), // found_color 1
new Color( 255, 255, 255 ), // found_color 0 + 1
new Color( 255, 0, 0 ), // branch_length_color
new Color( 255, 0, 0 ), // branch_color
new Color( 255, 0, 0 ), // box_color
- new Color( 0, 0, 0 ), // collapesed_fill_color
+ new Color( 255, 0, 0 ), // collapesed_fill_color
new Color( 0, 255, 0 ), // found_color
new Color( 255, 0, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 1 + 2
new Color( 0, 191, 255 ), // branch_length_color
new Color( 0, 191, 255 ), // branch_color
new Color( 0, 191, 255 ), // box_color
- new Color( 255, 255, 255 ), // collapesed_fill_color
+ new Color( 0, 191, 255 ), // collapesed_fill_color
new Color( 255, 0, 0 ), // found_color 0
new Color( 0, 255, 0 ), // found_color 1
new Color( 255, 255, 0 ), // found_color 0 + 1
new Color( 77, 77, 255 ), // branch_length_color
new Color( 234, 173, 234 ), // branch_color
new Color( 77, 77, 255 ), // box_color
- new Color( 77, 77, 255 ), // collapsed_fill_color
+ new Color( 234, 173, 234 ), // collapsed_fill_color
new Color( 243, 243, 21 ), // found_color 0
new Color( 255, 20, 147 ), // found_color 1
new Color( 255, 255, 255 ), // found_color 1 + 2
private Font _base_font;
private Font _small_font_system;
private Font _large_font_system;
- private Font _small_italic_font_system;
- private Font _large_italic_font_system;
private Font _small_font_memory;
private Font _large_font_memory;
- private Font _small_italic_font_memory;
- private Font _large_italic_font_memory;
// Handy holders for font metrics
public FontMetrics _fm_small;
FontMetrics _fm_large;
- FontMetrics _fm_small_italic;
- FontMetrics _fm_small_italic_bold;
- FontMetrics _fm_large_italic;
- FontMetrics _fm_large_italic_bold;
+ FontMetrics _fm_large_bold;
// hold font measurements
int _small_max_descent = 0;
int _small_max_ascent = 0;
if ( decreased_size_by_system && !isDecreasedSizeBySystem() ) {
_small_font_memory = _small_font;
_large_font_memory = _large_font;
- _small_italic_font_memory = _small_italic_font;
- _large_italic_font_memory = _large_italic_font;
}
setDecreasedSizeBySystem( decreased_size_by_system );
if ( _large_font.getSize() >= min ) {
_small_font = _small_font.deriveFont( _small_font.getSize() - FONT_SIZE_CHANGE_STEP );
_large_font = _large_font.deriveFont( _large_font.getSize() - FONT_SIZE_CHANGE_STEP );
- _small_italic_font = _small_italic_font.deriveFont( _small_italic_font.getSize() - FONT_SIZE_CHANGE_STEP );
- _large_italic_font = _large_italic_font.deriveFont( _large_italic_font.getSize() - FONT_SIZE_CHANGE_STEP );
setupFontMetrics();
}
}
return _large_font;
}
- Font getLargeItalicFont() {
- return _large_italic_font;
- }
-
- Font getLargeItalicFontSystem() {
- return _large_italic_font_system;
- }
-
Font getSmallFontSystem() {
return _small_font_system;
}
- Font getSmallItalicFont() {
- return _small_italic_font;
- }
-
- Font getSmallItalicFontSystem() {
- return _small_italic_font_system;
- }
-
void increaseFontSize() {
_small_font = _small_font.deriveFont( _small_font.getSize() + FONT_SIZE_CHANGE_STEP );
_large_font = _large_font.deriveFont( _large_font.getSize() + FONT_SIZE_CHANGE_STEP );
- _small_italic_font = _small_italic_font.deriveFont( _small_italic_font.getSize() + FONT_SIZE_CHANGE_STEP );
- _large_italic_font = _large_italic_font.deriveFont( _large_italic_font.getSize() + FONT_SIZE_CHANGE_STEP );
setupFontMetrics();
}
setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 12f );
_large_font = _large_font.deriveFont( 14f );
- _small_italic_font = _small_italic_font.deriveFont( 12f );
- _large_italic_font = _large_italic_font.deriveFont( 14f );
setupFontMetrics();
}
setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 8f );
_large_font = _large_font.deriveFont( 10f );
- _small_italic_font = _small_italic_font.deriveFont( 8f );
- _large_italic_font = _large_italic_font.deriveFont( 10f );
setupFontMetrics();
}
setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( SMALL_FONTS_BASE - 1 );
_large_font = _large_font.deriveFont( SMALL_FONTS_BASE );
- _small_italic_font = _small_italic_font.deriveFont( SMALL_FONTS_BASE - 1 );
- _large_italic_font = _large_italic_font.deriveFont( SMALL_FONTS_BASE );
setupFontMetrics();
}
setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 2f );
_large_font = _large_font.deriveFont( 3f );
- _small_italic_font = _small_italic_font.deriveFont( 2f );
- _large_italic_font = _large_italic_font.deriveFont( 3f );
setupFontMetrics();
}
setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 5f );
_large_font = _large_font.deriveFont( 6f );
- _small_italic_font = _small_italic_font.deriveFont( 5f );
- _large_italic_font = _large_italic_font.deriveFont( 6f );
setupFontMetrics();
}
}
_small_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), small_size );
_large_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), getBaseFont().getSize() );
- _small_italic_font = new Font( getBaseFont().getFontName(), italic, small_size );
- _large_italic_font = new Font( getBaseFont().getFontName(), italic, getBaseFont().getSize() );
_small_font_system = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), small_size );
_large_font_system = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), getBaseFont().getSize() );
- _small_italic_font_system = new Font( getBaseFont().getFontName(), italic, small_size );
- _large_italic_font_system = new Font( getBaseFont().getFontName(), italic, getBaseFont().getSize() );
_small_font_memory = _small_font;
_large_font_memory = _large_font;
- _small_italic_font_memory = _small_italic_font;
- _large_italic_font_memory = _large_italic_font;
setupFontMetrics();
}
private void setupFontMetrics() {
_fm_small = _owner.getFontMetrics( _small_font );
_fm_large = _owner.getFontMetrics( _large_font );
- _fm_small_italic = _owner.getFontMetrics( _small_italic_font );
- _fm_small_italic_bold = _owner.getFontMetrics( _small_italic_font.deriveFont( Font.BOLD ) );
- _fm_large_italic = _owner.getFontMetrics( _large_italic_font );
- _fm_large_italic_bold = _owner.getFontMetrics( _large_italic_font.deriveFont( Font.BOLD ) );
+ _fm_large_bold = _owner.getFontMetrics( _large_font.deriveFont( Font.BOLD ) );
_small_max_descent = _fm_small.getMaxDescent();
_small_max_ascent = _fm_small.getMaxAscent() + 1;
}
if ( node.getNodeData().isHasTaxonomy() ) {
final Taxonomy tax = node.getNodeData().getTaxonomy();
if ( getControlPanel().isShowTaxonomyCode() && !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ) {
- sum += getTreeFontSet()._fm_large_italic.stringWidth( tax.getTaxonomyCode() + " " );
+ sum += getTreeFontSet()._fm_large.stringWidth( tax.getTaxonomyCode() + " " );
}
if ( getControlPanel().isShowTaxonomyScientificNames()
&& !ForesterUtil.isEmpty( tax.getScientificName() ) ) {
- sum += getTreeFontSet()._fm_large_italic.stringWidth( tax.getScientificName() + " " );
+ sum += getTreeFontSet()._fm_large.stringWidth( tax.getScientificName() + " " );
}
if ( getControlPanel().isShowTaxonomyCommonNames() && !ForesterUtil.isEmpty( tax.getCommonName() ) ) {
- sum += getTreeFontSet()._fm_large_italic.stringWidth( tax.getCommonName() + " ()" );
+ sum += getTreeFontSet()._fm_large.stringWidth( tax.getCommonName() + " ()" );
}
}
if ( getControlPanel().isShowProperties() && node.getNodeData().isHasProperties() ) {
}
_sb.append( propertiesToString( node ) );
}
- Font visual_font = null;
- if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null ) ) {
- visual_font = node.getNodeData().getNodeVisualData().getFont();
- g.setFont( visual_font != null ? visual_font : getTreeFontSet().getLargeFont() );
- }
- else {
- g.setFont( getTreeFontSet().getLargeFont() );
- }
- if ( is_in_found_nodes ) {
- g.setFont( getTreeFontSet().getLargeFont().deriveFont( Font.BOLD ) );
- }
+ final boolean using_visual_font = setFont( g, node, is_in_found_nodes );
double down_shift_factor = 3.0;
if ( !node.isExternal() && ( node.getNumberOfDescendants() == 1 ) ) {
down_shift_factor = 1;
}
final double pos_x = node.getXcoord() + x + 2 + half_box_size;
double pos_y;
- if ( visual_font == null ) {
+ if ( !using_visual_font ) {
pos_y = ( node.getYcoord() + ( getTreeFontSet()._fm_large.getAscent() / down_shift_factor ) );
}
else {
- pos_y = ( node.getYcoord() + ( getFontMetrics( visual_font ).getAscent() / down_shift_factor ) );
+ pos_y = ( node.getYcoord() + ( getFontMetrics( getFont() ).getAscent() / down_shift_factor ) );
}
final String sb_str = _sb.toString();
// GUILHEM_BEG ______________
}
}
+ private boolean setFont( final Graphics2D g, final PhylogenyNode node, final boolean is_in_found_nodes ) {
+ Font visual_font = null;
+ if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null ) ) {
+ visual_font = node.getNodeData().getNodeVisualData().getFont();
+ g.setFont( visual_font != null ? visual_font : getTreeFontSet().getLargeFont() );
+ }
+ else if ( is_in_found_nodes ) {
+ g.setFont( getTreeFontSet().getLargeFont().deriveFont( Font.BOLD ) );
+ }
+ else {
+ g.setFont( getTreeFontSet().getLargeFont() );
+ }
+ return visual_font != null;
+ }
+
private void setColor( final Graphics2D g,
final PhylogenyNode node,
final boolean to_graphics_file,
_sb.append( node.getNodeData().getSequence().getName() );
}
}
- g.setFont( getTreeFontSet().getLargeFont() );
- if ( is_in_found_nodes ) {
- g.setFont( getTreeFontSet().getLargeFont().deriveFont( Font.BOLD ) );
- }
+ final boolean using_visual_font = setFont( g, node, is_in_found_nodes );
+ //g.setFont( getTreeFontSet().getLargeFont() );
+ //if ( is_in_found_nodes ) {
+ // g.setFont( getTreeFontSet().getLargeFont().deriveFont( Font.BOLD ) );
+ // }
if ( _sb.length() > 1 ) {
final String sb_str = _sb.toString();
double m = 0;
if ( node.getNodeData().isHasTaxonomy() ) {
if ( getControlPanel().isShowTaxonomyCode()
&& ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getTaxonomyCode() ) ) ) {
- x += getTreeFontSet()._fm_large_italic.stringWidth( node.getNodeData().getTaxonomy()
+ x += getTreeFontSet()._fm_large.stringWidth( node.getNodeData().getTaxonomy()
.getTaxonomyCode()
+ " " );
}
if ( getControlPanel().isShowTaxonomyScientificNames()
&& ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getScientificName() ) ) ) {
- x += getTreeFontSet()._fm_large_italic.stringWidth( node.getNodeData().getTaxonomy()
+ x += getTreeFontSet()._fm_large.stringWidth( node.getNodeData().getTaxonomy()
.getScientificName()
+ " " );
}
if ( getControlPanel().isShowTaxonomyCommonNames()
&& ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getCommonName() ) ) ) {
- x += getTreeFontSet()._fm_large_italic.stringWidth( node.getNodeData().getTaxonomy()
+ x += getTreeFontSet()._fm_large.stringWidth( node.getNodeData().getTaxonomy()
.getCommonName()
+ " " );
}
my_node = getPhylogeny().getFirstExternalNode();
}
if ( getControlPanel().isShowTaxonomyCode() && ( PhylogenyMethods.getSpecies( my_node ).length() > 0 ) ) {
- x += getTreeFontSet()._fm_large_italic.stringWidth( PhylogenyMethods.getSpecies( my_node ) + " " );
+ x += getTreeFontSet()._fm_large.stringWidth( PhylogenyMethods.getSpecies( my_node ) + " " );
}
if ( getControlPanel().isShowNodeNames() && ( my_node.getName().length() > 0 ) ) {
x += getTreeFontSet()._fm_large.stringWidth( my_node.getName() + " " );
final boolean to_graphics_file,
final double x_shift ) {
final Taxonomy taxonomy = node.getNodeData().getTaxonomy();
- Font visual_font = null;
- if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null ) ) {
- visual_font = node.getNodeData().getNodeVisualData().getFont();
- g.setFont( visual_font != null ? visual_font : getTreeFontSet().getLargeItalicFont() );
- }
- else {
- g.setFont( getTreeFontSet().getLargeItalicFont() );
- }
+ final boolean using_visual_font = setFont( g, node, is_in_found_nodes );
setColor( g, node, to_graphics_file, to_pdf, is_in_found_nodes, getTreeColorSet().getTaxonomyColor() );
final double start_x = node.getXcoord() + 3 + ( getOptions().getDefaultNodeShapeSize() / 2 ) + x_shift;
double start_y;
- if ( visual_font == null ) {
+ if ( !using_visual_font ) {
start_y = node.getYcoord()
+ ( getTreeFontSet()._fm_large.getAscent() / ( node.getNumberOfDescendants() == 1 ? 1 : 3.0 ) );
}
else {
start_y = node.getYcoord()
- + ( getFontMetrics( visual_font ).getAscent() / ( node.getNumberOfDescendants() == 1 ? 1 : 3.0 ) );
+ + ( getFontMetrics( getFont() ).getAscent() / ( node.getNumberOfDescendants() == 1 ? 1 : 3.0 ) );
}
_sb.setLength( 0 );
if ( _control_panel.isShowTaxonomyCode() && !ForesterUtil.isEmpty( taxonomy.getTaxonomyCode() ) ) {
/* GUILHEM_END */
TreePanel.drawString( label, start_x, start_y, g );
if ( is_in_found_nodes ) {
- return getTreeFontSet()._fm_large_italic_bold.stringWidth( label );
+ return getTreeFontSet()._fm_large_bold.stringWidth( label );
}
else {
- if ( visual_font == null ) {
- return getTreeFontSet()._fm_large_italic.stringWidth( label );
+ if ( !using_visual_font ) {
+ return getTreeFontSet()._fm_large.stringWidth( label );
}
- return getFontMetrics( visual_font ).stringWidth( label );
+ return getFontMetrics( getFont() ).stringWidth( label );
}
}