Package java.awt

Examples of java.awt.Graphics.drawLine()


                int gridynext = intervalPos(row + 1, 480, rows);

                // Horizontal grid line
                if (row > 0) {
                    drawable.setColor(Color.lightGray);
                    drawable.drawLine(0, gridy, 640 - 1, gridy);
                }

                for (int col = 0; col < cols; col++) {
                    int gridx = intervalPos(col, 640, cols);
                    int gridxnext = intervalPos(col + 1, 640, cols);
View Full Code Here


                    int gridxnext = intervalPos(col + 1, 640, cols);

                    // Vertical grid line
                    if (row == 0 && col > 0) {
                        drawable.setColor(Color.lightGray);
                        drawable.drawLine(gridx, 0, gridx, 480 - 1);
                    }

                    // Cell
                    if (Math.random() < 0.5f) {
                        drawable.setColor(Color.white);
View Full Code Here

                int gridynext = intervalPos(row + 1, 300, rows);

                // Horizontal grid line
                if (row > 0) {
                    drawable.setColor(Color.lightGray);
                    drawable.drawLine(0, gridy, 300 - 1, gridy);
                }

                for (int col = 0; col < cols; col++) {
                    int gridx = intervalPos(col, 300, cols);
                    int gridxnext = intervalPos(col + 1, 300, cols);
View Full Code Here

                    int gridxnext = intervalPos(col + 1, 300, cols);

                    // Vertical grid line
                    if (row == 0 && col > 0) {
                        drawable.setColor(Color.lightGray);
                        drawable.drawLine(gridx, 0, gridx, 300 - 1);
                    }

                    // Cell
                    int cellIndex = col + row * cols;
                    if (clickCounter > cellIndex) {
View Full Code Here

    }
    // Draw minor gridlines
    myGraphics.setColor(Color.gray);
    for (int r=0;r<rows;r++){
      int h=(int)(r*rowHeight);
      myGraphics.drawLine(0,h,gridWidth,h);
    }
    for (int c=0;c<cols;c++){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
    }
View Full Code Here

      int h=(int)(r*rowHeight);
      myGraphics.drawLine(0,h,gridWidth,h);
    }
    for (int c=0;c<cols;c++){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
    }
    // Draw major gridlines
    myGraphics.setColor(Color.black);
    for (int r=0;r<=rows;r+=5){
      int h=(int)(r*rowHeight);
 
View Full Code Here

    }
    // Draw major gridlines
    myGraphics.setColor(Color.black);
    for (int r=0;r<=rows;r+=5){
      int h=(int)(r*rowHeight);
      myGraphics.drawLine(0,h,gridWidth,h);
      myGraphics.drawLine(0,h+1,gridWidth,h+1);
    }
    for (int c=0;c<=cols;c+=5){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
View Full Code Here

    // Draw major gridlines
    myGraphics.setColor(Color.black);
    for (int r=0;r<=rows;r+=5){
      int h=(int)(r*rowHeight);
      myGraphics.drawLine(0,h,gridWidth,h);
      myGraphics.drawLine(0,h+1,gridWidth,h+1);
    }
    for (int c=0;c<=cols;c+=5){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
      myGraphics.drawLine(w+1, 0, w+1, gridHeight);
View Full Code Here

      myGraphics.drawLine(0,h,gridWidth,h);
      myGraphics.drawLine(0,h+1,gridWidth,h+1);
    }
    for (int c=0;c<=cols;c+=5){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
      myGraphics.drawLine(w+1, 0, w+1, gridHeight);
    }
    //highlight current cell
    highlightCell(myGraphics, currentRow, currentCol,true);
    markCell(myGraphics,control.markedCell);
View Full Code Here

      myGraphics.drawLine(0,h+1,gridWidth,h+1);
    }
    for (int c=0;c<=cols;c+=5){
      int w=(int)(c*columnWidth);
      myGraphics.drawLine(w, 0, w, gridHeight);
      myGraphics.drawLine(w+1, 0, w+1, gridHeight);
    }
    //highlight current cell
    highlightCell(myGraphics, currentRow, currentCol,true);
    markCell(myGraphics,control.markedCell);
  }
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.