Added getDefaultTextAntialiasing(), use it to configure the default for

MultilineLabel.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2508 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-12-18 01:33:26 +00:00
parent b7e85472f4
commit c5504d6857
2 changed files with 21 additions and 1 deletions
@@ -386,7 +386,7 @@ public class MultiLineLabel extends JComponent
protected int _constrainedSize;
/** Whether to render the label with anti-aliasing. */
protected boolean _antialiased;
protected boolean _antialiased = SwingUtil.getDefaultTextAntialiasing();
/** Whether this label is dirty and should be re-layed out. */
protected boolean _dirty = true;
@@ -439,6 +439,16 @@ public class SwingUtil
gfx.setRenderingHints((RenderingHints)rock);
}
/**
* Returns true if anti-aliasing is desired by default. This currently checks the value of the
* <code>swing.aatext</code> property, but will someday switch to using Java Desktop Properties
* which in theory get their values from OS preferences.
*/
public static boolean getDefaultTextAntialiasing ()
{
return _defaultTextAntialiasing;
}
/**
* Adjusts the widths and heights of the cells of the supplied table to fit their contents.
*/
@@ -631,4 +641,14 @@ public class SwingUtil
/** Used by {@link #addDebugBorders}. */
protected static Random _rando = new Random();
/** Used by {@link #getDefaultTextAntialiasing}. */
protected static boolean _defaultTextAntialiasing;
static {
try {
_defaultTextAntialiasing = Boolean.getBoolean("swing.aatext");
} catch (Exception e) {
// security exception due to running in a sandbox, no problem
}
}
}