Methods Summary |
---|
CLayerElement | addLayer(CLayer layer)Add new layer to the top of list with no check for other
occurrences of the layer in the list
CLayerElement le =
new CLayerElement(layer, top, null);
if (top != null)
top.upper = le;
top = le;
if (bottom == null)
bottom = le;
count ++;
return le;
|
CLayerElement | find(CLayer layer)Find UI layer instance in the list
for(CLayerElement l = top; l != null; l = l.lower)
if (l.layer == layer) return l;
return null;
|
CLayerElement | getBottom()Get the most bottom list element
return bottom;
|
CLayerElement | getTop()Get the most top list element
return top;
|
boolean | removeLayer(CLayer layer)Remove layer from the list
CLayerElement le = find(layer);
if (le != null) {
removeLayerElement(le);
le.layer = null;
return true;
} else {
return false;
}
|
void | removeLayerElement(CLayerElement le)Remove layer element from the list with no extra checks.
It's caller's responsibility to apply the method on
list elements only.
CLayerElement upper = le.upper;
CLayerElement lower = le.lower;
if (upper != null) {
upper.lower = lower;
} else if (top == le) {
top = lower;
}
if (lower != null) {
lower.upper = upper;
} else if (bottom == le) {
bottom = upper;
}
// Clear links to neighbour layers
le.upper = le.lower = null;
count --;
|
int | size()Get number of layers in the list
return count;
|