Example usage for java.awt GraphicsDevice getIDstring

List of usage examples for java.awt GraphicsDevice getIDstring

Introduction

In this page you can find the example usage for java.awt GraphicsDevice getIDstring.

Prototype

public abstract String getIDstring();

Source Link

Document

Returns the identification string associated with this GraphicsDevice .

Usage

From source file:MainClass.java

public static void main(String[] a) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = ge.getScreenDevices();
    for (int i = 0; i < screenDevices.length; i++) {
        GraphicsDevice s = screenDevices[i];
        System.out.println(s.getIDstring());
    }//from  w  w w  . j av  a 2 s.  c  o  m
}

From source file:Main.java

public static void main(String[] args) {
    GraphicsDevice[] sds = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
    for (GraphicsDevice sd : sds) {
        System.out.println(sd.getIDstring());
        GraphicsConfiguration gc = sd.getDefaultConfiguration();
        JFrame f = new JFrame(gc);
        f.add(new JLabel(sd.getIDstring()));
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.pack();//from www .jav a  2  s.  co  m
        centerOn(f, gc);
        f.setVisible(true);
    }
}

From source file:Main.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice defaultScreen = ge.getDefaultScreenDevice();
    GraphicsConfiguration[] configurations = defaultScreen.getConfigurations();
    System.out.println("Default screen device: " + defaultScreen.getIDstring());
    for (int i = 0; i < configurations.length; i++) {
        System.out.println("  Configuration " + (i + 1));
        System.out.println("  " + configurations[i].getColorModel());
    }//from  w  w w .j a  v a 2 s  .  c  om
}

From source file:ShowConfigurations.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice defaultScreen = ge.getDefaultScreenDevice();
    GraphicsConfiguration[] configurations = defaultScreen.getConfigurations();
    System.out.println("Default screen device: " + defaultScreen.getIDstring());
    for (int i = 0; i < configurations.length; i++) {
        System.out.println("  Configuration " + (i + 1));
        System.out.println("  " + configurations[i].getColorModel());
    }/* ww w . ja  va2  s.c  o  m*/
    System.exit(0);
}

From source file:Main.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice defaultScreen = ge.getDefaultScreenDevice();
    GraphicsConfiguration[] configurations = defaultScreen.getConfigurations();
    System.out.println("Default screen device: " + defaultScreen.getIDstring());
    for (int i = 0; i < configurations.length; i++) {
        System.out.println("  Configuration " + (i + 1));
        GraphicsConfiguration c = configurations[i];
        System.out.println("  " + c.getColorModel());
        System.out.println("  " + c.getBounds());
        System.out.println("  " + c.getBufferCapabilities());
        System.out.println("  " + c.getDefaultTransform());
        System.out.println("  " + c.getDevice());
    }/*www . j av a2s  . c  o  m*/
}

From source file:RenderingUtils.java

private static Map desktopHints(Graphics2D g2) {
    if (isPrinting(g2)) {
        return null;
    }//from  w  w  w. j  a va 2s  .co  m
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    GraphicsDevice device = g2.getDeviceConfiguration().getDevice();
    Map desktopHints = (Map) toolkit.getDesktopProperty(PROP_DESKTOPHINTS + '.' + device.getIDstring());
    if (desktopHints == null) {
        desktopHints = (Map) toolkit.getDesktopProperty(PROP_DESKTOPHINTS);
    }
    // It is possible to get a non-empty map but with disabled AA.
    if (desktopHints != null) {
        Object aaHint = desktopHints.get(RenderingHints.KEY_TEXT_ANTIALIASING);
        if ((aaHint == RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)
                || (aaHint == RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT)) {
            desktopHints = null;
        }
    }
    return desktopHints;
}

From source file:com.sshtools.sshterm.SshTermFrame.java

public void init(SshToolsApplication application, SshToolsApplicationPanel panel)
        throws SshToolsApplicationException {
    super.init(application, panel);
    GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

    log.debug("Testing if " + device.getIDstring() + " can go full screen");
    try {/*from www.j av a 2s.c om*/
        Method m = device.getClass().getMethod("isFullScreenSupported", new Class[] {});
        if (((Boolean) m.invoke(device, new Object[] {})).booleanValue()
                || ConfigurationLoader.checkAndGetProperty("sshterm.enableFullScreen", "true").equals("true")) {
            log.info(device.getIDstring() + " can go full screen");
            addFullScreenActions();
        }
    } catch (SecurityException e) {
    } catch (NoSuchMethodException e) {
    } catch (IllegalArgumentException e) {
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }
}

From source file:org.squidy.nodes.plugin.PatternPlugin.java

@Plugin.Interface
public PNode getInterface() {

    PropertiesTable table = new PropertiesTable();

    TextFieldControl control = new TextFieldControl(remoteAddress);
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            remoteAddress = value;// www . j  av  a  2  s . c  om
            disposeControlClient();
        }
    });
    TableEntry<TextFieldControl> entry = new TableEntry<TextFieldControl>("Remote IP", "Description", control,
            "", "");
    table.addEntry(entry);

    control = new TextFieldControl(String.valueOf(remotePort));
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            remotePort = Integer.parseInt(value);
            disposeControlClient();
        }
    });
    entry = new TableEntry<TextFieldControl>("Remote Port", "Description", control, "", "");
    table.addEntry(entry);

    control = new TextFieldControl(String.valueOf(patternWidth));
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            patternWidth = Integer.parseInt(value);
        }
    });
    entry = new TableEntry<TextFieldControl>("Pattern Width", "Description", control, "", "");
    table.addEntry(entry);

    control = new TextFieldControl(String.valueOf(patternHeight));
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            patternHeight = Integer.parseInt(value);
        }
    });
    entry = new TableEntry<TextFieldControl>("Pattern Height", "Description", control, "", "");
    table.addEntry(entry);

    control = new TextFieldControl(String.valueOf(patternColumns));
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            patternColumns = Integer.parseInt(value);
        }
    });
    entry = new TableEntry<TextFieldControl>("Pattern Columns", "Description", control, "", "");
    table.addEntry(entry);

    control = new TextFieldControl(String.valueOf(patternRows));
    control.addPropertyUpdateListener(new PropertyUpdateListener<String>() {
        public void propertyUpdate(String value) {
            patternRows = Integer.parseInt(value);
        }
    });
    entry = new TableEntry<TextFieldControl>("Pattern Rows", "Description", control, "", "");
    table.addEntry(entry);

    GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    for (final GraphicsDevice device : graphicsEnvironment.getScreenDevices()) {

        CheckBoxControl control2 = new CheckBoxControl(false);
        control2.addPropertyUpdateListener(new PropertyUpdateListener<Boolean>() {

            /**
             * @param value
             */
            public void propertyUpdate(Boolean value) {

                InetAddress address = null;
                try {
                    address = InetAddress.getByName(remoteAddress);
                } catch (UnknownHostException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                try {
                    if (client == null) {
                        client = new ControlClient(address, remotePort);
                    }
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                SwitchableCommand command = new PatternScreen(device.getIDstring(), patternWidth, patternHeight,
                        patternColumns - 1, patternRows - 1);
                command.setState(value ? Switch.ON : Switch.OFF);
                client.send(command);

                Designer.getInstance().requestFocus();
            }
        });
        TableEntry<CheckBoxControl> entry2 = new TableEntry<CheckBoxControl>("Device " + device.getIDstring(),
                "Description", control2, "", "");
        table.addEntry(entry2);
    }

    CheckBoxControl loadImageControl = new CheckBoxControl(false);
    TableEntry<CheckBoxControl> loadImage = new TableEntry<CheckBoxControl>("Load Camera Image", "Description",
            loadImageControl, "", "");
    table.addEntry(loadImage);

    //   panelControl.setImage("C:\\projects\\Squidy\\squidy-2.0.0\\bayer.PNG");

    return table;

}