mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-10-12 01:45:18 +02:00
Formatierungen
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
package schule.ngb.zm;
|
package schule.ngb.zm;
|
||||||
|
|
||||||
import schule.ngb.zm.util.ImageLoader;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Image;
|
||||||
|
|
||||||
import java.awt.*;
|
import schule.ngb.zm.util.ImageLoader;
|
||||||
import java.awt.geom.AffineTransform;
|
|
||||||
import java.awt.image.ImageObserver;
|
|
||||||
|
|
||||||
public class ImageLayer extends Layer {
|
public class ImageLayer extends Layer {
|
||||||
|
|
||||||
@@ -16,20 +15,20 @@ public class ImageLayer extends Layer {
|
|||||||
|
|
||||||
protected boolean redraw = true;
|
protected boolean redraw = true;
|
||||||
|
|
||||||
public ImageLayer( String source ) {
|
public ImageLayer(String source) {
|
||||||
image = ImageLoader.loadImage(source);
|
image = ImageLoader.loadImage(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageLayer( Image image ) {
|
public ImageLayer(Image image) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageLayer( int width, int height, Image image ) {
|
public ImageLayer(int width, int height, Image image) {
|
||||||
super(width, height);
|
super(width, height);
|
||||||
this.image = image;
|
this.image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImage( Image image ) {
|
public void setImage(Image image) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
@@ -38,7 +37,7 @@ public class ImageLayer extends Layer {
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setX( double pX ) {
|
public void setX(double pX) {
|
||||||
this.x = pX;
|
this.x = pX;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
@@ -47,7 +46,7 @@ public class ImageLayer extends Layer {
|
|||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setY( double pY ) {
|
public void setY(double pY) {
|
||||||
this.y = pY;
|
this.y = pY;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
@@ -59,9 +58,9 @@ public class ImageLayer extends Layer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw( Graphics2D graphics ) {
|
public void draw(Graphics2D graphics) {
|
||||||
if( redraw && visible ) {
|
if (redraw && visible) {
|
||||||
drawing.drawImage(image, (int)x, (int)y, null);
|
drawing.drawImage(image, (int) x, (int) y, null);
|
||||||
redraw = false;
|
redraw = false;
|
||||||
}
|
}
|
||||||
super.draw(graphics);
|
super.draw(graphics);
|
||||||
|
|||||||
Reference in New Issue
Block a user