public final class SubstanceImageCreator
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
SubstanceImageCreator.SimplisticSoftBorderReverseFillPainter |
Custom fill painter for filling the checkmarks of checkboxes and radio
buttons.
|
Constructor | Description |
---|---|
SubstanceImageCreator() |
Modifier and Type | Method | Description |
---|---|---|
static java.awt.image.BufferedImage |
getArrow(float width,
float height,
float strokeWidth,
int direction,
SubstanceColorScheme scheme) |
Retrieves arrow image.
|
static javax.swing.Icon |
getArrowIcon(float width,
float height,
float strokeWidth,
int direction,
SubstanceColorScheme scheme) |
Retrieves arrow icon.
|
static javax.swing.Icon |
getArrowIcon(int fontSize,
int direction,
SubstanceColorScheme colorScheme) |
Returns arrow icon for the specified parameters.
|
static java.awt.image.BufferedImage |
getCheckBox(javax.swing.AbstractButton button,
SubstanceFillPainter fillPainter,
SubstanceBorderPainter borderPainter,
int dimension,
ComponentState componentState,
SubstanceColorScheme fillColorScheme,
SubstanceColorScheme markColorScheme,
SubstanceColorScheme borderColorScheme,
float checkMarkVisibility,
boolean isCheckMarkFadingOut) |
Retrieves check box of the specified size that matches the specified
component state.
|
static javax.swing.Icon |
getCloseIcon(int iSize,
SubstanceColorScheme colorScheme,
SubstanceColorScheme backgroundScheme) |
Returns
close icon. |
static javax.swing.Icon |
getCloseIcon(SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
Returns
close icon. |
static java.awt.image.BufferedImage |
getColorSchemeImage(java.awt.Component comp,
javax.swing.Icon original,
SubstanceColorScheme colorScheme,
float originalBrightnessFactor) |
Creates a new version of the specified icon that is rendered in the
colors of the specified color scheme.
|
static java.awt.image.BufferedImage |
getColorSchemeImage(java.awt.image.BufferedImage original,
SubstanceColorScheme colorScheme,
float originalBrightnessFactor) |
Creates a new version of the specified image that is rendered in the
colors of the specified color scheme.
|
static java.awt.Image |
getCrayonsImage() |
Retrieves crayons image for the crayon panel of color chooser.
|
static javax.swing.Icon |
getDoubleArrowIcon(int fontSize,
float width,
float height,
float strokeWidth,
int direction,
SubstanceColorScheme colorScheme) |
Retrieves arrow icon.
|
static javax.swing.Icon |
getDoubleArrowIconDelta(int fontSize,
float deltaWidth,
float deltaHeight,
float deltaStrokeWidth,
int direction,
SubstanceColorScheme colorScheme) |
Returns double arrow icon for the specified parameters.
|
static java.awt.image.BufferedImage |
getDragImage(java.awt.Component c,
SubstanceColorScheme colorScheme,
int width,
int height,
int maxNumberOfStripes) |
Returns drag bumps image.
|
static javax.swing.Icon |
getHexaMarker(int value,
SubstanceColorScheme colorScheme) |
Returns small icon representation of the specified integer value.
|
static javax.swing.Icon |
getMaximizeIcon(int iSize,
SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
Returns
maximize icon. |
static javax.swing.Icon |
getMaximizeIcon(SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
Returns
maximize icon. |
static javax.swing.Icon |
getMinimizeIcon(int iSize,
SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
Returns
minimize icon. |
static javax.swing.Icon |
getMinimizeIcon(SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
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 |
getRadioButton(javax.swing.JComponent component,
SubstanceFillPainter fillPainter,
SubstanceBorderPainter borderPainter,
int dimension,
ComponentState componentState,
int offsetX,
SubstanceColorScheme fillColorScheme,
SubstanceColorScheme markColorScheme,
SubstanceColorScheme borderColorScheme,
float checkMarkVisibility) |
Retrieves radio button of the specified size that matches the specified
parameters.
|
static java.awt.image.BufferedImage |
getResizeGripImage(java.awt.Component c,
SubstanceColorScheme colorScheme,
int dimension,
boolean isCrowded) |
Returns resize grip image.
|
static javax.swing.Icon |
getRestoreIcon(SubstanceColorScheme scheme,
SubstanceColorScheme backgroundScheme) |
Returns
restore icon. |
static java.awt.image.BufferedImage |
getRotated(java.awt.image.BufferedImage bi,
int quadrantClockwise) |
Returns rotated image.
|
static java.awt.image.VolatileImage |
getRotated(java.awt.image.VolatileImage bi,
int quadrantClockwise) |
Returns rotated image.
|
static javax.swing.Icon |
getSearchIcon(int dimension,
SubstanceColorScheme colorScheme,
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(SubstanceColorScheme scheme,
java.awt.Component c) |
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 java.awt.image.BufferedImage |
getTreeIcon(javax.swing.JTree tree,
SubstanceColorScheme fillScheme,
SubstanceColorScheme borderScheme,
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 void |
paintBorder(java.awt.Component c,
java.awt.Graphics2D graphics,
int x,
int y,
int width,
int height,
float radius,
SubstanceColorScheme borderScheme) |
Paints border instance of specified dimensions and status.
|
static void |
paintCompositeRoundedBackground(javax.swing.JComponent component,
java.awt.Graphics g,
int width,
int height,
int cornerRadius,
javax.swing.AbstractButton decrButton,
javax.swing.AbstractButton incrButton,
boolean flipSides) |
Retrieves composite background for the specified parameters.
|
static void |
paintRectangularBackground(java.awt.Component c,
java.awt.Graphics g,
int startX,
int startY,
int width,
int height,
SubstanceColorScheme colorScheme,
float borderAlpha,
boolean isVertical) |
Paints rectangular gradient background.
|
static void |
paintRectangularStripedBackground(java.awt.Component c,
java.awt.Graphics g,
int startX,
int startY,
int width,
int height,
SubstanceColorScheme colorScheme,
java.awt.image.BufferedImage stripeImage,
int stripeOffset,
float borderAlpha,
boolean isVertical) |
Paints rectangular gradient background with spots and optional replicated
stripe image.
|
static void |
paintSimpleBorder(java.awt.Component c,
java.awt.Graphics2D g2d,
int width,
int height,
SubstanceColorScheme borderColorScheme) |
Paints simple border.
|
static void |
paintSimpleBorderAliased(java.awt.Component c,
java.awt.Graphics2D g2d,
int width,
int height,
SubstanceColorScheme colorScheme) |
|
static void |
paintSplitDividerBumpImage(java.awt.Graphics g,
SubstanceSplitPaneDivider divider,
int x,
int y,
int width,
int height,
boolean isHorizontal,
SubstanceColorScheme colorScheme) |
Paints the bump dots on the split pane dividers.
|
static void |
paintTextComponentBorder(javax.swing.JComponent c,
java.awt.Graphics graphics,
int x,
int y,
int width,
int height,
float radius,
SubstanceColorScheme borderScheme) |
Paints border instance of specified dimensions and status.
|
static javax.swing.Icon |
toGreyscale(javax.swing.Icon icon) |
Translated the specified icon to grey scale.
|
public static void paintBorder(java.awt.Component c, java.awt.Graphics2D graphics, int x, int y, int width, int height, float radius, SubstanceColorScheme 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 paintTextComponentBorder(javax.swing.JComponent c, java.awt.Graphics graphics, int x, int y, int width, int height, float radius, SubstanceColorScheme 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 javax.swing.Icon getArrowIcon(int fontSize, int direction, SubstanceColorScheme colorScheme)
fontSize
- Font size.direction
- Arrow direction.colorScheme
- Arrow icon color scheme.public static javax.swing.Icon getArrowIcon(float width, float height, float strokeWidth, int direction, SubstanceColorScheme scheme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.scheme
- Color scheme for the arrow.SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
public static java.awt.image.BufferedImage getArrow(float width, float height, float strokeWidth, int direction, SubstanceColorScheme scheme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.scheme
- Color scheme for the arrow.SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
,
SwingConstants.CENTER
public static javax.swing.Icon getDoubleArrowIconDelta(int fontSize, float deltaWidth, float deltaHeight, float deltaStrokeWidth, int direction, SubstanceColorScheme colorScheme)
fontSize
- Font size.deltaWidth
- Arrow width delta.deltaHeight
- Arrow height delta.deltaStrokeWidth
- Arrow stroke width delta.direction
- Arrow direction.colorScheme
- Color scheme for the arrow.public static javax.swing.Icon getDoubleArrowIcon(int fontSize, float width, float height, float strokeWidth, int direction, SubstanceColorScheme colorScheme)
width
- Arrow width.height
- Arrow height.strokeWidth
- Stroke width.direction
- Arrow direction.colorScheme
- Color scheme 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 java.awt.image.VolatileImage getRotated(java.awt.image.VolatileImage 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 alpha 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(javax.swing.JComponent component, SubstanceFillPainter fillPainter, SubstanceBorderPainter borderPainter, int dimension, ComponentState componentState, int offsetX, SubstanceColorScheme fillColorScheme, SubstanceColorScheme markColorScheme, SubstanceColorScheme borderColorScheme, 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.fillColorScheme
- Color scheme for the inner fill.markColorScheme
- Color scheme for the check mark.borderColorScheme
- Color scheme for the border.checkMarkVisibility
- Check mark visibility in 0.0-1.0 range.public static java.awt.image.BufferedImage getCheckBox(javax.swing.AbstractButton button, SubstanceFillPainter fillPainter, SubstanceBorderPainter borderPainter, int dimension, ComponentState componentState, SubstanceColorScheme fillColorScheme, SubstanceColorScheme markColorScheme, SubstanceColorScheme borderColorScheme, float checkMarkVisibility, boolean isCheckMarkFadingOut)
button
- Button for the check mark.dimension
- Check box size.componentState
- Component state.fillColorScheme
- Color scheme for the inner fill.markColorScheme
- Color scheme for the check mark.borderColorScheme
- Color scheme for the border.checkMarkVisibility
- Check mark visibility in 0.0-1.0 range.isCheckMarkFadingOut
- if true
, the value of
interpolationCyclePos10
is used as the alpha
channel.public static void paintCompositeRoundedBackground(javax.swing.JComponent component, java.awt.Graphics g, 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 javax.swing.Icon getMinimizeIcon(SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
minimize
icon.scheme
- Color scheme for the icon.Minimize
icon.public static javax.swing.Icon getMinimizeIcon(int iSize, SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
minimize
icon.iSize
- Icon dimension.scheme
- Color scheme for the icon.Minimize
icon.public static javax.swing.Icon getRestoreIcon(SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
restore
icon.scheme
- Color scheme for the icon.Restore
icon.public static javax.swing.Icon getMaximizeIcon(SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
maximize
icon.scheme
- Color scheme for the icon.Maximize
icon.public static javax.swing.Icon getMaximizeIcon(int iSize, SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
maximize
icon.iSize
- Icon dimension.scheme
- Color scheme for the icon.Maximize
icon.public static javax.swing.Icon getCloseIcon(SubstanceColorScheme scheme, SubstanceColorScheme backgroundScheme)
close
icon.scheme
- Color scheme for the icon.Close
icon.public static javax.swing.Icon getCloseIcon(int iSize, SubstanceColorScheme colorScheme, SubstanceColorScheme backgroundScheme)
close
icon.iSize
- Icon dimension.colorScheme
- Color scheme for the icon.Close
icon.public static void paintRectangularBackground(java.awt.Component c, java.awt.Graphics g, int startX, int startY, int width, int height, SubstanceColorScheme 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 paintSimpleBorder(java.awt.Component c, java.awt.Graphics2D g2d, int width, int height, SubstanceColorScheme borderColorScheme)
g2d
- Graphics context.width
- Border width.height
- Border height.borderColorScheme
- Border color scheme.public static void paintSimpleBorderAliased(java.awt.Component c, java.awt.Graphics2D g2d, int width, int height, SubstanceColorScheme colorScheme)
public static void paintRectangularStripedBackground(java.awt.Component c, java.awt.Graphics g, int startX, int startY, int width, int height, SubstanceColorScheme 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, SubstanceColorScheme colorScheme, int width, int height, int maxNumberOfStripes)
c
- Component.colorScheme
- Color scheme.width
- Drag bumps width.height
- Drag bumps height.maxNumberOfStripes
- The maximum number of bump stripes (rows or columns).public static void paintSplitDividerBumpImage(java.awt.Graphics g, SubstanceSplitPaneDivider divider, int x, int y, int width, int height, boolean isHorizontal, SubstanceColorScheme colorScheme)
g
- Graphics context.divider
- Split pane divider.x
- X coordinate of the bump dots.y
- Y coordinate of the bump dots.width
- Width of the bump dots area.height
- Height of the bump dots area.isHorizontal
- Indicates whether the dots are horizontal.colorScheme
- First color scheme.public static java.awt.image.BufferedImage getResizeGripImage(java.awt.Component c, SubstanceColorScheme colorScheme, int dimension, boolean isCrowded)
c
- Component.colorScheme
- Color scheme.dimension
- Resize grip width.isCrowded
- Indicates whether the grips should be painted closely.public static java.awt.image.BufferedImage getTreeIcon(javax.swing.JTree tree, SubstanceColorScheme fillScheme, SubstanceColorScheme borderScheme, boolean isCollapsed)
tree
- Tree.fillScheme
- Icon fill color scheme.borderScheme
- Icon border color scheme.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, SubstanceColorScheme colorScheme)
value
- Integer value to represent.colorScheme
- Icon color scheme.public static javax.swing.Icon getSearchIcon(int dimension, SubstanceColorScheme colorScheme, boolean leftToRight)
dimension
- Icon dimension.colorScheme
- Icon color scheme.leftToRight
- LTR indication of the resulting icon.public static javax.swing.Icon getWatermarkIcon(SubstanceWatermark watermark)
watermark
- Watermark instance.public static javax.swing.Icon getSmallLockIcon(SubstanceColorScheme scheme, java.awt.Component c)
scheme
- Scheme instance.public static java.awt.image.BufferedImage getNegated(java.awt.image.BufferedImage bi)
bi
- Image.public static java.awt.image.BufferedImage getColorSchemeImage(java.awt.Component comp, javax.swing.Icon original, SubstanceColorScheme colorScheme, float originalBrightnessFactor)
comp
- Component.original
- The original icon.colorScheme
- Color scheme.public static java.awt.image.BufferedImage getColorSchemeImage(java.awt.image.BufferedImage original, SubstanceColorScheme colorScheme, float originalBrightnessFactor)
original
- The original image.colorScheme
- Color scheme.