NEED A PERFECT PAPER? PLACE YOUR FIRST ORDER AND SAVE 15% USING COUPON:

4.8/5

CAN YOU MAKE UML OF THE TWO CLASS CODE?

CAN YOU MAKE UML OF THE TWO CLASS CODE?

public class Hydron extends Monster {

Don't use plagiarized sources. Get Your Custom Essay on
CAN YOU MAKE UML OF THE TWO CLASS CODE?
Just from $13/Page
Order Essay

private Polygon triangle = new Polygon();

private double monster1X = 60.0, monster1Y = 0.0;

private double monster2X = 120.0, monster2Y = 100.0;

private double monster3X = 0.0, monster3Y = 100.0;

Label rollLabel = new Label();

Label hLabel = new Label(“Health: ” + this.health);

public Hydron(String name) {

super(name);

Label nameField = new Label(name);

setMargin(triangle, new Insets(0, 0, 0, 0));

setMargin(nameField, new Insets(0, 0, 5, 0));

setAlignment(Pos.CENTER);

triangle.getPoints().addAll(monster1X, monster1Y, monster2X, monster2Y, monster3X, monster3Y);

getChildren().add(triangle);

getChildren().add(nameField);

getChildren().add(hLabel);

}

public Polygon getTriangle() {

return triangle;

}

@Override

// change the size of the Hydrons

public void sizeChange() {

   monster1X = (monster1X / 25) * health;

   monster2X = (monster2X / 25) * health;

   monster2Y = (monster2Y / 25) * health;

   monster3Y = (monster3Y / 25) * health;

   hLabel.setText(“Health: ” + this.health);

   triangle.getPoints().setAll(monster1X, monster1Y, monster2X, monster2Y, monster3X, monster3Y);

System.out.println(“Monster 1 X: ” + monster1X);

System.out.println(“Monster 2 X: ” + monster2X);

System.out.println(“Monster 2 Y: ” + monster2Y);

System.out.println(“Monster 3 X: ” + monster3X);

}

}

_____________________________________

public class Zexor extends Monster {

private double sides = 100;

private String name;

protected Rectangle square = new Rectangle(sides, sides);

Label hLabel = new Label(“Health: ” + this.health);

public Zexor(String name) {

   super(name);

   Label nameField = new Label(name);

setMargin(square, new Insets(0, 0, 10, 10));

   setMargin(nameField, new Insets(0, 0, 10, 0));

   setAlignment(Pos.CENTER);

   getChildren().add(hLabel);

   getChildren().add(square);

   getChildren().add(nameField);

}

public void setSide(double newSides) {

   this.sides = newSides;

}

public double getSides() {

return sides;

}

@Override

public void sizeChange() {

   sides = (sides / 25) * health;

   hLabel.setText(“Health: ” + this.health);

   square.setHeight(sides);

   square.setWidth(sides);

   System.err.println(“Side: ” + sides);

}

public Rectangle getSquare() {

   return square;

Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!
Open chat
Scan the code
Need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and doctorate-prepared writers.