Package java.awt

Examples of java.awt.Graphics2D.drawRect()


                            // gx += 15;
                            // gy += tileH / 2;
                            // graphics.drawString(Arrays.toString(t), gx, gy);
                            graphics.setColor(Color.RED);
                            graphics.setStroke(new BasicStroke(2));
                            graphics.drawRect(gx + 1, gy + 1, tileW - 2, tileH - 2);
                        }
                    }
                    graphics.dispose();
                    ByteArrayOutputStream output = new ByteArrayOutputStream();
                    try {
View Full Code Here


        Composite old = g2.getComposite();
        g2.setComposite(AlphaComposite.Clear);
        g2.fillRect(0, 0, w, h);
        g2.setComposite(old);
        g2.setColor(Color.BLACK);
        g2.drawRect(insets.left, insets.top, 49, 19);
        g2.setColor(Color.RED);
        g2.drawRect(0, 0, w - 1, h - 1);
        g2.dispose();
        html.println("<td>" + saveImage(img) + "</td>");
    }
View Full Code Here

        g2.fillRect(0, 0, w, h);
        g2.setComposite(old);
        g2.setColor(Color.BLACK);
        g2.drawRect(insets.left, insets.top, 49, 19);
        g2.setColor(Color.RED);
        g2.drawRect(0, 0, w - 1, h - 1);
        g2.dispose();
        html.println("<td>" + saveImage(img) + "</td>");
    }

    static void printBorder(PrintWriter html, Border border) {
View Full Code Here

            Composite old = g2.getComposite();
            g2.setComposite(AlphaComposite.Clear);
            g2.fillRect(0, 0, w, h);
            g2.setComposite(old);
            g2.setColor(Color.RED);
            g2.drawRect(0, 0, w - 1, h - 1);
            g2.dispose();
            html.println("<td>" + saveImage(img) + "</td>");
        }
    }
View Full Code Here

                       RenderingHints.VALUE_ANTIALIAS_ON);

    g.setColor(Color.WHITE);
    g.fillRect(0, 0, THUMB_WIDTH, THUMB_HEIGHT);
    g.setColor(DEFAULT_BORDER_COLOR);
    g.drawRect(0, 0, THUMB_WIDTH - 1, THUMB_WIDTH - 1);
    g.fillRect(0, THUMB_WIDTH, THUMB_WIDTH, THUMB_HEIGHT - THUMB_WIDTH);

    int w = image.getWidth();
    int h = image.getHeight();
    int kb = (int) (imageFile.length() / 1024L) + 1;
View Full Code Here

    h0 = Math.max(h0, 1);

    AbstractThumbnail.drawResizedImage(g, image, ix, iy, w0, h0, highQuality);
    image.flush();
    g.setColor(DEFAULT_BORDER_COLOR);
    g.drawRect(0, 0, THUMB_SIZE - 1, THUMB_SIZE - 1);

    OutputStream os = null;

    try {
      os = new BufferedOutputStream(new FileOutputStream(thumbnailFile));
View Full Code Here

                  }
                }
            }
            else if ( textToUse == USER_TEXT ) {
                g2.drawRect( 0, 0, w - 1, h - 1 );
                if ( !isPrinting )
                  g.drawImage( backBuffer, 0, 0, this );

                for ( int i = drawStart; i <= drawEnd; i++ ) {
                    int lineStartX = canvasInset_Y;
View Full Code Here

                    modeSpecificDrawLine( g2, userText[i], lineStartX, lineStartY );
                }
            }
            else {
                float xPos, yPos = (float) canvasInset_Y;
                g2.drawRect( 0, 0, w - 1, h - 1 );
                if ( !isPrinting )
                  g.drawImage( backBuffer, 0, 0, this );

                for ( int i = drawStart; i <= drawEnd; i++ ) {
                    TextLayout oneLine = (TextLayout) lineBreakTLs.elementAt( i );
View Full Code Here

            testFont = testFont.deriveFont( fontSize * ZOOM );
            setParams( g2 );
            g2.setColor( Color.white );
            g2.fillRect( 0, 0, zoomAreaWidth, zoomAreaHeight );
            g2.setColor( Color.black );
            g2.drawRect( 0, 0, zoomAreaWidth, zoomAreaHeight );
            modeSpecificDrawChar( g2, currMouseOverChar,
                                  zoomAreaWidth / 2, (int) ( maxAscent * ZOOM ));
            g2.dispose();
            if ( !nowZooming )
              zoomWindow.show();
View Full Code Here

      int y = measures.toY(cursor);
      Graphics2D g2 = (Graphics2D) g;
      Stroke oldStroke = g2.getStroke();
      g2.setColor(hex.getForeground());
      g2.setStroke(CURSOR_STROKE);
      g2.drawRect(x, y, measures.getCellWidth() - 1,
          measures.getCellHeight() - 1);
      g2.setStroke(oldStroke);
    }
  }
}
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.