Package net.infonode.gui
Class ComponentUtil
java.lang.Object
net.infonode.gui.ComponentUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
static Component
static Component
findFirstComponentOfType
(Component comp, Class c) static Color
getBackgroundColor
(Component component) static final String
static final Component
getChildAt
(Container container, Point p) static final Component
getChildAtLine
(Container container, Point p, boolean horizontal) static final int
getComponentIndex
(Component component) static void
static int
getPreferredMaxHeight
(Component[] components) Calculates preferred max height for the given components without checking isVisible.static int
getPreferredMaxWidth
(Component[] components) Calculates preferred max width for the given components without checking isVisible.static Component
static final Component
getVisibleChildAt
(Container container, Point p) static int
static boolean
static boolean
static boolean
static boolean
static boolean
requestFocus
(Component component) Requests focus unless the component already has focus.static void
setAllOpaque
(Container c, boolean opaque) static Component
smartRequestFocus
(Component component) Requests focus for a component.static void
static 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'sFocusTraversalPolicy
is 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
-