Package java.awt

Examples of java.awt.Graphics.fillRect()


   
    private BufferedImage getChart(int offsetx, int offsety,  int width, int height, int chartWidth, int chartHeight) {
        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);
View Full Code Here


        try {
            do {
                BufferedImage bufferedimage = new BufferedImage(pageWidth, pageHeight, 1);
                Graphics g = bufferedimage.getGraphics();
                g.setColor(Color.white);
                g.fillRect(0, 0, pageWidth, pageHeight);

                if (printable.print(g, pageFormat, k) != 0) {
                    break;
                }
View Full Code Here

                }
                backingStore = createImage(s.width, s.height);
            }
            Graphics g = backingStore.getGraphics();
            g.setColor(getBackground());
            g.fillRect(0, 0, s.width - 1, s.height - 1);
            int px = 0;
            int py = 0;
            g.setColor(borderColor);
            for (int i = 0; i < borderWidth; i++) {
                g.drawRect(px, py, s.width - px - 1, s.height - py - 1);
View Full Code Here

                      n = n == null ? m.getName() : n;
                      if (m.isEnabled()) {
                          if (i == sel) {
                              g.setColor(selectionBackground);
                              int ty = borderWidth + (insets != null ? insets.top : 0) + (py - borderWidth - insets.top );
                              g.fillRect(borderWidth, ty, s.width - (borderWidth * 2), itemHeight);
                              if (borderWidth != 0) {
                                  g.setColor(borderColor);
                                  g.drawLine(borderWidth, ty, (borderWidth * 2) + s.width - 1, ty);
                                  g.drawLine(borderWidth, ty + itemHeight - 1, (borderWidth * 2) + s.width - 1, ty + itemHeight - 1);
                              }
View Full Code Here

    BufferedImage createImage() {
        Dimension d = calculateDimension();
        BufferedImage image = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
        Graphics g = image.getGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, d.width, d.height);
        printResources(g, d.width);
        return image;
    }
   
    protected int getRowHeight() {
View Full Code Here

     * test image generator
     */
    private static RenderedImage generateTestImage(int width, int height, Random r, double angle) {
        BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics g = img.getGraphics();
        g.setColor(Color.white); g.fillRect(0, 0, width, height); g.setColor(Color.BLUE);
        int x = width / 2;
        int y = height / 2;
        int radius = Math.min(x, y);
        g.drawLine(x, y, x + (int) (radius * Math.cos(angle)), y + (int) (radius * Math.sin(angle)));
        g.drawString("giftest", r.nextInt(width), r.nextInt(height));
View Full Code Here

    }
    public BufferedImage getChart(GanttExportSettings settings) {
        BufferedImage image = new BufferedImage(myMaxX, myMaxY,
                BufferedImage.TYPE_INT_RGB);
        Graphics g = image.getGraphics();
        g.fillRect(0, 0, myMaxX, myMaxY);
        paint(g);
        return image;
    }

    public String getName() {
View Full Code Here

        Graphics g2 = image2.getGraphics();
        ((Graphics2D) g2).setRenderingHint(
                RenderingHints.KEY_TEXT_ANTIALIASING,
                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g2.setColor(Color.WHITE);
        g2.fillRect(0, 0, width, height);
        printTasks(g2, myItemsToConsider);
       
        GanttImagePanel but = new GanttImagePanel("big.png", 300, 47);
        g2.setColor(new Color(102, 153, 153));
        g2.fillRect(0,0, width, but.getHeight());
View Full Code Here

        g2.fillRect(0, 0, width, height);
        printTasks(g2, myItemsToConsider);
       
        GanttImagePanel but = new GanttImagePanel("big.png", 300, 47);
        g2.setColor(new Color(102, 153, 153));
        g2.fillRect(0,0, width, but.getHeight());
        but.paintComponent(g2);       
        return image2;
    }
   
    private int getWidth() {
View Full Code Here

            while (true) {
                BufferedImage img = new BufferedImage(myPageWidth,
                        myPageHeight, BufferedImage.TYPE_INT_RGB);
                Graphics g = img.getGraphics();
                g.setColor(Color.white);
                g.fillRect(0, 0, myPageWidth, myPageHeight);
                if (myPrintable.print(g, myPageFormat, pageIndex) != Printable.PAGE_EXISTS)
                    break;
                PagePreview pp = new PagePreview(pageIndex, myPageFormat, myPrintable, myScale);
                myPreviewContainer.add(pp);
                pageIndex++;
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.