Package com.inductiveautomation.rm.swing
Class RMIconUtils
- java.lang.Object
-
- com.inductiveautomation.rm.swing.RMIconUtils
-
public class RMIconUtils extends java.lang.ObjectSome useful Icon utilities and subclasses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRMIconUtils.BorderIconAn icon implementation that renders a border on another icon.static classRMIconUtils.CompositeIconAn icon implementation that draws two icons.static classRMIconUtils.CompositeIcon2An icon implementation that draws two icons.static classRMIconUtils.LabelIconAn icon implementation that uses a JLabel.static classRMIconUtils.ShapeIconA simple icon implementation to draw a given shape in a given color in a given size.static classRMIconUtils.SpacerIconAn icon implementation that renders a border on another icon.static classRMIconUtils.StretcherIconAn icon implementation that stretches another icon to specified with.
-
Constructor Summary
Constructors Constructor Description RMIconUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RMIconUtils.CompositeIcon2getCompositeIcon(javax.swing.Icon anIcon1, javax.swing.Icon anIcon2, int anX, int aY)Returns a composite icon for original icon and new icon at x,y.static javax.swing.IcongetIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)Returns an icon for the given shape, color and size.static java.awt.image.BufferedImagegetImage(javax.swing.Icon anIcon, int aWidth, int aHeight)Returns an image for the given shape, image size and color.static javax.swing.ImageIcongetImageIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)Returns an image icon for the given shape, color and size.static javax.swing.ImageIcongetImageIcon(javax.swing.Icon anIcon)Returns an image icon for given icon.static javax.swing.ImageIcongetImageIcon(javax.swing.Icon anIcon, int aWidth, int aHeight)Returns an image icon for given icon.static voidsetButtonIconAsLabelIcon(javax.swing.AbstractButton aButton)Set button icon.static voidsetRolloverIcons(javax.swing.AbstractButton aButton, boolean doSelected)A convenience method for setting roll-over, pressed and selected icons for a tool bar button with just an icon.static voidsetRolloverIcons(javax.swing.AbstractButton aButton, boolean doSelected, int w, int h)A convenience method for setting roll-over, pressed and selected icons for a tool bar button with just an icon.
-
-
-
Method Detail
-
getIcon
public static javax.swing.Icon getIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)Returns an icon for the given shape, color and size.
-
getImageIcon
public static javax.swing.ImageIcon getImageIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)Returns an image icon for the given shape, color and size.
-
getImageIcon
public static javax.swing.ImageIcon getImageIcon(javax.swing.Icon anIcon)
Returns an image icon for given icon.
-
getImageIcon
public static javax.swing.ImageIcon getImageIcon(javax.swing.Icon anIcon, int aWidth, int aHeight)Returns an image icon for given icon.
-
getImage
public static java.awt.image.BufferedImage getImage(javax.swing.Icon anIcon, int aWidth, int aHeight)Returns an image for the given shape, image size and color.
-
setRolloverIcons
public static void setRolloverIcons(@Nullable javax.swing.AbstractButton aButton, boolean doSelected)A convenience method for setting roll-over, pressed and selected icons for a tool bar button with just an icon.
-
setRolloverIcons
public static void setRolloverIcons(@Nonnull javax.swing.AbstractButton aButton, boolean doSelected, int w, int h)A convenience method for setting roll-over, pressed and selected icons for a tool bar button with just an icon.
-
getCompositeIcon
public static RMIconUtils.CompositeIcon2 getCompositeIcon(javax.swing.Icon anIcon1, javax.swing.Icon anIcon2, int anX, int aY)
Returns a composite icon for original icon and new icon at x,y.
-
setButtonIconAsLabelIcon
public static void setButtonIconAsLabelIcon(javax.swing.AbstractButton aButton)
Set button icon.
-
-