Examples of GraphicsEnvironment


Examples of java.awt.GraphicsEnvironment

    return (Window) component;
  }

  public static boolean safeRestoreWindow(final Window frame, final Rectangle bounds)
  {
    final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    final GraphicsDevice[] devices = graphicsEnvironment.getScreenDevices();
    for (int i = 0; i < devices.length; i++)
    {
      final GraphicsDevice device = devices[i];
      final Rectangle rectangle = device.getDefaultConfiguration().getBounds();
      if (rectangle.contains(bounds) || rectangle.equals(bounds))
View Full Code Here

Examples of java.awt.GraphicsEnvironment

            return false;
        }

        /** Return the default graphics configuration. */
        public GraphicsConfiguration getAlphaCompatibleGraphicsConfiguration() {
            GraphicsEnvironment env = GraphicsEnvironment
                                                         .getLocalGraphicsEnvironment();
            GraphicsDevice dev = env.getDefaultScreenDevice();
            return dev.getDefaultConfiguration();
        }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

        }

        /** Return the default graphics configuration. */
        public GraphicsConfiguration getAlphaCompatibleGraphicsConfiguration() {
            if (isWindowAlphaSupported()) {
                GraphicsEnvironment env =
                    GraphicsEnvironment.getLocalGraphicsEnvironment();
                GraphicsDevice[] devices = env.getScreenDevices();
                for (int i = 0; i < devices.length; i++) {
                    GraphicsConfiguration[] configs =
                        devices[i].getConfigurations();
                    for (int j = 0; j < configs.length; j++) {
                        long visualID = getVisualID(configs[j]);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    * Centers window on desktop.
    * <p>
    * @param aFrame the Frame to center
    */
   private static void center(JFrame aFrame) {
      final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      final Point centerPoint = ge.getCenterPoint();
      final Rectangle bounds = ge.getMaximumWindowBounds();
      final int w = Math.min(aFrame.getWidth(), bounds.width);
      final int h = Math.min(aFrame.getHeight(), bounds.height);
      final int x = centerPoint.x - (w / 2);
      final int y = centerPoint.y - (h / 2);
      aFrame.setBounds(x, y, w, h);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

  protected String[] getFontFamilies()
  {
    if (fontFamilyNames == null)
    {
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      fontFamilyNames = env.getAvailableFontFamilyNames();
    }
    return fontFamilyNames;
  }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

  /**
   * {@inheritDoc}
   */
    public void createDump(DumpDestination destination) throws Exception {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        // get all graphic devices attached to computer
        GraphicsDevice[] gs = ge.getScreenDevices();

        // create dump entry for each device 
        for (int i=0; i < gs.length; i++) {
            DisplayMode mode = gs[i].getDisplayMode();
            Rectangle bounds = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
View Full Code Here

Examples of java.awt.GraphicsEnvironment

                public void actionPerformed(ActionEvent e) {
                    frame.setVisible(false);
                }
            });

            GraphicsEnvironment ge =
                GraphicsEnvironment.getLocalGraphicsEnvironment();
            String[]  fontNames = ge.getAvailableFontFamilyNames();
            Dimension fontsComboBoxDimension = new Dimension(160, 25);

            fontsComboBox = new JComboBox(fontNames);

            fontsComboBox.putClientProperty("is3DEnabled", Boolean.TRUE);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    Point location = dialog.getLocation();
   
    GraphicsConfiguration bestConfiguration = null;
    int bestDistance = 0;
   
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    for( GraphicsDevice device : environment.getScreenDevices() ){
      GraphicsConfiguration configuration = device.getDefaultConfiguration();
      Rectangle screenBounds = configuration.getBounds();
     
      if( screenBounds.contains( location )){
        bestConfiguration = configuration;
View Full Code Here

Examples of java.awt.GraphicsEnvironment

  public void componentMoved(ComponentEvent e) {
    updateBounds();
  }

  public static GraphicsDevice getDevice() {
    GraphicsEnvironment g_env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = g_env.getDefaultScreenDevice();
    return device;
  }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

         */
        private GraphicsConfiguration graphicsConfigurationForComponent(Component component) {
            Point point = component.getLocationOnScreen();
           
            // try to find the graphics configuration for our point of interest
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice[] gd = ge.getScreenDevices();
            for(int i = 0; i < gd.length; i++) {
                if(gd[i].getType() != GraphicsDevice.TYPE_RASTER_SCREEN) continue;
                GraphicsConfiguration defaultGraphicsConfiguration = gd[i].getDefaultConfiguration();
                if(!defaultGraphicsConfiguration.getBounds().contains(point)) continue;
                return defaultGraphicsConfiguration;
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.