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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user