Skip to content

Commit

Permalink
latest cut version --Kevin Mak
Browse files Browse the repository at this point in the history
sizes are correct
  • Loading branch information
wordpredictteam committed Oct 20, 2008
1 parent d587a59 commit d3876a2
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zoom_keyboard/AbsoluteLayoutDemo.java
Original file line number Diff line number Diff line change
@@ -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);
}

19 changes: 18 additions & 1 deletion zoom_keyboard/KeyboardLayout.java
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ public class KeyboardLayout
int matrix_x;
int matrix_y;

int max_width = 0;
int max_height = 0;

public ArrayList< ArrayList<KeyPosition> > 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;
}


/**

0 comments on commit d3876a2

Please sign in to comment.