git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@601 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d

This commit is contained in:
Tgui 2007-03-27 14:32:19 +00:00
parent 88d8f98ed6
commit 2b4e051783
4 changed files with 15 additions and 15 deletions

View File

@ -26,7 +26,7 @@ import javax.swing.table.TableModel;
import enginuity.NewGUI.data.ApplicationStateManager;
import enginuity.NewGUI.data.TableMetaData;
import enginuity.NewGUI.tools.ClipBoardCopyTest;
import enginuity.NewGUI.tools.ClipBoardCopy;
import enginuity.NewGUI.tools.FitData;
public class EInternalFrame extends JInternalFrame implements InternalFrameListener, ActionListener{
@ -75,7 +75,7 @@ public class EInternalFrame extends JInternalFrame implements InternalFrameListe
TableModel tableModel = new ETableRowLabel(data[0].length, tableMetaData.getRowLabels());
eTable = new ETable(tableMetaData, data, columnModel);
eTable.setBackground(Color.LIGHT_GRAY);
ClipBoardCopyTest excelCopy = new ClipBoardCopyTest(eTable);
ClipBoardCopy excelCopy = new ClipBoardCopy(eTable);
JTable headerColumn = new JTable(tableModel, rowHeaderModel);
eTable.createDefaultColumnsFromModel();

View File

@ -11,7 +11,7 @@ public class ETableModel extends AbstractTableModel {
private String[] columnNames = new String[11];
private Double[][] data = new Double[11][40];
private TableMetaData tableMetaData;
private DecimalFormat formatter = new DecimalFormat( "#.0" );
private DecimalFormat formatter = new DecimalFormat( "#.#" );
public ETableModel(TableMetaData metaData, Double[][] initialData) {
this.tableMetaData = metaData;
@ -54,8 +54,10 @@ public class ETableModel extends AbstractTableModel {
if(value instanceof String){
try{
String tempString = formatter.format(value);
temp = Double.parseDouble(tempString);
System.out.println("value:"+value+":");
//String tempString = formatter.format(value);
//temp = Double.parseDouble(tempString);
temp = Double.parseDouble((String)value);
}catch (NumberFormatException e) {
System.out.println("Not a valid number entered.");
}

View File

@ -12,7 +12,7 @@ import java.util.*;
* format used by Excel. This provides for clipboard interoperability between
* enabled JTables and Excel.
*/
public class ClipBoardCopyTest implements ActionListener {
public class ClipBoardCopy implements ActionListener {
private String rowstring, value;
private Clipboard clipBoard;
@ -25,7 +25,7 @@ public class ClipBoardCopyTest implements ActionListener {
* The Excel Adapter is constructed with a JTable on which it enables
* Copy-Paste and acts as a Clipboard listener.
*/
public ClipBoardCopyTest(JTable myJTable) {
public ClipBoardCopy(JTable myJTable) {
jTable1 = myJTable;
KeyStroke copy = KeyStroke.getKeyStroke(KeyEvent.VK_C,ActionEvent.CTRL_MASK, false);
// Identifying the copy KeyStroke user can modify this
@ -75,8 +75,7 @@ public class ClipBoardCopyTest implements ActionListener {
}
for (int i = 0; i < numrows; i++) {
for (int j = 0; j < numcols; j++) {
sbf.append(jTable1.getValueAt(rowsselected[i],
colsselected[j]));
sbf.append(jTable1.getValueAt(rowsselected[i],colsselected[j]));
if (j < numcols - 1)
sbf.append("\t");
}
@ -104,8 +103,7 @@ public class ClipBoardCopyTest implements ActionListener {
&& startCol + j < jTable1.getColumnCount())
jTable1.setValueAt(value, startRow + i, startCol
+ j);
System.out.println("Putting " + value + "atrow="
+ startRow + i + "column=" + startCol + j);
System.out.println("Putting " + value + "atrow="+ startRow + i + "column=" + startCol + j);
}
}
} catch (Exception ex) {

View File

@ -90,12 +90,12 @@ public class JutecToolBar extends JToolBar implements ActionListener {
//((ECUEditorMenuBar) parent.getJMenuBar()).openImageDialog();
System.out.println("Load Map From File");
String saveFileName = null;
fileChosen = fileChooser.showSaveDialog(null);
String openFileName = null;
fileChosen = fileChooser.showOpenDialog(null);
UtecMapData mapData = null;
if (fileChosen == JFileChooser.APPROVE_OPTION) {
saveFileName = fileChooser.getSelectedFile().getPath();
mapData = new UtecMapData(saveFileName);
openFileName = fileChooser.getSelectedFile().getPath();
mapData = new UtecMapData(openFileName);
//UtecDataManager.setCurrentMap(mapData);
UtecDataManager.addMap(mapData);