int _small_max_ascent = 0;
private final int _min;
private final int _max;
-
+ private boolean _decreased_size_by_system = false;
+
TreeFontSet( final MainPanel owner ) {
_owner = owner;
_min = _owner.getConfiguration().getMinBaseFontSize();
public Font getSmallFontSystem() {
return _small_font_system;
+
}
- void decreaseFontSize( final int min ) {
+ void decreaseFontSize( final int min, final boolean decreased_size_by_system ) {
+ 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 );
setupFontMetrics();
}
}
+
+
+
+
+
Font getBaseFont() {
return _base_font;
}
void largeFonts() {
+ setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 12f );
_large_font = _large_font.deriveFont( 14f );
_small_italic_font = _small_italic_font.deriveFont( 12f );
}
void mediumFonts() {
+ setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 8f );
_large_font = _large_font.deriveFont( 10f );
_small_italic_font = _small_italic_font.deriveFont( 8f );
}
void smallFonts() {
+ 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 );
}
void superTinyFonts() {
+ setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 2f );
_large_font = _large_font.deriveFont( 3f );
_small_italic_font = _small_italic_font.deriveFont( 2f );
}
void tinyFonts() {
+ setDecreasedSizeBySystem( false );
_small_font = _small_font.deriveFont( 5f );
_large_font = _large_font.deriveFont( 6f );
_small_italic_font = _small_italic_font.deriveFont( 5f );
_small_max_descent = _fm_small.getMaxDescent();
_small_max_ascent = _fm_small.getMaxAscent() + 1;
}
+
+ boolean isDecreasedSizeBySystem() {
+ return _decreased_size_by_system;
+ }
+
+ private void setDecreasedSizeBySystem( final boolean decreased_size_by_system ) {
+ _decreased_size_by_system = decreased_size_by_system;
+ }
}
getControlPanel().displayedPhylogenyMightHaveChanged( true );
}
else {
- getTreeFontSet().decreaseFontSize( 1 );
+ getTreeFontSet().decreaseFontSize( 1, false );
getControlPanel().displayedPhylogenyMightHaveChanged( true );
}
}
if ( recalc_longest_ext_node_info ) {
calculateLongestExtNodeInfo();
while ( ( getLongestExtNodeInfo() > ( x * 0.67 ) ) && ( getTreeFontSet().getLargeFont().getSize() > 2 ) ) {
- getMainPanel().getTreeFontSet().decreaseFontSize( getConfiguration().getMinBaseFontSize() );
+ getMainPanel().getTreeFontSet().decreaseFontSize( getConfiguration().getMinBaseFontSize(), true );
+
+
calculateLongestExtNodeInfo();
}
}
if ( dynamic_hiding_factor > 1 ) {
while ( dynamic_hiding_factor > 1
&& getTreeFontSet()._fm_large.getHeight() > TreeFontSet.SMALL_FONTS_BASE ) {
- getTreeFontSet().decreaseFontSize( 1 );
+ getTreeFontSet().decreaseFontSize( 1, true );
+
dynamic_hiding_factor = calcDynamicHidingFactor();
}
}
- else {
+ else if ( getTreeFontSet().isDecreasedSizeBySystem() ) {
while ( dynamic_hiding_factor < 1 && getTreeFontSet()._fm_large.getHeight() < 12 ) {
getTreeFontSet().increaseFontSize();
dynamic_hiding_factor = calcDynamicHidingFactor();
getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged( true );
}
else if ( ( e.getKeyCode() == KeyEvent.VK_SUBTRACT ) || ( e.getKeyCode() == KeyEvent.VK_MINUS ) ) {
- getMainPanel().getTreeFontSet().decreaseFontSize( 1 );
+ getMainPanel().getTreeFontSet().decreaseFontSize( 1, false );
+
+
getMainPanel().getControlPanel().displayedPhylogenyMightHaveChanged( true );
}
else if ( plusPressed( e.getKeyCode() ) ) {