Examples of GraphicsConfiguration


Examples of java.awt.GraphicsConfiguration

        // create an ARGB image
        BufferedImage argbImage = new BufferedImage(width, height, imageType);

        // from there, create an image with Transparency.BITMASK
        Graphics2D g = argbImage.createGraphics();
        GraphicsConfiguration gc = g.getDeviceConfiguration();
        argbImage = gc.createCompatibleImage(width, height, Transparency.BITMASK);
        g.dispose();
        // create a red rectangle
        g = argbImage.createGraphics();
        g.setColor(Color.red);
        g.fillRect(0, 0, width, height);
View Full Code Here

Examples of java.awt.GraphicsConfiguration

  public void test(TestHarness harness)
  {
    try {
      Frame frame = new Frame();
      Window window = new Window(frame);
      GraphicsConfiguration gc = window.getGraphicsConfiguration();

      Permission[] showWindowWithoutWarningBanner = new Permission[] {
  new AWTPermission("showWindowWithoutWarningBanner")};

      TestSecurityManager sm = new TestSecurityManager(harness);
View Full Code Here

Examples of java.awt.GraphicsConfiguration

    }
    rendererRun = true;
            } else if (type == FREE_DRAWING_SURFACE) {
                Pipeline.getPipeline().freeDrawingSurfaceNative(o);
            } else if (type == GETBESTCONFIG) {
    GraphicsConfiguration gc = ((GraphicsConfiguration [])
        ((GraphicsConfigTemplate3D) o).testCfg)[0];
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if (type == ISCONFIGSUPPORT) {
    GraphicsConfiguration  gc = (GraphicsConfiguration)
        ((GraphicsConfigTemplate3D) o).testCfg;
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if ((type == SET_GRAPHICSCONFIG_FEATURES) ||
           (type == SET_QUERYPROPERTIES)) {
    GraphicsConfiguration gc = ((Canvas3D)o).graphicsConfiguration;
    sendRenderMessage(gc, o, type);
    rendererRun = true;
      } else if (type == SET_VIEW) {
    Canvas3D cv = (Canvas3D) o;
    cv.view = cv.pendingView;
View Full Code Here

Examples of java.awt.GraphicsConfiguration

                 || (this.chartBufferWidth != available.getWidth())
                 || (this.chartBufferHeight != available.getHeight()))
         {
            this.chartBufferWidth = (int) available.getWidth();
            this.chartBufferHeight = (int) available.getHeight();
            GraphicsConfiguration gc = g2.getDeviceConfiguration();
            this.chartBuffer = gc.createCompatibleImage(
                    this.chartBufferWidth, this.chartBufferHeight,
                    Transparency.TRANSLUCENT);
            this.refreshBuffer = true;
         }
View Full Code Here

Examples of java.awt.GraphicsConfiguration

  private void validateBounds(){
    Rectangle bounds = dialog.getBounds();
   
    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;
        bestDistance = 0;
      }
View Full Code Here

Examples of java.awt.GraphicsConfiguration

         */
        private boolean paintBuffered(Graphics2D graphics) {
            boolean painted = false;

            // Paint the display into an offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle clipBounds = graphics.getClipBounds();
            java.awt.image.BufferedImage bufferedImage =
                gc.createCompatibleImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            if (bufferedImage != null) {
                Graphics2D bufferedImageGraphics = (Graphics2D)bufferedImage.getGraphics();
                bufferedImageGraphics.setClip(0, 0, clipBounds.width, clipBounds.height);
View Full Code Here

Examples of java.awt.GraphicsConfiguration

         */
        private boolean paintVolatileBuffered(Graphics2D graphics) {
            boolean painted = false;

            // Paint the display into a volatile offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle clipBounds = graphics.getClipBounds();
            java.awt.image.VolatileImage volatileImage =
                gc.createCompatibleVolatileImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            // If we have a valid volatile image, attempt to paint the
            // display to it
            if (volatileImage != null) {
View Full Code Here

Examples of java.awt.GraphicsConfiguration

   * Compute the size of the drawable rectangle with respect to the frame. Take into account the
   * Frame header as well as bars that are added by the OS
   */
  @Override
  protected void calcSizes() {
      GraphicsConfiguration gc = getGraphicsConfiguration();
    Rectangle screenRect = gc.getBounds();
//System.out.println("Screen bounds: "+screenRect);
    // System.out.println("Screen size: " + screenRect);
      Toolkit tk = Toolkit.getDefaultToolkit();
      Insets desktopInsets = tk.getScreenInsets(gc);
//System.out.println("Desktop insets: "+desktopInsets);
View Full Code Here

Examples of java.awt.GraphicsConfiguration

            // 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;
            }
           
            // we couldn't find a graphics configuration, use the component's
            return component.getGraphicsConfiguration();
View Full Code Here

Examples of java.awt.GraphicsConfiguration

  //private Polygon poly = new Polygon();
 
  public Renderer() {
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice device = env.getDefaultScreenDevice();
        GraphicsConfiguration gc = device.getDefaultConfiguration();
    frame = new Frame("Fysix", gc);
    frame.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
        System.exit(0);
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.