mirror of https://github.com/rusefi/RomRaider.git
Fixed 3d graph min and max values, user level display and font on table labels
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@312 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
5cb44dbd92
commit
1f2ef1351c
|
@ -1136,5 +1136,35 @@ public abstract class Table extends JPanel implements Serializable {
|
|||
|
||||
protected void highlightLiveData() {
|
||||
}
|
||||
|
||||
public double getMin() {
|
||||
if (getScale().getMin() == 0 && getScale().getMax() == 0) {
|
||||
double low = Double.MAX_VALUE;
|
||||
for (int i = 0; i < getDataSize(); i++) {
|
||||
|
||||
if (Double.parseDouble(data[i].getText()) < low) {
|
||||
low = Double.parseDouble(data[i].getText());
|
||||
}
|
||||
}
|
||||
return low;
|
||||
} else {
|
||||
return getScale().getMin();
|
||||
}
|
||||
}
|
||||
|
||||
public double getMax() {
|
||||
if (getScale().getMin() == 0 && getScale().getMax() == 0) {
|
||||
double high = Double.MIN_VALUE;
|
||||
for (int i = 0; i < getDataSize(); i++) {
|
||||
|
||||
if (Double.parseDouble(data[i].getText()) > high) {
|
||||
high = Double.parseDouble(data[i].getText());
|
||||
}
|
||||
}
|
||||
return high;
|
||||
} else {
|
||||
return getScale().getMax();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -164,7 +164,6 @@ public class Table3D extends Table {
|
|||
topPanel.add(new JLabel(xAxis.getName() + " (" + xAxis.getScale().getUnit() + ")", JLabel.CENTER), BorderLayout.NORTH);
|
||||
|
||||
JLabel yLabel = new JLabel();
|
||||
yLabel.setFont(new Font("Arial", Font.BOLD, 12));
|
||||
VTextIcon icon = new VTextIcon(yLabel, yAxis.getName() + " (" + yAxis.getScale().getUnit() + ")", VTextIcon.ROTATE_LEFT);
|
||||
yLabel.setIcon(icon);
|
||||
add(yLabel, BorderLayout.WEST);
|
||||
|
@ -884,4 +883,40 @@ public class Table3D extends Table {
|
|||
public DataCell[][] get3dData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public double getMin() {
|
||||
if (getScale().getMin() == 0 && getScale().getMax() == 0) {
|
||||
double low = Double.MAX_VALUE;
|
||||
|
||||
for (DataCell[] column : data) {
|
||||
for (DataCell cell : column) {
|
||||
if (Double.parseDouble(cell.getText()) < low) {
|
||||
low = Double.parseDouble(cell.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return low;
|
||||
} else {
|
||||
return getScale().getMin();
|
||||
}
|
||||
}
|
||||
|
||||
public double getMax() {
|
||||
if (getScale().getMin() == 0 && getScale().getMax() == 0) {
|
||||
double high = Double.MIN_VALUE;
|
||||
|
||||
for (DataCell[] column : data) {
|
||||
for (DataCell cell : column) {
|
||||
if (Double.parseDouble(cell.getText()) > high) {
|
||||
high = Double.parseDouble(cell.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return high;
|
||||
} else {
|
||||
return getScale().getMax();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,13 +28,13 @@ public class TablePropertyPanel extends javax.swing.JPanel {
|
|||
|
||||
if (table.getUserLevel() == 1) {
|
||||
userLevel.setText("Beginner");
|
||||
} else if (table.getUserLevel() == 1) {
|
||||
} else if (table.getUserLevel() == 2) {
|
||||
userLevel.setText("Intermediate");
|
||||
} else if (table.getUserLevel() == 1) {
|
||||
} else if (table.getUserLevel() == 3) {
|
||||
userLevel.setText("Advanced");
|
||||
} else if (table.getUserLevel() == 1) {
|
||||
} else if (table.getUserLevel() == 4) {
|
||||
userLevel.setText("All");
|
||||
} else if (table.getUserLevel() == 1) {
|
||||
} else if (table.getUserLevel() == 5) {
|
||||
userLevel.setText("Debug");
|
||||
}
|
||||
|
||||
|
|
|
@ -293,12 +293,12 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
|
|||
|
||||
|
||||
|
||||
double maxV = table.getScale().getMax();
|
||||
double minV = table.getScale().getMin();
|
||||
double maxV = table.getMax();
|
||||
double minV = table.getMin();
|
||||
//TODO Remove this when above is working
|
||||
//***********
|
||||
minV = 0.0;
|
||||
maxV = 13.01;
|
||||
/*minV = 0.0;
|
||||
maxV = 13.01;*/
|
||||
System.out.println("Scale: " + maxV + "," + minV);
|
||||
//***********
|
||||
|
||||
|
|
Loading…
Reference in New Issue