Class FlamingoUtilities
java.lang.Object
org.pushingpixels.flamingo.internal.utils.FlamingoUtilities
Helper utilities for Flamingo project. This class is for internal use only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckResizePoliciesConsistency(AbstractRibbonBand ribbonBand) static voidcheckResizePoliciesConsistencyBase(AbstractRibbonBand ribbonBand) static StringclipString(FontMetrics metrics, int availableWidth, String fullText) Clips string based on specified font metrics and available width (in pixels).static BufferedImagecreateThumbnail(BufferedImage image, int requestedThumbWidth) Creates a thumbnail of the specified width.static ColorgetAlphaColor(Color color, int alpha) Returns the alpha version of the specified color.static JRibbonApplicationMenuButtonRecursively searches thecompchild components for aJRibbonApplicationMenuButtonand returns it.static BufferedImagegetBlankImage(int width, int height) Retrieves transparent image of specified dimension.static Colorstatic ColorGets the color based on the specifiedUIManagerkeys.static ResizableIcongetCommandButtonPopupActionIcon(JCommandButton commandButton) Returns a popup action icon for the specific command button.static FontUIResourceGets the component font.static intgetHLayoutGap(AbstractCommandButton commandButton) static ColorgetLighterColor(Color color, double diff) Returns lighter version of the specified color.static ResizableIcongetRibbonBandExpandIcon(AbstractRibbonBand ribbonBand) Returns a ribbon band expand icon.static GeneralPathgetRibbonBorderOutline(int startX, int endX, int startSelectedX, int endSelectedX, int topY, int bandTopY, int bottomY, float radius) Returns the outline of the ribbon border.static GeneralPathgetRibbonGalleryOutline(int startX, int endX, int topY, int bottomY, float radius) Returns the outline of in-ribbon gallery.static GeneralPathgetRibbonTaskToggleButtonOutline(int width, int height, float radius) Returns the clip area of a task toggle button in ribbon component.static intgetVLayoutGap(AbstractCommandButton commandButton) static booleanhasPopupAction(AbstractCommandButton commandButton) static booleanstatic booleanisShowingMinimizedRibbonInPopup(JRibbonTaskToggleButton taskToggleButton) static voidrenderSurface(Graphics g, Container c, Rectangle rect, boolean toSimulateRollover, boolean hasTopBorder, boolean hasBottomBorder) static voidupdateRibbonFrameIconImages(JRibbonFrame ribbonFrame) Handles updating the application menu button icon image.
-
Constructor Details
-
FlamingoUtilities
public FlamingoUtilities()
-
-
Method Details
-
getFont
Gets the component font. -
getColor
Gets the color based on the specifiedUIManagerkeys. -
getRibbonBandExpandIcon
Returns a ribbon band expand icon.- Returns:
- Ribbon band expand icon.
-
getCommandButtonPopupActionIcon
Returns a popup action icon for the specific command button. -
createThumbnail
Creates a thumbnail of the specified width.- Parameters:
image- The original image.requestedThumbWidth- The width of the resulting thumbnail.- Returns:
- Thumbnail of the specified width.
-
getRibbonBorderOutline
public static 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.- Parameters:
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.- Returns:
- The outline of the ribbon border.
-
getRibbonTaskToggleButtonOutline
Returns the clip area of a task toggle button in ribbon component.- Parameters:
width- Toggle tab button width.height- Toggle tab button height.radius- Toggle tab button corner radius.- Returns:
- Clip area of a toggle tab button in ribbon component.
-
getRibbonGalleryOutline
public static GeneralPath getRibbonGalleryOutline(int startX, int endX, int topY, int bottomY, float radius) Returns the outline of in-ribbon gallery.- Parameters:
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.- Returns:
- The outline of in-ribbon gallery.
-
clipString
Clips string based on specified font metrics and available width (in pixels). Returns the clipped string, which contains the beginning and the end of the input string separated by ellipses (...) in case the string is too long to fit into the specified width, and the origianl string otherwise.- Parameters:
metrics- Font metrics.availableWidth- Available width in pixels.fullText- String to clip.- Returns:
- The clipped string, which contains the beginning and the end of the input string separated by ellipses (...) in case the string is too long to fit into the specified width, and the origianl string otherwise.
-
getBlankImage
Retrieves transparent image of specified dimension.- Parameters:
width- Image width.height- Image height.- Returns:
- Transparent image of specified dimension.
-
getAlphaColor
Returns the alpha version of the specified color.- Parameters:
color- Original color.alpha- Alpha channel value.- Returns:
- Alpha version of the specified color.
-
getHLayoutGap
-
getVLayoutGap
-
hasPopupAction
-
updateRibbonFrameIconImages
Handles updating the application menu button icon image. IfribbonFramedoes not have an application menu button nothing is performed.- Parameters:
ribbonFrame- the ribbon frame containing the application icon
-
getApplicationMenuButton
Recursively searches thecompchild components for aJRibbonApplicationMenuButtonand returns it. If nothing is foundnullis returned.- Parameters:
comp- the component to recursively search- Returns:
- the
JRibbonApplicationMenuButton, ornullif not found
-
renderSurface
-
getLighterColor
Returns lighter version of the specified color.- Parameters:
color- Color.diff- Difference factor (values closer to 1.0 will produce results closer to white color).- Returns:
- Lighter version of the specified color.
-
getBorderColor
-
isShowingMinimizedRibbonInPopup
-
isShowingMinimizedRibbonInPopup
-
checkResizePoliciesConsistency
-
checkResizePoliciesConsistencyBase
-