Permalink
Browse files

Renaming classes for readability

  • Loading branch information...
bluejamesbond committed Jan 14, 2015
1 parent 0c503a3 commit 8ed1ad7ba7ccf9d98484a1132df146dc951ed5f8
View
@@ -9,38 +9,38 @@
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
onUpdate DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
onUpdate DIRNAME=%~dp0
if "%DIRNAME%" == "" onUpdate DIRNAME=.
onUpdate APP_BASE_NAME=%~n0
onUpdate APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
onUpdate JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo ERROR: JAVA_HOME is not onUpdate and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo Please onUpdate the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
onUpdate JAVA_HOME=%JAVA_HOME:"=%
onUpdate JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo ERROR: JAVA_HOME is onUpdate to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo Please onUpdate the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
@@ -53,23 +53,23 @@ if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
onUpdate CMD_LINE_ARGS=
onUpdate _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
onUpdate CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
onUpdate CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
onUpdate CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
@@ -37,7 +37,7 @@
* optional list operations, and permits all elements (including
* <tt>null</tt>). In addition to implementing the <tt>List</tt> interface,
* the <tt>LinkedList</tt> class provides uniformly named methods to
* <tt>get</tt>, <tt>remove</tt> and <tt>insert</tt> an element at the
* <tt>isCancelled</tt>, <tt>remove</tt> and <tt>insert</tt> an element at the
* beginning and end of the list. These operations allow linked lists to be
* used as a stack or Queue. <p>
*
@@ -174,7 +174,7 @@ public void clear() {
* Returns the index of the first occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the lowest index <tt>i</tt> such that
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
* <tt>(o==null&nbsp;?&nbsp;isCancelled(i)==null&nbsp;:&nbsp;o.equals(isCancelled(i)))</tt>,
* or -1 if there is no such index.
*
* @param o element to search for
@@ -203,7 +203,7 @@ public int indexOf(Object o) {
* Returns the index of the last occurrence of the specified element
* in this list, or -1 if this list does not contain the element.
* More formally, returns the highest index <tt>i</tt> such that
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
* <tt>(o==null&nbsp;?&nbsp;isCancelled(i)==null&nbsp;:&nbsp;o.equals(isCancelled(i)))</tt>,
* or -1 if there is no such index.
*
* @param o element to search for
@@ -265,7 +265,7 @@ public boolean contains(Object o) {
* if it is present. If this list does not contain the element, it is
* unchanged. More formally, removes the element with the lowest index
* <tt>i</tt> such that
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>
* <tt>(o==null&nbsp;?&nbsp;isCancelled(i)==null&nbsp;:&nbsp;o.equals(isCancelled(i)))</tt>
* (if such an element exists). Returns <tt>true</tt> if this list
* contained the specified element (or equivalently, if this list
* changed as a result of the call).
@@ -333,7 +333,7 @@ public int size() {
* <p/>
* <p>If the list fits in the specified array with room to spare (i.e.,
* the array has more elements than the list), the element in the array
* immediately following the end of the list is set to <tt>null</tt>.
* immediately following the end of the list is onUpdate to <tt>null</tt>.
* (This is useful in determining the length of the list <i>only</i> if
* the caller knows that the list does not contain any null elements.)
* <p/>
@@ -171,7 +171,7 @@ protected synchronized void drawLayout(Canvas canvas, int startY, int endY, bool
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
}
layout.onDraw(canvas, startY, endY);
layout.draw(canvas, startY, endY);
// onDraw border around
if (layout.isDebugging()) {
@@ -252,7 +252,7 @@ private void initDocumentView(Context context, AttributeSet attrs, int type) {
final int N = a.getIndexCount();
// find and set project layout
// find and onUpdate project layout
layout = getDocumentLayoutInstance(a.getInt(R.styleable.DocumentView_documentView_textFormat, DocumentView.PLAIN_TEXT), paint);
IDocumentLayout.LayoutParams layoutParams = layout.getLayoutParams();
@@ -684,22 +684,22 @@ public int getId() {
public class MeasureTask extends AsyncTask<Void, Float, Boolean> {
private IDocumentLayout.ISet<Float> progress;
private IDocumentLayout.IGet<Boolean> cancelled;
private IDocumentLayout.IProgress<Float> progress;
private IDocumentLayout.ICancel<Boolean> cancelled;
public MeasureTask(float parentWidth) {
layout.getLayoutParams().setParentWidth(parentWidth);
progress = new IDocumentLayout.ISet<Float>() {
progress = new IDocumentLayout.IProgress<Float>() {
@Override
public void set(Float progress) {
public void onUpdate(Float progress) {
if (layoutProgressListener != null) {
layoutProgressListener.onProgressUpdate(progress);
}
}
};
cancelled = new IDocumentLayout.IGet<Boolean>() {
cancelled = new IDocumentLayout.ICancel<Boolean>() {
@Override
public Boolean get() {
public Boolean isCancelled() {
return isCancelled();
}
};
@@ -116,7 +116,7 @@ public int getLineCount() {
return lineCount;
}
public boolean measure(ISet<Float> progress, IGet<Boolean> cancelled) {
public boolean measure(IProgress<Float> progress, ICancel<Boolean> cancelled) {
if (!params.changed && !textChange) {
return true;
@@ -127,7 +127,7 @@ public boolean measure(ISet<Float> progress, IGet<Boolean> cancelled) {
return onMeasure(progress, cancelled);
}
protected abstract boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled);
protected abstract boolean onMeasure(IProgress<Float> progress, ICancel<Boolean> cancelled);
public void draw(Canvas canvas, int startTop, int startBottom) {
onDraw(canvas, startTop, startBottom);
@@ -147,12 +147,12 @@ public void draw(Canvas canvas, int startTop, int startBottom) {
START_OF_LINE, END_OF_LINE
}
public static interface ISet<T> {
public void set(T val);
public static interface IProgress<T> {
public void onUpdate(T val);
}
public static interface IGet<T> {
public T get();
public static interface ICancel<T> {
public T isCancelled();
}
public static class LayoutParams {
@@ -148,7 +148,7 @@ protected int getTrimmedLength(CharSequence s, int start, int end) {
@SuppressWarnings("ConstantConditions")
@Override
public boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled) {
public boolean onMeasure(IProgress<Float> progress, ICancel<Boolean> cancelled) {
boolean done = true;
float parentWidth = params.getParentWidth();
@@ -185,12 +185,12 @@ public boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled) {
for (lineNumber = 0; lineNumber < lines; lineNumber++) {
if (cancelled.get()) {
if (cancelled.isCancelled()) {
done = false;
break;
}
progress.set((float) lineNumber / (float) lines);
progress.onUpdate((float) lineNumber / (float) lines);
newTokens = ammortizeArray(newTokens, index);
@@ -61,7 +61,7 @@ private float getFontDescent() {
}
@Override
public boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled) {
public boolean onMeasure(IProgress<Float> progress, ICancel<Boolean> cancelled) {
boolean done = true;
String text = this.text.toString();
@@ -104,12 +104,12 @@ public boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled) {
main:
for (String paragraph : chunks) {
if (cancelled.get()) {
if (cancelled.isCancelled()) {
done = false;
break;
}
progress.set(prog++ / chunksLen);
progress.onUpdate(prog++ / chunksLen);
if (lineNumber >= params.maxLines) {
break;
@@ -202,7 +202,7 @@ public boolean onMeasure(ISet<Float> progress, IGet<Boolean> cancelled) {
lineNumber++;
// Chcek cancelled
if (cancelled.get()) {
if (cancelled.isCancelled()) {
done = false;
break;
}
@@ -425,7 +425,7 @@ private LineAnalysis fit(ListIterator<Unit> iterator, int startIndex, float spac
else {
// Check if the lastPartial
// was even set
// was even onUpdate
if (lastFormattedPartial != null) {
unit.unit = lastFormattedPartial;
@@ -41,7 +41,7 @@
* <p/>
* <p>The x position is the leading edge of the text. In a right-to-left
* paragraph, this will be to the right of the text to be drawn. Paint
* should not have an Align value other than LEFT or positioning will get
* should not have an Align value other than LEFT or positioning will isCancelled
* confused.
* <p/>
* <p>On return, workPaint will reflect the original paint plus any
@@ -172,8 +172,8 @@ private static float drawUniformRun(Canvas canvas,
/**
* Returns the advance widths for a uniform left-to-right run of text with
* no style changes in the middle of the run. If any style is replacement
* text, the first character will get the width of the replacement and the
* remaining characters will get a width of 0.
* text, the first character will isCancelled the width of the replacement and the
* remaining characters will isCancelled a width of 0.
*
* @param paint the paint, will not be modified
* @param workPaint a paint to modify; on return will reflect the original
@@ -227,7 +227,7 @@ public static int getTextWidths(TextPaint paint,
* <p/>
* <p>The x position is the leading edge of the text. In a right-to-left
* paragraph, this will be to the right of the text to be drawn. Paint
* should not have an Align value other than LEFT or positioning will get
* should not have an Align value other than LEFT or positioning will isCancelled
* confused.
* <p/>
* <p>This optimizes for unstyled text and so workPaint might not be

0 comments on commit 8ed1ad7

Please sign in to comment.