- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSnapshotReader.java
More file actions
Latest commit
77 lines (65 loc) · 2.59 KB
/
Copy pathSnapshotReader.java
File metadata and controls
77 lines (65 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* Created by Cekis on 2/20/2017.
*/
importjavafx.application.Application;
importjavafx.collections.FXCollections;
importjavafx.collections.ObservableList;
importjavafx.scene.Scene;
importjavafx.scene.control.Tab;
importjavafx.scene.control.TabPane;
importjavafx.scene.control.TableColumn;
importjavafx.scene.control.TableView;
importjavafx.scene.control.cell.PropertyValueFactory;
importjavafx.stage.Stage;
importswg.WSFile;
importjava.io.IOException;
publicclassSnapshotReaderextendsApplication {
publicstaticvoidmain(String[] args) {
launch(args);
}
@Override
publicvoidstart(StageprimaryStage) throwsIOException {
primaryStage.setTitle("SWG Snapshot Viewer");
TabPanetabView = newTabPane();
Tabtab = newTab();
tab.closableProperty().setValue(false);
tab.setText("lok.ws");
TableViewdataTable = newTableView();
ObservableListcols = dataTable.getColumns();
cols.add(makeColumn("Object ID", "id",75));
cols.add(makeColumn("Parent ID", "parentId", 75));
cols.add(makeColumn("Template", "template", dataTable, 550d));
cols.add(makeColumn("Index", "nodeIndex", 50));
cols.add(makeColumn("X", "x", 50));
cols.add(makeColumn("Y", "y", 50));
cols.add(makeColumn("Z", "z", 50));
cols.add(makeColumn("QW", "objW",50));
cols.add(makeColumn("QX", "objX",50));
cols.add(makeColumn("QY", "objY",50));
cols.add(makeColumn("QZ", "objZ",50));
tab.setContent(dataTable);
tabView.getTabs().add(tab);
WSFilewsFile = newWSFile();
wsFile.readFile("snapshot/lok.ws");
tab.setText(wsFile.getAreaName() + ".ws");
ObservableListdata = FXCollections.observableArrayList(wsFile.getAllNodes().toArray());
dataTable.setItems(data);
Scenescene = newScene(tabView, 300, 275);
primaryStage.setScene(scene);
primaryStage.show();
}
privateTableColumnmakeColumn(Stringname, Stringproperty, doublewidth){
TableColumnnewCol = newTableColumn();
newCol.setPrefWidth(width);
newCol.setText(name);
newCol.setCellValueFactory(newPropertyValueFactory(property));
returnnewCol;
}
privateTableColumnmakeColumn(Stringname, Stringproperty, TableViewdt, doublediff){
TableColumnnewCol = newTableColumn();
newCol.prefWidthProperty().bind(dt.widthProperty().subtract(diff));
newCol.setText(name);
newCol.setCellValueFactory(newPropertyValueFactory(property));
returnnewCol;
}
}