com.alee.utils
Class LafUtils

java.lang.Object
  extended by com.alee.utils.LafUtils

public final class LafUtils
extends java.lang.Object

This class provides a set of utilities for core WebLaF components. Created mostly for internal usage within WebLaF.

Author:
Mikle Garin

Field Summary
static int halfButton
          Draws web styled selection using shapes operations.
static int halfLine
           
static int halfSelector
           
static java.awt.geom.AffineTransform moveDown
           
static java.awt.geom.AffineTransform moveLeft
          Predefined transforms to move shapes or painting 1px l/r/u/d.
static java.awt.geom.AffineTransform moveRight
           
static java.awt.geom.AffineTransform moveUp
           
static int shadeWidth
           
 
Constructor Summary
LafUtils()
           
 
Method Summary
static java.awt.geom.GeneralPath createRoundedRectShape(int x, int y, int w, int h, int arcW, int arcH)
          Returns custom rounded rectangle shape
static java.awt.Shape createRoundedShape(int round, int... points)
          Creates rounded shape based on its corner points
static java.awt.Shape createRoundedShape(int round, java.awt.Point... points)
           
static java.awt.Shape createRoundedShape(int round, java.awt.Point[] points, boolean[] rounded)
           
static javax.swing.border.Border createWebBorder(java.awt.Insets insets)
          Creates border for web components.
static javax.swing.border.Border createWebBorder(int margin)
           
static javax.swing.border.Border createWebBorder(int top, int left, int bottom, int right)
           
static void drawAlphaLayer(java.awt.Graphics2D g2d, int x, int y, int width, int height)
           
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 drawAlphaLayer(java.awt.Graphics2D g2d, java.awt.Rectangle rectangle)
          Draws alpha-background
static void drawAlphaLayer(java.awt.Graphics2D g2d, java.awt.Rectangle rectangle, int size)
           
static void drawAlphaLayer(java.awt.Graphics2D g2d, java.awt.Rectangle rectangle, 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 drawCustomWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, 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, FocusType focusType, java.awt.Shape shape, java.lang.Boolean mouseover)
           
static void drawCustomWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, java.awt.Shape shape, java.lang.Boolean mouseover, java.lang.Boolean hasFocus)
           
static void drawDashedRect(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, int stripeLength, int spaceLength)
          Draws dashed rectangle
static void drawDashedRect(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, int stripeLength, int spaceLength, float stripeStart)
           
static void drawEtchedShape(java.awt.Graphics2D g2d, java.awt.image.BufferedImage topBg, java.awt.image.BufferedImage bottomBg, java.awt.Shape fullShape, java.awt.Shape bevelShape)
          Draws etched shape with specified background colors
static boolean drawWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, int shadeWidth, int round)
          Paints web styled focus within the component
static boolean drawWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, int shadeWidth, int round, java.lang.Boolean mouseover)
           
static boolean drawWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, int shadeWidth, int round, java.lang.Boolean mouseover, java.lang.Boolean hasFocus)
           
static boolean drawWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, int shadeWidth, int round, java.lang.Boolean mouseover, java.lang.Boolean hasFocus, java.awt.Color color)
           
static boolean drawWebFocus(java.awt.Graphics2D g2d, javax.swing.JComponent component, FocusType focusType, int shadeWidth, int round, java.lang.Boolean mouseover, java.lang.Boolean hasFocus, java.awt.Color color, java.awt.Stroke stroke)
           
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)
          Paints web styled border within the component with shadow and background if needed
static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d, javax.swing.JComponent component, java.awt.Color shadeColor, int shadeWidth, int round)
           
static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d, javax.swing.JComponent component, java.awt.Color shadeColor, int shadeWidth, int round, boolean fillBackground)
           
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)
           
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, 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, float opacity)
           
static void fillVisible(java.awt.Graphics g, javax.swing.JComponent c)
          Fills either clipped or visible rect
static void fillVisibleBackground(java.awt.Graphics g, javax.swing.JComponent c)
          Fills either clipped or visible rect with component background color if its opaque
static void firePainterChanged(javax.swing.JComponent component, Painter oldPainter, Painter newPainter)
          Fires painter property change event.
static
<T extends Painter>
T
getAdaptedPainter(Painter painter)
          Returns either the specified painter if it is not an adapted painter or the adapted painter.
static BorderMethods getBorderMethods(java.awt.Component component)
          Returns BorderMethods for the specified component or null if custom WebLaF border is not supported.
static java.awt.Rectangle getLabelEditorBounds(WebLabel label, WebTextField editor)
          Returns bounds for editor display atop of the label.
static
<T extends Painter>
T
getProperPainter(Painter painter, java.lang.Class properClass, java.lang.Class adapterClass)
          Returns the specified painter if it can be assigned to proper painter type.
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 component)
          Returns Styleable for the specified component or null if component is not styleable.
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 getTextCenterShear(java.awt.FontMetrics fm, java.lang.String text)
          Returns shear to center text
static int getTextCenterShearX(java.awt.FontMetrics fm, java.lang.String text)
           
static int getTextCenterShearY(java.awt.FontMetrics fm)
           
static
<T extends javax.swing.plaf.ComponentUI>
T
getUI(java.awt.Component component)
          Returns component UI or null if UI cannot be retreived.
static java.awt.Shape getWebBorderShape(javax.swing.JComponent component, int shadeWidth, int round)
           
static java.awt.Shape getWebFocusShape(javax.swing.JComponent component, FocusType focusType, 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 TexturePainter loadTexturePainter(java.lang.Object source)
          Returns TexturePainter which is read from the source.
static TexturePainter loadTexturePainter(ResourceFile resource)
          Returns TexturePainter which is read from specified ResourceFile.
static void nullifyButtonUI(javax.swing.JButton button)
          Nullifies button styles
static void paintTextEffect(java.awt.Graphics2D g2d, java.lang.String s, java.awt.Color c, int size, double tx, double ty, boolean isShadow)
           
static void paintTextGlow(java.awt.Graphics2D g2d, java.lang.String s, java.awt.Color glow)
          Draw a string with a glow effect.
static void paintTextShadow(java.awt.Graphics2D g2d, java.lang.String s)
          Draw a string with a drop shadow.
static void paintTextShadow(java.awt.Graphics2D g2d, java.lang.String s, java.awt.Color c)
          Draw a string with a drop shadow.
static void setScrollBarStyleId(javax.swing.JScrollPane scrollPane, java.lang.String styleId)
          Sets scroll pane bars style ID.
static boolean updateBorder(java.awt.Component component)
          Attempts to update component border if border methods are available for it.
static void updateBorder(javax.swing.JComponent component, java.awt.Insets margin, Painter painter)
          Updates component border using the specified margin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moveLeft

public static final java.awt.geom.AffineTransform moveLeft
Predefined transforms to move shapes or painting 1px l/r/u/d.


moveRight

public static final java.awt.geom.AffineTransform moveRight

moveUp

public static final java.awt.geom.AffineTransform moveUp

moveDown

public static final java.awt.geom.AffineTransform moveDown

halfButton

public static int halfButton
Draws web styled selection using shapes operations. This method is pretty slow and should not be used for multiply selections presentantion


halfSelector

public static int halfSelector

halfLine

public static int halfLine

shadeWidth

public static int shadeWidth
Constructor Detail

LafUtils

public LafUtils()
Method Detail

createWebBorder

public static javax.swing.border.Border createWebBorder(java.awt.Insets insets)
Creates border for web components.


createWebBorder

public static javax.swing.border.Border createWebBorder(int top,
                                                        int left,
                                                        int bottom,
                                                        int right)

createWebBorder

public static javax.swing.border.Border createWebBorder(int margin)

getProperPainter

public static <T extends Painter> T getProperPainter(Painter painter,
                                                     java.lang.Class properClass,
                                                     java.lang.Class adapterClass)
Returns the specified painter if it can be assigned to proper painter type. Otherwise returns newly created adapter painter that wraps the specified painter. Used by component UIs to adapt general-type painters for their specific-type needs.

Type Parameters:
T - proper painter type
Parameters:
painter - processed painter
properClass - proper painter class
adapterClass - adapter painter class
Returns:
specified painter if it can be assigned to proper painter type, new painter adapter if it cannot be assigned

getAdaptedPainter

public static <T extends Painter> T getAdaptedPainter(Painter painter)
Returns either the specified painter if it is not an adapted painter or the adapted painter. Used by component UIs to retrieve painters adapted for their specific needs.

Type Parameters:
T - desired painter type
Parameters:
painter - painter to process
Returns:
either the specified painter if it is not an adapted painter or the adapted painter

firePainterChanged

public static void firePainterChanged(javax.swing.JComponent component,
                                      Painter oldPainter,
                                      Painter newPainter)
Fires painter property change event. This is a workaround since firePropertyChange() method is protected and cannot be called w/o using reflection.

Parameters:
component - component to fire property change to
oldPainter - old painter
newPainter - new painter

setScrollBarStyleId

public static void setScrollBarStyleId(javax.swing.JScrollPane scrollPane,
                                       java.lang.String styleId)
Sets scroll pane bars style ID.

Parameters:
scrollPane - scroll pane to process
styleId - scroll pane bars style ID

getUI

public static <T extends javax.swing.plaf.ComponentUI> T getUI(java.awt.Component component)
Returns component UI or null if UI cannot be retreived.

Type Parameters:
T - UI class type
Parameters:
component - component to retrieve UI from
Returns:
component UI or null if UI cannot be retreived

updateBorder

public static void updateBorder(javax.swing.JComponent component,
                                java.awt.Insets margin,
                                Painter painter)
Updates component border using the specified margin

Parameters:
component - component which border needs to be updated
margin - component margin, or null if it doesn't have one
painter - component painter, or null if it doesn't have one

fillVisibleBackground

public static void fillVisibleBackground(java.awt.Graphics g,
                                         javax.swing.JComponent c)
Fills either clipped or visible rect with component background color if its opaque


fillVisible

public static void fillVisible(java.awt.Graphics g,
                               javax.swing.JComponent c)
Fills either clipped or visible rect


nullifyButtonUI

public static void nullifyButtonUI(javax.swing.JButton button)
Nullifies button styles


createRoundedShape

public static java.awt.Shape createRoundedShape(int round,
                                                int... points)
Creates rounded shape based on its corner points


createRoundedShape

public static java.awt.Shape createRoundedShape(int round,
                                                java.awt.Point... points)

createRoundedShape

public static java.awt.Shape createRoundedShape(int round,
                                                java.awt.Point[] points,
                                                boolean[] rounded)

drawAlphaLayer

public static void drawAlphaLayer(java.awt.Graphics2D g2d,
                                  java.awt.Rectangle rectangle)
Draws alpha-background


drawAlphaLayer

public static void drawAlphaLayer(java.awt.Graphics2D g2d,
                                  int x,
                                  int y,
                                  int width,
                                  int height)

drawAlphaLayer

public static void drawAlphaLayer(java.awt.Graphics2D g2d,
                                  java.awt.Rectangle rectangle,
                                  int size)

drawAlphaLayer

public static void drawAlphaLayer(java.awt.Graphics2D g2d,
                                  int x,
                                  int y,
                                  int width,
                                  int height,
                                  int size)

drawAlphaLayer

public static void drawAlphaLayer(java.awt.Graphics2D g2d,
                                  java.awt.Rectangle rectangle,
                                  int size,
                                  java.awt.Color light,
                                  java.awt.Color dark)

drawAlphaLayer

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)

getTextBounds

public static java.awt.Rectangle getTextBounds(java.lang.String text,
                                               java.awt.Graphics g,
                                               java.awt.Font font)
Determines real text size


getTextBounds

public static java.awt.Rectangle getTextBounds(java.lang.String text,
                                               java.awt.Graphics2D g2d,
                                               java.awt.Font font)

drawWebStyle

public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
                                          javax.swing.JComponent component)
Paints web styled border within the component with shadow and background if needed


drawWebStyle

public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
                                          javax.swing.JComponent component,
                                          java.awt.Color shadeColor,
                                          int shadeWidth,
                                          int round)

drawWebStyle

public static java.awt.Shape drawWebStyle(java.awt.Graphics2D g2d,
                                          javax.swing.JComponent component,
                                          java.awt.Color shadeColor,
                                          int shadeWidth,
                                          int round,
                                          boolean fillBackground)

drawWebStyle

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)

drawWebStyle

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,
                                          float opacity)

drawWebStyle

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)

drawWebStyle

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)

drawWebStyle

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)

getWebGradientPaint

public static java.awt.GradientPaint getWebGradientPaint(java.awt.Rectangle bounds)

getWebGradientPaint

public static java.awt.GradientPaint getWebGradientPaint(int x1,
                                                         int y1,
                                                         int x2,
                                                         int y2)

getWebBorderShape

public static java.awt.Shape getWebBorderShape(javax.swing.JComponent component,
                                               int shadeWidth,
                                               int round)

drawCustomWebBorder

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)
Paints custom shaped web styled border within the component with shadow and background


drawCustomWebBorder

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)

drawWebFocus

public static boolean drawWebFocus(java.awt.Graphics2D g2d,
                                   javax.swing.JComponent component,
                                   FocusType focusType,
                                   int shadeWidth,
                                   int round)
Paints web styled focus within the component


drawWebFocus

public static boolean drawWebFocus(java.awt.Graphics2D g2d,
                                   javax.swing.JComponent component,
                                   FocusType focusType,
                                   int shadeWidth,
                                   int round,
                                   java.lang.Boolean mouseover)

drawWebFocus

public static boolean drawWebFocus(java.awt.Graphics2D g2d,
                                   javax.swing.JComponent component,
                                   FocusType focusType,
                                   int shadeWidth,
                                   int round,
                                   java.lang.Boolean mouseover,
                                   java.lang.Boolean hasFocus)

drawWebFocus

public static boolean drawWebFocus(java.awt.Graphics2D g2d,
                                   javax.swing.JComponent component,
                                   FocusType focusType,
                                   int shadeWidth,
                                   int round,
                                   java.lang.Boolean mouseover,
                                   java.lang.Boolean hasFocus,
                                   java.awt.Color color)

drawWebFocus

public static boolean drawWebFocus(java.awt.Graphics2D g2d,
                                   javax.swing.JComponent component,
                                   FocusType focusType,
                                   int shadeWidth,
                                   int round,
                                   java.lang.Boolean mouseover,
                                   java.lang.Boolean hasFocus,
                                   java.awt.Color color,
                                   java.awt.Stroke stroke)

getWebFocusShape

public static java.awt.Shape getWebFocusShape(javax.swing.JComponent component,
                                              FocusType focusType,
                                              int shadeWidth,
                                              int round)

drawCustomWebFocus

public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
                                      javax.swing.JComponent component,
                                      FocusType focusType,
                                      java.awt.Shape shape)
Draws custom shaped web styled focus within the component


drawCustomWebFocus

public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
                                      javax.swing.JComponent component,
                                      FocusType focusType,
                                      java.awt.Shape shape,
                                      java.lang.Boolean mouseover)

drawCustomWebFocus

public static void drawCustomWebFocus(java.awt.Graphics2D g2d,
                                      javax.swing.JComponent component,
                                      FocusType focusType,
                                      java.awt.Shape shape,
                                      java.lang.Boolean mouseover,
                                      java.lang.Boolean hasFocus)

drawWebSelection

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)

drawWebSelection

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)

drawWebSelection

public static void drawWebSelection(java.awt.Graphics2D g2d,
                                    java.awt.Color color,
                                    java.awt.Rectangle selection,
                                    boolean resizableLR,
                                    boolean resizableUD,
                                    boolean drawConnectors)

drawWebSelection

public static void drawWebSelection(java.awt.Graphics2D g2d,
                                    java.awt.Color color,
                                    java.awt.Rectangle selection,
                                    boolean resizableLR,
                                    boolean resizableUD,
                                    boolean drawConnectors,
                                    boolean drawSideControls)

drawWebSelector

public static void drawWebSelector(java.awt.Graphics2D g2d,
                                   java.awt.Color color,
                                   java.awt.Rectangle selection,
                                   int selector)

drawWebIconedSelection

public static void drawWebIconedSelection(java.awt.Graphics2D g2d,
                                          java.awt.Rectangle selection,
                                          boolean resizableLR,
                                          boolean resizableUD,
                                          boolean drawConnectors)

drawWebIconedSelection

public static void drawWebIconedSelection(java.awt.Graphics2D g2d,
                                          java.awt.Rectangle selection,
                                          boolean resizableLR,
                                          boolean resizableUD,
                                          boolean drawConnectors,
                                          boolean drawSideControls)

drawWebIconedSelector

public static void drawWebIconedSelector(java.awt.Graphics2D g2d,
                                         java.awt.Rectangle selection,
                                         int selector)

drawWebIconedGripper

public static void drawWebIconedGripper(java.awt.Graphics2D g2d,
                                        java.awt.Point point)

drawWebIconedGripper

public static void drawWebIconedGripper(java.awt.Graphics2D g2d,
                                        int x,
                                        int y)

drawEtchedShape

public static void drawEtchedShape(java.awt.Graphics2D g2d,
                                   java.awt.image.BufferedImage topBg,
                                   java.awt.image.BufferedImage bottomBg,
                                   java.awt.Shape fullShape,
                                   java.awt.Shape bevelShape)
Draws etched shape with specified background colors


paintTextShadow

public static void paintTextShadow(java.awt.Graphics2D g2d,
                                   java.lang.String s)
Draw a string with a drop shadow. The light angle is assumed to be 0 degrees, (i.e., window is illuminated from top) and the shadow size is 2, with a 1 pixel vertical displacement. The shadow is intended to be subtle to be usable in as many text components as possible. The shadow is generated with multiple calls to draw string. This method paints the text on coordinates 0, 1. If text should be painted elsewhere, a transform should be applied to the graphics before passing it.


paintTextShadow

public static void paintTextShadow(java.awt.Graphics2D g2d,
                                   java.lang.String s,
                                   java.awt.Color c)
Draw a string with a drop shadow. The light angle is assumed to be 0 degrees, (i.e., window is illuminated from top) and the shadow size is 2, with a 1 pixel vertical displacement. The shadow is intended to be subtle to be usable in as many text components as possible. The shadow is generated with multiple calls to draw string. This method paints the text on coordinates 0, 1. If text should be painted elsewhere, a transform should be applied to the graphics before passing it.


paintTextGlow

public static void paintTextGlow(java.awt.Graphics2D g2d,
                                 java.lang.String s,
                                 java.awt.Color glow)
Draw a string with a glow effect. Glow differs from a drop shadow in that it isn't offset in any direction (i.e., not affected by "lighting conditions").


paintTextEffect

public static void paintTextEffect(java.awt.Graphics2D g2d,
                                   java.lang.String s,
                                   java.awt.Color c,
                                   int size,
                                   double tx,
                                   double ty,
                                   boolean isShadow)

drawDashedRect

public static void drawDashedRect(java.awt.Graphics2D g2d,
                                  int x1,
                                  int y1,
                                  int x2,
                                  int y2,
                                  int stripeLength,
                                  int spaceLength)
Draws dashed rectangle


drawDashedRect

public static void drawDashedRect(java.awt.Graphics2D g2d,
                                  int x1,
                                  int y1,
                                  int x2,
                                  int y2,
                                  int stripeLength,
                                  int spaceLength,
                                  float stripeStart)

createRoundedRectShape

public static java.awt.geom.GeneralPath createRoundedRectShape(int x,
                                                               int y,
                                                               int w,
                                                               int h,
                                                               int arcW,
                                                               int arcH)
Returns custom rounded rectangle shape


getTextCenterShear

public static java.awt.Point getTextCenterShear(java.awt.FontMetrics fm,
                                                java.lang.String text)
Returns shear to center text


getTextCenterShearX

public static int getTextCenterShearX(java.awt.FontMetrics fm,
                                      java.lang.String text)

getTextCenterShearY

public static int getTextCenterShearY(java.awt.FontMetrics fm)

updateBorder

public static boolean updateBorder(java.awt.Component component)
Attempts to update component border if border methods are available for it. Returns whether attempt has succeed or not.

Parameters:
component - component which border should be updated
Returns:
true if attempt has succeed, false otherwise

getBorderMethods

public static BorderMethods getBorderMethods(java.awt.Component component)
Returns BorderMethods for the specified component or null if custom WebLaF border is not supported.

Parameters:
component - component to process
Returns:
BorderMethods for the specified component or null if custom WebLaF border is not supported

getShapeProvider

public static ShapeProvider getShapeProvider(java.awt.Component component)
Returns shape provider for the specified component or null if shape provider is not supported. This might be used to provide dynamic component shape to other components.

Parameters:
component - component to process
Returns:
shape provider for the specified component or null if shape provider is not supported

getStyleable

public static Styleable getStyleable(java.awt.Component component)
Returns Styleable for the specified component or null if component is not styleable.

Parameters:
component - component to process
Returns:
Styleable for the specified component or null if component is not styleable

getLabelEditorBounds

public static java.awt.Rectangle getLabelEditorBounds(WebLabel label,
                                                      WebTextField editor)
Returns bounds for editor display atop of the label.

Parameters:
label - edited label
editor - label editor field
Returns:
bounds for editor display atop of the label

loadTexturePainter

public static TexturePainter loadTexturePainter(java.lang.Object source)
Returns TexturePainter which is read from the source.

Parameters:
source - one of possible sources: URL, String, File, Reader, InputStream
Returns:
TexturePainter

loadTexturePainter

public static TexturePainter loadTexturePainter(ResourceFile resource)
Returns TexturePainter which is read from specified ResourceFile.

Parameters:
resource - file description
Returns:
TexturePainter