Examples of GraphicsDevice


Examples of java.awt.GraphicsDevice

     * This is used for GraphicsConfigTemplate3D passing
     * graphics call to RequestRenderer, and for creating
     * an off-screen buffer for an off-screen Canvas3D.
     */
    private Renderer createRenderer(GraphicsConfiguration gc) {
  final GraphicsDevice gd = gc.getDevice();

  Renderer rdr = Screen3D.deviceRendererMap.get(gd);
  if (rdr != null) {
      return rdr;
  }
View Full Code Here

Examples of java.awt.GraphicsDevice

    // Issue for Issue 175
    // Pass DestroyCtxAndOffScreenBuffer to the Renderer thread for execution.
    void sendDestroyCtxAndOffScreenBuffer(Canvas3D c) {
        // Assertion check. Look for comment in sendCreateOffScreenBuffer.
        GraphicsDevice gd = c.graphicsConfiguration.getDevice();
  assert Screen3D.deviceRendererMap.get(gd) != null;

  synchronized (mcThreadLock) {
            // Issue 364: create master control thread if needed
      createMasterControlThread();
View Full Code Here

Examples of java.awt.GraphicsDevice

  // time as the MasterControl thread is trying to create a new
  // Renderer.  Fortunately, this should never happen since both
  // the GraphicsTemplate3D methods that return a valid Graphics
  // Configuration and the Canvas3D constructor will ultimately
  // cause a renderer to be created via sendRenderMessage().
  GraphicsDevice gd = c.graphicsConfiguration.getDevice();
  J3dDebug.doAssert((Screen3D.deviceRendererMap.get(gd) != null),
        "Screen3D.deviceRendererMap.get(gd) != null");

  synchronized (mcThreadLock) {
            // Create master control thread if needed
View Full Code Here

Examples of java.awt.GraphicsDevice

     */
    public static void setFullScreen(boolean fullScreen) {
        if (fullScreen != isFullScreen()) {
            DisplayHost displayHost = applicationContext.getDisplayHost();

            GraphicsDevice graphicsDevice =
                windowedHostFrame.getGraphicsConfiguration().getDevice();

            if (fullScreen) {
                // Go to full screen mode
                windowedHostFrame.remove(displayHost);
                windowedHostFrame.setVisible(false);

                fullScreenHostFrame.add(displayHost);
                fullScreenHostFrame.setVisible(true);

                graphicsDevice.setFullScreenWindow(fullScreenHostFrame);

            } else {
                // Go to windowed mode
                try {
                    graphicsDevice.setFullScreenWindow(null);
                } catch (Exception exception) {
                    // TODO remove this catch. On Win32 platforms, the
                    // preceding call can throw.
                }

View Full Code Here

Examples of java.awt.GraphicsDevice

    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.GraphicsDevice

  public void keyTyped(KeyEvent e) {}
 
  private void toggleFullScreen()
  {
    GraphicsDevice device = this.getGraphicsConfiguration().getDevice();
    if(device.isFullScreenSupported())
    {

      if(fullScreen==false)
      {
        remove( viewButton );
       
        fullScreenFrame = new JFrame();
        fullScreenFrame.setBackground(Color.black);
        fullScreenFrame.setUndecorated(true);
        fullScreenFrame.addKeyListener(this);
       
        fullScreenFrame.setLayout( new FlowLayout() );
        fullScreenFrame.add( viewLabel );
       
        device.setFullScreenWindow(fullScreenFrame);
        this.setVisible(true);
       
        fullScreen = true;
        showNewImage(image);
      }
      else
      {
        fullScreenFrame.remove( viewLabel );
        add( viewButton,BorderLayout.CENTER );
       
        device.setFullScreenWindow(null);
        fullScreenFrame.dispose();
        fullScreenFrame=null;
       
        this.setVisible(true);
       
View Full Code Here

Examples of java.awt.GraphicsDevice

        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());
            }
        }
        // zoom out if its too big for the screen
View Full Code Here

Examples of java.awt.GraphicsDevice

        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());
            }
        }
        // zoom out if its too big for the screen
View Full Code Here

Examples of java.awt.GraphicsDevice

        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());
            }
        }
        if (GUIPreferences.getInstance().getWindowSizeHeight() != 0) {
View Full Code Here

Examples of java.awt.GraphicsDevice

  public void keyTyped(KeyEvent e) {}
 
  private void toggleFullScreen()
  {
    GraphicsDevice device = this.getGraphicsConfiguration().getDevice();
    if(device.isFullScreenSupported())
    {

      if(fullScreen==false)
      {
        scrollPane.remove( screenView );
        fullScreenFrame = new JFrame();
        fullScreenFrame.setUndecorated(true);
        fullScreenFrame.addKeyListener(this);
       
        fullScreenFrame.setLayout( new FlowLayout() );
        fullScreenFrame.add( screenView );
       
        device.setFullScreenWindow(fullScreenFrame);
        this.setVisible(true);
       
        fullScreen = true;
      }
      else
      {
        fullScreenFrame.remove( screenView );
        scrollPane.setViewportView( screenView );
       
        device.setFullScreenWindow(null);
        fullScreenFrame.dispose();
        fullScreenFrame=null;
       
        this.setVisible(true);
       
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.