|
Sweet Home 3D 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.eteks.sweethome3d.swing.SwingTools
public class SwingTools
Gathers some useful tools for Swing.
Method Summary | ||
---|---|---|
static void |
addAutoSelectionOnFocusGain(JTextComponent textComponent)
Adds focus and mouse listeners to the given textComponent that will
select all its text when it gains focus by transfer. |
|
static Cursor |
createCustomCursor(URL smallCursorImageUrl,
URL largeCursorImageUrl,
float xCursorHotSpot,
float yCursorHotSpot,
String cursorName,
Cursor defaultCursor)
Returns a new custom cursor. |
|
static JScrollPane |
createScrollPane(JComponent component)
Returns a scroll pane containing the given component
that always displays scroll bars under Mac OS X. |
|
static JPanel |
createTitledPanel(String title)
Returns a new panel with a border and the given title |
|
static void |
deselectAllRadioButtons(JRadioButton... radioButtons)
Forces radio buttons to be deselected even if they belong to a button group. |
|
static
|
findChildren(JComponent parent,
Class<T> childrenClass)
Returns the children of a component of the given class. |
|
static Border |
getDropableComponentBorder()
Returns the border of a component where a user may drop objects. |
|
static String |
getLocalizedLabelText(UserPreferences preferences,
Class<?> resourceClass,
String resourceKey,
Object... resourceParameters)
Returns a localized text for menus items and labels depending on the system. |
|
static BufferedImage |
getPatternImage(TextureImage pattern,
Color backgroundColor,
Color foregroundColor)
Returns the image matching a given pattern. |
|
static void |
hideDisabledMenuItems(JPopupMenu popupMenu)
Adds a listener that will update the given popup menu to hide disabled menu items. |
|
static void |
installFocusBorder(JComponent component)
Updates the border of component with an empty border
changed to a colored border when it will gain focus. |
|
static boolean |
isRectangleVisibleAtScreen(Rectangle rectangle)
Returns true if the given rectangle is fully visible at screen. |
|
static int |
showConfirmDialog(JComponent parentComponent,
JComponent messageComponent,
String title,
JComponent focusedComponent)
Displays messageComponent in a modal dialog box, giving focus to one of its components. |
|
static boolean |
showDocumentInBrowser(URL url)
Attempts to display the given url in a browser and returns true
if it was done successfully. |
|
static void |
showMessageDialog(JComponent parentComponent,
JComponent messageComponent,
String title,
int messageType,
JComponent focusedComponent)
Displays messageComponent in a modal dialog box, giving focus to one of its components. |
|
static void |
showSplashScreenWindow(URL imageUrl)
Displays the image referenced by imageUrl in an AWT window
disposed once an other AWT frame is created. |
|
static void |
updateSwingResourceLanguage()
Updates the Swing resource bundles in use from the current Locale and class loader. |
|
static void |
updateSwingResourceLanguage(UserPreferences preferences)
Updates the Swing resource bundles in use from the current Locale and the class loaders of preferences. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void installFocusBorder(JComponent component)
component
with an empty border
changed to a colored border when it will gain focus.
If the component
component is the child of a JViewPort
instance this border will be installed on its scroll pane parent.
public static void updateSwingResourceLanguage()
public static void updateSwingResourceLanguage(UserPreferences preferences)
public static String getLocalizedLabelText(UserPreferences preferences, Class<?> resourceClass, String resourceKey, Object... resourceParameters)
public static void addAutoSelectionOnFocusGain(JTextComponent textComponent)
textComponent
that will
select all its text when it gains focus by transfer.
public static void deselectAllRadioButtons(JRadioButton... radioButtons)
public static int showConfirmDialog(JComponent parentComponent, JComponent messageComponent, String title, JComponent focusedComponent)
messageComponent
in a modal dialog box, giving focus to one of its components.
public static void showMessageDialog(JComponent parentComponent, JComponent messageComponent, String title, int messageType, JComponent focusedComponent)
messageComponent
in a modal dialog box, giving focus to one of its components.
public static BufferedImage getPatternImage(TextureImage pattern, Color backgroundColor, Color foregroundColor)
public static Border getDropableComponentBorder()
public static void showSplashScreenWindow(URL imageUrl)
imageUrl
in an AWT window
disposed once an other AWT frame is created.
If the imageUrl
is incorrect, nothing happens.
public static JPanel createTitledPanel(String title)
title
public static JScrollPane createScrollPane(JComponent component)
component
that always displays scroll bars under Mac OS X.
public static void hideDisabledMenuItems(JPopupMenu popupMenu)
public static boolean showDocumentInBrowser(URL url)
url
in a browser and returns true
if it was done successfully.
public static <T extends Component> List<T> findChildren(JComponent parent, Class<T> childrenClass)
public static boolean isRectangleVisibleAtScreen(Rectangle rectangle)
true
if the given rectangle is fully visible at screen.
public static Cursor createCustomCursor(URL smallCursorImageUrl, URL largeCursorImageUrl, float xCursorHotSpot, float yCursorHotSpot, String cursorName, Cursor defaultCursor)
|
Sweet Home 3D 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License |