You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2018/08/13 01:57:17 UTC
svn commit: r1837913 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk: ./
content/ skin/ text/
Author: rwhitcomb
Date: Mon Aug 13 01:57:16 2018
New Revision: 1837913
URL: http://svn.apache.org/viewvc?rev=1837913&view=rev
Log:
PIVOT-1032: Fix the remaining "Whitespace" errors in all the source.
Plus fix some other style errors in several of the smaller files in
this set.
Modified:
pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Dimensions.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/HyperlinkButton.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Label.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Limits.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Point.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/ScriptApplication.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollBar.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Span.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewIndexBindMapping.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerIndexBindMapping.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNumberedListView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ComponentNode.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Element.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Paragraph.java
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java Mon Aug 13 01:57:16 2018
@@ -290,7 +290,7 @@ public abstract class Button extends Com
if (queuedActionDelay <= 0) {
ApplicationContext.queueCallback(actionCallback);
} else {
- ApplicationContext.scheduleCallback(actionCallback, (long)queuedActionDelay);
+ ApplicationContext.scheduleCallback(actionCallback, (long) queuedActionDelay);
}
} else {
action.perform(this);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Mon Aug 13 01:57:16 2018
@@ -125,7 +125,7 @@ public abstract class Component implemen
* @return The previous value in the target dictionary (but note
* the caveats from the {@link #put(String,Object)} method.
*/
- public Object copy(Style key, Dictionary<String,Object> source) {
+ public Object copy(Style key, Dictionary<String, Object> source) {
return copy(key.toString(), source);
}
@@ -410,11 +410,14 @@ public abstract class Component implemen
// Event listener lists
private ComponentListener.Listeners componentListeners = new ComponentListener.Listeners();
private ComponentStateListener.Listeners componentStateListeners = new ComponentStateListener.Listeners();
- private ComponentDecoratorListener.Listeners componentDecoratorListeners = new ComponentDecoratorListener.Listeners();
+ private ComponentDecoratorListener.Listeners componentDecoratorListeners =
+ new ComponentDecoratorListener.Listeners();
private ComponentStyleListener.Listeners componentStyleListeners = new ComponentStyleListener.Listeners();
private ComponentMouseListener.Listeners componentMouseListeners = new ComponentMouseListener.Listeners();
- private ComponentMouseButtonListener.Listeners componentMouseButtonListeners = new ComponentMouseButtonListener.Listeners();
- private ComponentMouseWheelListener.Listeners componentMouseWheelListeners = new ComponentMouseWheelListener.Listeners();
+ private ComponentMouseButtonListener.Listeners componentMouseButtonListeners =
+ new ComponentMouseButtonListener.Listeners();
+ private ComponentMouseWheelListener.Listeners componentMouseWheelListeners =
+ new ComponentMouseWheelListener.Listeners();
private ComponentKeyListener.Listeners componentKeyListeners = new ComponentKeyListener.Listeners();
private ComponentTooltipListener.Listeners componentTooltipListeners = new ComponentTooltipListener.Listeners();
private ComponentDataListener.Listeners componentDataListeners = new ComponentDataListener.Listeners();
@@ -2564,7 +2567,7 @@ public abstract class Component implemen
* component.
*/
public TextInputMethodListener getTextInputMethodListener() {
- return ((ComponentSkin)getSkin()).getTextInputMethodListener();
+ return ((ComponentSkin) getSkin()).getTextInputMethodListener();
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Dimensions.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Dimensions.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Dimensions.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Dimensions.java Mon Aug 13 01:57:16 2018
@@ -44,34 +44,34 @@ public final class Dimensions implements
*
* @param side The width and height of this dimensions.
*/
- public Dimensions(int side) {
+ public Dimensions(final int side) {
this.width = this.height = side;
}
- public Dimensions(int width, int height) {
+ public Dimensions(final int width, final int height) {
this.width = width;
this.height = height;
}
- public Dimensions(Dimensions dimensions) {
+ public Dimensions(final Dimensions dimensions) {
Utils.checkNull(dimensions, "dimensions");
this.width = dimensions.width;
this.height = dimensions.height;
}
- public Dimensions(Dictionary<String, ?> dimensions) {
+ public Dimensions(final Dictionary<String, ?> dimensions) {
Utils.checkNull(dimensions, "dimensions");
width = dimensions.getInt(WIDTH_KEY, 0);
height = dimensions.getInt(HEIGHT_KEY, 0);
}
- public Dimensions(Sequence<?> dimensions) {
+ public Dimensions(final Sequence<?> dimensions) {
Utils.checkNull(dimensions, "dimensions");
- width = ((Number)dimensions.get(0)).intValue();
- height = ((Number)dimensions.get(1)).intValue();
+ width = ((Number) dimensions.get(0)).intValue();
+ height = ((Number) dimensions.get(1)).intValue();
}
/**
@@ -81,7 +81,7 @@ public final class Dimensions implements
* @param factor The amount to add to/subtract from both the width and height.
* @return The new dimensions with the changed values.
*/
- public Dimensions expand(int factor) {
+ public Dimensions expand(final int factor) {
return new Dimensions(width + factor, height + factor);
}
@@ -93,7 +93,7 @@ public final class Dimensions implements
* @param heightDelta The amount to add to/subtract from the height.
* @return The new dimensions with the changed values.
*/
- public Dimensions expand(int widthDelta, int heightDelta) {
+ public Dimensions expand(final int widthDelta, final int heightDelta) {
return new Dimensions(width + widthDelta, height + heightDelta);
}
@@ -104,12 +104,12 @@ public final class Dimensions implements
* @param insets The padding amounts (width and height) to expand by.
* @return The new dimensions with the changed values.
*/
- public Dimensions expand(Insets insets) {
+ public Dimensions expand(final Insets insets) {
return new Dimensions(width + insets.getWidth(), height + insets.getHeight());
}
@Override
- public boolean equals(Object object) {
+ public boolean equals(final Object object) {
boolean equals = false;
if (object instanceof Dimensions) {
@@ -148,7 +148,7 @@ public final class Dimensions implements
* @see #Dimensions(Sequence)
* @see #Dimensions(int, int)
*/
- public static Dimensions decode(String value) {
+ public static Dimensions decode(final String value) {
Utils.checkNullOrEmpty(value, "dimensions");
Dimensions dimensions;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/HyperlinkButton.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/HyperlinkButton.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/HyperlinkButton.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/HyperlinkButton.java Mon Aug 13 01:57:16 2018
@@ -46,7 +46,7 @@ public class HyperlinkButton extends Lin
private class URIAction extends Action {
private URI uri;
- public URIAction(URI uri) {
+ public URIAction(final URI uri) {
this.uri = uri;
}
@@ -54,12 +54,12 @@ public class HyperlinkButton extends Lin
return uri;
}
- public void setUri(URI uri) {
+ public void setUri(final URI uri) {
this.uri = uri;
}
@Override
- public void perform(Component source) {
+ public void perform(final Component source) {
if (uri == null) {
throw new RuntimeException("URI is null.");
}
@@ -87,14 +87,14 @@ public class HyperlinkButton extends Lin
* and the {@link URI} target to null.
*/
public HyperlinkButton() {
- this((URI)null);
+ this((URI) null);
}
/**
* Construct a hyperlink button that references the given {@link URI}.
* @param uri The target of this hyperlink.
*/
- public HyperlinkButton(URI uri) {
+ public HyperlinkButton(final URI uri) {
super();
setUri(uri);
@@ -108,7 +108,7 @@ public class HyperlinkButton extends Lin
* @param uriString The target of this hyperlink given as a string.
* @throws URISyntaxException if the string argument is not a proper URI.
*/
- public HyperlinkButton(String uriString) throws URISyntaxException {
+ public HyperlinkButton(final String uriString) throws URISyntaxException {
this(uriString == null ? null : new URI(uriString));
}
@@ -117,7 +117,7 @@ public class HyperlinkButton extends Lin
* @param url The target of this hyperlink.
* @throws URISyntaxException if the URL does not specify a valid {@link URI}.
*/
- public HyperlinkButton(URL url) throws URISyntaxException {
+ public HyperlinkButton(final URL url) throws URISyntaxException {
this(url == null ? null : url.toURI());
}
@@ -127,7 +127,7 @@ public class HyperlinkButton extends Lin
* @param text Alternate text for the hyperlink.
* @param uri The target of this hyperlink.
*/
- public HyperlinkButton(String text, URI uri) {
+ public HyperlinkButton(final String text, final URI uri) {
this(uri);
setButtonData(text);
}
@@ -139,7 +139,7 @@ public class HyperlinkButton extends Lin
* @param uriString The string specifying the hyperlink target.
* @throws URISyntaxException if the string does not specify a valid {@link URI}.
*/
- public HyperlinkButton(String text, String uriString) throws URISyntaxException {
+ public HyperlinkButton(final String text, final String uriString) throws URISyntaxException {
this(text, new URI(uriString));
}
@@ -160,7 +160,7 @@ public class HyperlinkButton extends Lin
* the URI set as an element property.
* @param uri The target for this hyperlink.
*/
- public void setUri(URI uri) {
+ public void setUri(final URI uri) {
// If the user has already set the button data in BXML,
// then don't set the data to this new URI string
Object buttonData = getButtonData();
@@ -183,7 +183,7 @@ public class HyperlinkButton extends Lin
* @throws URISyntaxException if the string is not a valid {@link URI}.
* @see #setUri(URI)
*/
- public void setUri(String uriString) throws URISyntaxException {
+ public void setUri(final String uriString) throws URISyntaxException {
Utils.checkNullOrEmpty(uriString, "URI string");
setUri(new URI(uriString));
}
@@ -194,7 +194,7 @@ public class HyperlinkButton extends Lin
* @throws URISyntaxException if the <code>URL</code> does not specify
* a valid {@link URI}.
*/
- public void setUrl(URL url) throws URISyntaxException {
+ public void setUrl(final URL url) throws URISyntaxException {
setUri(url == null ? null : url.toURI());
}
@@ -206,7 +206,7 @@ public class HyperlinkButton extends Lin
* @throws MalformedURLException if the string cannot be converted to a <code>URL</code>
* @throws URISyntaxException if the <code>URL</code> does not specify a valid {@link URI}.
*/
- public void setUrl(String urlString) throws MalformedURLException, URISyntaxException {
+ public void setUrl(final String urlString) throws MalformedURLException, URISyntaxException {
Utils.checkNullOrEmpty(urlString, "URL string");
setUrl(new URL(urlString));
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Label.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Label.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Label.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Label.java Mon Aug 13 01:57:16 2018
@@ -62,7 +62,7 @@ public class Label extends Component {
this("");
}
- public Label(String text) {
+ public Label(final String text) {
setText(text);
installSkin(Label.class);
@@ -82,7 +82,7 @@ public class Label extends Component {
* @throws IllegalArgumentException if the text is {@code null} or if
* the text length exceeds the allowed maximum.
*/
- public void setText(String text) {
+ public void setText(final String text) {
Utils.checkNull(text, "text");
if (text.length() > maximumLength) {
@@ -104,7 +104,7 @@ public class Label extends Component {
* @param text The text to set (if {@code null} will set an empty string {@code ""}).
* @see #setText
*/
- public void setTextOrEmpty(String text) {
+ public void setTextOrEmpty(final String text) {
this.setText(text != null ? text : "");
}
@@ -130,7 +130,7 @@ public class Label extends Component {
* @param maximumLength The maximum length of the label text.
* @throws IllegalArgumentException if the length given is negative.
*/
- public void setMaximumLength(int maximumLength) {
+ public void setMaximumLength(final int maximumLength) {
Utils.checkNonNegative(maximumLength, "maximumLength");
int previousMaximumLength = this.maximumLength;
@@ -152,7 +152,7 @@ public class Label extends Component {
*
* @param textKey The text key, or <tt>null</tt> to clear the binding.
*/
- public void setTextKey(String textKey) {
+ public void setTextKey(final String textKey) {
String previousTextKey = this.textKey;
if (previousTextKey != textKey) {
@@ -165,7 +165,7 @@ public class Label extends Component {
return textBindType;
}
- public void setTextBindType(BindType textBindType) {
+ public void setTextBindType(final BindType textBindType) {
Utils.checkNull(textBindType, "textBindType");
BindType previousTextBindType = this.textBindType;
@@ -180,7 +180,7 @@ public class Label extends Component {
return textBindMapping;
}
- public void setTextBindMapping(TextBindMapping textBindMapping) {
+ public void setTextBindMapping(final TextBindMapping textBindMapping) {
TextBindMapping previousTextBindMapping = this.textBindMapping;
if (previousTextBindMapping != textBindMapping) {
@@ -190,7 +190,7 @@ public class Label extends Component {
}
@Override
- public void load(Object context) {
+ public void load(final Object context) {
if (textKey != null && JSON.containsKey(context, textKey) && textBindType != BindType.STORE) {
Object value = JSON.get(context, textKey);
@@ -200,12 +200,12 @@ public class Label extends Component {
value = textBindMapping.toString(value);
}
- setTextOrEmpty((String)value);
+ setTextOrEmpty((String) value);
}
}
@Override
- public void store(Object context) {
+ public void store(final Object context) {
if (textKey != null && textBindType != BindType.LOAD) {
String textLocal = getText();
JSON.put(context, textKey,
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Limits.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Limits.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Limits.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Limits.java Mon Aug 13 01:57:16 2018
@@ -46,7 +46,7 @@ public final class Limits implements Ser
this(Integer.MIN_VALUE, Integer.MAX_VALUE);
}
- public Limits(int minimum, int maximum) {
+ public Limits(final int minimum, final int maximum) {
if (minimum > maximum) {
throw new IllegalArgumentException("minimum is greater than maximum.");
}
@@ -61,11 +61,11 @@ public final class Limits implements Ser
*
* @param value The single value range for this limits.
*/
- public Limits(int value) {
+ public Limits(final int value) {
this(value, value);
}
- public Limits(Limits limits) {
+ public Limits(final Limits limits) {
Utils.checkNull(limits, "limits");
minimum = limits.minimum;
@@ -81,7 +81,7 @@ public final class Limits implements Ser
* @param limits The map/dictionary containing the desired limits values.
* @throws IllegalArgumentException if the min is greater than the max.
*/
- public Limits(Dictionary<String, ?> limits) {
+ public Limits(final Dictionary<String, ?> limits) {
Utils.checkNull(limits, "limits");
minimum = limits.getInt(MINIMUM_KEY, Integer.MIN_VALUE);
@@ -92,11 +92,11 @@ public final class Limits implements Ser
}
}
- public Limits(Sequence<?> limits) {
+ public Limits(final Sequence<?> limits) {
Utils.checkNull(limits, "limits");
- minimum = ((Number)limits.get(0)).intValue();
- maximum = ((Number)limits.get(1)).intValue();
+ minimum = ((Number) limits.get(0)).intValue();
+ maximum = ((Number) limits.get(1)).intValue();
if (minimum > maximum) {
throw new IllegalArgumentException("minimum is greater than maximum.");
@@ -110,7 +110,7 @@ public final class Limits implements Ser
* the range in this case cannot be represented by an integer.
*/
public long range() {
- return ((long)maximum - (long)minimum + 1L);
+ return ((long) maximum - (long) minimum + 1L);
}
/**
@@ -120,7 +120,7 @@ public final class Limits implements Ser
* @param value The value to limit.
* @return The bounded value.
*/
- public int constrain(int value) {
+ public int constrain(final int value) {
if (value < minimum) {
return minimum;
} else if (value > maximum) {
@@ -137,12 +137,12 @@ public final class Limits implements Ser
* @param value The value to test.
* @return Whether the value is contained within the limits.
*/
- public boolean contains(int value) {
+ public boolean contains(final int value) {
return (value >= minimum) && (value <= maximum);
}
@Override
- public boolean equals(Object object) {
+ public boolean equals(final Object object) {
boolean equals = false;
if (object instanceof Limits) {
@@ -202,7 +202,7 @@ public final class Limits implements Ser
* @see #Limits(Dictionary)
* @see #Limits(int, int)
*/
- public static Limits decode(String value) {
+ public static Limits decode(final String value) {
Utils.checkNull(value, "value");
Limits limits;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Point.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Point.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Point.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Point.java Mon Aug 13 01:57:16 2018
@@ -39,30 +39,30 @@ public final class Point implements Seri
public static final String X_KEY = "x";
public static final String Y_KEY = "y";
- public Point(int x, int y) {
+ public Point(final int x, final int y) {
this.x = x;
this.y = y;
}
- public Point(Point point) {
+ public Point(final Point point) {
Utils.checkNull(point, "point");
this.x = point.x;
this.y = point.y;
}
- public Point(Dictionary<String, ?> point) {
+ public Point(final Dictionary<String, ?> point) {
Utils.checkNull(point, "point");
this.x = point.getInt(X_KEY);
this.y = point.getInt(Y_KEY);
}
- public Point(Sequence<?> point) {
+ public Point(final Sequence<?> point) {
Utils.checkNull(point, "point");
- this.x = ((Number)point.get(0)).intValue();
- this.y = ((Number)point.get(1)).intValue();
+ this.x = ((Number) point.get(0)).intValue();
+ this.y = ((Number) point.get(1)).intValue();
}
/**
@@ -78,12 +78,12 @@ public final class Point implements Seri
* @return A new object represented the translated
* location.
*/
- public Point translate(int dx, int dy) {
+ public Point translate(final int dx, final int dy) {
return new Point(x + dx, y + dy);
}
@Override
- public boolean equals(Object object) {
+ public boolean equals(final Object object) {
boolean equals = false;
if (object instanceof Point) {
@@ -119,7 +119,7 @@ public final class Point implements Seri
* @see #Point(Dictionary)
* @see #Point(int, int)
*/
- public static Point decode(String value) {
+ public static Point decode(final String value) {
Utils.checkNull(value);
Point point;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ScriptApplication.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ScriptApplication.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ScriptApplication.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ScriptApplication.java Mon Aug 13 01:57:16 2018
@@ -44,7 +44,7 @@ public class ScriptApplication implement
private String sourceDefault = null;
@Override
- public void startup(Display display, Map<String, String> properties) throws Exception {
+ public void startup(final Display display, final Map<String, String> properties) throws Exception {
// Get the location of the source file
String src = properties.get(SRC_KEY);
if (src == null) {
@@ -97,12 +97,12 @@ public class ScriptApplication implement
window = new Window();
window.setMaximized(true);
window.open(display);
- Window auxWindow = (Window)component;
+ Window auxWindow = (Window) component;
auxWindow.open(window);
auxWindow.requestFocus();
} else {
if (component instanceof Window) {
- window = (Window)component;
+ window = (Window) component;
} else {
window = new Window();
window.setContent(component);
@@ -138,7 +138,7 @@ public class ScriptApplication implement
* @param srcArgument The name of a source file that will be used if
* the <tt>--src=...</tt> argument is missing from the command line.
*/
- public ScriptApplication(String srcArgument) {
+ public ScriptApplication(final String srcArgument) {
if (srcArgument.startsWith("@")) {
this.sourceDefault = srcArgument;
} else {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollBar.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollBar.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollBar.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollBar.java Mon Aug 13 01:57:16 2018
@@ -69,9 +69,9 @@ public class ScrollBar extends Container
public Scope(Sequence<?> scope) {
Utils.checkNull(scope, "scope");
- start = ((Number)scope.get(0)).intValue();
- end = ((Number)scope.get(1)).intValue();
- extent = ((Number)scope.get(2)).intValue();
+ start = ((Number) scope.get(0)).intValue();
+ end = ((Number) scope.get(1)).intValue();
+ extent = ((Number) scope.get(2)).intValue();
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Span.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Span.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Span.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Span.java Mon Aug 13 01:57:16 2018
@@ -41,7 +41,7 @@ public final class Span {
*
* @param index The start and end of this span (inclusive).
*/
- public Span(int index) {
+ public Span(final int index) {
start = index;
end = index;
}
@@ -51,7 +51,7 @@ public final class Span {
* @param start The start of this span - inclusive.
* @param end The end of the span - inclusive.
*/
- public Span(int start, int end) {
+ public Span(final int start, final int end) {
this.start = start;
this.end = end;
}
@@ -63,7 +63,7 @@ public final class Span {
* @param span An existing span (which must not be {@code null}).
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public Span(Span span) {
+ public Span(final Span span) {
Utils.checkNull(span, "span");
start = span.start;
@@ -78,7 +78,7 @@ public final class Span {
* @throws IllegalArgumentException if the given span is {@code null}
* or if the dictionary does not contain the start and end keys.
*/
- public Span(Dictionary<String, ?> span) {
+ public Span(final Dictionary<String, ?> span) {
Utils.checkNull(span, "span");
if (!span.containsKey(START_KEY)) {
@@ -101,11 +101,11 @@ public final class Span {
* @param span A sequence containing the start and end values.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public Span(Sequence<?> span) {
+ public Span(final Sequence<?> span) {
Utils.checkNull(span, "span");
- start = ((Number)span.get(0)).intValue();
- end = ((Number)span.get(1)).intValue();
+ start = ((Number) span.get(0)).intValue();
+ end = ((Number) span.get(1)).intValue();
}
/**
@@ -125,7 +125,7 @@ public final class Span {
* otherwise.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public boolean contains(Span span) {
+ public boolean contains(final Span span) {
Utils.checkNull(span, "span");
int otherNormalStart = span.normalStart();
@@ -151,7 +151,7 @@ public final class Span {
* otherwise.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public boolean adjacentTo(Span span) {
+ public boolean adjacentTo(final Span span) {
Utils.checkNull(span, "span");
int otherNormalStart = span.normalStart();
@@ -177,7 +177,7 @@ public final class Span {
* otherwise.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public boolean before(Span span) {
+ public boolean before(final Span span) {
Utils.checkNull(span, "span");
return normalEnd() < span.normalStart();
@@ -193,7 +193,7 @@ public final class Span {
* otherwise.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public boolean after(Span span) {
+ public boolean after(final Span span) {
Utils.checkNull(span, "span");
return normalStart() > span.normalEnd();
@@ -207,7 +207,7 @@ public final class Span {
* <tt>false</tt>, otherwise.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public boolean intersects(Span span) {
+ public boolean intersects(final Span span) {
Utils.checkNull(span, "span");
int otherNormalStart = span.normalStart();
@@ -231,16 +231,14 @@ public final class Span {
* <tt>span</tt>, or <tt>null</tt> if the spans do not intersect.
* @throws IllegalArgumentException if the given span is {@code null}.
*/
- public Span intersect(Span span) {
+ public Span intersect(final Span span) {
Utils.checkNull(span, "span");
- Span intersection = null;
-
if (intersects(span)) {
- intersection = new Span(Math.max(start, span.start), Math.min(end, span.end));
+ return new Span(Math.max(start, span.start), Math.min(end, span.end));
}
- return intersection;
+ return null;
}
/**
@@ -250,7 +248,7 @@ public final class Span {
* @return A new Span instance representing the union of this span and
* <tt>span</tt>.
*/
- public Span union(Span span) {
+ public Span union(final Span span) {
Utils.checkNull(span, "span");
return new Span(Math.min(start, span.start), Math.max(end, span.end));
@@ -279,7 +277,7 @@ public final class Span {
* @param end The new proposed end.
* @return A span containing the normalized range.
*/
- public static Span normalize(int start, int end) {
+ public static Span normalize(final int start, final int end) {
return new Span(Math.min(start, end), Math.max(start, end));
}
@@ -301,7 +299,7 @@ public final class Span {
* span (both start and end).
* @return A new {@link Span} with updated values.
*/
- public Span offset(int offset) {
+ public Span offset(final int offset) {
return new Span(this.start + offset, this.end + offset);
}
@@ -312,7 +310,7 @@ public final class Span {
* span (only the end).
* @return A new {@link Span} with updated value.
*/
- public Span lengthen(int offset) {
+ public Span lengthen(final int offset) {
return new Span(this.start, this.end + offset);
}
@@ -323,12 +321,12 @@ public final class Span {
* span (only the start).
* @return A new {@link Span} with updated value.
*/
- public Span move(int offset) {
+ public Span move(final int offset) {
return new Span(this.start + offset, this.end);
}
/**
- * Decides whether the normalized version of this span is equal the
+ * Decides whether the normalized version of this span is equal to the
* normalized version of the other span. Saves the overhead of making
* a new object (with {@link #normalize}).
*
@@ -336,7 +334,7 @@ public final class Span {
* @return Whether or not the normalized values of both spans are the same.
* @throws IllegalArgumentException if the other span is {@code null}.
*/
- public boolean normalEquals(Span span) {
+ public boolean normalEquals(final Span span) {
Utils.checkNull(span, "span");
return (normalStart() == span.normalStart())
@@ -344,7 +342,7 @@ public final class Span {
}
@Override
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
boolean equal = false;
if (o instanceof Span) {
@@ -389,7 +387,7 @@ public final class Span {
* @see #Span(int, int)
* @see #Span(int)
*/
- public static Span decode(String value) {
+ public static Span decode(final String value) {
Utils.checkNullOrEmpty(value, "value");
Span span;
@@ -426,7 +424,7 @@ public final class Span {
/** Comparator that determines the index of the first intersecting range. */
public static final Comparator<Span> START_COMPARATOR = new Comparator<Span>() {
@Override
- public int compare(Span range1, Span range2) {
+ public int compare(final Span range1, final Span range2) {
return (range1.end - range2.start);
}
};
@@ -434,7 +432,7 @@ public final class Span {
/** Comparator that determines the index of the last intersecting range. */
public static final Comparator<Span> END_COMPARATOR = new Comparator<Span>() {
@Override
- public int compare(Span range1, Span range2) {
+ public int compare(final Span range1, final Span range2) {
return (range1.start - range2.end);
}
};
@@ -442,7 +440,7 @@ public final class Span {
/** Comparator that determines if two ranges intersect. */
public static final Comparator<Span> INTERSECTION_COMPARATOR = new Comparator<Span>() {
@Override
- public int compare(Span range1, Span range2) {
+ public int compare(final Span range1, final Span range2) {
return (range1.start > range2.end) ? 1 : (range2.start > range1.end) ? -1 : 0;
}
};
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java Mon Aug 13 01:57:16 2018
@@ -1196,9 +1196,10 @@ public class TextPane extends Container
System.out.println(msg + ":");
}
String indenting = StringUtils.fromNChars(' ', indent * 2);
- System.out.format(FORMAT, indenting, node.getClass().getSimpleName(), node.getDocumentOffset(), node.getCharacterCount());
+ System.out.format(FORMAT, indenting, node.getClass().getSimpleName(),
+ node.getDocumentOffset(), node.getCharacterCount());
if (node instanceof Element) {
- for (Node n : (Element)node) {
+ for (Node n : (Element) node) {
dumpNode("", n, indent + 1);
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewIndexBindMapping.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewIndexBindMapping.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewIndexBindMapping.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewIndexBindMapping.java Mon Aug 13 01:57:16 2018
@@ -39,9 +39,9 @@ public class ListViewIndexBindMapping im
* if the value is out of range of the list size.
*/
@Override
- public int indexOf(List<?> listData, Object value) {
+ public int indexOf(final List<?> listData, final Object value) {
if (value instanceof Number) {
- int iValue = ((Number)value).intValue();
+ int iValue = ((Number) value).intValue();
if (iValue >= -1 && iValue < listData.getLength()) {
return iValue;
}
@@ -59,7 +59,7 @@ public class ListViewIndexBindMapping im
* @return The <tt>Integer</tt> value of the index.
*/
@Override
- public Object get(List<?> listData, int index) {
+ public Object get(final List<?> listData, final int index) {
return Integer.valueOf(index);
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerIndexBindMapping.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerIndexBindMapping.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerIndexBindMapping.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerIndexBindMapping.java Mon Aug 13 01:57:16 2018
@@ -39,9 +39,9 @@ public class SpinnerIndexBindMapping imp
* if the value is out of range of the data list size.
*/
@Override
- public int indexOf(List<?> spinnerData, Object value) {
+ public int indexOf(final List<?> spinnerData, final Object value) {
if (value instanceof Integer) {
- int iValue = ((Integer)value).intValue();
+ int iValue = ((Integer) value).intValue();
if (iValue >= -1 && iValue < spinnerData.getLength()) {
return iValue;
}
@@ -59,7 +59,7 @@ public class SpinnerIndexBindMapping imp
* @return The <tt>Integer</tt> value of the index.
*/
@Override
- public Object get(List<?> spinnerData, int index) {
+ public Object get(final List<?> spinnerData, final int index) {
return Integer.valueOf(index);
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkin.java Mon Aug 13 01:57:16 2018
@@ -126,7 +126,7 @@ public class TextPaneSkin extends Contai
}
private TextPane getTextPane() {
- return (TextPane)getComponent();
+ return (TextPane) getComponent();
}
private Rectangle getCaretRectangle(TextHitInfo textCaret) {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNodeView.java Mon Aug 13 01:57:16 2018
@@ -54,7 +54,7 @@ abstract class TextPaneSkinNodeView impl
private boolean valid = false;
- public TextPaneSkinNodeView(TextPaneSkin textPaneSkin, Node node) {
+ public TextPaneSkinNodeView(final TextPaneSkin textPaneSkin, final Node node) {
this.textPaneSkin = textPaneSkin;
this.node = node;
}
@@ -67,7 +67,7 @@ abstract class TextPaneSkinNodeView impl
return parent;
}
- protected void setParent(TextPaneSkinElementView parent) {
+ protected void setParent(final TextPaneSkinElementView parent) {
this.parent = parent;
}
@@ -99,7 +99,7 @@ abstract class TextPaneSkinNodeView impl
return new Dimensions(width, height);
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
assert (width >= 0);
assert (height >= 0);
@@ -113,7 +113,7 @@ abstract class TextPaneSkinNodeView impl
repaint();
}
- public void setSize(Dimensions size) {
+ public void setSize(final Dimensions size) {
Utils.checkNull(size, "size");
setSize(size.width, size.height);
}
@@ -130,7 +130,7 @@ abstract class TextPaneSkinNodeView impl
return new Point(x, y);
}
- protected void setLocation(int x, int y) {
+ protected void setLocation(final int x, final int y) {
// Redraw the region formerly occupied by this view
repaint();
@@ -158,12 +158,12 @@ abstract class TextPaneSkinNodeView impl
repaint(0, 0, width, height);
}
- public void repaint(int xArgument, int yArgument, int widthArgument, int heightArgument) {
- assert (widthArgument >= 0);
- assert (heightArgument >= 0);
+ public void repaint(final int xArg, final int yArg, final int widthArg, final int heightArg) {
+ assert (widthArg >= 0);
+ assert (heightArg >= 0);
if (parent != null) {
- parent.repaint(xArgument + this.x, yArgument + this.y, widthArgument, heightArgument);
+ parent.repaint(xArg + this.x, yArg + this.y, widthArg, heightArg);
}
}
@@ -183,7 +183,7 @@ abstract class TextPaneSkinNodeView impl
valid = false;
}
- public final void layout(int breakWidth) {
+ public final void layout(final int breakWidth) {
// reduce the number of layout calculations we need to do by only
// redoing them if necessary
if (!valid || previousBreakWidth != breakWidth) {
@@ -221,33 +221,33 @@ abstract class TextPaneSkinNodeView impl
public abstract Bounds getCharacterBounds(int offset);
@Override
- public void parentChanged(Node nodeArgument, Element previousParent) {
+ public void parentChanged(final Node nodeArgument, final Element previousParent) {
// No-op
}
@Override
- public void offsetChanged(Node nodeArgument, int previousOffset) {
+ public void offsetChanged(final Node nodeArgument, final int previousOffset) {
// No-op
}
@Override
- public void rangeInserted(Node nodeArgument, int offset, int span) {
+ public void rangeInserted(final Node nodeArgument, final int offset, final int span) {
// No-op
}
@Override
- public void rangeRemoved(Node nodeArgument, int offset, int characterCount,
- CharSequence removedChars) {
+ public void rangeRemoved(final Node nodeArgument, final int offset, final int characterCount,
+ final CharSequence removedChars) {
// No-op
}
@Override
- public void nodesRemoved(Node nodeArgument, Sequence<Node> removed, int offset) {
+ public void nodesRemoved(final Node nodeArgument, final Sequence<Node> removed, final int offset) {
// No-op
}
@Override
- public void nodeInserted(Node nodeArgument, int offset) {
+ public void nodeInserted(final Node nodeArgument, final int offset) {
// No-op
}
@@ -264,23 +264,23 @@ abstract class TextPaneSkinNodeView impl
private static HashMap<Class<? extends Node>, NodeCreator> nodeViewCreatorMap = new HashMap<>();
static {
nodeViewCreatorMap.put(Document.class, (textPaneSkin, node) ->
- new TextPaneSkinDocumentView(textPaneSkin, (Document)node));
+ new TextPaneSkinDocumentView(textPaneSkin, (Document) node));
nodeViewCreatorMap.put(Paragraph.class, (textPaneSkin, node) ->
- new TextPaneSkinParagraphView(textPaneSkin, (Paragraph)node));
+ new TextPaneSkinParagraphView(textPaneSkin, (Paragraph) node));
nodeViewCreatorMap.put(TextNode.class, (textPaneSkin, node) ->
- new TextPaneSkinTextNodeView(textPaneSkin, (TextNode)node));
+ new TextPaneSkinTextNodeView(textPaneSkin, (TextNode) node));
nodeViewCreatorMap.put(ImageNode.class, (textPaneSkin, node) ->
- new TextPaneSkinImageNodeView(textPaneSkin, (ImageNode)node));
+ new TextPaneSkinImageNodeView(textPaneSkin, (ImageNode) node));
nodeViewCreatorMap.put(ComponentNode.class, (textPaneSkin, node) ->
- new TextPaneSkinComponentNodeView(textPaneSkin, (ComponentNode)node));
+ new TextPaneSkinComponentNodeView(textPaneSkin, (ComponentNode) node));
nodeViewCreatorMap.put(TextSpan.class, (textPaneSkin, node) ->
- new TextPaneSkinSpanView(textPaneSkin, (TextSpan)node));
+ new TextPaneSkinSpanView(textPaneSkin, (TextSpan) node));
nodeViewCreatorMap.put(NumberedList.class, (textPaneSkin, node) ->
- new TextPaneSkinNumberedListView(textPaneSkin, (NumberedList)node));
+ new TextPaneSkinNumberedListView(textPaneSkin, (NumberedList) node));
nodeViewCreatorMap.put(BulletedList.class, (textPaneSkin, node) ->
- new TextPaneSkinBulletedListView(textPaneSkin, (BulletedList)node));
+ new TextPaneSkinBulletedListView(textPaneSkin, (BulletedList) node));
nodeViewCreatorMap.put(List.Item.class, (textPaneSkin, node) ->
- new TextPaneSkinListItemView(textPaneSkin, (List.Item)node));
+ new TextPaneSkinListItemView(textPaneSkin, (List.Item) node));
}
/**
@@ -290,7 +290,7 @@ abstract class TextPaneSkinNodeView impl
* @param node The data node we are creating the view for.
* @return The corresponding view node.
*/
- public static TextPaneSkinNodeView createNodeView(TextPaneSkin textPaneSkin, Node node) {
+ public static TextPaneSkinNodeView createNodeView(final TextPaneSkin textPaneSkin, final Node node) {
TextPaneSkinNodeView nodeView = null;
NodeCreator creator = nodeViewCreatorMap.get(node.getClass());
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNumberedListView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNumberedListView.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNumberedListView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinNumberedListView.java Mon Aug 13 01:57:16 2018
@@ -34,11 +34,21 @@ class TextPaneSkinNumberedListView exten
}
}
- private static final RomanValue[] ROMAN_VALUE_TABLE = { new RomanValue(1000, "M"),
- new RomanValue(900, "CM"), new RomanValue(500, "D"), new RomanValue(400, "CD"),
- new RomanValue(100, "C"), new RomanValue(90, "XC"), new RomanValue(50, "L"),
- new RomanValue(40, "XL"), new RomanValue(10, "X"), new RomanValue(9, "IX"),
- new RomanValue(5, "V"), new RomanValue(4, "IV"), new RomanValue(1, "I") };
+ private static final RomanValue[] ROMAN_VALUE_TABLE = {
+ new RomanValue(1000, "M"),
+ new RomanValue(900, "CM"),
+ new RomanValue(500, "D"),
+ new RomanValue(400, "CD"),
+ new RomanValue(100, "C"),
+ new RomanValue(90, "XC"),
+ new RomanValue(50, "L"),
+ new RomanValue(40, "XL"),
+ new RomanValue(10, "X"),
+ new RomanValue(9, "IX"),
+ new RomanValue(5, "V"),
+ new RomanValue(4, "IV"),
+ new RomanValue(1, "I")
+ };
private static String int2roman(int n) {
int num = n;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ComponentNode.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ComponentNode.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ComponentNode.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/ComponentNode.java Mon Aug 13 01:57:16 2018
@@ -85,25 +85,25 @@ public class ComponentNode extends Block
public CharSequence getCharacters(Component comp) {
if (comp instanceof TextInput) {
- return ((TextInput)comp).getCharacters();
+ return ((TextInput) comp).getCharacters();
} else if (comp instanceof TextArea) {
- return ((TextArea)comp).getCharacters();
+ return ((TextArea) comp).getCharacters();
} else if (comp instanceof TextPane) {
- return ((TextPane)comp).getText(); // TODO: use getCharacters when it is available
+ return ((TextPane) comp).getText(); // TODO: use getCharacters when it is available
} else if (comp instanceof Label) {
- return ((Label)comp).getText();
+ return ((Label) comp).getText();
} else if (comp instanceof Button) {
- Object buttonData = ((Button)comp).getButtonData();
+ Object buttonData = ((Button) comp).getButtonData();
if (buttonData instanceof BaseContent) {
- return ((BaseContent)buttonData).getText();
+ return ((BaseContent) buttonData).getText();
} else if (buttonData instanceof CharSequence) {
- return (CharSequence)buttonData;
+ return (CharSequence) buttonData;
} else {
return buttonData.toString();
}
} else if (comp instanceof Container) {
StringBuilder buf = new StringBuilder();
- for (Component child : (Container)comp) {
+ for (Component child : (Container) comp) {
buf.append(getCharacters(child));
}
return buf;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Element.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Element.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Element.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Element.java Mon Aug 13 01:57:16 2018
@@ -114,7 +114,7 @@ public abstract class Element extends No
while ((parent != null) && !(parent instanceof Paragraph)) {
parent = parent.getParent();
}
- return (Paragraph)parent;
+ return (Paragraph) parent;
}
@Override
@@ -287,7 +287,7 @@ public abstract class Element extends No
try {
for (Node child : element.nodes) {
if (child instanceof Element) {
- addCharacters(buf, (Element)child);
+ addCharacters(buf, (Element) child);
} else {
buf.append(child.getCharacters());
}
@@ -392,9 +392,9 @@ public abstract class Element extends No
node.setParent(null);
removedCharacterCount += node.getCharacterCount();
if (node instanceof Element) {
- removedChars.append(((Element)node).getText());
+ removedChars.append(((Element) node).getText());
} else if (node instanceof TextNode) {
- removedChars.append(((TextNode)node).getText());
+ removedChars.append(((TextNode) node).getText());
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Paragraph.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Paragraph.java?rev=1837913&r1=1837912&r2=1837913&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Paragraph.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Paragraph.java Mon Aug 13 01:57:16 2018
@@ -31,12 +31,12 @@ public class Paragraph extends Block {
add(new TextNode());
}
- public Paragraph(String text) {
+ public Paragraph(final String text) {
super();
add(text);
}
- public Paragraph(Paragraph paragraph, boolean recursive) {
+ public Paragraph(final Paragraph paragraph, final boolean recursive) {
super(paragraph, recursive);
if (!recursive) {
add(new TextNode());
@@ -50,7 +50,7 @@ public class Paragraph extends Block {
* @return A new {@link Node} containing the removed characters.
*/
@Override
- public Node removeRange(int offset, int characterCount) {
+ public Node removeRange(final int offset, final int characterCount) {
if (offset + characterCount == getCharacterCount()) {
return super.removeRange(offset, characterCount - 1);
}
@@ -66,7 +66,7 @@ public class Paragraph extends Block {
* @return New {@link Paragraph} with these characters.
*/
@Override
- public Paragraph getRange(int offset, int characterCount) {
+ public Paragraph getRange(final int offset, final int characterCount) {
if (offset + characterCount == getCharacterCount()) {
return (Paragraph) super.getRange(offset, characterCount - 1);
}
@@ -80,7 +80,7 @@ public class Paragraph extends Block {
* @return The character at that position.
*/
@Override
- public char getCharacterAt(int offset) {
+ public char getCharacterAt(final int offset) {
char c;
if (offset == getCharacterCount() - 1) {
c = '\n';
@@ -113,13 +113,13 @@ public class Paragraph extends Block {
* @return The index of the (new or existing) text node where
* the text was added.
*/
- public int add(String text) {
+ public int add(final String text) {
int length = getLength();
if (length > 0) {
// Add to the last node if it is a text node already
Node node = get(length - 1);
if (node instanceof TextNode) {
- ((TextNode)node).appendText(text);
+ ((TextNode) node).appendText(text);
return length - 1;
}
}
@@ -128,7 +128,7 @@ public class Paragraph extends Block {
}
@Override
- public void insert(Node node, int index) {
+ public void insert(final Node node, final int index) {
if (node instanceof Block) {
throw new IllegalArgumentException("Child node must not be an instance of "
+ Block.class.getName());
@@ -145,7 +145,7 @@ public class Paragraph extends Block {
* for the trailing newline character.
*/
@Override
- public Sequence<Integer> getPathAt(int offset) {
+ public Sequence<Integer> getPathAt(final int offset) {
Sequence<Integer> path;
if (offset < super.getCharacterCount()) {
@@ -166,7 +166,7 @@ public class Paragraph extends Block {
* @return The descendant node at that offset.
*/
@Override
- public Node getDescendantAt(int offset) {
+ public Node getDescendantAt(final int offset) {
Node descendant;
if (offset < super.getCharacterCount()) {
@@ -179,7 +179,7 @@ public class Paragraph extends Block {
}
@Override
- public Paragraph duplicate(boolean recursive) {
+ public Paragraph duplicate(final boolean recursive) {
return new Paragraph(this, recursive);
}
}