Fields Summary |
---|
protected static final int | TOTAL_MASK |
protected static final int | SWEEP_STROKE_WIDTH_BIT |
protected static final int | SWEEP_STROKE_CAP_BIT |
protected static final int | SWEEP_STROKE_JOIN_BIT |
protected static final int | SWEEP_SHADER_BIT |
protected static final int | SWEEP_TRANSFORM_BIT |
private static final android.graphics.RectF | gRect |
private static final float[] | gPts |
private static final int | NUM_PARALLEL_LINES |
private static final float[] | gTriPts |
private static final float[] | gLinePts |
private static final LinkedHashMap | gMaps |
private static final int[] | mIndices |
private static final String[] | mLastAppliedModifications |
Methods Summary |
---|
public static void | apply(android.graphics.Paint paint, android.graphics.Canvas canvas)
int mapIndex = 0;
for (LinkedHashMap<String, DisplayModifier> map : gMaps.values()) {
int displayModifierIndex = mIndices[mapIndex];
for (Entry<String, DisplayModifier> modifierEntry : map.entrySet()) {
if (displayModifierIndex == 0) {
mLastAppliedModifications[mapIndex] = modifierEntry.getKey();
modifierEntry.getValue().modifyDrawing(paint, canvas);
break;
}
displayModifierIndex--;
}
mapIndex++;
}
|
private static boolean | checkModificationStateMask()
int operatorMask = 0x0;
int mapIndex = 0;
for (LinkedHashMap<String, DisplayModifier> map : gMaps.values()) {
int displayModifierIndex = mIndices[mapIndex];
for (Entry<String, DisplayModifier> modifierEntry : map.entrySet()) {
if (displayModifierIndex == 0) {
mLastAppliedModifications[mapIndex] = modifierEntry.getKey();
operatorMask |= modifierEntry.getValue().mask();
break;
}
displayModifierIndex--;
}
mapIndex++;
}
return operatorMask == TOTAL_MASK;
|
public static int[] | getIndices()
return mIndices;
|
public static java.lang.String[] | getLastAppliedModifications()
return mLastAppliedModifications.clone();
|
private static java.util.LinkedHashMap | getMapAtIndex(int index)
for (LinkedHashMap<String, DisplayModifier> map : gMaps.values()) {
if (index == 0) {
return map;
}
index--;
}
return null;
|
public static java.lang.String[][] | getStrings()
String[][] keys = new String[gMaps.size()][];
int i = 0;
for (LinkedHashMap<String, DisplayModifier> map : gMaps.values()) {
keys[i] = new String[map.size()];
int j = 0;
for (String key : map.keySet()) {
keys[i][j++] = key;
}
i++;
}
return keys;
|
protected int | mask() // only sweep over specified transforms
return 0x0;
|
public abstract void | modifyDrawing(android.graphics.Paint paint, android.graphics.Canvas canvas)
|
public static void | setIndex(int mapIndex, int newIndexValue)
mIndices[mapIndex] = newIndexValue;
|
public static boolean | step()
boolean ret = false;
do {
ret |= stepInternal(true);
} while (!checkModificationStateMask());
return ret;
|
public static boolean | stepBack()
boolean ret = false;
do {
ret |= stepInternal(false);
} while (!checkModificationStateMask());
return ret;
|
private static boolean | stepInternal(boolean forward)
int modifierMapIndex = gMaps.size() - 1;
while (modifierMapIndex >= 0) {
LinkedHashMap<String, DisplayModifier> map = getMapAtIndex(modifierMapIndex);
mIndices[modifierMapIndex] += (forward ? 1 : -1);
if (mIndices[modifierMapIndex] >= 0 && mIndices[modifierMapIndex] < map.size()) {
break;
}
mIndices[modifierMapIndex] = (forward ? 0 : map.size() - 1);
modifierMapIndex--;
}
return modifierMapIndex < 0; // true if resetting
|