Examples of clipRect()


Examples of com.google.code.appengine.awt.Graphics.clipRect()

    // 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;
    }

    public void draw3DRect(int x, int y, int width, int height, boolean raised) {
        // Note: lighter/darker colors should be used to draw 3d rect.
View Full Code Here

Examples of java.awt.Graphics.clipRect()

      }

      // draw loading bar, clipping it depending on percentage done
      if (progressbar != null) {
        int barSize = (progressbar.getWidth(null) * percentage) / 100;
        og.clipRect(x-progressbar.getWidth(null)/2, 0, barSize, offscreen.getHeight(null));
        og.drawImage(progressbarBuffer, x-progressbar.getWidth(null)/2, y-progressbar.getHeight(null)/2, this);
      }

      painting = false;
    }
View Full Code Here

Examples of java.awt.Graphics.clipRect()

        BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB );
        Graphics g2 = result.getGraphics();
        g2.setColor(Color.white);
        g2.fillRect(0, 0, width,height);
        g2.translate(offsetx, -offsety);
        g2.clipRect(0,offsety,width,height);
        myChartModel.setBounds(new Dimension(chartWidth, chartHeight));
        paintChart(g2);
        //myChartModel.setTuningOptions(ChartModelImpl.TuningOptions.DEFAULT);
        return result;
View Full Code Here

Examples of java.awt.Graphics.clipRect()

    }
   
    @Override
    public void paintBorder(Graphics g) {
      Graphics graphics = g.create();
      graphics.clipRect(0, getHeight() - insets.bottom, getWidth(), 100);
      /*
       * Adjust the width, so that the drawn border does not get corners
       * that may look ugly
       */
      getBorder().paintBorder(this, graphics, -insets.left, 0,
View Full Code Here

Examples of java.awt.Graphics.clipRect()

    p.addPoint(x + width - borderWidth, y + borderWidth);
    p.addPoint(x + borderWidth, y + borderWidth);
    p.addPoint(x + borderWidth, y + height - borderWidth);
    p.addPoint(x, y + height);
    g.setClip(p);
    g.clipRect(oldClip.x, oldClip.y, oldClip.width, oldClip.height);
   
    // top border
    for (int i = x; i < x + width; i += imageWidth) {
      g.drawImage(topLeftImage, i, y, null);
    }
View Full Code Here

Examples of java.awt.Graphics.clipRect()

    p.addPoint(x, y + height);
    p.addPoint(x + borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + borderWidth);
    g.setClip(p);
    g.clipRect(oldClip.x, oldClip.y, oldClip.width, oldClip.height);
   
    // Bottom border. More than one y coordinate may be needed in case the
    // tile border coincides to be inside the bottom border.
    int startY = y + height - borderWidth - (height - borderWidth) % imageHeight;
    int endY = y + height - height % imageHeight;
View Full Code Here

Examples of java.awt.Graphics.clipRect()

        final int width = peerComponent.getWidth();
        final int height = peerComponent.getHeight();
        Graphics g = SystemProperties.getProperty("gnu.javax.swing.noGraphics2D") == null ?
            new JNodeGraphics2D(this) : GraphicsFactory.getInstance().createGraphics(this);
        g.translate(x, y);
        g.clipRect(0, 0, width, height);

        /*
        Throwable t = new Throwable();
        StackTraceElement[] st = t.getStackTrace();
        for(StackTraceElement ste : st){
View Full Code Here

Examples of java.awt.Graphics.clipRect()

      }

      // draw loading progress bar, clipping it depending on percentage done
      if (progressbar != null) {
        int barSize = (progressbar.getWidth(null) * percentage) / 100;
        og.clipRect(x-progressbar.getWidth(null)/2, 0, barSize, offscreen.getHeight(null));
        og.drawImage(progressbarBuffer, x-progressbar.getWidth(null)/2, y-progressbar.getHeight(null)/2, this);
      }

      painting = false;
    }
View Full Code Here

Examples of java.awt.Graphics.clipRect()

                    continue;
                }
                Graphics gComp = getChildJComponentGraphics(graphics, comp);
                if (gComp != null) {
                    Rectangle componentBounds = getComponentVisibleRect(comp, SwingUtilities.getLocalBounds(comp));
                    gComp.clipRect(componentBounds.x, componentBounds.y, componentBounds.width, componentBounds.height);
                    Rectangle clipBounds = gComp.getClipBounds();
                    if (!clipBounds.isEmpty()) {
                        comp.paint(gComp);
                    }
                    gComp.dispose();
View Full Code Here

Examples of java.awt.Graphics.clipRect()

                    visibleRect);

            if (repaintRect.isEmpty()) {
                return;
            }
            g.clipRect(rect.x, rect.y, rect.width, rect.height);
        }

        if (RepaintManager.currentManager(this).isDoubleBufferingEnabled()
            && effectiveRoot instanceof JComponent
            && isDoubleBufferingEnabled(effectiveRoot)) {
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.