From ab9387a5e4c5eddaf11a38c4450b91b72748de66 Mon Sep 17 00:00:00 2001 From: Scotthew Date: Mon, 26 Aug 2013 22:48:26 -0700 Subject: [PATCH] - Resolves issues with 3D drawing. - Fixes saving table as string when table includes "static" data. - Resolves issues saving as repository. --- src/main/java/com/romraider/maps/Table1D.java | 16 ++++++++++++++++ .../java/com/romraider/swing/TableToolBar.java | 12 +++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/romraider/maps/Table1D.java b/src/main/java/com/romraider/maps/Table1D.java index 419ee3a5..46e4b850 100644 --- a/src/main/java/com/romraider/maps/Table1D.java +++ b/src/main/java/com/romraider/maps/Table1D.java @@ -246,4 +246,20 @@ public class Table1D extends Table { public void updateTableLabel() { this.getAxisParent().updateTableLabel(); } + + @Override + public StringBuffer getTableAsString() { + if(isStaticDataTable()) { + StringBuffer output = new StringBuffer(Settings.BLANK); + for (int i = 0; i < data.length; i++) { + output.append(data[i].getStaticText()); + if (i < data.length - 1) { + output.append(Settings.TAB); + } + } + return output; + } else { + return super.getTableAsString(); + } + } } \ No newline at end of file diff --git a/src/main/java/com/romraider/swing/TableToolBar.java b/src/main/java/com/romraider/swing/TableToolBar.java index d5b9acd9..cc3cdc90 100644 --- a/src/main/java/com/romraider/swing/TableToolBar.java +++ b/src/main/java/com/romraider/swing/TableToolBar.java @@ -575,10 +575,7 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene float[] rowValues = new float[valueCount]; for (int i = 0; i < valueCount; i++) { DataCell theCell = tableData[i][j]; - rowValues[i] = (float) theCell.getBinValue(); - //float theValue = (float)theCell.getValue(); - //BigDecimal finalRoundedValue = new BigDecimal(theValue).setScale(2,BigDecimal.ROUND_HALF_UP); - //rowValues[i] = finalRoundedValue.floatValue(); + rowValues[i] = (float) theCell.getRealValue(); } graphValues.add(rowValues); } @@ -592,10 +589,7 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene double[] xValues = new double[length]; for (int i = 0; i < length; i++) { - xValues[i] = dataCells[i].getBinValue(); - //double theValue = dataCells[i].getValue(); - //BigDecimal finalRoundedValue = new BigDecimal(theValue).setScale(2,BigDecimal.ROUND_HALF_UP); - //xValues[i] = finalRoundedValue.doubleValue(); + xValues[i] = dataCells[i].getRealValue(); } //Gather y/z axis values @@ -604,7 +598,7 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene double[] yValues = new double[length]; for (int i = 0; i < length; i++) { - double theValue = dataCells[i].getBinValue(); + double theValue = dataCells[i].getRealValue(); BigDecimal finalRoundedValue = new BigDecimal(theValue).setScale(2, BigDecimal.ROUND_HALF_UP); yValues[i] = finalRoundedValue.doubleValue(); }