com.moneydance.util
Class UiUtil

java.lang.Object
  extended by com.moneydance.util.UiUtil

public class UiUtil
extends java.lang.Object

User interface utilities and constants.

Author:
Kevin Menningen - Mennē Software Solutions, LLC

Field Summary
static int DLG_HGAP
          Horizontal gap between content and dialog border.
static int DLG_VGAP
          Vertical gap between content and dialog border.
static int HGAP
          Horizontal gap between components/controls.
static java.lang.String LABEL_COLON
          Text that follows a label.
static java.lang.Object TEXT_ANTIALIAS_HINT
          Best looking anti-aliasing setting for text from experimental results on several systems.
static int VGAP
          Vertical gap between components/controls.
 
Constructor Summary
UiUtil()
           
 
Method Summary
static java.lang.String addLabelSuffix(com.moneydance.apps.md.view.resources.MDResourceProvider resources, java.lang.String label)
          Add a colon prompt after a text label if it does not have a colon.
static java.lang.String getLabelText(com.moneydance.apps.md.view.resources.MDResourceProvider resources, java.lang.String key)
          Get a label from resources, and if it does not have a colon, add it.
static java.awt.Point moveOnScreen(java.awt.Point point, java.awt.Rectangle rectangle)
          Move the point in screen coordinates so the specified rectangle fits on screen.
static void runOnUIThread(java.lang.Runnable runnable)
          Runs the specified code on the Event Dispatch thread (the UI thread).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HGAP

public static final int HGAP
Horizontal gap between components/controls.

See Also:
Constant Field Values

VGAP

public static final int VGAP
Vertical gap between components/controls.

See Also:
Constant Field Values

DLG_HGAP

public static final int DLG_HGAP
Horizontal gap between content and dialog border.

See Also:
Constant Field Values

DLG_VGAP

public static final int DLG_VGAP
Vertical gap between content and dialog border.

See Also:
Constant Field Values

LABEL_COLON

public static final java.lang.String LABEL_COLON
Text that follows a label. Some locales prefer ' : ', others prefer ': '.

See Also:
Constant Field Values

TEXT_ANTIALIAS_HINT

public static java.lang.Object TEXT_ANTIALIAS_HINT
Best looking anti-aliasing setting for text from experimental results on several systems. This should be used anywhere text is being rendered. Has significant effect on Windows and Linux systems, should have no effect on Mac systems.

Constructor Detail

UiUtil

public UiUtil()
Method Detail

runOnUIThread

public static void runOnUIThread(java.lang.Runnable runnable)
Runs the specified code on the Event Dispatch thread (the UI thread).

Parameters:
runnable - Code to run on the UI thread.

moveOnScreen

public static java.awt.Point moveOnScreen(java.awt.Point point,
                                          java.awt.Rectangle rectangle)
Move the point in screen coordinates so the specified rectangle fits on screen.

Parameters:
point - The point in screen coordinates.
rectangle - The rectangle to fit.
Returns:
A point on the screen.

getLabelText

public static java.lang.String getLabelText(com.moneydance.apps.md.view.resources.MDResourceProvider resources,
                                            java.lang.String key)
Get a label from resources, and if it does not have a colon, add it. Also adds a space at the end for better spacing in the UI layout.

Parameters:
resources - Resource provider.
key - String key to look up in the resources
Returns:
A string with a colon at the end.

addLabelSuffix

public static java.lang.String addLabelSuffix(com.moneydance.apps.md.view.resources.MDResourceProvider resources,
                                              java.lang.String label)
Add a colon prompt after a text label if it does not have a colon. Also adds a space at the end for better spacing in the UI layout.

Parameters:
resources - Resource provider.
label - String to add the colon to.
Returns:
A string with a colon at the end.