public class FlamingoUtilities
extends java.lang.Object
Constructor | Description |
---|---|
FlamingoUtilities() |
Modifier and Type | Method | Description |
---|---|---|
static void |
checkResizePoliciesConsistency(AbstractRibbonBand ribbonBand) |
|
static void |
checkResizePoliciesConsistencyBase(AbstractRibbonBand ribbonBand) |
|
static java.lang.String |
clipString(java.awt.FontMetrics metrics,
int availableWidth,
java.lang.String fullText) |
Clips string based on specified font metrics and available width (in
pixels).
|
static java.awt.image.BufferedImage |
createThumbnail(java.awt.image.BufferedImage image,
int requestedThumbWidth) |
Creates a thumbnail of the specified width.
|
static java.awt.Color |
getAlphaColor(java.awt.Color color,
int alpha) |
Returns the alpha version of the specified color.
|
static JRibbonApplicationMenuButton |
getApplicationMenuButton(java.awt.Component comp) |
Recursively searches the
comp child components for a
JRibbonApplicationMenuButton and returns it. |
static java.awt.image.BufferedImage |
getBlankImage(int width,
int height) |
Retrieves transparent image of specified dimension.
|
static java.awt.Color |
getBorderColor() |
|
static java.awt.Color |
getColor(java.awt.Color defaultColor,
java.lang.String... keys) |
Gets the color based on the specified
UIManager keys. |
static ResizableIcon |
getCommandButtonPopupActionIcon(JCommandButton commandButton) |
Returns a popup action icon for the specific command button.
|
static javax.swing.plaf.FontUIResource |
getFont(java.awt.Component comp,
java.lang.String... keys) |
Gets the component font.
|
static int |
getHLayoutGap(AbstractCommandButton commandButton) |
|
static java.awt.Color |
getLighterColor(java.awt.Color color,
double diff) |
Returns lighter version of the specified color.
|
static ResizableIcon |
getRibbonBandExpandIcon(AbstractRibbonBand ribbonBand) |
Returns a ribbon band expand icon.
|
static java.awt.geom.GeneralPath |
getRibbonBorderOutline(int startX,
int endX,
int startSelectedX,
int endSelectedX,
int topY,
int bandTopY,
int bottomY,
float radius) |
Returns the outline of the ribbon border.
|
static java.awt.geom.GeneralPath |
getRibbonGalleryOutline(int startX,
int endX,
int topY,
int bottomY,
float radius) |
Returns the outline of in-ribbon gallery.
|
static java.awt.geom.GeneralPath |
getRibbonTaskToggleButtonOutline(int width,
int height,
float radius) |
Returns the clip area of a task toggle button in ribbon component.
|
static int |
getVLayoutGap(AbstractCommandButton commandButton) |
|
static boolean |
hasPopupAction(AbstractCommandButton commandButton) |
|
static boolean |
isShowingMinimizedRibbonInPopup(JRibbon ribbon) |
|
static boolean |
isShowingMinimizedRibbonInPopup(JRibbonTaskToggleButton taskToggleButton) |
|
static void |
renderSurface(java.awt.Graphics g,
java.awt.Container c,
java.awt.Rectangle rect,
boolean toSimulateRollover,
boolean hasTopBorder,
boolean hasBottomBorder) |
|
static void |
updateRibbonFrameIconImages(JRibbonFrame ribbonFrame) |
Handles updating the application menu button icon image.
|
public static javax.swing.plaf.FontUIResource getFont(java.awt.Component comp, java.lang.String... keys)
comp
- Component.keys
- UIManager
keys.null
, its font is returned.
Otherwise the first entry in UIManager
which is a
Font
is returned.public static java.awt.Color getColor(java.awt.Color defaultColor, java.lang.String... keys)
UIManager
keys.defaultColor
- Default color to return if none of the UIManager
keys
are present.keys
- UIManager
keys.UIManager
which is a color. If none,
then the default color is returned.public static ResizableIcon getRibbonBandExpandIcon(AbstractRibbonBand ribbonBand)
public static ResizableIcon getCommandButtonPopupActionIcon(JCommandButton commandButton)
public static java.awt.image.BufferedImage createThumbnail(java.awt.image.BufferedImage image, int requestedThumbWidth)
image
- The original image.requestedThumbWidth
- The width of the resulting thumbnail.public static java.awt.geom.GeneralPath getRibbonBorderOutline(int startX, int endX, int startSelectedX, int endSelectedX, int topY, int bandTopY, int bottomY, float radius)
startX
- The starting X of the ribbon area.endX
- The ending X of the ribbon area.startSelectedX
- The starting X of the toggle tab button of the selected task.endSelectedX
- The ending X of the toggle tab button of the selected task.topY
- The top Y of the ribbon area.bandTopY
- The top Y of the ribbon band area.bottomY
- The bottom Y of the ribbon area.radius
- Corner radius.public static java.awt.geom.GeneralPath getRibbonTaskToggleButtonOutline(int width, int height, float radius)
width
- Toggle tab button width.height
- Toggle tab button height.radius
- Toggle tab button corner radius.public static java.awt.geom.GeneralPath getRibbonGalleryOutline(int startX, int endX, int topY, int bottomY, float radius)
startX
- Start X of the in-ribbon gallery.endX
- End X of the in-ribbon gallery.topY
- Top Y of the in-ribbon gallery.bottomY
- Bottom Y of the in-ribbon gallery.radius
- Corner radius.public static java.lang.String clipString(java.awt.FontMetrics metrics, int availableWidth, java.lang.String fullText)
metrics
- Font metrics.availableWidth
- Available width in pixels.fullText
- String to clip.public static java.awt.image.BufferedImage getBlankImage(int width, int height)
width
- Image width.height
- Image height.public static java.awt.Color getAlphaColor(java.awt.Color color, int alpha)
color
- Original color.alpha
- Alpha channel value.public static int getHLayoutGap(AbstractCommandButton commandButton)
public static int getVLayoutGap(AbstractCommandButton commandButton)
public static boolean hasPopupAction(AbstractCommandButton commandButton)
public static void updateRibbonFrameIconImages(JRibbonFrame ribbonFrame)
ribbonFrame
does not have an application menu button nothing
is performed.ribbonFrame
- the ribbon frame containing the application iconpublic static JRibbonApplicationMenuButton getApplicationMenuButton(java.awt.Component comp)
comp
child components for a
JRibbonApplicationMenuButton
and returns it. If nothing is
found null
is returned.comp
- the component to recursively searchJRibbonApplicationMenuButton
, or
null
if not foundpublic static void renderSurface(java.awt.Graphics g, java.awt.Container c, java.awt.Rectangle rect, boolean toSimulateRollover, boolean hasTopBorder, boolean hasBottomBorder)
public static java.awt.Color getLighterColor(java.awt.Color color, double diff)
color
- Color.diff
- Difference factor (values closer to 1.0 will produce results
closer to white color).public static java.awt.Color getBorderColor()
public static boolean isShowingMinimizedRibbonInPopup(JRibbon ribbon)
public static boolean isShowingMinimizedRibbonInPopup(JRibbonTaskToggleButton taskToggleButton)
public static void checkResizePoliciesConsistency(AbstractRibbonBand ribbonBand)
public static void checkResizePoliciesConsistencyBase(AbstractRibbonBand ribbonBand)