|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.swing.JCSwingUtilities
Utilities class that provides tools to perferm common tasks.
Constructor Summary | |
JCSwingUtilities()
|
Method Summary | |
static Dimension |
getButtonPSFromGraphics(JButton button,
Graphics gc)
Gets the preferred size of a swing JButton from the font metrics
specified by the Graphics object. |
static Dimension |
getLabelPSFromGraphics(JLabel label,
Graphics gc)
Gets the preferred size of a swing JLabel from the font metrics
specified by the Graphics object. |
static Dimension |
getPreferredSizeFromGraphics(JComponent component,
Graphics gc,
boolean override)
Calculates the preferred size of Swing components from the font metrics in the specified Graphics object, not from the default screen font
metrics as Swing usually does. |
static void |
setEnabled(Component container,
boolean value)
Recursively calls setEnabled() on all child components of a
container. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JCSwingUtilities()
Method Detail |
public static void setEnabled(Component container, boolean value)
setEnabled()
on all child components of a
container. If the Component passed in is not a Container,
it is either enabled or disabled, and the method returns.
container
- the Component to be recursively enabled
or disabledvalue
- a boolean indicating if the container and its
children (recursively) should be enabled or disabled; true
means
enabled, false
disabledpublic static Dimension getPreferredSizeFromGraphics(JComponent component, Graphics gc, boolean override)
Graphics
object, not from the default screen font
metrics as Swing usually does. JLabel
and JButton
.
component
- The component to get the preferred size from (currently,
this must be a JButton
or a
JLabel
)gc
- The graphics object used to obtain font metricsoverride
- true
if this overrides the use of
getPreferredSize()
from the UI class specified
for the component all the time; false
if
preferred size is to be calculated by this method only when
the component's UI class is the default one
public static Dimension getLabelPSFromGraphics(JLabel label, Graphics gc)
JLabel
from the font metrics
specified by the Graphics
object.
label
- The JLabel whose preferred size is requiredgc
- The graphics object used to obtain font metrics
public static Dimension getButtonPSFromGraphics(JButton button, Graphics gc)
JButton
from the font metrics
specified by the Graphics
object.
button
- The JButton whose preferred size is requiredgc
- The graphics object used to obtain font metrics
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |