mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
Weitere Methoden zum hinzufügen und entfernen von Shapes
This commit is contained in:
@@ -3,6 +3,7 @@ package schule.ngb.zm.shapes;
|
|||||||
import schule.ngb.zm.Layer;
|
import schule.ngb.zm.Layer;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
public class ShapesLayer extends Layer {
|
public class ShapesLayer extends Layer {
|
||||||
@@ -48,17 +49,35 @@ public class ShapesLayer extends Layer {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add( Shape... shape ) {
|
public void add( Shape... shapes ) {
|
||||||
synchronized( shapes ) {
|
synchronized( shapes ) {
|
||||||
for( Shape f : shape ) {
|
for( Shape s : shapes ) {
|
||||||
shapes.add(f);
|
this.shapes.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove( Shape shape ) {
|
public void add( Collection<Shape> shapes ) {
|
||||||
synchronized( shapes ) {
|
synchronized( shapes ) {
|
||||||
shapes.remove(shape);
|
for( Shape s : shapes ) {
|
||||||
|
this.shapes.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove( Shape... shapes ) {
|
||||||
|
synchronized( shapes ) {
|
||||||
|
for( Shape s: shapes ) {
|
||||||
|
this.shapes.remove(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove( Collection<Shape> shapes ) {
|
||||||
|
synchronized( shapes ) {
|
||||||
|
for( Shape s: shapes ) {
|
||||||
|
this.shapes.remove(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user