public class PgsUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PgsUtils.ShadowedIcon |
| Modifier and Type | Field and Description |
|---|---|
static Stroke |
borderStroke |
static Stroke |
rolloverBorderStroke |
| Constructor and Description |
|---|
PgsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createHtmlToolTip(String text)
The given text is surrounded by a HTML document with a specific style.
|
static void |
drawButtonBorder(Graphics g,
int x,
int y,
int w,
int h) |
static void |
drawButtonBorder(Graphics g,
int x,
int y,
int w,
int h,
Color c) |
static void |
drawButtonBorder(Graphics g,
int x,
int y,
int w,
int h,
int c1,
int c2,
Color c) |
static void |
drawButtonBorder(Graphics g,
int x,
int y,
int w,
int h,
Stroke st,
Color c) |
static void |
drawDefaultButtonBorder(Graphics g,
int x,
int y,
int w,
int h,
boolean isRollover) |
static void |
drawDisabledBorder(Graphics g,
int x,
int y,
int w,
int h) |
static void |
drawDisabledBorder(Graphics g,
int x,
int y,
int w,
int h,
int c1,
int c2) |
static void |
drawGradient(Graphics g,
int width,
int height,
Color from,
Color to) |
static void |
drawGradient(Graphics g,
int x,
int y,
int width,
int height,
Color from,
Color to) |
static void |
drawGradient(Graphics g,
JComponent c) |
static void |
drawGradient(Graphics g,
JComponent c,
String prefix) |
static void |
drawGradient(Graphics g,
JComponent c,
String prefix,
int x,
int y,
int width,
int height) |
static void |
drawGradient(Graphics g,
JComponent c,
String prefix1,
String prefix2) |
static void |
drawHorizontalBumps(Graphics g,
int x,
int y,
int width) |
static void |
drawRolloverButtonBorder(Graphics g,
int x,
int y,
int w,
int h) |
static void |
drawRoundRect(Graphics g,
int x,
int y,
int w,
int h) |
static void |
drawRoundRect(Graphics g,
int x,
int y,
int w,
int h,
int c1,
int c2) |
static void |
drawVerticalBumps(Graphics g,
int x,
int y,
int height) |
static void |
drawVistaBackground(Graphics g,
Component b,
Color start,
Color mid,
Color end) |
static void |
drawVistaBackground(Graphics g,
Component b,
String prefix) |
static void |
drawVistaBackground(Graphics g,
int x,
int y,
int width,
int height,
Color start,
Color mid,
Color end) |
static void |
fixHtmlDisplay(JComponent component)
This method fixes the display of HTML enabled components (like JEditorPanes
and JTextPanes).
|
static Icon |
getDisabledButtonIcon(Image image) |
static GradientPaint |
getGradientPaint(int x,
int y,
int width,
int height,
Color from,
Color to) |
static Icon |
getToolBarIcon(Image i) |
static boolean |
hasFocus(Component component) |
static void |
installAntialiasing(Graphics g) |
static boolean |
isFlat(JComponent b) |
static boolean |
isFlat(String id) |
static boolean |
isLeftToRight(Component c) |
protected static void |
paintMenuItemBackground(Graphics g,
AbstractButton menuItem,
Color bgColor,
String prefix) |
static void |
paintSprite(Graphics g,
int x,
int y,
int[][] sprite,
Color[] colors)
Paint the given sprite.
|
static void |
regenerateBorderStroke() |
static void |
uninstallAntialiasing(Graphics g) |
public static Stroke borderStroke
public static Stroke rolloverBorderStroke
public static String createHtmlToolTip(String text)
p-Element and a tooltip should have a single h1
at the beginning of the document.
Example:
comp.setToolTipText(PgsUtils.createHtmlToolTip(new StringBuilder()
.append("<h1>Tooltips changed, too</h1>")
.append("<p>Office 2007 and Windows Vista have introduced a new kind<br>")
.append("of UI for tooltips. To make it short: They should look better now.</p>")
.append("<p>Therefore Tooltips in PgsLookAndFeel now feature a background gradient<br>")
.append("as well as a default style for HTML text within them. This is available through<br>")
.append("a utility method in PgsUtils.</p>")
.toString()));text - public static boolean isFlat(JComponent b)
public static boolean isFlat(String id)
public static void paintSprite(Graphics g, int x, int y, int[][] sprite, Color[] colors)
g - x - y - sprite - colors - public static GradientPaint getGradientPaint(int x, int y, int width, int height, Color from, Color to)
public static void drawGradient(Graphics g, int width, int height, Color from, Color to)
public static void drawGradient(Graphics g, int x, int y, int width, int height, Color from, Color to)
public static void drawGradient(Graphics g, JComponent c, String prefix, int x, int y, int width, int height)
public static void drawGradient(Graphics g, JComponent c, String prefix)
public static void drawGradient(Graphics g, JComponent c, String prefix1, String prefix2)
public static void drawGradient(Graphics g, JComponent c)
public static void drawVistaBackground(Graphics g, Component b, Color start, Color mid, Color end)
public static void drawVistaBackground(Graphics g, int x, int y, int width, int height, Color start, Color mid, Color end)
protected static void paintMenuItemBackground(Graphics g, AbstractButton menuItem, Color bgColor, String prefix)
public static boolean isLeftToRight(Component c)
public static void drawVerticalBumps(Graphics g, int x, int y, int height)
public static void drawHorizontalBumps(Graphics g, int x, int y, int width)
public static boolean hasFocus(Component component)
public static void regenerateBorderStroke()
public static void drawButtonBorder(Graphics g, int x, int y, int w, int h, Stroke st, Color c)
public static void drawButtonBorder(Graphics g, int x, int y, int w, int h, Color c)
public static void drawButtonBorder(Graphics g, int x, int y, int w, int h, int c1, int c2, Color c)
public static void drawDefaultButtonBorder(Graphics g, int x, int y, int w, int h, boolean isRollover)
public static void drawButtonBorder(Graphics g, int x, int y, int w, int h)
public static void drawRolloverButtonBorder(Graphics g, int x, int y, int w, int h)
public static void drawDisabledBorder(Graphics g, int x, int y, int w, int h)
public static void drawDisabledBorder(Graphics g, int x, int y, int w, int h, int c1, int c2)
public static void drawRoundRect(Graphics g, int x, int y, int w, int h)
public static void drawRoundRect(Graphics g, int x, int y, int w, int h, int c1, int c2)
public static void installAntialiasing(Graphics g)
public static void uninstallAntialiasing(Graphics g)
public static void fixHtmlDisplay(JComponent component)
Copyright © 2015. All rights reserved.