Package models

Examples of models.UndecoratedBranch


public class TestStarDecorator {

  public static void main(String[] args) {

    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification decoratedBranch = new StarDecorator(
        plainBranch);
    BranchOfTreeSpecification reDecoratedBranch = new StarDecorator(
        new StarDecorator(plainBranch));

    System.out.println("plainBranch.getDecorations() ="
        + plainBranch.getDecorations());
    System.out.println("decoratedBranch.getDecorations() ="
        + decoratedBranch.getDecorations());
    System.out.println("reDecoratedBranch.getDecorations() ="
        + reDecoratedBranch.getDecorations());

    plainBranch.animate();
    System.out.println("plainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranch.animate();
    System.out.println("decoratedBranch.animate.getDecorations() ="
        + decoratedBranch.getDecorations());
View Full Code Here


public class TestBallLightDecorator {

  public static void main(String[] args) {

    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification decoratedBranchLightBall = new LightsDecorator(
        new BallDecorator(plainBranch));

    BranchOfTreeSpecification reDecoratedBallLight = new BallDecorator(
        new LightsDecorator(plainBranch));

    System.out.println("plainBranch.getDecorations() ="
        + plainBranch.getDecorations());
    System.out.println("decoratedBranchLightBall.getDecorations() ="
        + decoratedBranchLightBall.getDecorations());
    System.out.println("reDecoratedBallLight.getDecorations() ="
        + reDecoratedBallLight.getDecorations());

    // Animate the first time
    System.out.println();
    plainBranch.animate();
    System.out.println("plainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranchLightBall.animate();
    System.out
        .println("decoratedBranchLightBall.animate.getDecorations() ="
            + decoratedBranchLightBall.getDecorations());
    reDecoratedBallLight.animate();

    System.out.println("reDecoratedBallLight.animate.getDecorations() ="
        + reDecoratedBallLight.getDecorations());

    // Animate the second time
    System.out.println();
    plainBranch.animate();
    System.out.println("plainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranchLightBall.animate();
    System.out
        .println("decoratedBranchLightBall.animate.getDecorations() ="
            + decoratedBranchLightBall.getDecorations());
View Full Code Here

public class TestAllDecorators {

  public static void main(String[] args) {

    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification decoratedBranchWithStar = new StarDecorator(
        plainBranch);

    BranchOfTreeSpecification redecoratedBranchWithStarBall = new BallDecorator(
        decoratedBranchWithStar);
View Full Code Here

  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification lightBranch = new LightsDecorator(plainBranch);
    BranchOfTreeSpecification ballBranch = new BallDecorator(plainBranch);
    BranchOfTreeSpecification starBranch = new StarDecorator(plainBranch);

    XMASTree myTree2Light2Ball = new XMASTree(4);
View Full Code Here

public class TestBallDecorator {
 
  public static void main (String [] args){
 
  BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
  BranchOfTreeSpecification decoratedBranch = new BallDecorator( plainBranch);
  BranchOfTreeSpecification reDecoratedBranch = new BallDecorator( new BallDecorator( plainBranch));
 
  System.out.println("plainBranch.getDecorations() ="+plainBranch.getDecorations());
  System.out.println("decoratedBranch.getDecorations() ="+decoratedBranch.getDecorations());
  System.out.println("reDecoratedBranch.getDecorations() ="
                  +reDecoratedBranch.getDecorations());
 
  plainBranch.animate();
  System.out.println("plainBranch.animate.getDecorations() ="+plainBranch.getDecorations());
 
  decoratedBranch.animate();
  System.out.println("decoratedBranch.animate.getDecorations() ="+decoratedBranch.getDecorations());
 
  reDecoratedBranch.animate();
View Full Code Here

public class TestMultiDecorators {

  public static void main(String[] args) {

    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification decoratedBranchWithStar = new StarDecorator(
        plainBranch);

    BranchOfTreeSpecification redecoratedBranchWithStarBall = new BallDecorator(
        decoratedBranchWithStar);

    BranchOfTreeSpecification redecoratedBranchWithStarBallLight = new LightsDecorator(
        redecoratedBranchWithStarBall);

    System.out.println("\nplainBranch.getDecorations() ="
        + plainBranch.getDecorations());
    System.out.println("decoratedBranchWithStar.getDecorations() ="
        + decoratedBranchWithStar.getDecorations());
    System.out.println("redecoratedBranchWithStarBall.getDecorations() ="
        + redecoratedBranchWithStarBall.getDecorations());

    System.out
        .println("redecoratedBranchWithStarBallLight.getDecorations() ="
            + redecoratedBranchWithStarBallLight.getDecorations());

    // Animate the first time
    plainBranch.animate();
    System.out.println("\nplainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranchWithStar.animate();
    System.out.println("decoratedBranchWithStar.animate.getDecorations() ="
        + decoratedBranchWithStar.getDecorations());

    redecoratedBranchWithStarBall.animate();
    System.out
        .println("redecoratedBranchWithStarBall.animate.getDecorations() ="
            + redecoratedBranchWithStarBall.getDecorations());

    redecoratedBranchWithStarBallLight.animate();
    System.out
        .println("redecoratedBranchWithStarBallLight.animate.getDecorations() ="
            + redecoratedBranchWithStarBallLight.getDecorations());

    // Animate the second time
    plainBranch.animate();
    System.out.println("\nplainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranchWithStar.animate();
    System.out.println("decoratedBranchWithStar.animate.getDecorations() ="
        + decoratedBranchWithStar.getDecorations());
View Full Code Here

public class TestLightDecorator {

  public static void main(String[] args) {

    BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
    BranchOfTreeSpecification decoratedBranch = new LightsDecorator(
        plainBranch);
    BranchOfTreeSpecification reDecoratedBranch = new LightsDecorator(
        new LightsDecorator(plainBranch));

    System.out.println("plainBranch.getDecorations() ="
        + plainBranch.getDecorations());
    System.out.println("decoratedBranch.getDecorations() ="
        + decoratedBranch.getDecorations());
    System.out.println("reDecoratedBranch.getDecorations() ="
        + reDecoratedBranch.getDecorations());

    plainBranch.animate();
    System.out.println("plainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranch.animate();
    System.out.println("decoratedBranch.animate.getDecorations() ="
        + decoratedBranch.getDecorations());

    reDecoratedBranch.animate();
    System.out.println("reDecoratedBranch.animate.getDecorations() ="
        + reDecoratedBranch.getDecorations());

    plainBranch.animate();
    System.out.println("plainBranch.animate.getDecorations() ="
        + plainBranch.getDecorations());

    decoratedBranch.animate();
    System.out.println("decoratedBranch.animate.getDecorations() ="
        + decoratedBranch.getDecorations());
View Full Code Here

TOP

Related Classes of models.UndecoratedBranch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.