Examples of GraphicsEnvironment


Examples of java.awt.GraphicsEnvironment

   *
   * @param frame
   *            The frame to center
   */
  public static void centerFrameOnMainDisplay(final JFrame frame) {
    final GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    final GraphicsDevice[] screens = ge.getScreenDevices();
    if (screens.length < 1) {
      return; // Silently fail.
    }
    final Rectangle screenBounds = screens[0].getDefaultConfiguration()
        .getBounds();
View Full Code Here

Examples of java.awt.GraphicsEnvironment

   *
   * @param frame
   *            The frame to center
   */
  public void centerFrameOnMainDisplay(final JFrame frame) {
    final GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    final GraphicsDevice[] screens = ge.getScreenDevices();
    if (screens.length < 1) {
      return; // Silently fail.
    }
    final Rectangle screenBounds = screens[0].getDefaultConfiguration()
        .getBounds();
View Full Code Here

Examples of java.awt.GraphicsEnvironment

  /**
   * Initialize the font selection dialog.
   * @param selfont font selection dialog
   */
  public void setupSelFont(Object selfont) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    Font[] fonts = ge.getAllFonts();
    Object cbFonts = find(selfont, "fonts");
    String curfont = getFont().getFontName();
    float cursize = getFont().getSize2D();
    Object fsize = find(selfont, "fsize");
    NumberFormat nf = NumberFormat.getNumberInstance();
View Full Code Here

Examples of java.awt.GraphicsEnvironment

   * @return Returns the dimension of the first available screen. If in dual screen mode,
   * the first screen is used. If no screen is available (Oo), the dimension (0,0) is returned.
   * @since 3.0
   */
  public Dimension getScreenDimension() {
       final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      final GraphicsDevice[] gs = ge.getScreenDevices();

      if(gs.length>0) {
        final DisplayMode mode = gs[0].getDisplayMode();
        return new Dimension(mode.getWidth(), mode.getHeight());
      }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

        }
        data.setUserLanguage(System.getProperty("user.language") + "-" + region);
        try {
            int screenHeight = 0;
            int screenWidth = 0;
            GraphicsEnvironment ge;
            GraphicsDevice[] gs;
            ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            gs = ge.getScreenDevices();
            for (GraphicsDevice g : gs) {
                DisplayMode dm = g.getDisplayMode();
                screenWidth += dm.getWidth();
                screenHeight += dm.getHeight();
            }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

     * @return the center point of the current screen.
     * @deprecated this method is not useful in multi-screen environments.
     */
    public static Point getCenterPoint ()
    {
      final GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
      try
      {
        final Method method = GraphicsEnvironment.class.getMethod("getCenterPoint", (Class[]) null);
        return (Point) method.invoke(localGraphicsEnvironment, (Object[]) null);
      }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

   * @return the maximum bounds of the current screen.
   * @deprecated this method is not useful in multi-screen environments.
   */
    public static Rectangle getMaximumWindowBounds ()
    {
      final GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
      try
      {
        final Method method = GraphicsEnvironment.class.getMethod("getMaximumWindowBounds", (Class[]) null);
        return (Rectangle) method.invoke(localGraphicsEnvironment, (Object[]) null);
      }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

public class NoticeView extends JWindow implements ActionListener {
  private static final long  serialVersionUID  = 7125782553222257225L;
 
  public NoticeView(String msg) {
    GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
   
    setLayout(null);
    setSize(new Dimension(250, 120));
    setPreferredSize(new Dimension(250, 120));
    setAlwaysOnTop(true);
    setLocation((e.getMaximumWindowBounds().width-250), (e.getMaximumWindowBounds().height-120));
   
    JButton btnX = new JButton("X");
    btnX.setBounds(205, 0, 45, 45);
    btnX.addActionListener(this);
    add(btnX);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

@SuppressWarnings("serial")
public class CustomWait extends JFrame{

  public CustomWait(String name) {
    GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
   
    try{
         UIManager.setLookAndFeel(
              UIManager.getSystemLookAndFeelClassName());
      }
      catch(Exception ex){
      }

    JLabel j = new JLabel("Waiting for " + name);
    j.setIcon( new ImageIcon("resources/images/ajax-loader.gif"));
    j.setBackground(Color.LIGHT_GRAY);
    j.setHorizontalAlignment(SwingConstants.CENTER);
    setResizable(false);
    setAlwaysOnTop(true);
    setLocation(((e.getMaximumWindowBounds().width-200+e.getMaximumWindowBounds().x)/2), ((e.getMaximumWindowBounds().height-70+e.getMaximumWindowBounds().y)/2));
    setSize(new Dimension(200, 80));
   
    this.add(j);
  }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    super(canvas);
    this.layerId = layerId;
    bounds = b;
    layerAlpha = 1.0f;
    visible = true;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    int w = Math.max((int) b.width, 1);
    int h = Math.max((int) b.height, 1);

    if (ge.isHeadlessInstance()) {
      img = new BufferedImage(w, h,
          layerId.equals("backing") ? BufferedImage.TYPE_INT_RGB
              : BufferedImage.TYPE_INT_ARGB);
    } else {
      GraphicsConfiguration gc = ge.getDefaultScreenDevice()
          .getDefaultConfiguration();
//        int imageType = layerId.equals("backing") && false ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
//        img = new BufferedImage((int)b.width, (int)b.height, imageType);
      img = gc.createCompatibleImage(w, h,
          layerId.equals("backing") ? Transparency.OPAQUE
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.