Package com.moneydance.awt
Class AwtUtil
java.lang.Object
com.moneydance.awt.AwtUtil
public class AwtUtil
extends java.lang.Object
Description: Misc. functions to make GUI programming easier.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_INSETstatic intDEFAULT_X_INSETstatic java.awt.InsetsnoInsetsstatic java.awt.InsetstallInsetsstatic intWINDOW_BOTTOM_LEFTstatic intWINDOW_BOTTOM_RIGHTstatic intWINDOW_CENTERstatic intWINDOW_TOP_LEFTstatic intWINDOW_TOP_RIGHT -
Constructor Summary
Constructors Constructor Description AwtUtil() -
Method Summary
Modifier and Type Method Description static voidcenterWindow(java.awt.Window win)static java.awt.ColorcolorFromHexString(java.lang.String colorString)Returns an instance of java.awt.Color for the given string, which should consist of a 6 digit hexadecimal string with a prefix of either '0x' or '#'.static voiddrawHashOverArea(java.awt.Graphics2D g, int x, int y, int width, int height)Draw diagonal hashing lines over the given area.static voiddumpSizingInformation(java.io.PrintStream out, java.lang.String prefix, java.awt.Component c, int depthLimit)static voidenableAntiAliasing(java.awt.Graphics g)static java.awt.GridBagConstraintsgetC(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, java.awt.Insets insets)static java.awt.GridBagConstraintsgetC(int x, int y, float weightx, float weighty, int width, int height, int padx, int pady, int topInset, int leftInset, int botInset, int rightInset)static java.awt.ComponentgetClosestFrameOrDialogAncestor(java.awt.Component c)Returns the nearest Frame or JDialog that is an ancestor to the given component.static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int inset)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int xinset, int yinset)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int topInset, int leftInset, int botInset, int rightInset)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int topInset, int leftInset, int botInset, int rightInset)static java.awt.GridBagConstraintsgetConstraints(int x, int y, float weightx, float weighty, int width, int height, int topInset, int leftInset, int botInset, int rightInset)static java.awt.FramegetFrame(java.awt.Component c)static javax.swing.JFramegetJFrame(java.awt.Component c)Since build 505 of Moneydancestatic java.awt.ComponentgetTopmostParent(java.awt.Component c)static java.awt.WindowgetWindow(java.awt.Component c)static java.lang.StringhexStringForColor(java.awt.Color color)Return the hex string for the given colour.static java.awt.ImageloadImage(java.lang.Class base, java.lang.String imageFileName)static java.awt.ImageloadImage(java.lang.Class base, java.lang.String imageFileName, java.awt.Component comp)static java.awt.ImageloadImage(java.lang.String imageFileName)static voidsetupWindow(java.awt.Window child)static voidsetupWindow(java.awt.Window child, int position)static voidsetupWindow(java.awt.Window child, int width, int height)static voidsetupWindow(java.awt.Window child, int width, int height, int position)static voidsetupWindow(java.awt.Window child, int width, int height, int x, int y)static voidsetupWindow(java.awt.Window child, int width, int height, int x, int y, java.awt.Component parent)static voidsetupWindow(java.awt.Window child, int width, int height, java.awt.Component parent)static voidsetupWindow(java.awt.Window child, java.awt.Component parent)static voidsetWindowPosition(java.awt.Window win, int position)static voidsetWindowPosition(java.awt.Window child, java.awt.Component parent)
-
Field Details
-
DEFAULT_INSET
public static final int DEFAULT_INSET- See Also:
- Constant Field Values
-
DEFAULT_X_INSET
public static final int DEFAULT_X_INSET- See Also:
- Constant Field Values
-
noInsets
public static final java.awt.Insets noInsets -
tallInsets
public static final java.awt.Insets tallInsets -
WINDOW_BOTTOM_RIGHT
public static final int WINDOW_BOTTOM_RIGHT- See Also:
- Constant Field Values
-
WINDOW_BOTTOM_LEFT
public static final int WINDOW_BOTTOM_LEFT- See Also:
- Constant Field Values
-
WINDOW_TOP_LEFT
public static final int WINDOW_TOP_LEFT- See Also:
- Constant Field Values
-
WINDOW_TOP_RIGHT
public static final int WINDOW_TOP_RIGHT- See Also:
- Constant Field Values
-
WINDOW_CENTER
public static final int WINDOW_CENTER- See Also:
- Constant Field Values
-
-
Constructor Details
-
AwtUtil
public AwtUtil()
-
-
Method Details
-
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int inset) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int xinset, int yinset) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int topInset, int leftInset, int botInset, int rightInset) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, int topInset, int leftInset, int botInset, int rightInset) -
getConstraints
public static java.awt.GridBagConstraints getConstraints(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, int topInset, int leftInset, int botInset, int rightInset) -
getC
public static java.awt.GridBagConstraints getC(int x, int y, float weightx, float weighty, int width, int height, int padx, int pady, int topInset, int leftInset, int botInset, int rightInset) -
getC
public static java.awt.GridBagConstraints getC(int x, int y, float weightx, float weighty, int width, int height, boolean fillx, boolean filly, int align, java.awt.Insets insets) -
loadImage
public static java.awt.Image loadImage(java.lang.Class base, java.lang.String imageFileName) -
loadImage
public static java.awt.Image loadImage(java.lang.String imageFileName) throws java.io.IOException- Throws:
java.io.IOException
-
loadImage
public static java.awt.Image loadImage(java.lang.Class base, java.lang.String imageFileName, java.awt.Component comp) throws java.io.IOException- Throws:
java.io.IOException
-
getTopmostParent
public static final java.awt.Component getTopmostParent(java.awt.Component c) -
getFrame
public static final java.awt.Frame getFrame(java.awt.Component c) -
getClosestFrameOrDialogAncestor
public static java.awt.Component getClosestFrameOrDialogAncestor(java.awt.Component c)Returns the nearest Frame or JDialog that is an ancestor to the given component. If no JDialog or Frame is found then return the top-most component ancestor. -
getJFrame
public static final javax.swing.JFrame getJFrame(java.awt.Component c)Since build 505 of Moneydance -
getWindow
public static final java.awt.Window getWindow(java.awt.Component c) -
centerWindow
public static final void centerWindow(java.awt.Window win) -
setWindowPosition
public static final void setWindowPosition(java.awt.Window win, int position) -
setWindowPosition
public static final void setWindowPosition(java.awt.Window child, java.awt.Component parent) -
setupWindow
public static final void setupWindow(java.awt.Window child) -
setupWindow
public static final void setupWindow(java.awt.Window child, int position) -
setupWindow
public static final void setupWindow(java.awt.Window child, java.awt.Component parent) -
setupWindow
public static final void setupWindow(java.awt.Window child, int width, int height) -
setupWindow
public static final void setupWindow(java.awt.Window child, int width, int height, int position) -
setupWindow
public static final void setupWindow(java.awt.Window child, int width, int height, int x, int y, java.awt.Component parent) -
setupWindow
public static final void setupWindow(java.awt.Window child, int width, int height, int x, int y) -
setupWindow
public static final void setupWindow(java.awt.Window child, int width, int height, java.awt.Component parent) -
dumpSizingInformation
public static void dumpSizingInformation(java.io.PrintStream out, java.lang.String prefix, java.awt.Component c, int depthLimit) -
enableAntiAliasing
public static void enableAntiAliasing(java.awt.Graphics g) -
drawHashOverArea
public static void drawHashOverArea(java.awt.Graphics2D g, int x, int y, int width, int height)Draw diagonal hashing lines over the given area.- Since:
- build 600
-
colorFromHexString
public static java.awt.Color colorFromHexString(java.lang.String colorString)Returns an instance of java.awt.Color for the given string, which should consist of a 6 digit hexadecimal string with a prefix of either '0x' or '#'. Returns null if the string specifies an invalid color. -
hexStringForColor
public static java.lang.String hexStringForColor(java.awt.Color color)Return the hex string for the given colour. This does _not_ include any 0x or # prefix and is only the 6 digit hexadecimal string.
-