Package java.awt

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


    * 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

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

  /**
   * {@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

                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

    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

  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

         */
        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

                .getBoard().getHeight() / 10 + 1];
        dirtyMap = true;

        // ensure its on screen
        Rectangle virtualBounds = new Rectangle();
        GraphicsEnvironment ge = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices();
        for (int j = 0; j < gs.length; j++) {
            GraphicsDevice gd = gs[j];
            GraphicsConfiguration[] gc = gd.getConfigurations();
            for (int i = 0; i < gc.length; i++) {
                virtualBounds = virtualBounds.union(gc[i].getBounds());
View Full Code Here

                + currentHexSideBySin30 + 2 * margin;
        requiredHeight = (2 * m_game.getBoard().getHeight() + 1)
                * currentHexSideByCos30 + 2 * margin + buttonHeight;
        // ensure its on screen
        Rectangle virtualBounds = new Rectangle();
        GraphicsEnvironment ge = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices();
        for (int j = 0; j < gs.length; j++) {
            GraphicsDevice gd = gs[j];
            GraphicsConfiguration[] gc = gd.getConfigurations();
            for (int i = 0; i < gc.length; i++) {
                virtualBounds = virtualBounds.union(gc[i].getBounds());
View Full Code Here

TOP

Related Classes of java.awt.GraphicsEnvironment

Copyright © 2018 www.massapicom. 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.