Package java.awt

Examples of java.awt.Graphics2D.drawLine()


        g.setPaint(attributes.linePaint);
        g.setStroke(attributes.stroke);
        if (horizontalOrientation) {
            g.drawLine(0 + 3, height / 2, width - 3, height / 2);
        } else {
            g.drawLine(width / 2, 0 + 3, width / 2, height - 3);
        }

        return new ImageIcon(bigImage);
    }
View Full Code Here


        int imageType = BufferedImage.TYPE_INT_ARGB;
        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
        g2d.dispose();
        // byte [] imageData = AcmeGifHelper.encodeGif(bufferedImage);
View Full Code Here

        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
        g2d.dispose();
        // byte [] imageData = AcmeGifHelper.encodeGif(bufferedImage);

        // ServletOutputStream sos = response.getOutputStream();
View Full Code Here

        int imageType = BufferedImage.TYPE_INT_ARGB;
        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
        g2d.dispose();
        // byte [] imageData = AcmeGifHelper.encodeGif(bufferedImage);
View Full Code Here

        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
        g2d.dispose();
        // byte [] imageData = AcmeGifHelper.encodeGif(bufferedImage);

        // ServletOutputStream sos = response.getOutputStream();
View Full Code Here

            int lx=(_param.width-2*_param.xmargin);
            int ly=(_param.height-2*_param.ymargin);
            int nx=lx/gr;
            int ny=ly/gr;
            for(int i=0;i<=nx;i++){
                g2.drawLine(i*gr,0,i*gr,ly);
                //g2.fillRect(i*gr,0,1,ly);
            }
            for(int j=0;j<=ny;j++){
                g2.drawLine(0,j*gr,lx,j*gr);
                //g2.fillRect(0,j*gr,lx,1);
 
View Full Code Here

            for(int i=0;i<=nx;i++){
                g2.drawLine(i*gr,0,i*gr,ly);
                //g2.fillRect(i*gr,0,1,ly);
            }
            for(int j=0;j<=ny;j++){
                g2.drawLine(0,j*gr,lx,j*gr);
                //g2.fillRect(0,j*gr,lx,1);
            }
            g2.setStroke(oldStroke);
            g2.translate(-_param.xmargin,-_param.ymargin);
        }
View Full Code Here

     * @param y
     */
    public void paintIcon(Component c, Graphics g, int x, int y) {
        Graphics2D g2 = (Graphics2D)g;
        g2.setStroke(stroke);
        g2.drawLine(x, y, x + getIconWidth(), y);
    }

    /**
     *
     *
 
View Full Code Here

        g.fillRect(0, 0, width + LABEL_WIDTH, heigh + LABEL_WIDTH);

        // draw lines
        g.setColor(Color.LIGHT_GRAY);
        for (int y = GRID_SIZE; y < classNames.length; y += GRID_SIZE) {
            g.drawLine(0, y * (CELLS_SIZE + CELL_PAD), width, y
                    * (CELLS_SIZE + CELL_PAD));
        }
        for (int x = GRID_SIZE; x < jarNames.length; x += GRID_SIZE) {
            g.drawLine(x * (CELLS_SIZE + CELL_PAD), 0, x
                    * (CELLS_SIZE + CELL_PAD), heigh);
View Full Code Here

        for (int y = GRID_SIZE; y < classNames.length; y += GRID_SIZE) {
            g.drawLine(0, y * (CELLS_SIZE + CELL_PAD), width, y
                    * (CELLS_SIZE + CELL_PAD));
        }
        for (int x = GRID_SIZE; x < jarNames.length; x += GRID_SIZE) {
            g.drawLine(x * (CELLS_SIZE + CELL_PAD), 0, x
                    * (CELLS_SIZE + CELL_PAD), heigh);
        }

        // draw diagram
        for (int y = 0; y < classNames.length; y++) {
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.