|
||||||||||
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.
Nested Class Summary | |
---|---|
static class |
SubstanceImageCreator.Corner
Corner enum (for creating rounded rectangles). |
static class |
SubstanceImageCreator.Side
Corner enum (for creating rounded rectangles). |
static class |
SubstanceImageCreator.TreeIcon
Enum for various tree node states. |
Field Summary | |
---|---|
static int |
ARROW_HEIGHT
Combobox button arrow default height. |
static int |
ARROW_WIDTH
Combobox button arrow default width. |
static int |
DRAG_BUMP_DIAMETER
Drag bump diameter. |
static int |
ICON_DIMENSION
Default icon dimension. |
Constructor Summary | |
---|---|
SubstanceImageCreator()
|
Method Summary | |
---|---|
static Icon |
getArrowIcon(int width,
int height,
int direction)
Retrieves downward pointing arrow. |
static BufferedImage |
getBlankImage(int width,
int height)
Retrieves transparent image of specified dimension. |
static BufferedImage |
getBorder(int width,
int height,
ColorSchemeEnum borderSchemeEnum,
Set<SubstanceImageCreator.Corner> roundedCorners,
boolean hasDropShadow,
int marginGap)
Retrieves a border instance of specified dimensions and status. |
static BufferedImage |
getCheckBox(int dimension,
ComponentState componentState)
Retrieves check box of the specified size that matches the specified component state. |
static BufferedImage |
getCheckBox(int dimension,
ComponentState componentState,
ColorSchemeEnum mainColorSchemeEnum)
Retrieves check box of the specified size that matches the specified component state. |
static Icon |
getCloseIcon(ColorSchemeEnum colorSchemeEnum)
Returns close icon. |
static BufferedImage |
getCompositeRoundedBackground(int width,
int height,
int cornerRadius,
ComponentState compDecrState,
ComponentState compIncrState,
boolean flipSides)
Retrieves composite background for the specified parameters. |
static BufferedImage |
getComputerIcon()
Retrieves computer icon. |
static Image |
getCrayonsImage()
|
static BufferedImage |
getDiskIcon()
Retrieves disk icon. |
static BufferedImage |
getDragImage(int width,
int height)
Returns drag bumps image. |
static BufferedImage |
getFlipRoundedButton(int width,
int height,
int cornerRadius,
ColorSchemeEnum colorSchemeEnum,
int cyclePos,
SubstanceImageCreator.Side side,
boolean isSideOpen)
Retrieves rounded background for the specified parameters which is rotated by 90 degrees counter clock wise. |
static BufferedImage |
getFloppyIcon()
Retrieves floppy icon. |
static BufferedImage |
getGradientCubesImage(Component component,
int width,
int height,
ColorSchemeEnum colorSchemeEnum,
int leftTransitionStart,
int leftTransitionEnd,
int rightTransitionStart,
int rightTransitionEnd)
Creates an image with transition area between two colors. |
static BufferedImage |
getHomeIcon()
Retrieves home icon. |
static BufferedImage |
getLonghornProgressBar(int width,
int height,
ColorSchemeEnum colorSchemeEnum)
Returns Longhorn-inspired rectangular gradient background with gradient horizontal translucent stripe. |
static Icon |
getMaximizeIcon(ColorSchemeEnum colorSchemeEnum)
Returns maximize icon. |
static Icon |
getMinimizeIcon(ColorSchemeEnum colorSchemeEnum)
Returns minimize icon. |
static BufferedImage |
getRadioButton(int dimension,
ComponentState componentState)
Retrieves radio button of the specified size that matches the specified component state. |
static BufferedImage |
getRadioButton(int dimension,
ComponentState componentState,
int offsetX)
Retrieves radio button of the specified size that matches the specified component state. |
static BufferedImage |
getRadioButton(int dimension,
ComponentState componentState,
int offsetX,
ColorSchemeEnum mainColorSchemeEnum)
|
static BufferedImage |
getRectangularBackground(int width,
int height,
ColorSchemeEnum colorSchemeEnum,
boolean hasDarkBorder)
Returns rectangular gradient background. |
static BufferedImage |
getRectangularSpottedBackground(int width,
int height,
ColorSchemeEnum colorSchemeEnum,
boolean hasSpots,
BufferedImage stripeImage,
int stripeOffset)
Returns rectangular gradient background with spots and optional replicated stripe image. |
static Icon |
getRestoreIcon(ColorSchemeEnum colorSchemeEnum)
Returns restore icon. |
static BufferedImage |
getRotated(BufferedImage bi,
int quadrantClockwise)
Returns rotated image. |
static BufferedImage |
getRoundedBackground(int width,
int height,
int cornerRadius,
ColorSchemeEnum borderSchemeEnum,
ColorSchemeEnum fillSchemeEnum,
int cyclePos,
SubstanceImageCreator.Side side,
boolean isSideOpen,
boolean hasShine)
Retrieves rounded background for the specified parameters. |
static BufferedImage |
getRoundedBackground(int width,
int height,
int cornerRadius,
ColorSchemeEnum colorSchemeEnum,
int cyclePos,
SubstanceImageCreator.Side side)
Retrieves rounded background for the specified parameters. |
static BufferedImage |
getRoundedBackground(int width,
int height,
int cornerRadius,
ColorSchemeEnum colorSchemeEnum,
int cyclePos,
SubstanceImageCreator.Side side,
boolean isSideOpen)
Retrieves rounded background for the specified parameters. |
static BufferedImage |
getRoundedTriangleBackground(int width,
int height,
int cornerRadius,
ComponentState componentState,
ColorSchemeEnum mainColorSchemeEnum)
Retrieves rounded background with triangular bottom half for the specified parameters. |
static BufferedImage |
getSingleCrayon(Color mainColor,
int width,
int height)
|
static BufferedImage |
getStripe(int baseSize)
Returns diagonal stripe image. |
static BufferedImage |
getTreeIcon(boolean isCollapsed)
Retrieves tree icon. |
static BufferedImage |
getTreeLeafIcon()
Retrieves tree leaf icon. |
static BufferedImage |
getTreeNodeIcon(SubstanceImageCreator.TreeIcon treeIconKind)
Retrieves tree node icon. |
static Icon |
makeTransparent(Icon icon,
double alpha)
Makes the specified icon transparent. |
static Icon |
toGreyscale(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 |
Field Detail |
---|
public static final int ICON_DIMENSION
public static final int ARROW_WIDTH
public static final int ARROW_HEIGHT
public static final int DRAG_BUMP_DIAMETER
Constructor Detail |
---|
public SubstanceImageCreator()
Method Detail |
---|
public static BufferedImage getBlankImage(int width, int height)
width
- Image width.height
- Image height.
public static BufferedImage getBorder(int width, int height, ColorSchemeEnum borderSchemeEnum, Set<SubstanceImageCreator.Corner> roundedCorners, boolean hasDropShadow, int marginGap)
width
- Border width.height
- Border height.borderSchemeEnum
- Border color scheme enum.roundedCorners
- A set of corners that will be rounded.hasDropShadow
- If true
, drop shadow will be drawn.marginGap
- The margin gap around the border
public static Icon getArrowIcon(int width, int height, int direction)
width
- Arrow width.height
- Arrow height.direction
- Arrow direction.
SwingConstants.NORTH
,
SwingConstants.WEST
,
SwingConstants.SOUTH
,
SwingConstants.EAST
public static BufferedImage getRotated(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 Icon toGreyscale(Icon icon)
icon
- Icon.
public static Icon makeTransparent(Icon icon, double alpha)
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 BufferedImage getRoundedBackground(int width, int height, int cornerRadius, ColorSchemeEnum colorSchemeEnum, int cyclePos, SubstanceImageCreator.Side side)
width
- Image width.height
- Image height.cornerRadius
- Corner radius.colorSchemeEnum
- Color scheme for the border and the fillingcyclePos
- Cycle position index.side
- Straight side (if not null
).
public static BufferedImage getRadioButton(int dimension, ComponentState componentState)
dimension
- Radio button size.componentState
- Component state.
public static BufferedImage getRadioButton(int dimension, ComponentState componentState, int offsetX)
dimension
- Radio button size.componentState
- Component state.offsetX
- Offset on X axis - should be positive in order to
see the entire radio button.
public static BufferedImage getRadioButton(int dimension, ComponentState componentState, int offsetX, ColorSchemeEnum mainColorSchemeEnum)
public static BufferedImage getCheckBox(int dimension, ComponentState componentState)
dimension
- Check box size.componentState
- Component state.
public static BufferedImage getCheckBox(int dimension, ComponentState componentState, ColorSchemeEnum mainColorSchemeEnum)
dimension
- Check box size.componentState
- Component state.
public static BufferedImage getRoundedBackground(int width, int height, int cornerRadius, ColorSchemeEnum colorSchemeEnum, int cyclePos, SubstanceImageCreator.Side side, boolean isSideOpen)
width
- Image width.height
- Image height.cornerRadius
- Corner radius.colorSchemeEnum
- Color scheme for the border and the fillingcyclePos
- Cycle position index.side
- Straight side (if not null
).isSideOpen
- If true
, the above side will not have
border.public static BufferedImage getFlipRoundedButton(int width, int height, int cornerRadius, ColorSchemeEnum colorSchemeEnum, int cyclePos, SubstanceImageCreator.Side side, boolean isSideOpen)
width
- Image width.height
- Image height.cornerRadius
- Corner radius.colorSchemeEnum
- Color scheme for the border and the fillingcyclePos
- Cycle position index.side
- Straight side (if not null
).isSideOpen
- If true
, the above side will not have
border.
public static BufferedImage getCompositeRoundedBackground(int width, int height, int cornerRadius, ComponentState compDecrState, ComponentState compIncrState, boolean flipSides)
increased
state. decreased
state.
width
- Image width.height
- Image height.cornerRadius
- Corner radius.compDecrState
- The decreased
state.compIncrState
- The increased
state.flipSides
- If true
, the drawn halves of the first
and the second layers above will be swapped.
public static BufferedImage getRoundedBackground(int width, int height, int cornerRadius, ColorSchemeEnum borderSchemeEnum, ColorSchemeEnum fillSchemeEnum, int cyclePos, SubstanceImageCreator.Side side, boolean isSideOpen, boolean hasShine)
width
- Image width.height
- Image height.cornerRadius
- Corner radius.borderSchemeEnum
- Color scheme for the border.fillSchemeEnum
- Color scheme for the filling.cyclePos
- Cycle position index.side
- Straight side (if not null
).isSideOpen
- If true
, the above side will not
have border.hasShine
- If true
, shine-spot will be added.
public static BufferedImage getRoundedTriangleBackground(int width, int height, int cornerRadius, ComponentState componentState, ColorSchemeEnum mainColorSchemeEnum)
width
- Image width.height
- Image height.cornerRadius
- Corner radius.componentState
- Component state.
public static BufferedImage getGradientCubesImage(Component component, int width, int height, ColorSchemeEnum colorSchemeEnum, int leftTransitionStart, int leftTransitionEnd, int rightTransitionStart, int rightTransitionEnd)
width
- The width of the resilting image.height
- The height of the resilting image.colorSchemeEnum
- Color scheme.leftTransitionStart
- The starting column of the left transition
area. All the pixels lying to the left of
this column will be colored uniformly by the
left-side color.leftTransitionEnd
- The ending column of the left transition
area. All the pixels lying to the right of
this column will be colored uniformly by the
right-side color.rightTransitionStart
- The starting column of the right transition
area. All the pixels lying to the left of
this column will be colored uniformly by the
left-side color.rightTransitionEnd
- The ending column of the right transition
area. All the pixels lying to the right of
this column will be colored uniformly by the
right-side color.
public static Icon getMinimizeIcon(ColorSchemeEnum colorSchemeEnum)
minimize
icon.
colorSchemeEnum
- Color scheme for the icon.
Minimize
icon.public static Icon getRestoreIcon(ColorSchemeEnum colorSchemeEnum)
restore
icon.
colorSchemeEnum
- Color scheme for the icon.
Restore
icon.public static Icon getMaximizeIcon(ColorSchemeEnum colorSchemeEnum)
maximize
icon.
colorSchemeEnum
- Color scheme for the icon.
Maximize
icon.public static Icon getCloseIcon(ColorSchemeEnum colorSchemeEnum)
close
icon.
colorSchemeEnum
- Color scheme for the icon.
Close
icon.public static BufferedImage getRectangularBackground(int width, int height, ColorSchemeEnum colorSchemeEnum, boolean hasDarkBorder)
width
- Background width.height
- Background height.colorSchemeEnum
- Color scheme for the background.hasDarkBorder
- If true
, the resulting image will
have dark border.
public static BufferedImage getRectangularSpottedBackground(int width, int height, ColorSchemeEnum colorSchemeEnum, boolean hasSpots, BufferedImage stripeImage, int stripeOffset)
width
- Background width.height
- Background height.colorSchemeEnum
- Color scheme for the background.hasSpots
- If true
, the resulting image will
have spots.stripeImage
- Stripe image to replicate.stripeOffset
- Offset of the first stripe replication.
public static BufferedImage getStripe(int baseSize)
baseSize
- Stripe base in pixels.
public static BufferedImage getDragImage(int width, int height)
width
- Drag bumps width.height
- Drag bumps height.
public static BufferedImage getTreeIcon(boolean isCollapsed)
isCollapsed
- Collapsed state.
public static BufferedImage getTreeNodeIcon(SubstanceImageCreator.TreeIcon treeIconKind)
treeIconKind
- Tree node icon kind.
public static BufferedImage getTreeLeafIcon()
public static BufferedImage getHomeIcon()
public static BufferedImage getComputerIcon()
public static BufferedImage getDiskIcon()
public static BufferedImage getFloppyIcon()
public static BufferedImage getLonghornProgressBar(int width, int height, ColorSchemeEnum colorSchemeEnum)
width
- Background width.height
- Background height.colorSchemeEnum
- Color scheme for the background.
public static BufferedImage getSingleCrayon(Color mainColor, int width, int height)
public static Image getCrayonsImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |