Changeset b8f5c95


Ignore:
Timestamp:
Jul 25, 2017 10:13:36 AM (3 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
0feb16d
Parents:
70393fd
Message:

Console: Move JRobin default color and font changes into SummaryRenderer?

This ensures these changes are applied to Debian installs, where we get JRobin
from the package manager instead of our bundled source.

The padding and grid stroke changes to RrdGraphConstants? have not been reverted,
because there is no API provided to alter those values. This will result in a
minor difference between Debian and non-Debian graphs, and if a user shares
those graphs, it will reveal the fact that they have installed the Debian
package. This is acceptable, given that the graphs themselves inherently reveal
significantly more private information than that.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/jrobin/java/src/org/jrobin/graph/RrdGraphConstants.java

    r70393fd rb8f5c95  
    162162         * Default minor grid color
    163163         */
    164         Color DEFAULT_GRID_COLOR = new Color(100, 100, 100, 75);
     164        Color DEFAULT_GRID_COLOR = new Color(171, 171, 171, 95);
    165165        // Color DEFAULT_GRID_COLOR = new Color(140, 140, 140);
    166166        /**
    167167         * Default major grid color
    168168         */
    169         Color DEFAULT_MGRID_COLOR = new Color(255, 91, 91, 110);
     169        Color DEFAULT_MGRID_COLOR = new Color(255, 91, 91, 95);
    170170        // Color DEFAULT_MGRID_COLOR = new Color(130, 30, 30);
    171171        /**
     
    252252         */
    253253        String DEFAULT_FONT_NAME = System.getProperty("os.name").toLowerCase().contains("windows") ?
    254                         "Lucida Console" : "Monospaced";
     254                        "Lucida Sans Typewriter" : "Monospaced";
    255255
    256256        /**
  • apps/jrobin/java/src/org/jrobin/graph/RrdGraphDef.java

    r70393fd rb8f5c95  
    133133        }
    134134
    135         fonts[FONTTAG_DEFAULT]   = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10);
    136         fonts[FONTTAG_TITLE]     = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10);
    137         fonts[FONTTAG_AXIS]      = new Font("Droid Sans Mono", Font.PLAIN, 10);
    138         fonts[FONTTAG_UNIT]      = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10);
    139         fonts[FONTTAG_LEGEND]    = new Font("Droid Sans Mono", Font.PLAIN, 10);
     135        fonts[FONTTAG_DEFAULT]   = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8);
     136        fonts[FONTTAG_TITLE]     = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 9);
     137        fonts[FONTTAG_AXIS]      = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 7);
     138        fonts[FONTTAG_UNIT]      = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8);
     139        fonts[FONTTAG_LEGEND]    = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 8);
    140140        fonts[FONTTAG_WATERMARK] = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 1).deriveFont(5.5F);
    141141    }
     
    174174                System.err.println(exception.getLocalizedMessage());
    175175            }
    176             font = new Font("Monospaced", Font.PLAIN, 10);
     176            font = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10);
    177177        }
    178178
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java

    r70393fd rb8f5c95  
    3636    private final SummaryListener _listener;
    3737    private final I2PAppContext _context;
     38    private static final Color GRID_COLOR = new Color(100, 100, 100, 75);
     39    private static final Color MGRID_COLOR = new Color(255, 91, 91, 110);
    3840    private static final Color AREA_COLOR = new Color(100, 160, 200, 200);
    3941    private static final Color LINE_COLOR = new Color(0, 30, 110, 255);
    4042    private static final Color RESTART_BAR_COLOR = new Color(223, 13, 13, 255);
     43    private static final String DEFAULT_FONT_NAME = System.getProperty("os.name").toLowerCase().contains("windows") ?
     44            "Lucida Console" : "Monospaced";
    4145
    4246    public SummaryRenderer(I2PAppContext ctx, SummaryListener lsnr) {
     
    126130        try {
    127131            RrdGraphDef def = new RrdGraphDef();
     132
     133            // Override defaults
     134            def.setColor(RrdGraphDef.COLOR_GRID,  GRID_COLOR);
     135            def.setColor(RrdGraphDef.COLOR_MGRID, MGRID_COLOR);
     136            def.setFont(RrdGraphDef.FONTTAG_DEFAULT, new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10));
     137            def.setFont(RrdGraphDef.FONTTAG_TITLE,   new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10));
     138            def.setFont(RrdGraphDef.FONTTAG_AXIS,    new Font("Droid Sans Mono", Font.PLAIN, 10));
     139            def.setFont(RrdGraphDef.FONTTAG_UNIT,    new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10));
     140            def.setFont(RrdGraphDef.FONTTAG_LEGEND,  new Font("Droid Sans Mono", Font.PLAIN, 10));
     141
    128142            // improve text legibility
    129143            String lang = Messages.getLanguage(_context);
  • history.txt

    r70393fd rb8f5c95  
     12017-07-25 str4d
     2 * Console: Move JRobin default color and font changes into SummaryRenderer
     3
    142017-07-15 zzz
    25 * Console: Fix compile error with Jetty 9.2.22 (ticket #2019)
Note: See TracChangeset for help on using the changeset viewer.