-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhysicsSim.fxml
233 lines (231 loc) · 15.7 KB
/
PhysicsSim.fxml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.canvas.Canvas?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckMenuItem?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TitledPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<BorderPane fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="525.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="PhysicsSimController">
<top>
<MenuBar prefHeight="25.0" prefWidth="700.0" BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" onAction="#save" text="Save Scenario" />
<MenuItem mnemonicParsing="false" onAction="#saveAs" text="Save As..." />
<MenuItem mnemonicParsing="false" onAction="#loadFile" text="Load Scenario" />
<MenuItem mnemonicParsing="false" onAction="#exit" text="Exit" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Insert">
<items>
<MenuItem mnemonicParsing="false" onAction="#insert2DMotion" text="Particle (2D Motion)" />
<MenuItem mnemonicParsing="false" onAction="#insertCircularMotion" text="Particle (Circular Motion)" />
</items>
</Menu>
<Menu disable="true" mnemonicParsing="false" text="Help" visible="false">
<items>
<MenuItem disable="true" mnemonicParsing="false" text="About" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="PlayBack">
<items>
<CheckMenuItem fx:id="runMenuItem" mnemonicParsing="false" onAction="#runAnimation" text="Run" />
<CheckMenuItem fx:id="pauseMenuItem" mnemonicParsing="false" onAction="#stopAnimation" text="Pause" />
</items></Menu>
</menus>
</MenuBar>
</top>
<right>
<TitledPane animated="false" collapsible="false" prefHeight="500.0" prefWidth="200.0" text="Details" BorderPane.alignment="CENTER">
<content>
<TabPane fx:id="tabPane" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab fx:id="sceneTab" text="Scene">
<content>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="20.0">
<children>
<Button mnemonicParsing="false" onAction="#runAnimation" prefHeight="25.0" prefWidth="242.0" text="Run" />
<Button mnemonicParsing="false" onAction="#stopAnimation" prefHeight="25.0" prefWidth="238.0" text="Pause" />
<Button mnemonicParsing="false" onAction="#insert2DMotion" prefHeight="25.0" prefWidth="243.0" text="New 2D Motion" />
<Button mnemonicParsing="false" onAction="#insertCircularMotion" prefHeight="25.0" prefWidth="216.0" text="New Circular Motion" />
<Button mnemonicParsing="false" onAction="#clearSystem" prefHeight="25.0" prefWidth="226.0" text="Clear" />
<Button mnemonicParsing="false" onAction="#save" prefHeight="25.0" prefWidth="178.0" text="Save" />
<Button mnemonicParsing="false" onAction="#saveAs" prefHeight="25.0" prefWidth="220.0" text="Save As..." />
<Button mnemonicParsing="false" onAction="#loadFile" prefHeight="25.0" prefWidth="206.0" text="Load" />
</children>
<padding>
<Insets left="30.0" right="30.0" top="30.0" />
</padding>
</VBox>
</content></Tab>
<Tab fx:id="particleTab" disable="true" text="Particle">
<content>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="30.0">
<children>
<AnchorPane prefHeight="14.0" prefWidth="198.0">
<children>
<ComboBox fx:id="particleSelection1" onAction="#updateSelection" prefWidth="150.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
<GridPane hgap="5.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Position" GridPane.columnSpan="2147483647" />
<Label text="x:" GridPane.rowIndex="1" />
<Label text="y:" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label text="Velocity" textOverrun="CLIP" GridPane.columnSpan="2147483647" GridPane.rowIndex="2" />
<Label text="y:" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label text="x:" GridPane.rowIndex="3" />
<Label text="Acceleration" GridPane.columnSpan="2147483647" GridPane.rowIndex="4" />
<Label text="y:" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<Label text="x:" GridPane.rowIndex="5" />
<TextField fx:id="positionX" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="velocityX" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="accelerationX" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<TextField fx:id="positionY" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<TextField fx:id="velocityY" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<TextField fx:id="accelerationY" GridPane.columnIndex="3" GridPane.rowIndex="5" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</GridPane>
<VBox prefHeight="51.0" prefWidth="138.0" spacing="20.0">
<children>
<Button fx:id="updateButton1" mnemonicParsing="false" onAction="#updateMotion" prefHeight="25.0" prefWidth="264.0" text="Update" />
<Button fx:id="deleteButton1" mnemonicParsing="false" onAction="#removeParticle" prefHeight="25.0" prefWidth="246.0" text="Delete">
<VBox.margin>
<Insets />
</VBox.margin>
</Button>
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</VBox>
</children>
<padding>
<Insets left="30.0" right="30.0" top="30.0" />
</padding>
</VBox>
</content>
</Tab>
<Tab fx:id="circularTab" disable="true" text="Circular">
<content>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="30.0">
<children>
<AnchorPane prefHeight="24.0" prefWidth="138.0">
<children>
<ComboBox fx:id="particleSelection2" onAction="#updateSelection" prefWidth="150.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
<VBox prefHeight="188.0" prefWidth="138.0" spacing="10.0">
<children>
<GridPane hgap="5.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Center" GridPane.columnSpan="2147483647" />
<Label text="x:" GridPane.rowIndex="1" />
<TextField fx:id="centerX" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="y:" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="centerY" GridPane.columnIndex="3" GridPane.rowIndex="1" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</GridPane>
<GridPane hgap="5.0" vgap="10.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Radius:" textOverrun="CLIP" GridPane.columnSpan="2147483647" />
<Label text="Velocity:" GridPane.columnSpan="2147483647" GridPane.rowIndex="1" />
<TextField fx:id="radius" GridPane.columnIndex="2" GridPane.columnSpan="2147483647" />
<TextField fx:id="velocityC" GridPane.columnIndex="2" GridPane.columnSpan="2147483647" GridPane.rowIndex="1" />
<Label text="Position (𝜃):" GridPane.columnSpan="2147483647" GridPane.rowIndex="2" />
<TextField fx:id="theta" GridPane.columnIndex="2" GridPane.columnSpan="2147483647" GridPane.rowIndex="2" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</GridPane>
</children>
</VBox>
<VBox prefHeight="35.0" prefWidth="138.0" spacing="20.0">
<children>
<Button fx:id="updateButton2" mnemonicParsing="false" onAction="#updateMotion" prefHeight="25.0" prefWidth="264.0" text="Update" />
<Button fx:id="deleteButton2" mnemonicParsing="false" onAction="#removeParticle" prefHeight="25.0" prefWidth="246.0" text="Delete">
<VBox.margin>
<Insets />
</VBox.margin>
</Button>
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</VBox>
</children>
<padding>
<Insets left="30.0" right="30.0" top="30.0" />
</padding>
</VBox>
</content></Tab>
</tabs>
</TabPane>
</content>
</TitledPane>
</right>
<left>
<Pane BorderPane.alignment="CENTER">
<children>
<Canvas fx:id="canvas" height="500.0" width="500.0" />
</children>
</Pane>
</left>
</BorderPane>