> For the complete documentation index, see [llms.txt](https://easy-draw.joemazzone.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easy-draw.joemazzone.net/java/module-reference/object-methods.md).

# Object Methods

Every Easy Draw drawing object is a child class of `EasyDraw.Shape`, so they all share these methods.

## `rotate(angle)`

Rotates an Easy Draw object by a specified amount of degrees around its center.

Positive numbers rotate the shape clockwise (to the right). Negative numbers rotate the shape counter-clockwise (to the left).

```java
rect1.rotate(45);
```

A `Rectangle` can also rotate around its top-left corner instead of its center:

```java
rect1.rotate(45, true);
```

`getAngle()` tells you how far an object has been rotated in total, and `setAngle(angle)` sets it.

## `erase()`

Deletes the object from the canvas.

```java
rect1.erase();
```

## `setVisible(visible)` and `isVisible()`

Hides or shows the object without erasing it.

```java
rect1.setVisible(false);
```

## `toString()`

Returns the string representation of the object. The string will include the object type and ID number used by Easy Draw.

```java
System.out.println(rect1);
```

`getType()` returns just the type, like `"Rectangle"`, and `getId()` returns just the ID number.

## `eventSetup(event, handler)`

Binds an event to the object. See [Event Handling](https://easy-draw.joemazzone.net/java/module-reference/event-handling.md).

## Getters and Setters

Every property of an object has a getter and a setter. Getters return the property's value. Setters change the property and update the drawing right away.

```java
EasyDraw.Circle cir = new EasyDraw.Circle(300, 300, 20);

cir.setRadius(cir.getRadius() + 10);     // Grow the circle by 10
cir.setCenter(cir.getCenterX() + 5, cir.getCenterY());    // Move it right 5
```

`true` / `false` properties use `is` instead of `get`, like `isVisible()` and `isBold()`. See [Drawing Shapes](https://easy-draw.joemazzone.net/java/module-reference/drawing-shapes.md) and [Text and Images](https://easy-draw.joemazzone.net/java/module-reference/text-and-images.md) for the getters and setters of each shape.
