diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2014-05-14 17:17:03 +0200 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2014-05-14 17:17:03 +0200 |
commit | 767cb91dc3dab13a60c9945b168ce04b8e5d2f53 (patch) | |
tree | 65d6aaeb6edb43376d1d55a178b1a56ed9c649f9 /src/net/java/sip/communicator/plugin/desktoputil | |
parent | bac4d9426752ca4962527cbbc19b2e80be77abae (diff) | |
download | jitsi-767cb91dc3dab13a60c9945b168ce04b8e5d2f53.zip jitsi-767cb91dc3dab13a60c9945b168ce04b8e5d2f53.tar.gz jitsi-767cb91dc3dab13a60c9945b168ce04b8e5d2f53.tar.bz2 |
Fix line endings
Diffstat (limited to 'src/net/java/sip/communicator/plugin/desktoputil')
-rw-r--r-- | src/net/java/sip/communicator/plugin/desktoputil/ScreenInformation.java | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/net/java/sip/communicator/plugin/desktoputil/ScreenInformation.java b/src/net/java/sip/communicator/plugin/desktoputil/ScreenInformation.java index f1e8f11..0020bb2 100644 --- a/src/net/java/sip/communicator/plugin/desktoputil/ScreenInformation.java +++ b/src/net/java/sip/communicator/plugin/desktoputil/ScreenInformation.java @@ -1,68 +1,68 @@ -/*
- * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.plugin.desktoputil;
-
-import java.awt.*;
-
-/**
- * A class which reads the screen bounds and provides this information.
- *
- * @author Ingo Bauersachs
- */
-public class ScreenInformation
-{
- /**
- * Calculates the bounding box of all available screens. This method is
- * highly inaccurate when screens of different sizes are used or not evenly
- * aligned. A correct implementation should generate a polygon.
- *
- * @return A polygon of the usable screen area.
- */
- public static Rectangle getScreenBounds()
- {
- final GraphicsEnvironment ge = GraphicsEnvironment
- .getLocalGraphicsEnvironment();
-
- Rectangle bounds = new Rectangle();
- for(GraphicsDevice gd : ge.getScreenDevices())
- {
- GraphicsConfiguration gc = gd.getDefaultConfiguration();
- bounds = bounds.union(gc.getBounds());
- }
- return bounds;
- }
-
- /**
- * Checks whether the top edge of the rectangle is contained in any of the
- * available screens.
- *
- * @param window The bounding box of the window.
- * @return True when the top edge is in a visible screen area; false
- * otherwise
- */
- public static boolean isTitleOnScreen(Rectangle window)
- {
- final GraphicsEnvironment ge = GraphicsEnvironment
- .getLocalGraphicsEnvironment();
-
- boolean leftInside = false;
- boolean rightInside = false;
- Point left = new Point(window.x, window.y);
- Point right = new Point(window.x, window.y + window.width);
- for(GraphicsDevice gd : ge.getScreenDevices())
- {
- GraphicsConfiguration gc = gd.getDefaultConfiguration();
- if(gc.getBounds().contains(left))
- leftInside = true;
- if(gc.getBounds().contains(right))
- rightInside = true;
- if(leftInside && rightInside)
- return true;
- }
- return leftInside && rightInside;
- }
-}
+/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.desktoputil; + +import java.awt.*; + +/** + * A class which reads the screen bounds and provides this information. + * + * @author Ingo Bauersachs + */ +public class ScreenInformation +{ + /** + * Calculates the bounding box of all available screens. This method is + * highly inaccurate when screens of different sizes are used or not evenly + * aligned. A correct implementation should generate a polygon. + * + * @return A polygon of the usable screen area. + */ + public static Rectangle getScreenBounds() + { + final GraphicsEnvironment ge = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + + Rectangle bounds = new Rectangle(); + for(GraphicsDevice gd : ge.getScreenDevices()) + { + GraphicsConfiguration gc = gd.getDefaultConfiguration(); + bounds = bounds.union(gc.getBounds()); + } + return bounds; + } + + /** + * Checks whether the top edge of the rectangle is contained in any of the + * available screens. + * + * @param window The bounding box of the window. + * @return True when the top edge is in a visible screen area; false + * otherwise + */ + public static boolean isTitleOnScreen(Rectangle window) + { + final GraphicsEnvironment ge = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + + boolean leftInside = false; + boolean rightInside = false; + Point left = new Point(window.x, window.y); + Point right = new Point(window.x, window.y + window.width); + for(GraphicsDevice gd : ge.getScreenDevices()) + { + GraphicsConfiguration gc = gd.getDefaultConfiguration(); + if(gc.getBounds().contains(left)) + leftInside = true; + if(gc.getBounds().contains(right)) + rightInside = true; + if(leftInside && rightInside) + return true; + } + return leftInside && rightInside; + } +} |