mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimization
This commit is contained in:
@@ -69,10 +69,16 @@ public class ScreenUtil {
|
||||
}
|
||||
|
||||
public static Shape getAllScreensShape() {
|
||||
Rectangle[] rectangles = getAllScreenBounds();
|
||||
GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
if (devices.length == 0) {
|
||||
return new Rectangle();
|
||||
}
|
||||
if (devices.length == 1) {
|
||||
return getScreenRectangle(devices[0]);
|
||||
}
|
||||
Area area = new Area();
|
||||
for (Rectangle rectangle : rectangles) {
|
||||
area.add(new Area(rectangle));
|
||||
for (GraphicsDevice device : devices) {
|
||||
area.add(new Area(getScreenRectangle(device)));
|
||||
}
|
||||
return area;
|
||||
}
|
||||
@@ -84,6 +90,12 @@ public class ScreenUtil {
|
||||
*/
|
||||
public static Rectangle getAllScreensRectangle() {
|
||||
GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
if (devices.length == 0) {
|
||||
return new Rectangle();
|
||||
}
|
||||
if (devices.length == 1) {
|
||||
return getScreenRectangle(devices[0]);
|
||||
}
|
||||
int minX = 0;
|
||||
int maxX = 0;
|
||||
int minY = 0;
|
||||
|
||||
Reference in New Issue
Block a user