Fixed table selection issues.

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@257 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Tgui 2006-08-23 06:02:44 +00:00
parent 64f0e3c64e
commit f811c61518
5 changed files with 28 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@ -122,7 +122,10 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
} else {
this.setBackground(scaledColor);
}
requestFocus();
//TODO Uncomment if needed after further testing
//Removed to test with 3d graph
//requestFocus();
}
public void setHighlighted(Boolean highlighted) {

View File

@ -510,12 +510,25 @@ public class Table3D extends Table {
}
}
public void deSelectCellAt(int x, int y) {
clearSelection();
data[x][y].setSelected(false);
highlightX = x;
highlightY = y;
}
public void selectCellAt(int x, int y) {
clearSelection();
data[x][y].setSelected(true);
highlightX = x;
highlightY = y;
}
public void selectCellAtWithoutClear(int x, int y) {
data[x][y].setSelected(true);
highlightX = x;
highlightY = y;
}
public void cursorUp() {
if (highlightY > 0 && data[highlightX][highlightY].isSelected()) {

View File

@ -340,13 +340,13 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
// TODO Tie into Enginuity 2d table values
public void newGraphData(Vector data) {
System.out.println("New data recieved at the client \n*********************");
//System.out.println("New data recieved at the client \n*********************");
Iterator modDataListenerIterator = data.iterator();
while(modDataListenerIterator.hasNext()){
TableData td = (TableData)modDataListenerIterator.next();
System.out.println("X:"+td.getX()+" Z:"+td.getZ()+" VALUE:"+td.getValue());
//System.out.println("X:"+td.getX()+" Z:"+td.getZ()+" VALUE:"+td.getValue());
Table3D table3d = (Table3D)table;
table3d.selectCellAt(td.getX(), table3d.getSizeY() - td.getZ() - 1);
@ -355,18 +355,24 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
table.setRealValue(td.getValue()+"");
}
System.out.println("*********************");
//System.out.println("*********************");
}
public void cellSelected(int x, int z){
//Set cell to be selected
System.out.println("Selected"+x+","+z);
Table3D table3d = (Table3D)table;
table3d.selectCellAt(x, table3d.getSizeY() - z - 1);
table3d.selectCellAtWithoutClear(x, table3d.getSizeY() - z - 1);
}
public void cellDeSelected(int x, int z){
//Set cell de selected
System.out.println("De Selected"+x+","+z);
Table3D table3d = (Table3D)table;
table3d.selectCellAt(x, table3d.getSizeY() - z - 1);
table3d.deSelectCellAt(x, table3d.getSizeY() - z - 1);
}
}