Package java.awt

Examples of java.awt.Graphics.drawLine()


        offset = fm.stringWidth(label) / 2;
          if (i >= max// Place rightmost label to left
        offset = fm.stringWidth(label);
   
    mygfx.drawString(label, x - offset, size.height/2);
          mygfx.drawLine(x, size.height/2, x, size.height);
    j++;
      } else
    mygfx.drawLine(x, 3 * size.height/4, x, size.height);
        }

View Full Code Here


   
    mygfx.drawString(label, x - offset, size.height/2);
          mygfx.drawLine(x, size.height/2, x, size.height);
    j++;
      } else
    mygfx.drawLine(x, 3 * size.height/4, x, size.height);
        }

  if (labelFont != null)
      mygfx.dispose();
    }
View Full Code Here

                              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);
                              }
                              g.setColor(selectionForeground);
                          } else {
                              g.setColor(getForeground());
View Full Code Here

                              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);
                              }
                              g.setColor(selectionForeground);
                          } else {
                              g.setColor(getForeground());
                          }
View Full Code Here

        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));
        return img;
    }

    public static void main(String[] args) {
View Full Code Here

   */
  private Texture getColoredImageTexture(Color color) {
    BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
    Graphics g = image.getGraphics();
    g.setColor(color);
    g.drawLine(0, 0, 0, 0);
    g.dispose();
    Texture texture = new TextureLoader(image).getTexture();
    texture.setCapability(Texture.ALLOW_IMAGE_READ);
    texture.setCapability(Texture.ALLOW_FORMAT_READ);
    texture.getImage(0).setCapability(ImageComponent2D.ALLOW_IMAGE_READ);
View Full Code Here

  private static Icon createCloseIcon(Image image) {
    Graphics g = image.getGraphics();

    g.setColor(Color.BLACK);
    /* \\\ */
    g.drawLine(1, 2, TITLEBAR_HEIGHT - 3, TITLEBAR_HEIGHT - 2);
    g.drawLine(1, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 2);
    g.drawLine(2, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 3);
   
    /* /// */
    g.drawLine(TITLEBAR_HEIGHT - 3, 1, 1, TITLEBAR_HEIGHT - 3);
View Full Code Here

    Graphics g = image.getGraphics();

    g.setColor(Color.BLACK);
    /* \\\ */
    g.drawLine(1, 2, TITLEBAR_HEIGHT - 3, TITLEBAR_HEIGHT - 2);
    g.drawLine(1, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 2);
    g.drawLine(2, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 3);
   
    /* /// */
    g.drawLine(TITLEBAR_HEIGHT - 3, 1, 1, TITLEBAR_HEIGHT - 3);
    g.drawLine(TITLEBAR_HEIGHT - 2, 1, 1, TITLEBAR_HEIGHT - 2);
View Full Code Here

    g.setColor(Color.BLACK);
    /* \\\ */
    g.drawLine(1, 2, TITLEBAR_HEIGHT - 3, TITLEBAR_HEIGHT - 2);
    g.drawLine(1, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 2);
    g.drawLine(2, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 3);
   
    /* /// */
    g.drawLine(TITLEBAR_HEIGHT - 3, 1, 1, TITLEBAR_HEIGHT - 3);
    g.drawLine(TITLEBAR_HEIGHT - 2, 1, 1, TITLEBAR_HEIGHT - 2);
    g.drawLine(TITLEBAR_HEIGHT - 2, 2, 2, TITLEBAR_HEIGHT - 2);
View Full Code Here

    g.drawLine(1, 2, TITLEBAR_HEIGHT - 3, TITLEBAR_HEIGHT - 2);
    g.drawLine(1, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 2);
    g.drawLine(2, 1, TITLEBAR_HEIGHT - 2, TITLEBAR_HEIGHT - 3);
   
    /* /// */
    g.drawLine(TITLEBAR_HEIGHT - 3, 1, 1, TITLEBAR_HEIGHT - 3);
    g.drawLine(TITLEBAR_HEIGHT - 2, 1, 1, TITLEBAR_HEIGHT - 2);
    g.drawLine(TITLEBAR_HEIGHT - 2, 2, 2, TITLEBAR_HEIGHT - 2);

    g.dispose();
    return new ImageIcon(image);
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.