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

…lines 1–119 unchanged (119 lines)
120 *
121 * @return A paint for the specified value.
122 */
123 public Paint getPaint(double value) {
124 double v = Math.max(value, this.lowerBound);
125 v = Math.min(v, this.upperBound);
126 int g = (int) ((value - this.lowerBound) / (this.upperBound
127 - this.lowerBound) * 255.0);
128 return new Color(g, g, g);
129 }
130
131 /**
132 * Tests this <code>GrayPaintScale</code> instance for equality with an
…lines 133–174 unchanged (42 lines)

After

…lines 1–119 unchanged (119 lines)
120 *
121 * @return A paint for the specified value.
122 */
123 public Paint getPaint(double value) {
124 double v = Math.max(value, this.lowerBound);
125 v = Math.min(v, this.upperBound);
126 int g = (int) ((v - this.lowerBound) / (this.upperBound
127 - this.lowerBound) * 255.0);
128 return new Color(g, g, g);
129 }
130
131 /**
132 * Tests this <code>GrayPaintScale</code> instance for equality with an
…lines 133–174 unchanged (42 lines)

Before

program
block_comment "/* ========================================================="...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "renderer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "awt"
. "."
identifier "Color"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "awt"
. "."
identifier "Paint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "PublicCloneable"
; ";"
block_comment "/**\r\n * A paint scale that returns shades of gray.\r\n * \r\n * "...
class_declaration
modifiers
public "public"
class "class"
identifier "GrayPaintScale"
super_interfaces
implements "implements"
type_list
type_identifier "PaintScale"
, ","
type_identifier "PublicCloneable"
, ","
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** The lower bound. */"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "lowerBound"
; ";"
block_comment "/** The upper bound. */"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "upperBound"
; ";"
block_comment "/**\r\n * Creates a new <code>GrayPaintScale</code> instan"...
constructor_declaration
modifiers
public "public"
identifier "GrayPaintScale"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
this "this"
argument_list
( "("
decimal_floating_point_literal "0.0"
, ","
decimal_floating_point_literal "1.0"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Creates a new paint scale for values in the spec"...
constructor_declaration (+62 nodes collapsed)
block_comment "/**\r\n * Returns the lower bound.\r\n * \r\n * @retur"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getLowerBound"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "lowerBound"
; ";"
} "}"
block_comment "/**\r\n * Returns the upper bound.\r\n * \r\n * @retur"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getUpperBound"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "upperBound"
; ";"
} "}"
block_comment "/**\r\n * Returns a paint for the specified value.\r\n *"...
method_declaration
modifiers
public "public"
type_identifier "Paint"
identifier "getPaint"
formal_parameters
( "("
formal_parameter
floating_point_type
double "double"
identifier "value"
) ")"
block
{ "{"
local_variable_declaration
floating_point_type
double "double"
variable_declarator
identifier "v"
= "="
method_invocation
identifier "Math"
. "."
identifier "max"
argument_list
( "("
identifier "value"
, ","
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
; ";"
expression_statement
assignment_expression
identifier "v"
= "="
method_invocation
identifier "Math"
. "."
identifier "min"
argument_list
( "("
identifier "v"
, ","
field_access
this "this"
. "."
identifier "upperBound"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "g"
= "="
cast_expression
( "("
integral_type
int "int"
) ")"
parenthesized_expression
( "("
binary_expression
binary_expression
parenthesized_expression
( "("
binary_expression
identifier "value"
- "-"
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
/ "/"
parenthesized_expression
( "("
binary_expression
field_access
this "this"
. "."
identifier "upperBound"
- "-"
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
* "*"
decimal_floating_point_literal "255.0"
) ")"
; ";"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "Color"
argument_list
( "("
identifier "g"
, ","
identifier "g"
, ","
identifier "g"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Tests this <code>GrayPaintScale</code> instance "...
method_declaration (+110 nodes collapsed)
block_comment "/**\r\n * Returns a clone of this <code>GrayPaintScale</co"...
method_declaration (+24 nodes collapsed)
} "}"

After

program
block_comment "/* ========================================================="...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "renderer"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "awt"
. "."
identifier "Color"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "awt"
. "."
identifier "Paint"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "PublicCloneable"
; ";"
block_comment "/**\r\n * A paint scale that returns shades of gray.\r\n * \r\n * "...
class_declaration
modifiers
public "public"
class "class"
identifier "GrayPaintScale"
super_interfaces
implements "implements"
type_list
type_identifier "PaintScale"
, ","
type_identifier "PublicCloneable"
, ","
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** The lower bound. */"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "lowerBound"
; ";"
block_comment "/** The upper bound. */"
field_declaration
modifiers
private "private"
floating_point_type
double "double"
variable_declarator
identifier "upperBound"
; ";"
block_comment "/**\r\n * Creates a new <code>GrayPaintScale</code> instan"...
constructor_declaration
modifiers
public "public"
identifier "GrayPaintScale"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
this "this"
argument_list
( "("
decimal_floating_point_literal "0.0"
, ","
decimal_floating_point_literal "1.0"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Creates a new paint scale for values in the spec"...
constructor_declaration (+62 nodes collapsed)
block_comment "/**\r\n * Returns the lower bound.\r\n * \r\n * @retur"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getLowerBound"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "lowerBound"
; ";"
} "}"
block_comment "/**\r\n * Returns the upper bound.\r\n * \r\n * @retur"...
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "getUpperBound"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "upperBound"
; ";"
} "}"
block_comment "/**\r\n * Returns a paint for the specified value.\r\n *"...
method_declaration
modifiers
public "public"
type_identifier "Paint"
identifier "getPaint"
formal_parameters
( "("
formal_parameter
floating_point_type
double "double"
identifier "value"
) ")"
block
{ "{"
local_variable_declaration
floating_point_type
double "double"
variable_declarator
identifier "v"
= "="
method_invocation
identifier "Math"
. "."
identifier "max"
argument_list
( "("
identifier "value"
, ","
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
; ";"
expression_statement
assignment_expression
identifier "v"
= "="
method_invocation
identifier "Math"
. "."
identifier "min"
argument_list
( "("
identifier "v"
, ","
field_access
this "this"
. "."
identifier "upperBound"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "g"
= "="
cast_expression
( "("
integral_type
int "int"
) ")"
parenthesized_expression
( "("
binary_expression
binary_expression
parenthesized_expression
( "("
binary_expression
identifier "v"
- "-"
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
/ "/"
parenthesized_expression
( "("
binary_expression
field_access
this "this"
. "."
identifier "upperBound"
- "-"
field_access
this "this"
. "."
identifier "lowerBound"
) ")"
* "*"
decimal_floating_point_literal "255.0"
) ")"
; ";"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "Color"
argument_list
( "("
identifier "g"
, ","
identifier "g"
, ","
identifier "g"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Tests this <code>GrayPaintScale</code> instance "...
method_declaration (+110 nodes collapsed)
block_comment "/**\r\n * Returns a clone of this <code>GrayPaintScale</co"...
method_declaration (+24 nodes collapsed)
} "}"