MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getScreenBounds

Method getScreenBounds

ij/src/main/java/ij/gui/GUI.java:107–118  ·  view source on GitHub ↗

Get maximum bounds for the screen that contains a given point. @param point Coordinates of point. @param accountForInsets Deduct the space taken up by menu and status bars, etc. (after point is found to be inside bonds) @return Rectangle of bounds or null if point not inside of any scre

(Point point, boolean accountForInsets)

Source from the content-addressed store, hash-verified

105 * @return Rectangle of bounds or <code>null</code> if point not inside of any screen.
106 */
107 public static Rectangle getScreenBounds(Point point, boolean accountForInsets) {
108 if (GraphicsEnvironment.isHeadless())
109 return new Rectangle(0,0,0,0);
110 for (GraphicsConfiguration config : getScreenConfigs()) {
111 Rectangle bounds = config.getBounds();
112 if (bounds != null && bounds.contains(point)) {
113 Insets insets = accountForInsets ? Toolkit.getDefaultToolkit().getScreenInsets(config) : null;
114 return shrinkByInsets(bounds, insets);
115 }
116 }
117 return null;
118 }
119
120 /**
121 * Get maximum bounds for the screen that contains a given component.

Callers 6

getScreenSizeMethod · 0.95
getLocationMethod · 0.95
runMethod · 0.95
getInfoMethod · 0.95
captureScreenMethod · 0.95
getMaxWindowBoundsMethod · 0.95

Calls 4

getScreenConfigsMethod · 0.95
shrinkByInsetsMethod · 0.95
getBoundsMethod · 0.65
containsMethod · 0.45

Tested by

no test coverage detected