From d3876a2dd9556d635c817934312b9967babafc5b Mon Sep 17 00:00:00 2001 From: wordpredictteam Date: Mon, 20 Oct 2008 01:29:33 +0000 Subject: [PATCH] latest cut version --Kevin Mak sizes are correct --- zoom_keyboard/AbsoluteLayoutDemo.java | 2 +- zoom_keyboard/KeyboardLayout.java | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/zoom_keyboard/AbsoluteLayoutDemo.java b/zoom_keyboard/AbsoluteLayoutDemo.java index ad5a052..a3ae8d0 100644 --- a/zoom_keyboard/AbsoluteLayoutDemo.java +++ b/zoom_keyboard/AbsoluteLayoutDemo.java @@ -130,7 +130,7 @@ private void createAndShowGUI() { KeyboardDraw(KeyboardLayoutArray.get(1)); //Size and display the window. - frame.setSize(920, 300); + frame.setSize(1020, 380); frame.setVisible(true); } diff --git a/zoom_keyboard/KeyboardLayout.java b/zoom_keyboard/KeyboardLayout.java index 4a3cff5..c256090 100644 --- a/zoom_keyboard/KeyboardLayout.java +++ b/zoom_keyboard/KeyboardLayout.java @@ -19,6 +19,9 @@ public class KeyboardLayout int matrix_x; int matrix_y; + int max_width = 0; + int max_height = 0; + public ArrayList< ArrayList > theList; //private int width; //private int height; @@ -103,7 +106,7 @@ private int getArrayIndex(int i, int j) { public ArrayList KeySizeCalc(int i,int j) // i(x axis) and j(y axis) are the indexes on the grid { - final int SIZE_1=100, SIZE_2=50,SIZE_3=25; //s1,s2,s3 are the three new sizes of the keys + final int SIZE_1=100, SIZE_2=70,SIZE_3=50; //s1,s2,s3 are the three new sizes of the keys // sentinel for null object KeyPosition kpSentinel = new KeyPosition(99, 99, 99, 99,99, 99, 99); @@ -166,6 +169,7 @@ public ArrayList KeySizeCalc(int i,int j) // i(x axis) and j(y axis) are the ind // calculate top and left for the array list int curr_top=0, curr_left=0, next_top=0; //next vars + int biggest_width = 0; KeyPosition kpLoc; for (int index_j=0; index_j < 5; index_j++) // height(y) { @@ -186,8 +190,13 @@ public ArrayList KeySizeCalc(int i,int j) // i(x axis) and j(y axis) are the ind } curr_top = next_top; + if (biggest_width < curr_left) + biggest_width = curr_left; } + max_height = curr_top; + max_width = biggest_width; + @@ -208,6 +217,14 @@ public ArrayList KeySizeCalc(int i,int j) // i(x axis) and j(y axis) are the ind return returnArray; } + + public int getMaxWidth() { + return max_width; + } + + public int getMaxHeight() { + return max_height; + } /**