Home | History | Annotate | Download | only in openwnn

Lines Matching refs:layer

36      * Text layer 0.
38 * This text layer holds key strokes.<br>
43 * Text layer 1.
45 * This text layer holds the result of the letter converter.<br>
50 * Text layer 2.
52 * This text layer holds the result of the consecutive clause converter.<br>
60 /** Composing text's layer data */
96 * @param layer Layer
101 public StrSegment getStrSegment(int layer, int pos) {
103 ArrayList<StrSegment> strLayer = mStringLayer[layer];
119 * @param layer Layer
124 public String toString(int layer, int from, int to) {
127 ArrayList<StrSegment> strLayer = mStringLayer[layer];
140 * Convert segments of the layer to a string.
142 * @param layer Layer
145 public String toString(int layer) {
146 return this.toString(layer, 0, mStringLayer[layer].size() - 1);
150 * Update the upper layer's data.
152 * @param layer The base layer
157 private void modifyUpper(int layer, int mod_from, int mod_len, int org_len) {
158 if (layer >= MAX_LAYER - 1) {
159 /* no layer above */
163 int uplayer = layer + 1;
167 * if there is no element on above layer,
168 * add a element includes whole elements of the lower layer.
170 strUplayer.add(new StrSegment(toString(layer), 0, mStringLayer[layer].size() - 1));
181 last.string = toString(layer, last.from, last.to);
234 ss.string = toString(layer, ss.from, ss.to);
245 StrSegment ss = new StrSegment(toString(layer, mod_from, mod_to),
262 * @param layer Layer to insert
265 public void insertStrSegment(int layer, StrSegment str) {
266 int cursor = mCursor[layer];
267 mStringLayer[layer].add(cursor, str);
268 modifyUpper(layer, cursor, 1, 0);
269 setCursor(layer, cursor + 1);
275 * @param layer1 Layer to insert
303 * @param layer Layer
308 protected void replaceStrSegment0(int layer, StrSegment[] str, int from, int to) {
309 ArrayList<StrSegment> strLayer = mStringLayer[layer];
324 modifyUpper(layer, from, str.length, to - from + 1);
330 * @param layer Layer
334 public void replaceStrSegment(int layer, StrSegment[] str, int num) {
335 int cursor = mCursor[layer];
336 replaceStrSegment0(layer, str, cursor - num, cursor - 1);
337 setCursor(layer, cursor + str.length - num);
343 * @param layer Layer
346 public void replaceStrSegment(int layer, StrSegment[] str) {
347 int cursor = mCursor[layer];
348 replaceStrSegment0(layer, str, cursor - 1, cursor - 1);
349 setCursor(layer, cursor + str.length - 1);
355 * @param layer Layer
359 public void deleteStrSegment(int layer, int from, int to) {
366 if (layer == 2) {
373 } else if (layer == 1) {
430 * @param layer Layer
435 private void deleteStrSegment0(int layer, int from, int to, int diff) {
436 ArrayList<StrSegment> strLayer = mStringLayer[layer];
452 * @param layer Layer
454 * @return The number of string segments in the specified layer
456 public int delete(int layer, boolean rightside) {
457 int cursor = mCursor[layer];
458 ArrayList<StrSegment> strLayer = mStringLayer[layer];
461 deleteStrSegment(layer, cursor-1, cursor-1);
462 setCursor(layer, cursor - 1);
464 deleteStrSegment(layer, cursor, cursor);
465 setCursor(layer, cursor);
471 * Get the string layer.
473 * @param layer Layer
476 public ArrayList<StrSegment> getStringLayer(int layer) {
478 return mStringLayer[layer];
487 * @param layer Layer
491 private int included(int layer, int pos) {
495 int uplayer = layer + 1;
510 * @param layer Layer
514 public int setCursor(int layer, int pos) {
515 if (pos > mStringLayer[layer].size()) {
516 pos = mStringLayer[layer].size();
521 if (layer == 0) {
525 } else if (layer == 1) {
540 * @param layer Layer
544 public int moveCursor(int layer, int diff) {
545 int c = mCursor[layer] + diff;
547 return setCursor(layer, c);
553 * @param layer Layer
556 public int getCursor(int layer) {
557 return mCursor[layer];
563 * @param layer Layer
566 public int size(int layer) {
567 return mStringLayer[layer].size();