Examples of Graphics


Examples of ae.java.awt.Graphics

            if (ra.paintRects[i] != null
                && !ra.paintRects[i].isEmpty())
            {
                // Should use separate Graphics for each paint() call,
                // since paint() can change Graphics state for next call.
                Graphics g = comp.getGraphics();
                if (g != null) {
                    try {
                        g.setClip(ra.paintRects[i]);
                        if (i == UPDATE) {
                            updateComponent(comp, g);
                        } else {
                            if (shouldClearRectBeforePaint) {
                                g.clearRect( ra.paintRects[i].x,
                                             ra.paintRects[i].y,
                                             ra.paintRects[i].width,
                                             ra.paintRects[i].height);
                            }
                            paintComponent(comp, g);
                        }
                    } finally {
                        g.dispose();
                    }
                }
            }
        }
    }
View Full Code Here

Examples of ch.blackspirit.graphics.Graphics

    public void init(GLAutoDrawable drawable) {
      if(LOGGER.isLoggable(Level.FINER)) LOGGER.finer("Image graphics context initializing");
      debug(drawable);
      LOGGER.info("Initializing image graphics context");
      if(context.graphicsListener != null) {
        Graphics userGraphics = graphics;
        if(isTrace()) {
          userGraphics = traceGraphics;
          traceGraphics.setDelegate(graphics);
          traceGraphics.setLevel(getTraceLevel());
        }
View Full Code Here

Examples of cli.System.Drawing.Graphics

     * Create a Graphics with the settings for the given FontRenderContext
     *
     * @return
     */
    private static Graphics createGraphics(FontRenderContext frc){
        Graphics g = Graphics.FromImage(BITMAP);
        boolean fm = frc.usesFractionalMetrics();
        g.set_SmoothingMode(SmoothingMode.wrap(fm ? SmoothingMode.None : SmoothingMode.AntiAlias));
        g.set_PixelOffsetMode(PixelOffsetMode.wrap(fm ? PixelOffsetMode.None : PixelOffsetMode.HighQuality));
        g.set_TextRenderingHint(TextRenderingHint.wrap(fm ? TextRenderingHint.SingleBitPerPixelGridFit : TextRenderingHint.AntiAliasGridFit));
        return g;
    }
View Full Code Here

Examples of com.google.code.appengine.awt.Graphics

    }

    // Public methods

    public Graphics create(int x, int y, int width, int height) {
        Graphics res = create();
        res.translate(x, y);
        res.clipRect(0, 0, width, height);
        return res;
    }
View Full Code Here

Examples of com.sun.dtv.lwuit.Graphics

        }
        if(transitionType == TYPE_FADE) {
            motion = Motion.createSplineMotion(0, 256, speed);
            motion.start();
           
            Graphics g = buffer.getGraphics();
            g.translate(-source.getAbsoluteX(), -source.getAbsoluteY());
           
            if(getSource().getParent() != null){
                getSource().getComponentForm().paintComponent(g);
            }
            //getSource().paintBackgrounds(g);
            paint(g, getDestination(), 0, 0);
            rgbBuffer = new RGBImage(buffer.getRGB(), buffer.getWidth(), buffer.getHeight());
           
            paint(g, getSource(), 0, 0);
            g.translate(source.getAbsoluteX(), source.getAbsoluteY());
           
        } else {
            if (transitionType == TYPE_SLIDE) {
                int dest;
                int startOffset = 0;
                if (slideType == SLIDE_HORIZONTAL) {
                    dest = w;
                    if(destination instanceof Dialog) {
                        startOffset = w - ((Dialog)destination).getContentPane().getWidth();
                        if(forward) {
                            startOffset -= ((Dialog)destination).getContentPane().getStyle().getMargin(Component.LEFT);
                        } else {
                            startOffset -= ((Dialog)destination).getContentPane().getStyle().getMargin(Component.RIGHT);
                        }
                    } else {
                        if(source instanceof Dialog) {
                            dest = ((Dialog)source).getContentPane().getWidth();
                            if(forward) {
                                dest += ((Dialog)source).getContentPane().getStyle().getMargin(Component.LEFT);
                            } else {
                                dest += ((Dialog)source).getContentPane().getStyle().getMargin(Component.RIGHT);
                            }
                        }
                    }
                } else {
                    dest = h;
                    if(destination instanceof Dialog) {
                        startOffset = h - ((Dialog)destination).getContentPane().getHeight() -
                            ((Dialog)destination).getTitleComponent().getHeight();
                        if(forward) {
                            startOffset -= ((Dialog)destination).getContentPane().getStyle().getMargin(Component.BOTTOM);
                        } else {
                            startOffset -= ((Dialog)destination).getContentPane().getStyle().getMargin(Component.TOP);
                            startOffset -= ((Dialog)destination).getTitleStyle().getMargin(Component.TOP);
                            if(!drawDialogMenu && ((Dialog)destination).getCommandCount() > 0) {
                                startOffset -= ((Dialog)destination).getSoftButton(0).getParent().getHeight();
                            }
                        }
                    } else {
                        if(source instanceof Dialog) {
                            dest = ((Dialog)source).getContentPane().getHeight() +
                                ((Dialog)source).getTitleComponent().getHeight();
                            if(forward) {
                                dest += ((Dialog)source).getContentPane().getStyle().getMargin(Component.BOTTOM);
                            } else {
                                dest += ((Dialog)source).getContentPane().getStyle().getMargin(Component.TOP);
                                dest += ((Dialog)source).getTitleStyle().getMargin(Component.TOP);
                                if(((Dialog)source).getCommandCount() > 0) {
                                    dest += ((Dialog)source).getSoftButton(0).getParent().getHeight();
                                }
                            }
                        }
                    }
                }
               
                motion = Motion.createSplineMotion(startOffset, dest, speed);

                // make sure the destination is painted fully at least once
                // we must use a full buffer otherwise the clipping will take effect
                Graphics g = buffer.getGraphics();
               
                // If this is a dialog render the tinted frame once since
                // tinting is expensive
                if(getSource() instanceof Dialog) {
                    paint(g, getDestination(), 0, 0);
View Full Code Here

Examples of eu.semberal.migmang.graphics.Graphics

    public GameStatus getGameStatus() {
        return gameStatus;
    }

    public Controller() {
        view = new Graphics();
        view.attachWindowEventsListener(this);
    }
View Full Code Here

Examples of java.awt.Graphics

        BufferedImage image = ImageIO.read(tfile);

        BufferedImage myImage =
          new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics g = myImage.getGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h);

        int width = image.getWidth();
        int height = image.getHeight();

        if (width > height) {
          Image newImage =
            image.getScaledInstance(w, -1, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            0,
            (h - newImage.getHeight(null)) / 2,
            null);
        } else {
          Image newImage =
            image.getScaledInstance(-1, h, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            (w - newImage.getWidth(null)) / 2,
            0,
            null);
        }
View Full Code Here

Examples of java.awt.Graphics

        BufferedImage image = ImageIO.read(tfile);

        BufferedImage myImage =
          new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics g = myImage.getGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h);

        int width = image.getWidth();
        int height = image.getHeight();

        if (width > height) {
          Image newImage =
            image.getScaledInstance(w, -1, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            0,
            (h - newImage.getHeight(null)) / 2,
            null);
        } else {
          Image newImage =
            image.getScaledInstance(-1, h, Image.SCALE_SMOOTH);
          g.drawImage(
            newImage,
            (w - newImage.getWidth(null)) / 2,
            0,
            null);
        }
View Full Code Here

Examples of java.awt.Graphics

            BufferedImage bufImage = new BufferedImage(
                    image.getWidth(null),
                    image.getHeight(null),
                    BufferedImage.TYPE_INT_ARGB);

            Graphics g = bufImage.createGraphics();
            g.drawImage(image, 0, 0, null);
            return bufImage;
        }
    }
View Full Code Here

Examples of java.awt.Graphics

  }

  @Override
  public void paintIcon(ComponentDrawContext c,
      int x, int y, AttributeSet attrs) {
    Graphics g = c.getGraphics();
    if (toolIcon != null) {
      toolIcon.paintIcon(c.getDestination(), g, x + 2, y + 2);
    }
  }
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.