Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1public class Rectangle {
2 private double width;
3 private double height;
4
5 public Rectangle(double width, double height) {
6 this.width = width;
7 this.height = height;
8 }
9
10 public double area() {
11 return width * height;
12 }
13}
14

After

1public interface Shape {
2 double area();
3}
4
5public class Rectangle implements Shape {
6 private double width;
7 private double height;
8
9 public Rectangle(double width, double height) {
10 this.width = width;
11 this.height = height;
12 }
13
14 @Override
15 public double area() {
16 return width * height;
17 }
18}
19

Before

program
class_declaration
modifiers
public "public"
class "class"
identifier "Rectangle"
class_body
{ "{"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "width"
; ";"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "height"
; ";"
constructor_declaration (+37 nodes collapsed)
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "area"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "width"
* "*"
identifier "height"
; ";"
} "}"
} "}"

After

program
interface_declaration
modifiers
public "public"
interface "interface"
identifier "Shape"
interface_body
{ "{"
method_declaration
floating_point_type
double "double"
identifier "area"
formal_parameters
( "("
) ")"
; ";"
} "}"
class_declaration
modifiers
public "public"
class "class"
identifier "Rectangle"
super_interfaces
implements "implements"
type_list
type_identifier "Shape"
class_body
{ "{"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "width"
; ";"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "height"
; ";"
constructor_declaration (+37 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
floating_point_type
double "double"
identifier "area"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "width"
* "*"
identifier "height"
; ";"
} "}"
} "}"