java.awt.Graphics2D.finalize()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中java.awt.Graphics2D.finalize()方法的一些代码示例,展示了Graphics2D.finalize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graphics2D.finalize()方法的具体详情如下:
包路径:java.awt.Graphics2D
类名称:Graphics2D
方法名:finalize

Graphics2D.finalize介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: net.sf.ingenias/editor

/**
 * Finalizes the object.
 */
public void finalize() {
  super.finalize();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-graphics

@Override
public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

@Override
public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-graphics

@Override
public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: org.geotools/gt-render

public void finalize() {
  delegate.finalize();
}

代码示例来源:origin: jrtom/jung

public void finalize() {
 delegate.finalize();
}

代码示例来源:origin: org.openmicroscopy/ome-poi

public void finalize() {
  System.out.println( "finalize():" );
  g2D.finalize();
}

代码示例来源:origin: com.haulmont.thirdparty/poi

public void finalize() {
  System.out.println( "finalize():" );
  g2D.finalize();
}

代码示例来源:origin: stackoverflow.com

public class ImageButton extends JButton {

  protected ImageButton(){
  }

  @Override
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    Image img = Toolkit.getDefaultToolkit().getImage("water.bmp");

    g2.drawImage(img, 45, 35, this);
    g2.finalize();
  }
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public void finalize() {
  System.out.println( "finalize():" );
  g2D.finalize();
}

代码示例来源:origin: stackoverflow.com

public class Coin{
int x;
int y;
public void Coin(int x, int y, Graphics g){
  Graphics2D g2 = (Graphics2D) g;
  Image img1 = (//File Location);
  g2.drawImage(img1, x, y, //this);
  //If you have trouble with the ImageObserver (this part) try //class name of the applet.this
  this.x = x;
  this.y = y;

  g2.finalize();
}
public int getX(){
  return x;
}
public int getY(){
  return y;
}
}

代码示例来源:origin: stackoverflow.com

public void paintComponent(Graphics g) {
  //System.out.println(gameInProgress);

  if(gameInProgress == true) {
    super.paintComponent(g);

    //Add a couple new variables
    int x = 115;

    Graphics2D g2 = (Graphics2D) g;
    Image image = null;
    int i;
    for (i = 0; i < 4; i++) {
      image = Toolkit.getDefaultToolkit().getImage("images/"+deck[i]+".png");
      //New location of g2.drawImage
      //The X positions should change each time
      g2.drawImage(image, x, 5, 80, 107, this);
      //Change the X location of the next image
      x = x + 80;
    }
    //Moved g2.drawImage from here to above the bracket
    g2.finalize();
  }
}

代码示例来源:origin: us.ihmc/ihmc-perception

public Rect[] detectAndOutline(BufferedImage bufferedImage)
{
 Rect[] faces = detect(bufferedImage);
 Graphics2D g2 = bufferedImage.createGraphics();
 for (int i = 0; i < faces.length; i++)
 {
   if (DEBUG)
   {
    System.out.println("Face " + i + ": " + faces[i]);
   }
   g2.drawRect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
 }
 g2.finalize();
 return faces;
}

代码示例来源:origin: us.ihmc/IHMCPerception

public Rect[] detectAndOutline(BufferedImage bufferedImage)
{
 Rect[] faces = detect(bufferedImage);
 Graphics2D g2 = bufferedImage.createGraphics();
 for (int i = 0; i < faces.length; i++)
 {
   if (DEBUG)
   {
    System.out.println("Face " + i + ": " + faces[i]);
   }
   g2.drawRect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
 }
 g2.finalize();
 return faces;
}

代码示例来源:origin: us.ihmc/IHMCPerception

public void drawImagePoints(BufferedImage image, Point2d[] imagePoints, Color color)
  {
   Graphics2D g2 = image.createGraphics();
   g2.setStroke(new BasicStroke(4));
   g2.setColor(color);

   for (int i = 0; i < imagePoints.length; i++)
   {
     if (i > 0)
     {
      int radius = 2;
      g2.drawOval((int) imagePoints[i].getX() - radius, (int) imagePoints[i].getY() - radius, 2 * radius, 2 * radius);
      g2.drawLine((int) imagePoints[i - 1].getX(), (int) imagePoints[i - 1].getY(), (int) imagePoints[i].getX(), (int) imagePoints[i].getY());
     }
     else
     {
      int radius = 12;
      g2.drawOval((int) imagePoints[i].getX() - radius, (int) imagePoints[i].getY() - radius, 2 * radius, 2 * radius);
     }

   }
   g2.finalize();
  }
}

代码示例来源:origin: us.ihmc/ihmc-perception

public void drawImagePoints(BufferedImage image, Point2D[] imagePoints, Color color)
  {
   Graphics2D g2 = image.createGraphics();
   g2.setStroke(new BasicStroke(4));
   g2.setColor(color);

   for (int i = 0; i < imagePoints.length; i++)
   {
     if (i > 0)
     {
      int radius = 2;
      g2.drawOval((int) imagePoints[i].getX() - radius, (int) imagePoints[i].getY() - radius, 2 * radius, 2 * radius);
      g2.drawLine((int) imagePoints[i - 1].getX(), (int) imagePoints[i - 1].getY(), (int) imagePoints[i].getX(), (int) imagePoints[i].getY());
     }
     else
     {
      int radius = 12;
      g2.drawOval((int) imagePoints[i].getX() - radius, (int) imagePoints[i].getY() - radius, 2 * radius, 2 * radius);
     }

   }
   g2.finalize();
  }
}

代码示例来源:origin: us.ihmc/ihmc-perception

public void drawBox(BufferedImage image, RigidBodyTransform transform, double scale)
  {
   DenseMatrix64F rotation =new DenseMatrix64F(3,3);
   Vector3D translation = new Vector3D();
   transform.getRotation(rotation);
   transform.getTranslation(translation);
   Se3_F64 targetToSensor = new Se3_F64(rotation,new Vector3D_F64(translation.getX(), translation.getY(), translation.getZ()));

   Graphics2D g2 = image.createGraphics();
   g2.setStroke(new BasicStroke(4));
   g2.setColor(java.awt.Color.RED);
   VisualizeFiducial.drawCube(targetToSensor, this.intrinsicParameters, scale, 2, g2);
   g2.finalize();

   
  }
}

代码示例来源:origin: us.ihmc/IHMCPerception

public void drawBox(BufferedImage image, RigidBodyTransform transform, double scale)
  {
   DenseMatrix64F rotation =new DenseMatrix64F(3,3);
   Vector3d translation = new Vector3d();
   transform.getRotation(rotation);
   transform.getTranslation(translation);
   Se3_F64 targetToSensor = new Se3_F64(rotation,new Vector3D_F64(translation.getX(), translation.getY(), translation.getZ()));

   Graphics2D g2 = image.createGraphics();
   g2.setStroke(new BasicStroke(4));
   g2.setColor(java.awt.Color.RED);
   VisualizeFiducial.drawCube(targetToSensor, this.intrinsicParameters, scale, 2, g2);
   g2.finalize();

   
  }
}

相关文章

Graphics2D类方法