Anpassung der Package-Struktur
This commit is contained in:
parent
ccc83414c7
commit
e5c6fa634a
|
@ -27,7 +27,7 @@ und diese Projekt folgt [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
### Changed
|
||||
- Neue Package-Struktur:
|
||||
- `schule.ngb.zm.media` für Audio-Klassen (und ggf. zukünftig Video).
|
||||
- `schule.ngb.zm.tasks` für alles Rund um Parallelität.
|
||||
- `schule.ngb.zm.util.tasks` für alles Rund um Parallelität.
|
||||
- `Zeichenthread` und `TaskRunner` setzen die Namen der Threads für besseres Debugging.
|
||||
|
||||
### Removed
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
package schule.ngb.zm;
|
||||
|
||||
public class Gradient {
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package schule.ngb.zm;
|
||||
|
||||
import schule.ngb.zm.shapes.Shape;
|
||||
import schule.ngb.zm.layers.ColorLayer;
|
||||
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Graphics;
|
||||
|
@ -8,7 +8,6 @@ import java.awt.Graphics2D;
|
|||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferStrategy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package schule.ngb.zm;
|
||||
|
||||
import schule.ngb.zm.anim.Animation;
|
||||
import schule.ngb.zm.shapes.ShapesLayer;
|
||||
import schule.ngb.zm.tasks.TaskRunner;
|
||||
import schule.ngb.zm.layers.ColorLayer;
|
||||
import schule.ngb.zm.layers.DrawingLayer;
|
||||
import schule.ngb.zm.layers.ImageLayer;
|
||||
import schule.ngb.zm.layers.ShapesLayer;
|
||||
import schule.ngb.zm.util.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.ImageLoader;
|
||||
import schule.ngb.zm.util.Log;
|
||||
|
||||
|
@ -1381,8 +1384,8 @@ public class Zeichenmaschine extends Constants {
|
|||
* // Next frame has started
|
||||
* </code></pre>
|
||||
* <p>
|
||||
* Die {@link schule.ngb.zm.tasks.FrameSynchronizedTask} implementiert eine
|
||||
* {@link schule.ngb.zm.tasks.Task}, die sich automatisch auf diese Wiese
|
||||
* Die {@link schule.ngb.zm.util.tasks.FrameSynchronizedTask} implementiert eine
|
||||
* {@link schule.ngb.zm.util.tasks.Task}, die sich automatisch auf diese Wiese
|
||||
* mit dem Zeichenthread synchronisiert.
|
||||
*/
|
||||
public static final Object globalSyncLock = new Object[0];
|
||||
|
|
|
@ -2,9 +2,7 @@ package schule.ngb.zm.anim;
|
|||
|
||||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.Updatable;
|
||||
import schule.ngb.zm.events.EventDispatcher;
|
||||
import schule.ngb.zm.tasks.FrameSynchronizedTask;
|
||||
import schule.ngb.zm.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.events.EventDispatcher;
|
||||
|
||||
import java.util.function.DoubleUnaryOperator;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package schule.ngb.zm.anim;
|
||||
|
||||
import schule.ngb.zm.events.Listener;
|
||||
import schule.ngb.zm.util.events.Listener;
|
||||
|
||||
public interface AnimationListener extends Listener<Animation> {
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ package schule.ngb.zm.anim;
|
|||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.Vector;
|
||||
import schule.ngb.zm.tasks.FrameSynchronizedTask;
|
||||
import schule.ngb.zm.tasks.FramerateLimitedTask;
|
||||
import schule.ngb.zm.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.tasks.FrameSynchronizedTask;
|
||||
import schule.ngb.zm.util.tasks.FramerateLimitedTask;
|
||||
import schule.ngb.zm.util.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.Log;
|
||||
import schule.ngb.zm.util.Validator;
|
||||
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
package schule.ngb.zm;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.Layer;
|
||||
import schule.ngb.zm.Options;
|
||||
|
||||
import java.awt.GradientPaint;
|
||||
import java.awt.Paint;
|
|
@ -1,4 +1,7 @@
|
|||
package schule.ngb.zm;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Drawable;
|
||||
import schule.ngb.zm.Layer;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.util.Collections;
|
|
@ -1,5 +1,7 @@
|
|||
package schule.ngb.zm;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Layer;
|
||||
import schule.ngb.zm.Options;
|
||||
import schule.ngb.zm.util.ImageLoader;
|
||||
|
||||
import java.awt.*;
|
||||
|
@ -8,9 +10,9 @@ import java.util.Stack;
|
|||
|
||||
public class DrawingLayer extends Layer {
|
||||
|
||||
protected Color fillColor = DEFAULT_FILLCOLOR;
|
||||
protected schule.ngb.zm.Color fillColor = DEFAULT_FILLCOLOR;
|
||||
|
||||
protected Color strokeColor = DEFAULT_STROKECOLOR;
|
||||
protected schule.ngb.zm.Color strokeColor = DEFAULT_STROKECOLOR;
|
||||
|
||||
protected double strokeWeight = DEFAULT_STROKEWEIGHT;
|
||||
|
||||
|
@ -43,7 +45,7 @@ public class DrawingLayer extends Layer {
|
|||
fontMetrics = drawing.getFontMetrics();
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
public schule.ngb.zm.Color getColor() {
|
||||
return fillColor;
|
||||
}
|
||||
|
||||
|
@ -51,7 +53,7 @@ public class DrawingLayer extends Layer {
|
|||
setFillColor(gray, gray, gray, 255);
|
||||
}
|
||||
|
||||
public void setFillColor( Color color ) {
|
||||
public void setFillColor( schule.ngb.zm.Color color ) {
|
||||
fillColor = color;
|
||||
drawing.setColor(color.getJavaColor());
|
||||
}
|
||||
|
@ -69,10 +71,10 @@ public class DrawingLayer extends Layer {
|
|||
}
|
||||
|
||||
public void setFillColor( int red, int green, int blue, int alpha ) {
|
||||
setFillColor(new Color(red, green, blue, alpha));
|
||||
setFillColor(new schule.ngb.zm.Color(red, green, blue, alpha));
|
||||
}
|
||||
|
||||
public Color getStrokeColor() {
|
||||
public schule.ngb.zm.Color getStrokeColor() {
|
||||
return strokeColor;
|
||||
}
|
||||
|
||||
|
@ -80,7 +82,7 @@ public class DrawingLayer extends Layer {
|
|||
setStrokeColor(gray, gray, gray, 255);
|
||||
}
|
||||
|
||||
public void setStrokeColor( Color color ) {
|
||||
public void setStrokeColor( schule.ngb.zm.Color color ) {
|
||||
strokeColor = color;
|
||||
drawing.setColor(color.getJavaColor());
|
||||
}
|
||||
|
@ -98,7 +100,7 @@ public class DrawingLayer extends Layer {
|
|||
}
|
||||
|
||||
public void setStrokeColor( int red, int green, int blue, int alpha ) {
|
||||
setStrokeColor(new Color(red, green, blue, alpha));
|
||||
setStrokeColor(new schule.ngb.zm.Color(red, green, blue, alpha));
|
||||
}
|
||||
|
||||
public void setStrokeWeight( double pWeight ) {
|
||||
|
@ -169,10 +171,10 @@ public class DrawingLayer extends Layer {
|
|||
}
|
||||
|
||||
public void clear( int red, int green, int blue, int alpha ) {
|
||||
clear(new Color(red, green, blue, alpha));
|
||||
clear(new schule.ngb.zm.Color(red, green, blue, alpha));
|
||||
}
|
||||
|
||||
public void clear( Color pColor ) {
|
||||
public void clear( schule.ngb.zm.Color pColor ) {
|
||||
/*graphics.setBackground(pColor);
|
||||
graphics.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());*/
|
||||
java.awt.Color currentColor = drawing.getColor();
|
|
@ -1,8 +1,9 @@
|
|||
package schule.ngb.zm;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
|
||||
import schule.ngb.zm.Layer;
|
||||
import schule.ngb.zm.util.ImageLoader;
|
||||
|
||||
public class ImageLayer extends Layer {
|
|
@ -1,13 +1,17 @@
|
|||
package schule.ngb.zm;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.Layer;
|
||||
import schule.ngb.zm.Options;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public final class Shape2DLayer extends Layer {
|
||||
|
||||
protected Color strokeColor = DEFAULT_STROKECOLOR;
|
||||
protected schule.ngb.zm.Color strokeColor = DEFAULT_STROKECOLOR;
|
||||
|
||||
protected Color fillColor = DEFAULT_FILLCOLOR;
|
||||
protected schule.ngb.zm.Color fillColor = DEFAULT_FILLCOLOR;
|
||||
|
||||
protected double strokeWeight = DEFAULT_STROKEWEIGHT;
|
||||
|
||||
|
@ -39,7 +43,7 @@ public final class Shape2DLayer extends Layer {
|
|||
this.instantDraw = instantDraw;
|
||||
}
|
||||
|
||||
public Color getFillColor() {
|
||||
public schule.ngb.zm.Color getFillColor() {
|
||||
return fillColor;
|
||||
}
|
||||
|
||||
|
@ -47,7 +51,7 @@ public final class Shape2DLayer extends Layer {
|
|||
setFillColor(gray, gray, gray, 255);
|
||||
}
|
||||
|
||||
public void setFillColor( Color pColor ) {
|
||||
public void setFillColor( schule.ngb.zm.Color pColor ) {
|
||||
fillColor = pColor;
|
||||
drawing.setColor(pColor.getJavaColor());
|
||||
}
|
||||
|
@ -65,10 +69,10 @@ public final class Shape2DLayer extends Layer {
|
|||
}
|
||||
|
||||
public void setFillColor( int red, int green, int blue, int alpha ) {
|
||||
setFillColor(new Color(red, green, blue, alpha));
|
||||
setFillColor(new schule.ngb.zm.Color(red, green, blue, alpha));
|
||||
}
|
||||
|
||||
public Color getStrokeColor() {
|
||||
public schule.ngb.zm.Color getStrokeColor() {
|
||||
return strokeColor;
|
||||
}
|
||||
|
||||
|
@ -76,7 +80,7 @@ public final class Shape2DLayer extends Layer {
|
|||
setStrokeColor(gray, gray, gray, 255);
|
||||
}
|
||||
|
||||
public void setStrokeColor( Color pColor ) {
|
||||
public void setStrokeColor( schule.ngb.zm.Color pColor ) {
|
||||
strokeColor = pColor;
|
||||
drawing.setColor(pColor.getJavaColor());
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package schule.ngb.zm.shapes;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Layer;
|
||||
import schule.ngb.zm.anim.Animation;
|
||||
import schule.ngb.zm.anim.AnimationFacade;
|
||||
import schule.ngb.zm.anim.Easing;
|
||||
import schule.ngb.zm.shapes.Shape;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.util.*;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.turtle;
|
||||
package schule.ngb.zm.layers;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.Layer;
|
|
@ -1,6 +1,6 @@
|
|||
package schule.ngb.zm.media;
|
||||
|
||||
import schule.ngb.zm.events.Listener;
|
||||
import schule.ngb.zm.util.events.Listener;
|
||||
|
||||
public interface AudioListener extends Listener<Audio> {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package schule.ngb.zm.media;
|
||||
|
||||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.tasks.TaskRunner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package schule.ngb.zm.media;
|
||||
|
||||
import schule.ngb.zm.anim.Animation;
|
||||
import schule.ngb.zm.anim.AnimationListener;
|
||||
import schule.ngb.zm.events.EventDispatcher;
|
||||
import schule.ngb.zm.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.events.EventDispatcher;
|
||||
import schule.ngb.zm.util.tasks.TaskRunner;
|
||||
import schule.ngb.zm.util.Log;
|
||||
import schule.ngb.zm.util.ResourceStreamProvider;
|
||||
import schule.ngb.zm.util.Validator;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.shapes.Rectangle;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.Options;
|
||||
import schule.ngb.zm.shapes.Rectangle;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.shapes.Rectangle;
|
||||
import schule.ngb.zm.util.Validator;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Graphics2D;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.shapes.Circle;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.charts;
|
||||
package schule.ngb.zm.shapes.charts;
|
||||
|
||||
import schule.ngb.zm.Color;
|
||||
import schule.ngb.zm.shapes.Circle;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.events;
|
||||
package schule.ngb.zm.util.events;
|
||||
|
||||
import schule.ngb.zm.util.Validator;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.events;
|
||||
package schule.ngb.zm.util.events;
|
||||
|
||||
public interface Listener<E> {
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
|
||||
import schule.ngb.zm.Zeichenmaschine;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
import java.util.concurrent.Delayed;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public abstract class DelayedTask extends Task implements Delayed {
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.Zeichenmaschine;
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
import schule.ngb.zm.Constants;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
public abstract class RateLimitedTask extends Task {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
import schule.ngb.zm.Updatable;
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
package schule.ngb.zm.tasks;
|
||||
package schule.ngb.zm.util.tasks;
|
||||
|
||||
import schule.ngb.zm.util.Log;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Führt Aufgaben (Tasks) parallel zum Hauptprogramm aus.
|
|
@ -1,5 +1,6 @@
|
|||
package schule.ngb.zm;
|
||||
|
||||
import schule.ngb.zm.layers.Shape2DLayer;
|
||||
import schule.ngb.zm.shapes.Rectangle;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package schule.ngb.zm;
|
||||
|
||||
import schule.ngb.zm.turtle.TurtleLayer;
|
||||
import schule.ngb.zm.turtle.TurtleLayer.Turtle;
|
||||
import schule.ngb.zm.layers.TurtleLayer;
|
||||
import schule.ngb.zm.layers.TurtleLayer.Turtle;
|
||||
|
||||
public class TestTurtle extends Zeichenmaschine {
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import schule.ngb.zm.Color;
|
|||
import schule.ngb.zm.Constants;
|
||||
import schule.ngb.zm.Options;
|
||||
import schule.ngb.zm.Zeichenmaschine;
|
||||
import schule.ngb.zm.layers.ShapesLayer;
|
||||
import schule.ngb.zm.shapes.*;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package schule.ngb.zm.events;
|
||||
package schule.ngb.zm.util.events;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
Loading…
Reference in New Issue