mirror of https://github.com/rusefi/RomRaider.git
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:
parent
64f0e3c64e
commit
f811c61518
Binary file not shown.
Binary file not shown.
|
@ -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) {
|
||||
|
|
|
@ -510,6 +510,13 @@ 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);
|
||||
|
@ -517,6 +524,12 @@ public class Table3D extends Table {
|
|||
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()) {
|
||||
selectCellAt(highlightX, highlightY - 1);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue