X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FTreeFontSet.java;h=47fd94ef06062bf6d0b034c67c0544fada9ac260;hb=a9e626aa67ff9cb1649c371f9d705eb04498cc33;hp=c278f1cac0bb3c8988ff5d598cdbaeb2ba9ddb2d;hpb=3542e5787500857e4b73f3bc943f32acc390cd9a;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/TreeFontSet.java b/forester/java/src/org/forester/archaeopteryx/TreeFontSet.java index c278f1ca..47fd94e 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreeFontSet.java +++ b/forester/java/src/org/forester/archaeopteryx/TreeFontSet.java @@ -87,6 +87,36 @@ public final class TreeFontSet { return _small_max_descent; } + private Font getLargeFontSystem() { + return _large_font_system; + } + + private void intializeFonts() { + final int small_size = getBaseFont().getSize() - 2; + int italic = Font.ITALIC; + if ( getBaseFont().getStyle() == Font.BOLD ) { + italic = italic + Font.BOLD; + } + _small_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), small_size ); + _large_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), 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_font_memory = _small_font; + _large_font_memory = _large_font; + setupFontMetrics(); + } + + private void setDecreasedSizeBySystem( final boolean decreased_size_by_system ) { + _decreased_size_by_system = decreased_size_by_system; + } + + private void setupFontMetrics() { + _fm_small = _owner.getFontMetrics( _small_font ); + _fm_large = _owner.getFontMetrics( _large_font ); + _small_max_descent = _fm_small.getMaxDescent(); + _small_max_ascent = _fm_small.getMaxAscent() + 1; + } + void decreaseFontSize( final int min, final boolean decreased_size_by_system ) { if ( decreased_size_by_system && !isDecreasedSizeBySystem() ) { _small_font_memory = _small_font; @@ -151,7 +181,7 @@ public final class TreeFontSet { void smallFonts() { setDecreasedSizeBySystem( false ); - _small_font = _small_font.deriveFont( SMALL_FONTS_BASE - 1 ); + _small_font = _small_font.deriveFont( SMALL_FONTS_BASE - 2 ); _large_font = _large_font.deriveFont( SMALL_FONTS_BASE ); setupFontMetrics(); } @@ -159,44 +189,14 @@ public final class TreeFontSet { void superTinyFonts() { setDecreasedSizeBySystem( false ); _small_font = _small_font.deriveFont( 2f ); - _large_font = _large_font.deriveFont( 3f ); + _large_font = _large_font.deriveFont( 4f ); setupFontMetrics(); } void tinyFonts() { setDecreasedSizeBySystem( false ); - _small_font = _small_font.deriveFont( 5f ); + _small_font = _small_font.deriveFont( 4f ); _large_font = _large_font.deriveFont( 6f ); setupFontMetrics(); } - - private Font getLargeFontSystem() { - return _large_font_system; - } - - private void intializeFonts() { - final int small_size = getBaseFont().getSize() - 1; - int italic = Font.ITALIC; - if ( getBaseFont().getStyle() == Font.BOLD ) { - italic = italic + Font.BOLD; - } - _small_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), small_size ); - _large_font = new Font( getBaseFont().getFontName(), getBaseFont().getStyle(), 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_font_memory = _small_font; - _large_font_memory = _large_font; - setupFontMetrics(); - } - - private void setDecreasedSizeBySystem( final boolean decreased_size_by_system ) { - _decreased_size_by_system = decreased_size_by_system; - } - - private void setupFontMetrics() { - _fm_small = _owner.getFontMetrics( _small_font ); - _fm_large = _owner.getFontMetrics( _large_font ); - _small_max_descent = _fm_small.getMaxDescent(); - _small_max_ascent = _fm_small.getMaxAscent() + 1; - } }