Codota Logo
ScreenUtil.getGraphicsDeviceAt
Code IndexAdd Codota to your IDE (free)

How to use
getGraphicsDeviceAt
method
in
dorkbox.util.ScreenUtil

Best Java code snippets using dorkbox.util.ScreenUtil.getGraphicsDeviceAt (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: com.dorkbox/SystemTray-Dorkbox-Util

public static
Rectangle getScreenBoundsAt(Point pos) {
  GraphicsDevice gd = getGraphicsDeviceAt(pos);
  Rectangle bounds = null;
  if (gd != null) {
    bounds = gd.getDefaultConfiguration()
          .getBounds();
  }
  return bounds;
}
origin: UNIVALI-LITE/Portugol-Studio

/**
 * have to adjust for offsets when the window-manager has a toolbar that consumes space and prevents overlap.
 *
 * this is only done on the 2nd popup is added to the list
 */
void calculateOffset(final boolean showFromTop, final int anchorX, final int anchorY) {
  if (offsetY == 0) {
    Point point = new Point(anchorX, anchorY);
    GraphicsConfiguration gc = 
        ScreenUtil.getGraphicsDeviceAt(point)
                       .getDefaultConfiguration();
    Insets screenInsets = Toolkit.getDefaultToolkit()
                   .getScreenInsets(gc);
    if (showFromTop) {
      if (screenInsets.top > 0) {
        offsetY = screenInsets.top - LookAndFeel.MARGIN;
      }
    } else {
      if (screenInsets.bottom > 0) {
        offsetY = screenInsets.bottom + LookAndFeel.MARGIN;
      }
    }
  }
}
origin: com.dorkbox/SystemTray-Dorkbox-Util

public static
void showOnSameScreenAsMouse_Center(final Container frame) {
  Point mouseLocation = MouseInfo.getPointerInfo()
                  .getLocation();
  GraphicsDevice deviceAtMouse = ScreenUtil.getGraphicsDeviceAt(mouseLocation);
  Rectangle bounds = deviceAtMouse.getDefaultConfiguration()
                  .getBounds();
  frame.setLocation(bounds.x + bounds.width / 2 - frame.getWidth() / 2, bounds.y + bounds.height / 2 - frame.getHeight() / 2);
}
origin: com.dorkbox/SystemTray-Dorkbox-Util

public static
void showOnSameScreenAsMouse(final Container frame) {
  Point mouseLocation = MouseInfo.getPointerInfo()
                  .getLocation();
  GraphicsDevice deviceAtMouse = ScreenUtil.getGraphicsDeviceAt(mouseLocation);
  frame.setLocation(deviceAtMouse.getDefaultConfiguration()
                  .getBounds().x, frame.getY());
}
origin: UNIVALI-LITE/Portugol-Studio

                .getLocation();
device = ScreenUtil.getGraphicsDeviceAt(mouseLocation);
origin: UNIVALI-LITE/Portugol-Studio

  idAndPosition = ScreenUtil.getGraphicsDeviceAt(point) + ":" + position;
} else {
  idAndPosition = parent.getName() + ":" + position;
dorkbox.utilScreenUtilgetGraphicsDeviceAt

Popular methods of ScreenUtil

  • getScreenBoundsAt

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now