java.lang.Object
ij.gui.GUI
This class consists of static GUI utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidPositions the specified window in the center of the screen that contains target.static voidPositions the specified window in the center of the screen containing the "ImageJ" window.static ImagecreateBlankImage(int width, int height) Obsoletestatic voidLightens overly dark scrollbar background on Windows 8.static final voidWorks around an OpenJDK bug on Windows that causes the scrollbar thumb color and background color to be almost identical.static Rectanglestatic RectanglegetMaxWindowBounds(Component component) static RectanglegetMaxWindowBounds(Point point) static Rectanglestatic RectanglegetScreenBounds(Component component) static RectanglegetScreenBounds(Component component, boolean accountForInsets) Get maximum bounds for the screen that contains a given component.static RectanglegetScreenBounds(Point point) static RectanglegetScreenBounds(Point point, boolean accountForInsets) Get maximum bounds for the screen that contains a given point.static Rectanglestatic Rectanglestatic GenericDialognewNonBlockingDialog(String title) Returns a new NonBlockingGenericDialog with the given title, except when Java is running in headless mode, in which case a GenericDialog is be returned.static GenericDialognewNonBlockingDialog(String title, ImagePlus imp) Returns a new NonBlockingGenericDialog with the given title if Prefs.nonBlockingFilterDialogs is 'true' and 'imp' is displayed, otherwise returns a GenericDialog.static voidScales an AWT component according toPrefs.getGuiScale().static booleanscale(JComponent component) Tries to detect if a Swing component is unscaled and scales it it according to.invalid reference
#getGuiScale()static voidscalePopupMenu(PopupMenu popup) static booleanshowCompositeAdvisory(ImagePlus imp, String title)
-
Constructor Details
-
GUI
public GUI()
-
-
Method Details
-
center
Positions the specified window in the center of the screen that contains target. -
centerOnImageJScreen
Positions the specified window in the center of the screen containing the "ImageJ" window. -
center
-
getScreenBounds
Get maximum bounds for the screen that contains a given point.- Parameters:
point- Coordinates of point.accountForInsets- Deduct the space taken up by menu and status bars, etc. (after point is found to be inside bonds)- Returns:
- Rectangle of bounds or
nullif point not inside of any screen.
-
getScreenBounds
Get maximum bounds for the screen that contains a given component.- Parameters:
component- An AWT component located on the desired screen. Ifnullis provided, the default screen is used.accountForInsets- Deduct the space taken up by menu and status bars, etc.- Returns:
- Rectangle of bounds.
-
getScreenBounds
-
getScreenBounds
-
getScreenBounds
-
getMaxWindowBounds
-
getMaxWindowBounds
-
getMaxWindowBounds
-
getZeroBasedMaxBounds
-
getUnionOfBounds
-
createBlankImage
Obsolete -
fix
Lightens overly dark scrollbar background on Windows 8. -
showCompositeAdvisory
-
scale
Scales an AWT component according toPrefs.getGuiScale().- Parameters:
component- the AWT component to be scaled. If a container, scaling is applied to all its child components
-
scalePopupMenu
-
scale
Tries to detect if a Swing component is unscaled and scales it it according to.invalid reference
#getGuiScale()This is mainly relevant to linux: Swing components scale automatically on most platforms, specially since Java 8. However there are still exceptions to this on linux: e.g., In Ubuntu, Swing components do scale, but only under the GTK Linvalid input: '&F'. (On the other hand AWT components do not scale at all on hiDPI screens on linux).
This method tries to avoid exaggerated font sizes by detecting if a component has been already scaled by the UIManager, applying only
to the component's font if not.invalid reference
#getGuiScale()- Parameters:
component- the component to be scaled- Returns:
- true, if component's font was resized
-
fixScrollbar
Works around an OpenJDK bug on Windows that causes the scrollbar thumb color and background color to be almost identical. -
newNonBlockingDialog
Returns a new NonBlockingGenericDialog with the given title, except when Java is running in headless mode, in which case a GenericDialog is be returned. -
newNonBlockingDialog
Returns a new NonBlockingGenericDialog with the given title if Prefs.nonBlockingFilterDialogs is 'true' and 'imp' is displayed, otherwise returns a GenericDialog.- Parameters:
title- Dialog titleimp- The image associated with this dialog
-