Package org.esa.snap.ui
Class UIUtils
java.lang.Object
org.esa.snap.ui.UIUtils
The 
UIUtils class provides methods frequently used in connection with graphical user interfaces.- Version:
 - $Revision: 8407 $ $Date: 2010-02-14 12:58:02 +0100 (So, 14 Feb 2010) $
 
- 
Field Summary
Fields - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidcenterComponent(Component comp) Centers the given component within the screen area.static voidcenterComponent(Component comp, Component alignComp) Centers the given component over another component.static JSpinnercreateDoubleSpinner(double value, double rangeMinimum, double rangeMaximum, double stepSize, double bigStepSize, String formatPattern) static BordercreateGroupBorder(String title) static JSpinnercreateSpinner(Number value, Comparable rangeMinimum, Comparable rangeMaximum, Number stepSize, Number bigStepSize, String formatPattern) static JSpinnercreateSpinner(org.esa.snap.core.param.Parameter param, Number spinnerStep, String formatPattern) static JMenustatic intfindMenuItemPosition(JPopupMenu popupMenu, String name) static intfindMenuPosition(JMenuBar menuBar, String name) static JMenufindSubMenu(JPopupMenu popupMenu, String name) static URLgetImageURL(String resourcePath) Gets the location of the given image resource path as an URL.static URLgetImageURL(String resourcePath, Class callerClass) Gets the location of the given image resource path as an URL.static FramegetRootFrame(Component component) static JFramegetRootJFrame(Component component) static WindowgetRootWindow(Component component) static intReturns the (main) screen's height in pixels.static DimensionReturns the (main) screen's size in pixels.static intReturns the (main) screen's width in pixels.static StringgetUniqueFrameTitle(JInternalFrame[] frames, String titleBase) static ImageIconloadImageIcon(String resourcePath) Gets the image icon loaded from the given resource path.static ImageIconloadImageIcon(String resourcePath, Class callerClass) Gets the image icon loaded from the given resource path.static CursorsetRootFrameCursor(Component component, Cursor newCursor) static CursorsetRootFrameDefaultCursor(Component component) static CursorsetRootFrameWaitCursor(Component component) static voidshowPopup(JPopupMenu popup, MouseEvent event) Ensures that the popup menue is allways inside the application frame 
- 
Field Details
- 
PROPERTY_SOURCE_PRODUCT
- See Also:
 
 - 
IMAGE_RESOURCE_PATH
- See Also:
 
 - 
COLOR_DARK_RED
 - 
COLOR_DARK_BLUE
 - 
COLOR_DARK_GREEN
 
 - 
 - 
Method Details
- 
loadImageIcon
Gets the image icon loaded from the given resource path.Note that this method only works for images found in the classpath of the class loader which loaded this
UIUtilsclass. If you are not sure, you should better usegetImageURL(String, Class).- Parameters:
 resourcePath- the resource path- Returns:
 - an image icon loaded from the given resource path or 
nullif it could not be found 
 - 
loadImageIcon
Gets the image icon loaded from the given resource path.- Parameters:
 resourcePath- the resource pathcallerClass- the class which calls this method and therefore provides the class loader for the requested resource- Returns:
 - an image icon loaded from the given resource path or 
nullif it could not be found - Since:
 - 4.0
 
 - 
getImageURL
Gets the location of the given image resource path as an URL.Note that this method only works for images found in the classpath of the class loader which loaded this
UIUtilsclass. If you are not sure, you should better usegetImageURL(String, Class).- Parameters:
 resourcePath- the resource path- Returns:
 - an URL representing the given resource path or 
nullif it could not be found 
 - 
getImageURL
Gets the location of the given image resource path as an URL.- Parameters:
 resourcePath- the resource pathcallerClass- the class which calls this method and therefore provides the class loader for the requested resource- Returns:
 - an URL representing the given resource path or 
nullif it could not be found - Since:
 - 4.0
 
 - 
getScreenSize
Returns the (main) screen's size in pixels. - 
getScreenWidth
public static int getScreenWidth()Returns the (main) screen's width in pixels. - 
getScreenHeight
public static int getScreenHeight()Returns the (main) screen's height in pixels. - 
centerComponent
Centers the given component within the screen area.The method performs the alignment by setting a newly computed location for the component. It does not alter the component's size.
- Parameters:
 comp- the component whose location is to be altered- Throws:
 IllegalArgumentException- if the component isnull
 - 
centerComponent
Centers the given component over another component.The method performs the alignment by setting a newly computed location for the component. It does not alter the component's size.
- Parameters:
 comp- the component whose location is to be alteredalignComp- the component used for the alignment of the first component, ifnullthe component is ceneterd within the screen area- Throws:
 IllegalArgumentException- if the component isnull
 - 
showPopup
Ensures that the popup menue is allways inside the application frame - 
getRootWindow
 - 
createGroupBorder
 - 
getRootFrame
 - 
getRootJFrame
 - 
setRootFrameWaitCursor
 - 
setRootFrameDefaultCursor
 - 
setRootFrameCursor
 - 
findMenu
 - 
findMenuPosition
 - 
findMenuItemPosition
 - 
findSubMenu
 - 
getUniqueFrameTitle
 - 
createSpinner
 - 
createDoubleSpinner
 - 
createSpinner
public static JSpinner createSpinner(Number value, Comparable rangeMinimum, Comparable rangeMaximum, Number stepSize, Number bigStepSize, String formatPattern)  
 -