Beispiel #1
0
 protected Shape(int x, int y, int radius, DrawAPI drawAPI)
 {
     this.x       = x;
     this.y       = y;
     this.radius  = radius;
     this.drawAPI = drawAPI;
 }
Beispiel #2
0
 public Circle(int x, int y, int radius, DrawAPI api)
     : base(api)
 {
     this.x      = x;
     this.y      = y;
     this.radius = radius;
 }
Beispiel #3
0
    public static void BridgePatternDemo()
    {
        // complex drawing responsibility is left to DrawAPI
        DrawAPI drawAPI = new DrawAPI();

        Patterns.StructuralPatterns.BridgePattern.Shape shape1 = new Patterns.StructuralPatterns.BridgePattern.Circle(drawAPI);
        shape1.drawCircle();

        Patterns.StructuralPatterns.BridgePattern.Shape shape2 = new Patterns.StructuralPatterns.BridgePattern.Rectangle(drawAPI);
        shape2.drawRectangle();
    }
Beispiel #4
0
 public Circle(int x, int y, int radius, DrawAPI drawAPI) : base(drawAPI)
 {
     this.x      = x;
     this.y      = y;
     this.radius = radius;
 }
Beispiel #5
0
 public Shape(DrawAPI api)
 {
     drawAPI = api;
 }
Beispiel #6
0
 public Shape(DrawAPI drawAPI)
 {
     this.drawAPI = drawAPI;
 }
Beispiel #7
0
 protected Shape(DrawAPI a)
 {
     api = a;
 }
Beispiel #8
0
    protected DrawAPI drawAPI;                  //Cannot be accessed

    protected AbstractShape(DrawAPI drawAPI)    //Cannot be accessed
    {
        this.drawAPI = drawAPI;
    }
Beispiel #9
0
 public Shape(DrawAPI drawAPI)
 {
     _drawAPI = drawAPI;
 }
Beispiel #10
0
 public Shape(DrawAPI a)
 {
     drawAPI = a;
 }
Beispiel #11
0
 public override void Draw()
 {
     DrawAPI.drawCircle(radius, x, y);
 }
Beispiel #12
0
 public Circle(int x, int y, int radius, DrawAPI drawAPI) : base(drawAPI)
 {
     _x      = x;
     _y      = y;
     _radius = radius;
 }
Beispiel #13
0
 public FilledCircle(DrawAPI api) : base(api)
 {
 }
Beispiel #14
0
 public Circle(int x, int y, int radius, DrawAPI drawAPI) : base(drawAPI)
 {                                // the drawAPI instance is protected by the abstract class DrawAPI
     this.x      = x;
     this.y      = y;
     this.radius = radius;
 }
Beispiel #15
0
 protected Shape(DrawAPI drawAPI)
 {
     this.drawAPI = drawAPI;
 }
Beispiel #16
0
 //private int x, y, radius;
 public Circle(int x, int y, int radius, DrawAPI drawAP) : base(x, y, radius, drawAP)
 {
 }
Beispiel #17
0
 public EmptyCircle(DrawAPI api) : base(api)
 {
 }