Class WidgetUtilities
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.WidgetUtilities
Various utility functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName for the internal client property that marks a component as previewable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfirePropertyChangeEvent(JComponent component, String propertyName, Object oldValue, Object newValue) Fires the matching property change event on the specific component.static CompositeReturns the composite to use for painting the specified component.static CompositegetAlphaComposite(Component c, float translucency) static CompositegetAlphaComposite(Component c, float translucency, Graphics g) Returns the composite to use for painting the specified component.static CompositeReturns the composite to use for painting the specified component.static PreviewPainterReturns the preview painter for the specified component.static IconReturns the current icon for the specified button.static PasswordStrengthCheckerReturns the password strength checker for the specified password field.static booleanhasAutomaticDnDSupport(JTree tree) Checks whether the specified tree component has automatic drag and drop support.static booleanhasAutoScroll(JScrollPane scrollPane) Checks whether the specified scroll pane supports auto scroll.static booleanhasNoAnimations(Component comp, RadianceThemingSlices.AnimationFacet animationFacet) Checks whether the specified component has been configured (specifically or globally) to have no animations of the specific facet.static booleanhasTextEditContextMenu(JTextComponent textComp) Checks whether the specified text component has edit context menu property.static booleanChecks whether the specified text component has "flip select on escape" property.static booleanhasTextFocusSelectAllProperty(JTextComponent textComp) Checks whether the specified text component has "select all on focus gain" property.static voidmakePreviewable(Component comp, Map<Component, Boolean> dbSnapshot) Makes the specified component and all its descendants previewable.static voidrestorePreviewable(Component comp, Map<Component, Boolean> dbSnapshot) Restores the regular (non-previewable) status of the specified component and all its descendants.static booleantoIgnoreAnimations(Component comp)
-
Field Details
-
PREVIEW_MODE
Name for the internal client property that marks a component as previewable.- See Also:
-
-
Constructor Details
-
WidgetUtilities
private WidgetUtilities()Private constructor. Is here to enforce using static methods only.
-
-
Method Details
-
makePreviewable
Makes the specified component and all its descendants previewable.- Parameters:
comp- Component.dbSnapshot- The "snapshot" map that will contain the original double-buffer status of the specified component and all its descendants. Key isJComponent, value isBoolean.
-
restorePreviewable
Restores the regular (non-previewable) status of the specified component and all its descendants.- Parameters:
comp- Component.dbSnapshot- The "snapshot" map that contains the original double-buffer status of the specified component and all its descendants. Key isJComponent, value isBoolean.
-
hasTextFocusSelectAllProperty
Checks whether the specified text component has "select all on focus gain" property.- Parameters:
textComp- Text component.- Returns:
trueif the specified text component has "select all on focus gain" property,falseotherwise.
-
hasTextFlipSelectOnEscapeProperty
Checks whether the specified text component has "flip select on escape" property.- Parameters:
textComp- Text component.- Returns:
trueif the specified text component has "flip select on escape" property,falseotherwise.
-
hasTextEditContextMenu
Checks whether the specified text component has edit context menu property.- Parameters:
textComp- Text component.- Returns:
trueif the specified text component has edit context menu property,falseotherwise.
-
hasAutoScroll
Checks whether the specified scroll pane supports auto scroll.- Parameters:
scrollPane- Scroll pane component.- Returns:
trueif the specified scroll pane supports auto scroll,falseotherwise.
-
hasAutomaticDnDSupport
Checks whether the specified tree component has automatic drag and drop support.- Parameters:
tree- Tree component.- Returns:
trueif the specified text component has automatic drag and drop support,falseotherwise.
-
hasNoAnimations
public static boolean hasNoAnimations(Component comp, RadianceThemingSlices.AnimationFacet animationFacet) Checks whether the specified component has been configured (specifically or globally) to have no animations of the specific facet. Can be used to cull unnecessary code in animation listeners on large tables and lists.- Parameters:
comp- Component.animationFacet- Animation facet.- Returns:
trueif the specified component has been configured (specifically or globally) to have no animations of the specific facet,falseotherwise.
-
getIcon
Returns the current icon for the specified button. This method is for internal use only.- Parameters:
b- Button.- Returns:
- Icon for the specified button.
-
toIgnoreAnimations
-
firePropertyChangeEvent
public static void firePropertyChangeEvent(JComponent component, String propertyName, Object oldValue, Object newValue) Fires the matching property change event on the specific component.- Parameters:
component- Component.propertyName- Property name.oldValue- Old property value.newValue- New property value.
-
getAlphaComposite
Returns the composite to use for painting the specified component. The result should be set on theGraphics2Dbefore any custom rendering is done. This method can be used by application painting code and by look-and-feel delegates.- Parameters:
c- Component.translucency- The translucency of the original painting.g- The original graphics context.- Returns:
- The composite to use for painting the specified component.
-
getAlphaComposite
-
getAlphaComposite
Returns the composite to use for painting the specified component. The result should be set on theGraphics2Dbefore any custom rendering is done. This method can be used by application painting code and by look-and-feel delegates.- Parameters:
c- Component.- Returns:
- The composite to use for painting the specified component.
-
getAlphaComposite
Returns the composite to use for painting the specified component. The result should be set on theGraphics2Dbefore any custom rendering is done. This method can be used by application painting code and by look-and-feel delegates.- Parameters:
c- Component.- Returns:
- The composite to use for painting the specified component.
-
getComponentPreviewPainter
Returns the preview painter for the specified component.- Parameters:
comp- Component.- Returns:
- Preview painter for the specified component.
-
getPasswordStrengthChecker
Returns the password strength checker for the specified password field.- Parameters:
jpf- Password field.- Returns:
- Password strength checker for the specified password field. The result can be
null.
-