| java.lang.Object javax.swing.plaf.basic.BasicGraphicsUtils contrib.ch.randelshofer.quaqua.QuaquaUtilities
QuaquaUtilities | public class QuaquaUtilities extends BasicGraphicsUtils implements SwingConstants(Code) | | Utility class for the Quaqua LAF.
author: Werner Randelshofer, Staldenmattweg 2, CH-6405 Immensee, Switzerland version: 3.1 2006-09-04 Added method compositeRequestFocus. version: 3.0.5 2006-08-20 Method endGraphics must not set version: KEY_TEXT_ANTIALIASING to null. version: 3.0.4 2006-02-19 Catch Throwable in method setWindowAlpha instead version: of catching NoSuchMethodException. version: 3.0.3 2006-01-08 Don't set Window alpha, when running on version: Java 1.4.2_05 on Mac OS X 10.3.5. Because this only has the effect of turning version: the background color of the Window to white. version: 3.0.2 2005-12-10 Method isOnActiveWindow() did not reliably version: return true. version: 3.0.1 2005-11-12 Fixed NPE in method repaint border. version: 3.0 2005-09-24 Removed all reflection helper methods. Moved Sheet version: helper methods out into class Sheets. version: 2.6 2005-09-17 Method isOnFocusedWindow returns true, if version: the window returns false on "getFocusableWindowState". version: 2.5 2005-03-13 Renamed method isFrameActive to isOnActiveFrame. version: 2.4 2004-12-28 Method createBufferdImage added. Method version: isOnActiveWindow() renamed to isFrameActive(). version: 2.3 2004-12-14 Method getUI added. version: 2.2.1 2004-12-01 Methods setDragEnabled and getDragEnabled never version: worked because the attempted to get method objects on the wrong class. version: 2.2 2004-09-19 Refined algorithm of method isFrameActive. version: 2.1 2004-07-04 Methods repaintBorder, beginFont, endFont and version: isFocused added. version: 2.0 2004-04-27 Renamed from QuaquaGraphicUtils to QuaquaUtilities. version: Added method isFrameActive(Component). version: 1.1.1 2003-10-08 Diagnostic output to System.out removed. version: 1.1 2003-10-05 Methods getModifiersText and getModifiersUnicode version: added. version: 1.0 2003-07-19 Created. |
Method Summary | |
final public static Object | beginGraphics(Graphics2D graphics2d) | public static Component | compositeRequestFocus(Component component) Copied from BasicLookAndFeel. | public static void | configureGraphics(Graphics gr) | public static BufferedImage | createBufferedImage(URL location) | public static TexturePaint | createTexturePaint(URL location) | public static void | drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y) Draw a string with the graphics g at location
(x , y )
just like g.drawString would.
The character at index underlinedIndex
in text will be underlined. | final public static void | endGraphics(Graphics2D graphics2d, Object oldHints) | static int | findDisplayedMnemonicIndex(String text, int mnemonic) Returns index of the first occurrence of mnemonic
within string text . | public static String | getKeyModifiersText(int modifiers, boolean leftToRight) Returns a Mac OS X specific String describing the modifier key(s),
such as "Shift", or "Ctrl+Shift". | static String | getKeyModifiersUnicode(int modifiers, boolean leftToRight) | public static int | getLeftSideBearing(Font f, String string) | final public static boolean | isFocused(Component component) | static boolean | isHeadless() | public static boolean | isLeftToRight(Component c) | public static boolean | isOnActiveWindow(Component c) Returns true if the component is on a Dialog or a Frame, which is active,
or if it is on a Window, which is focused. | public static String | layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string. | public static String | layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string. | static void | provideErrorFeedback(Component component) Invoked when the user attempts an invalid operation,
such as pasting into an uneditable JTextField
that has focus. | public static void | repaintBorder(JComponent component) |
compositeRequestFocus | public static Component compositeRequestFocus(Component component)(Code) | | Copied from BasicLookAndFeel.
|
configureGraphics | public static void configureGraphics(Graphics gr)(Code) | | |
drawStringUnderlineCharAt | public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)(Code) | | Draw a string with the graphics g at location
(x , y )
just like g.drawString would.
The character at index underlinedIndex
in text will be underlined. If index is beyond the
bounds of text (including < 0), nothing will be
underlined.
Parameters: g - Graphics to draw with Parameters: text - String to draw Parameters: underlinedIndex - Index of character in text to underline Parameters: x - x coordinate to draw at Parameters: y - y coordinate to draw at since: 1.4 |
findDisplayedMnemonicIndex | static int findDisplayedMnemonicIndex(String text, int mnemonic)(Code) | | Returns index of the first occurrence of mnemonic
within string text . Matching algorithm is not
case-sensitive.
Parameters: text - The text to search through, may be null Parameters: mnemonic - The mnemonic to find the character for. index into the string if exists, otherwise -1 |
getKeyModifiersText | public static String getKeyModifiersText(int modifiers, boolean leftToRight)(Code) | | Returns a Mac OS X specific String describing the modifier key(s),
such as "Shift", or "Ctrl+Shift".
string a text description of the combination of modifierkeys that were held down during the event |
getKeyModifiersUnicode | static String getKeyModifiersUnicode(int modifiers, boolean leftToRight)(Code) | | |
getLeftSideBearing | public static int getLeftSideBearing(Font f, String string)(Code) | | |
isHeadless | static boolean isHeadless()(Code) | | |
isOnActiveWindow | public static boolean isOnActiveWindow(Component c)(Code) | | Returns true if the component is on a Dialog or a Frame, which is active,
or if it is on a Window, which is focused.
Always returns true, if the component has no parent window.
|
layoutCompoundLabel | public static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)(Code) | | Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string. Locations are computed
relative to the viewR rectangle.
The JComponents orientation (LEADING/TRAILING) will also be taken
into account and translated into LEFT/RIGHT values accordingly.
|
layoutCompoundLabel | public static String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)(Code) | | Compute and return the location of the icons origin, the
location of origin of the text baseline, and a possibly clipped
version of the compound labels string. Locations are computed
relative to the viewR rectangle.
This layoutCompoundLabel() does not know how to handle LEADING/TRAILING
values in horizontalTextPosition (they will default to RIGHT) and in
horizontalAlignment (they will default to CENTER).
Use the other version of layoutCompoundLabel() instead.
|
provideErrorFeedback | static void provideErrorFeedback(Component component)(Code) | | Invoked when the user attempts an invalid operation,
such as pasting into an uneditable JTextField
that has focus. The default implementation beeps. Subclasses
that wish different behavior should override this and provide
the additional feedback.
Parameters: component - Component the error occured in, may be nullindicating the error condition is not directlyassociated with a Component . |
Methods inherited from javax.swing.plaf.basic.BasicGraphicsUtils | public static void drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)(Code)(Java Doc) public static void drawDashedRect(Graphics g, int x, int y, int width, int height)(Code)(Java Doc) public static void drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)(Code)(Java Doc) public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)(Code)(Java Doc) public static void drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)(Code)(Java Doc) public static void drawString(Graphics g, String text, int underlinedChar, int x, int y)(Code)(Java Doc) public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)(Code)(Java Doc) public static Insets getEtchedInsets()(Code)(Java Doc) public static Insets getGrooveInsets()(Code)(Java Doc) public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap)(Code)(Java Doc)
|
|
|