|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.substance.SubstanceImageCreator
public final class SubstanceImageCreator
Provides utility functions for creating various images for Substance look and feel. This class is for internal use only.
Constructor Summary | |
---|---|
SubstanceImageCreator()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
getArrow(int width,
int height,
float strokeWidth,
int direction,
SubstanceTheme theme)
Retrieves arrow image. |
static javax.swing.Icon |
getArrowIcon(int width,
int height,
float strokeWidth,
int direction,
SubstanceTheme theme)
Retrieves arrow icon. |
static javax.swing.Icon |
getArrowIcon(int fontSize,
int deltaWidth,
int deltaHeight,
float deltaStrokeWidth,
int direction,
SubstanceTheme theme)
Returns arrow icon for the specified parameters. |
static javax.swing.Icon |
getArrowIcon(int fontSize,
int direction,
SubstanceTheme theme)
Returns arrow icon for the specified parameters. |
static java.awt.Image |
getBigHexaMarker(int value,
SubstanceTheme theme)
Returns big icon representation of the specified integer value. |
static java.awt.image.BufferedImage |
getCheckBox(int dimension,
ComponentState componentState)
Retrieves check box of the specified size that matches the specified component state. |
static java.awt.image.BufferedImage |
getCheckBox(javax.swing.JComponent component,
int dimension,
ComponentState componentState,
SubstanceTheme theme1,
SubstanceTheme theme2,
float interpolationCyclePos10,
float checkMarkVisibility)
Retrieves check box of the specified size that matches the specified component state. |
static javax.swing.Icon |
getCloseIcon(int iSize,
ColorScheme colorScheme)
Returns close icon. |
static javax.swing.Icon |
getCloseIcon(int iSize,
SubstanceTheme theme)
Returns close icon. |
static javax.swing.Icon |
getCloseIcon(SubstanceTheme theme)
Returns close icon. |
static java.awt.image.BufferedImage |
getCompositeRoundedBackground(javax.swing.JComponent component,
int width,
int height,
int cornerRadius,
javax.swing.AbstractButton decrButton,
javax.swing.AbstractButton incrButton,
boolean flipSides)
Retrieves composite background for the specified parameters. |
static java.awt.Image |
getCrayonsImage()
Retrieves crayons image for the crayon panel of color chooser. |
static javax.swing.Icon |
getDoubleArrowIcon(int width,
int height,
float strokeWidth,
int direction,
SubstanceTheme theme)
Retrieves arrow icon. |
static javax.swing.Icon |
getDoubleArrowIcon(int fontSize,
int deltaWidth,
int deltaHeight,
float deltaStrokeWidth,
int direction,
SubstanceTheme theme)
Returns double arrow icon for the specified parameters. |
static javax.swing.Icon |
getDoubleArrowIcon(int fontSize,
int direction,
SubstanceTheme theme)
Returns double arrow icon for the specified parameters. |
static java.awt.image.BufferedImage |
getDragImage(java.awt.Component c,
SubstanceTheme theme,
boolean alwaysUseActive,
int width,
int height,
boolean isCrowded,
int maxNumberOfStripes)
Returns drag bumps image. |
static javax.swing.Icon |
getHexaMarker(int value,
SubstanceTheme theme)
Returns small icon representation of the specified integer value. |
static javax.swing.Icon |
getMaximizeIcon(int iSize,
SubstanceTheme theme)
Returns maximize icon. |
static javax.swing.Icon |
getMaximizeIcon(SubstanceTheme theme)
Returns maximize icon. |
static javax.swing.Icon |
getMinimizeIcon(int iSize,
SubstanceTheme theme)
Returns minimize icon. |
static javax.swing.Icon |
getMinimizeIcon(SubstanceTheme theme)
Returns minimize icon. |
static java.awt.image.BufferedImage |
getNegated(java.awt.image.BufferedImage bi)
Returns the negative of the specified image. |
static java.awt.image.BufferedImage |
getOneLineGradient(int width,
java.awt.Color colorLeft,
java.awt.Color colorRight,
java.util.Map<java.lang.Integer,java.awt.Color> waypoints)
Returns a one-pixel high line of the specified width that has gradient based on the parameters. |
static java.awt.image.BufferedImage |
getRadioButton(int dimension,
ComponentState componentState,
int offsetX)
Retrieves radio button of the specified size that matches the specified component state. |
static java.awt.image.BufferedImage |
getRadioButton(javax.swing.JComponent component,
int dimension,
ComponentState componentState,
int offsetX,
SubstanceTheme theme1,
SubstanceTheme theme2,
float interpolationCyclePos10,
float checkMarkVisibility)
Retrieves radio button of the specified size that matches the specified parameters. |
static java.awt.image.BufferedImage |
getResizeGripImage(java.awt.Component c,
SubstanceTheme theme,
boolean alwaysUseActive,
int dimension,
boolean isCrowded)
Returns resize grip image. |
static javax.swing.Icon |
getRestoreIcon(SubstanceTheme theme)
Returns restore icon. |
static java.awt.image.BufferedImage |
getRotated(java.awt.image.BufferedImage bi,
int quadrantClockwise)
Returns rotated image. |
static javax.swing.Icon |
getSearchIcon(int dimension,
SubstanceTheme theme,
boolean leftToRight)
Returns search icon. |
static java.awt.image.BufferedImage |
getSingleCrayon(java.awt.Color mainColor,
int width,
int height)
Retrieves a single crayon of the specified color and dimensions for the crayon panel in color chooser. |
static javax.swing.Icon |
getSmallLockIcon(ColorScheme scheme)
Returns a lock icon that matches the specified scheme. |
static java.awt.image.BufferedImage |
getStripe(int baseSize,
java.awt.Color color)
Returns diagonal stripe image. |
static javax.swing.Icon |
getThemeIcon(SubstanceTheme theme)
Returns an icon that matches the specified theme. |
static java.awt.image.BufferedImage |
getThemeImage(java.awt.image.BufferedImage original,
SubstanceTheme theme,
boolean toSaturate)
Creates a new version of the specified image that is rendered in the colors of the specified theme. |
static java.awt.image.BufferedImage |
getThemeImage(java.awt.Component comp,
javax.swing.Icon original,
SubstanceTheme theme,
boolean toSaturate)
Creates a new version of the specified icon that is rendered in the colors of the specified theme. |
static java.awt.image.BufferedImage |
getTreeIcon(int fontSize,
javax.swing.JTree tree,
ColorScheme colorScheme,
boolean isDark,
boolean isCollapsed)
Retrieves tree icon. |
static javax.swing.Icon |
getWatermarkIcon(SubstanceWatermark watermark)
Returns an icon that matches the specified watermark. |
static javax.swing.Icon |
makeTransparent(java.awt.Component c,
javax.swing.Icon icon,
double alpha)
Makes the specified icon transparent. |
static java.awt.image.BufferedImage |
overlayEcho(java.awt.image.BufferedImage image,
float echoAlpha,
int offsetX,
int offsetY)
Overlays light-colored echo below the specified image. |
static void |
paintBorder(java.awt.Component c,
java.awt.Graphics2D graphics,
int x,
int y,
int width,
int height,
float radius,
ColorScheme borderScheme)
Paints border instance of specified dimensions and status. |
static void |
paintBorder(java.awt.Component c,
java.awt.Graphics2D graphics,
int x,
int y,
int width,
int height,
float radius,
SubstanceTheme theme)
Paints border instance of specified dimensions and status. |
static void |
paintOneLineGradient(java.awt.Graphics2D graphics,
int x,
int y,
int dimension,
boolean isVertical,
java.awt.Color colorLeft,
java.awt.Color colorRight,
java.util.Map<java.lang.Integer,java.awt.Color> waypoints)
Paints a one-pixel high line of the specified width that has gradient based on the parameters. |
static void |
paintRectangularBackground(java.awt.Graphics g,
int startX,
int startY,
int width,
int height,
ColorScheme colorScheme,
float borderAlpha,
boolean isVertical)
Paints rectangular gradient background. |
static void |
paintRectangularStripedBackground(java.awt.Graphics g,
int startX,
int startY,
int width,
int height,
ColorScheme colorScheme,
java.awt.image.BufferedImage stripeImage,
int stripeOffset,
float borderAlpha,
boolean isVertical)
Paints rectangular gradient background with spots and optional replicated stripe image. |
static javax.swing.Icon |
toGreyscale(javax.swing.Icon icon)
Translated the specified icon to grey scale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubstanceImageCreator()
Method Detail |
---|
public static void paintBorder(java.awt.Component c, java.awt.Graphics2D graphics, int x, int y, int width, int height, float radius, ColorScheme borderScheme)
c
- Component.graphics
- Graphics context.x
- Component left X (in graphics context).y
- Component top Y (in graphics context).width
- Border width.height
- Border height.radius
- Border radius.borderScheme
- Border color scheme.public static void paintBorder(java.awt.Component c, java.awt.Graphics2D graphics, int x, int y, int width, int height, float radius, SubstanceTheme theme)
c
- Component.graphics
- Graphics context.x
- Component left X (in graphics context).y
- Component top Y (in graphics context).width
- Border width.height
- Border height.radius
- Border radius.theme
- Border theme.public static javax.swing.Icon getArrowIcon(int fontSize, int direction, SubstanceTheme theme)
fontSize
- Font size.direction
- Arrow direction.theme
- Icon theme.
public static javax.swing.Icon getArrowIcon(int fontSize, int deltaWidth, int deltaHeight, float deltaStrokeWidth, int direction, SubstanceTheme theme)
fontSize
- Font size.deltaWidth
- Arrow width delta.deltaHeight
- Arrow height delta.deltaStrokeWidth
- Arrow stroke width delta.direction
- Arrow direction.theme
- Icon theme.
public static javax.swing.Icon getArrowIcon(int width, int height, float strokeWidth, int direction, SubstanceTheme theme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.theme
- Theme for the arrow.
SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
public static java.awt.image.BufferedImage getArrow(int width, int height, float strokeWidth, int direction, SubstanceTheme theme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.theme
- Theme for the arrow.
SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
public static javax.swing.Icon getDoubleArrowIcon(int fontSize, int direction, SubstanceTheme theme)
fontSize
- Font size.direction
- Arrow direction.theme
- Icon theme.
public static javax.swing.Icon getDoubleArrowIcon(int fontSize, int deltaWidth, int deltaHeight, float deltaStrokeWidth, int direction, SubstanceTheme theme)
fontSize
- Font size.deltaWidth
- Arrow width delta.deltaHeight
- Arrow height delta.deltaStrokeWidth
- Arrow stroke width delta.direction
- Arrow direction.theme
- Icon theme.
public static javax.swing.Icon getDoubleArrowIcon(int width, int height, float strokeWidth, int direction, SubstanceTheme theme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.theme
- Theme for the arrow.
SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
public static java.awt.image.BufferedImage getRotated(java.awt.image.BufferedImage bi, int quadrantClockwise)
bi
- Image to rotate.quadrantClockwise
- Amount of quadrants to rotate in clockwise directio. The
rotation angle is 90 times this value.
public static javax.swing.Icon toGreyscale(javax.swing.Icon icon)
icon
- Icon.
public static javax.swing.Icon makeTransparent(java.awt.Component c, javax.swing.Icon icon, double alpha)
c
- Component.icon
- Icon.alpha
- The opaqueness of the resulting image. The closer this value
is to 0.0, the more transparent resulting image will be.
public static java.awt.image.BufferedImage getRadioButton(int dimension, ComponentState componentState, int offsetX)
dimension
- Radio button size.componentState
- Component state.offsetX
- Offset in X axis.
public static java.awt.image.BufferedImage getRadioButton(javax.swing.JComponent component, int dimension, ComponentState componentState, int offsetX, SubstanceTheme theme1, SubstanceTheme theme2, float interpolationCyclePos10, float checkMarkVisibility)
component
- Component.dimension
- Radio button dimension.componentState
- Component state.offsetX
- Offset on X axis - should be positive in order to see the
entire radio button.theme1
- Theme 1.theme2
- Theme 2.interpolationCyclePos10
- Interpolation cycle.checkMarkVisibility
- Checkmark visibility in 0.0-1.0 range.
public static java.awt.image.BufferedImage getCheckBox(int dimension, ComponentState componentState)
dimension
- Check box size.componentState
- Component state.
public static java.awt.image.BufferedImage getCheckBox(javax.swing.JComponent component, int dimension, ComponentState componentState, SubstanceTheme theme1, SubstanceTheme theme2, float interpolationCyclePos10, float checkMarkVisibility)
component
- Component.dimension
- Check box size.componentState
- Component state.theme1
- Theme 1.theme2
- Theme 2.interpolationCyclePos10
- Interpolation cycle.checkMarkVisibility
- Checkmark visibility in 0.0-1.0 range.
public static java.awt.image.BufferedImage getCompositeRoundedBackground(javax.swing.JComponent component, int width, int height, int cornerRadius, javax.swing.AbstractButton decrButton, javax.swing.AbstractButton incrButton, boolean flipSides)
increased
state.
decreased
state.
component
- Component.width
- Image width.height
- Image height.cornerRadius
- Corner radius.decrButton
- The decrease
button.incrButton
- The increase
button.flipSides
- If true
, the drawn halves of the first and the
second layers above will be swapped.
public static java.awt.image.BufferedImage getOneLineGradient(int width, java.awt.Color colorLeft, java.awt.Color colorRight, java.util.Map<java.lang.Integer,java.awt.Color> waypoints)
width
- The width of the resulting image.colorLeft
- The color of the leftmost pixel.colorRight
- The color of the rightmost pixel.waypoints
- Each entry in this map specifies color for some
waypoint
. The pixels between the waypoints
will be colored based on the interpolation of the two closest
waypoints.
public static void paintOneLineGradient(java.awt.Graphics2D graphics, int x, int y, int dimension, boolean isVertical, java.awt.Color colorLeft, java.awt.Color colorRight, java.util.Map<java.lang.Integer,java.awt.Color> waypoints)
graphics
- Graphics context.x
- X start coordinate.y
- Y start coordinate.dimension
- The dimension of the resulting image. If
isVertical
parameter is true
,
the resulting painting will be 1 pixel high and
dimension
pixels wide, otherwise it will be
dimension
pixels high and 1 pixel wide.isVertical
- Indication of horizontal / vertical orientation.colorLeft
- The color of the leftmost pixel.colorRight
- The color of the rightmost pixel.waypoints
- Each entry in this map specifies color for some
waypoint
. The pixels between the waypoints
will be colored based on the interpolation of the two closest
waypoints.public static java.awt.image.BufferedImage overlayEcho(java.awt.image.BufferedImage image, float echoAlpha, int offsetX, int offsetY)
image
- The input image.echoAlpha
- Alpha channel for the echo image.offsetX
- X offset of the echo.offsetY
- Y offset of the echo.
public static javax.swing.Icon getMinimizeIcon(SubstanceTheme theme)
minimize
icon.
theme
- Theme for the icon.
Minimize
icon.public static javax.swing.Icon getMinimizeIcon(int iSize, SubstanceTheme theme)
minimize
icon.
iSize
- Icon dimension.theme
- Theme for the icon.
Minimize
icon.public static javax.swing.Icon getRestoreIcon(SubstanceTheme theme)
restore
icon.
theme
- Theme for the icon.
Restore
icon.public static javax.swing.Icon getMaximizeIcon(SubstanceTheme theme)
maximize
icon.
theme
- Theme for the icon.
Maximize
icon.public static javax.swing.Icon getMaximizeIcon(int iSize, SubstanceTheme theme)
maximize
icon.
iSize
- Icon dimension.theme
- Theme for the icon.
Maximize
icon.public static javax.swing.Icon getCloseIcon(SubstanceTheme theme)
close
icon.
theme
- Theme for the icon.
Close
icon.public static javax.swing.Icon getCloseIcon(int iSize, SubstanceTheme theme)
close
icon.
iSize
- Icon dimension.theme
- Theme for the icon.
Close
icon.public static javax.swing.Icon getCloseIcon(int iSize, ColorScheme colorScheme)
close
icon.
iSize
- Icon dimension.colorScheme
- Color scheme for the icon.
Close
icon.public static void paintRectangularBackground(java.awt.Graphics g, int startX, int startY, int width, int height, ColorScheme colorScheme, float borderAlpha, boolean isVertical)
g
- Graphic context.startX
- Background starting X coord.startY
- Background starting Y coord.width
- Background width.height
- Background height.colorScheme
- Color scheme for the background.borderAlpha
- Border alpha.isVertical
- if true
, the gradient will be vertical, if
false
, the gradient will be horizontal.public static void paintRectangularStripedBackground(java.awt.Graphics g, int startX, int startY, int width, int height, ColorScheme colorScheme, java.awt.image.BufferedImage stripeImage, int stripeOffset, float borderAlpha, boolean isVertical)
g
- Graphics context.startX
- X start coordinate.startY
- Y start coordinate.width
- Background width.height
- Background height.colorScheme
- Color scheme for the background.stripeImage
- Stripe image to replicate.stripeOffset
- Offset of the first stripe replication.borderAlpha
- Border alpha.isVertical
- Indication of horizontal / vertical orientation.public static java.awt.image.BufferedImage getStripe(int baseSize, java.awt.Color color)
baseSize
- Stripe base in pixels.color
- Stripe color.
public static java.awt.image.BufferedImage getDragImage(java.awt.Component c, SubstanceTheme theme, boolean alwaysUseActive, int width, int height, boolean isCrowded, int maxNumberOfStripes)
c
- Component.theme
- Theme.alwaysUseActive
- Indicates whether the active theme should always be used.width
- Drag bumps width.height
- Drag bumps height.isCrowded
- Indicates whether the bumps should be painted closely.
public static java.awt.image.BufferedImage getResizeGripImage(java.awt.Component c, SubstanceTheme theme, boolean alwaysUseActive, int dimension, boolean isCrowded)
c
- Component.theme
- Theme.alwaysUseActive
- Indicates whether the active theme should always be used.dimension
- Resize grip width.isCrowded
- Indicates whether the grips should be painted closely.
public static java.awt.image.BufferedImage getTreeIcon(int fontSize, javax.swing.JTree tree, ColorScheme colorScheme, boolean isDark, boolean isCollapsed)
fontSize
- Font size.tree
- Tree.colorScheme
- Color scheme.isDark
- Indication whether the color scheme is drak.isCollapsed
- Collapsed state.
public static java.awt.image.BufferedImage getSingleCrayon(java.awt.Color mainColor, int width, int height)
mainColor
- Crayon main color.width
- Crayon width.height
- Crayon height.
public static java.awt.Image getCrayonsImage()
public static javax.swing.Icon getHexaMarker(int value, SubstanceTheme theme)
value
- Integer value to represent.theme
- Icon theme.
public static java.awt.Image getBigHexaMarker(int value, SubstanceTheme theme)
value
- Integer value to represent.theme
- Icon theme.
public static javax.swing.Icon getSearchIcon(int dimension, SubstanceTheme theme, boolean leftToRight)
dimension
- Icon dimension.theme
- Icon theme.leftToRight
- LTR indication of the resulting icon.
public static javax.swing.Icon getThemeIcon(SubstanceTheme theme)
theme
- Theme instance.
public static javax.swing.Icon getWatermarkIcon(SubstanceWatermark watermark)
watermark
- Watermark instance.
public static javax.swing.Icon getSmallLockIcon(ColorScheme scheme)
scheme
- Scheme instance.
public static java.awt.image.BufferedImage getNegated(java.awt.image.BufferedImage bi)
bi
- Image.
public static java.awt.image.BufferedImage getThemeImage(java.awt.Component comp, javax.swing.Icon original, SubstanceTheme theme, boolean toSaturate)
comp
- Component.original
- The original icon.theme
- Theme.toSaturate
- Indicates whether the resulting image should be saturated.
public static java.awt.image.BufferedImage getThemeImage(java.awt.image.BufferedImage original, SubstanceTheme theme, boolean toSaturate)
original
- The original image.theme
- Theme.toSaturate
- Indicates whether the resulting image should be saturated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |