Package net.infonode.gui
Class ComponentUtil
java.lang.Object
net.infonode.gui.ComponentUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic Componentstatic ComponentfindFirstComponentOfType(Component comp, Class c) static ColorgetBackgroundColor(Component component) static final Stringstatic final ComponentgetChildAt(Container container, Point p) static final ComponentgetChildAtLine(Container container, Point p, boolean horizontal) static final intgetComponentIndex(Component component) static voidstatic intgetPreferredMaxHeight(Component[] components) Calculates preferred max height for the given components without checking isVisible.static intgetPreferredMaxWidth(Component[] components) Calculates preferred max width for the given components without checking isVisible.static Componentstatic final ComponentgetVisibleChildAt(Container container, Point p) static intstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanrequestFocus(Component component) Requests focus unless the component already has focus.static voidsetAllOpaque(Container c, boolean opaque) static ComponentsmartRequestFocus(Component component) Requests focus for a component.static voidstatic void
-
Method Details
-
getChildAt
-
getVisibleChildAt
-
getChildAtLine
-
getComponentTreePosition
-
findComponentUnderGlassPaneAt
-
getComponentIndex
-
getBorderLayoutOrientation
-
getBackgroundColor
-
countComponents
-
getVisibleChildrenCount
-
getTopLevelAncestor
-
hasVisibleChildren
-
isOnlyVisibleComponent
-
isOnlyVisibleComponents
-
findFirstComponentOfType
-
isFocusable
-
requestFocus
Requests focus unless the component already has focus. For some weird reason callingComponent.requestFocusInWindow()when the component is focus owner changes focus owner to another component!- Parameters:
component- the component to request focus for- Returns:
- true if the component has focus or probably will get focus, otherwise false
-
smartRequestFocus
Requests focus for a component. If that's not possible it'sFocusTraversalPolicyis checked. If that doesn't work all it's children is recursively checked with this method.- Parameters:
component- the component to request focus for- Returns:
- the component which has focus or probably will obtain focus, null if no component will receive focus
-
getPreferredMaxHeight
Calculates preferred max height for the given components without checking isVisible.- Parameters:
components- Components to check- Returns:
- max height
-
getPreferredMaxWidth
Calculates preferred max width for the given components without checking isVisible.- Parameters:
components- Components to check- Returns:
- max width
-
setAllOpaque
-
validate
-
validate
-