public final class LafUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
halfButton
Draws web styled selection using shapes operations.
|
static int |
halfLine |
static int |
halfSelector |
static int |
shadeWidth |
| Constructor and Description |
|---|
LafUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height)
Draws alpha-background
|
static void |
drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height,
int size) |
static void |
drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height,
int size,
java.awt.Color light,
java.awt.Color dark) |
static void |
drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored)
Paints custom shaped web styled border within the component with shadow and background
|
static void |
drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder) |
static void |
drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
java.awt.Color backgroundColor) |
static void |
drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape)
Draws custom shaped web styled focus within the component
|
static void |
drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape,
java.lang.Boolean mouseover) |
static void |
drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape,
java.lang.Boolean mouseover,
java.lang.Boolean hasFocus) |
static void |
drawWebIconedGripper(java.awt.Graphics2D g2d,
int x,
int y) |
static void |
drawWebIconedGripper(java.awt.Graphics2D g2d,
java.awt.Point point) |
static void |
drawWebIconedSelection(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors) |
static void |
drawWebIconedSelection(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls) |
static void |
drawWebIconedSelector(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
int selector) |
static void |
drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
int x,
int y,
int width,
int height,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors) |
static void |
drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
int x,
int y,
int width,
int height,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls) |
static void |
drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors) |
static void |
drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls) |
static void |
drawWebSelector(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
int selector) |
static java.awt.Shape |
drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored)
Deprecated.
|
static java.awt.Shape |
drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border) |
static java.awt.Shape |
drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder) |
static java.awt.Shape |
drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
java.awt.Color background,
float opacity) |
static java.awt.Shape |
drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
float opacity) |
static java.awt.Insets |
getInsets(java.awt.Component component)
Returns current component border insets if it is supported.
|
static java.awt.Insets |
getMargin(java.awt.Component component)
Returns current component margin if it is supported.
|
static java.awt.Insets |
getPadding(java.awt.Component component)
Returns current component padding if it is supported.
|
static ShapeProvider |
getShapeProvider(java.awt.Component component)
Returns shape provider for the specified component or null if shape provider is not supported.
|
static Styleable |
getStyleable(java.awt.Component c)
Returns styleable element for the specified component.
|
static Styleable |
getStyleable(javax.swing.plaf.ComponentUI ui)
Returns styleable element for the specified ui.
|
static java.awt.Rectangle |
getTextBounds(java.lang.String text,
java.awt.Graphics2D g2d,
java.awt.Font font) |
static java.awt.Rectangle |
getTextBounds(java.lang.String text,
java.awt.Graphics g,
java.awt.Font font)
Determines real text size
|
static java.awt.Point |
getTextCenterShift(java.awt.FontMetrics metrics,
java.lang.String text)
Returns X and Y shift for the specified text and font metrics.
|
static int |
getTextCenterShiftX(java.awt.FontMetrics metrics,
java.lang.String text)
Returns X shift for the specified text and font metrics.
|
static int |
getTextCenterShiftY(java.awt.FontMetrics metrics)
Returns Y shift for the specified font metrics.
|
static <T extends javax.swing.plaf.ComponentUI> |
getUI(java.awt.Component component)
Returns component UI or null if UI cannot be retrieved.
|
static java.awt.Shape |
getWebBorderShape(javax.swing.JComponent component,
int shadeWidth,
int round) |
static java.awt.GradientPaint |
getWebGradientPaint(int x1,
int y1,
int x2,
int y2) |
static java.awt.GradientPaint |
getWebGradientPaint(java.awt.Rectangle bounds) |
static boolean |
isInDecoratedWindow(java.awt.Component component)
Returns whether window in which specified component located is decorated by L&F or not.
|
static TexturePainter |
loadTexturePainter(java.lang.Object source)
Returns TexturePainter which is read from the source.
|
static TexturePainter |
loadTexturePainter(com.alee.utils.xml.ResourceFile resource)
Returns TexturePainter which is read from specified ResourceFile.
|
static boolean |
setupLookAndFeelSafely(java.lang.Class<? extends javax.swing.LookAndFeel> clazz)
Installs specified L&F as current application's L&F.
|
static boolean |
setupLookAndFeelSafely(java.lang.String className)
Installs specified L&F as current application's L&F.
|
public static int halfButton
public static int halfSelector
public static int halfLine
public static int shadeWidth
public static boolean isInDecoratedWindow(java.awt.Component component)
component - component used to determine window decoration statepublic static java.awt.Insets getMargin(java.awt.Component component)
component - component to retrieve margin frompublic static java.awt.Insets getPadding(java.awt.Component component)
component - component to retrieve padding frompublic static java.awt.Insets getInsets(java.awt.Component component)
component - component to retrieve border insets frompublic static <T extends javax.swing.plaf.ComponentUI> T getUI(java.awt.Component component)
T - UI class typecomponent - component to retrieve UI frompublic static void drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height)
public static void drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height,
int size)
public static void drawAlphaLayer(java.awt.Graphics2D g2d,
int x,
int y,
int width,
int height,
int size,
java.awt.Color light,
java.awt.Color dark)
public static java.awt.Rectangle getTextBounds(java.lang.String text,
java.awt.Graphics g,
java.awt.Font font)
public static java.awt.Rectangle getTextBounds(java.lang.String text,
java.awt.Graphics2D g2d,
java.awt.Font font)
@Deprecated
public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored)
public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border)
public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder)
public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
float opacity)
public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Color shadeColor,
int shadeWidth,
int round,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
java.awt.Color background,
float opacity)
public static java.awt.GradientPaint getWebGradientPaint(java.awt.Rectangle bounds)
public static java.awt.GradientPaint getWebGradientPaint(int x1,
int y1,
int x2,
int y2)
public static java.awt.Shape getWebBorderShape(javax.swing.JComponent component,
int shadeWidth,
int round)
public static void drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored)
public static void drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder)
public static void drawCustomWebBorder(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
java.awt.Shape borderShape,
java.awt.Color shadeColor,
int shadeWidth,
boolean fillBackground,
boolean webColored,
java.awt.Color border,
java.awt.Color disabledBorder,
java.awt.Color backgroundColor)
public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape)
public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape,
java.lang.Boolean mouseover)
public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
javax.swing.JComponent component,
com.alee.utils.laf.FocusType focusType,
java.awt.Shape shape,
java.lang.Boolean mouseover,
java.lang.Boolean hasFocus)
public static void drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
int x,
int y,
int width,
int height,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors)
public static void drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
int x,
int y,
int width,
int height,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls)
public static void drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors)
public static void drawWebSelection(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls)
public static void drawWebSelector(java.awt.Graphics2D g2d,
java.awt.Color color,
java.awt.Rectangle selection,
int selector)
public static void drawWebIconedSelection(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors)
public static void drawWebIconedSelection(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
boolean resizableLR,
boolean resizableUD,
boolean drawConnectors,
boolean drawSideControls)
public static void drawWebIconedSelector(java.awt.Graphics2D g2d,
java.awt.Rectangle selection,
int selector)
public static void drawWebIconedGripper(java.awt.Graphics2D g2d,
java.awt.Point point)
public static void drawWebIconedGripper(java.awt.Graphics2D g2d,
int x,
int y)
public static java.awt.Point getTextCenterShift(java.awt.FontMetrics metrics,
java.lang.String text)
metrics - font metricstext - textpublic static int getTextCenterShiftX(java.awt.FontMetrics metrics,
java.lang.String text)
metrics - font metricstext - textpublic static int getTextCenterShiftY(java.awt.FontMetrics metrics)
metrics - font metricspublic static ShapeProvider getShapeProvider(java.awt.Component component)
component - component to processpublic static Styleable getStyleable(java.awt.Component c)
c - component to retrieve styleable element forpublic static Styleable getStyleable(javax.swing.plaf.ComponentUI ui)
ui - ui to retrieve styleable element forpublic static TexturePainter loadTexturePainter(java.lang.Object source)
source - one of possible sources: URL, String, File, Reader, InputStreampublic static TexturePainter loadTexturePainter(com.alee.utils.xml.ResourceFile resource)
resource - file descriptionpublic static boolean setupLookAndFeelSafely(java.lang.Class<? extends javax.swing.LookAndFeel> clazz)
clazz - L&F classpublic static boolean setupLookAndFeelSafely(java.lang.String className)
className - L&F canonical class name