-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.fxml
472 lines (470 loc) · 27.9 KB
/
Main.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXTextArea?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane fx:id="borderPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="778.0" prefWidth="775.0" style="-fx-background-color: #fff;" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Project2.MainController">
<left>
<Pane fx:id="sidebarPane" stylesheets="@stylesheet.css" BorderPane.alignment="CENTER">
<children>
<VBox fx:id="sidebar" alignment="TOP_CENTER" prefHeight="780.0" prefWidth="250.0" styleClass="sidebar" stylesheets="@stylesheet.css">
<children>
<ImageView fitHeight="230.0" fitWidth="230.0" pickOnBounds="true" smooth="false">
<image>
<Image url="@pictures/rahmani.jpg" />
</image>
<VBox.margin>
<Insets top="15.0" />
</VBox.margin>
</ImageView>
<JFXButton contentDisplay="RIGHT" ripplerFill="#f0e3e3" styleClass="sidebar-user-btn" text="Context-Free Grammars">
<font>
<Font name="Calibri" size="14.0" />
</font>
<graphic>
<ImageView fitHeight="6.0" fitWidth="14.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/arrow-desc.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<Label maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="250.0" style="-fx-text-fill: #b8b1b1;" text="Main Page" textFill="#b8b1b1">
<VBox.margin>
<Insets bottom="10.0" top="10.0" />
</VBox.margin>
<padding>
<Insets left="10.0" />
</padding>
<font>
<Font name="Comic Sans MS Bold" size="14.0" />
</font>
</Label>
<JFXButton fx:id="enterGrammarBtn" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" stylesheets="@stylesheet.css" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/keyboard.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="Enter Grammar" textFill="#b8b1b1">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<JFXButton fx:id="grammarValidationBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/validation.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="Grammar Validation" textFill="#b8b1b1">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<Label maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="250.0" style="-fx-text-fill: #b8b1b1;" text="Change To Normal Forms" textFill="#b8b1b1">
<padding>
<Insets left="10.0" />
</padding>
<font>
<Font name="Comic Sans MS Bold" size="14.0" />
</font>
<VBox.margin>
<Insets bottom="10.0" top="20.0" />
</VBox.margin>
</Label>
<JFXButton fx:id="deleteTrashBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/deleteTrash.png" />
</image>
<HBox.margin>
<Insets left="7.0" />
</HBox.margin>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="NF (Delete Trash)" textFill="#b8b1b1">
<HBox.margin>
<Insets left="25.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<JFXButton fx:id="cnfBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/cnf.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="CNF (Chomskey)" textFill="#b8b1b1">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<JFXButton fx:id="gnfBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="30.0" fitWidth="30.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/gnf.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="GNF (Greibach)" textFill="#b8b1b1">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<JFXButton fx:id="generateBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="20.0" />
</padding>
<children>
<ImageView fitHeight="37.0" fitWidth="34.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/tree.png" />
</image>
<HBox.margin>
<Insets left="-3.0" />
</HBox.margin>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="Generate by Grammar" textFill="#b8b1b1">
<HBox.margin>
<Insets left="15.0" />
</HBox.margin>
<font>
<Font name="Calibri Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<Label maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="250.0" style="-fx-text-fill: #b8b1b1;" text="Calculator" textFill="#b8b1b1">
<padding>
<Insets left="10.0" />
</padding>
<font>
<Font name="Comic Sans MS Bold" size="14.0" />
</font>
<VBox.margin>
<Insets bottom="10.0" top="20.0" />
</VBox.margin>
</Label>
<JFXButton fx:id="antlrBtn" prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="254.0">
<padding>
<Insets left="25.0" />
</padding>
<children>
<ImageView fitHeight="28.0" fitWidth="28.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/antlr.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="ANTLR" textFill="#b8b1b1">
<HBox.margin>
<Insets left="17.0" />
</HBox.margin>
<font>
<Font name="Consolas Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
<JFXButton prefHeight="40.0" prefWidth="300.0" styleClass="sidebar-btn" text=" ">
<graphic>
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="250.0">
<padding>
<Insets left="25.0" />
</padding>
<children>
<ImageView fitHeight="27.0" fitWidth="25.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/calculator.png" />
</image>
</ImageView>
<Label style="-fx-text-fill: #b8b1b1;" text="PDA Calculator" textFill="#b8b1b1">
<HBox.margin>
<Insets left="20.0" />
</HBox.margin>
<font>
<Font name="Consolas Bold" size="14.0" />
</font>
</Label>
</children>
</HBox>
</graphic>
</JFXButton>
</children>
</VBox>
</children>
</Pane>
</left>
<center>
<Pane fx:id="contentAreaPane" prefHeight="778.0" prefWidth="778.0" BorderPane.alignment="CENTER">
<children>
<VBox fx:id="content_area" prefHeight="778.0" prefWidth="770.0" style="-fx-background-color: #fff;" stylesheets="@stylesheet.css">
<children>
<HBox fx:id="menubar" alignment="CENTER_LEFT" maxHeight="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="55.0" style="-fx-background-color: #fff; -fx-border-color: #cccccc; -fx-border-width: 0px 0px 1px 0px;" stylesheets="@stylesheet.css">
<children>
<JFXButton fx:id="listBtn" alignment="CENTER" contentDisplay="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="50.0" ripplerFill="WHITE" styleClass="menu-bar-btns" text=" ">
<graphic>
<ImageView fitHeight="25.0" fitWidth="25.0" pickOnBounds="true" preserveRatio="true" styleClass="menu-bar-btns-icon">
<image>
<Image url="@pictures/th-list.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<HBox maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="300.0" HBox.hgrow="ALWAYS" />
<HBox alignment="TOP_RIGHT" layoutX="10.0" layoutY="10.0" HBox.hgrow="ALWAYS">
<children>
<JFXButton fx:id="closeBtn" alignment="CENTER" contentDisplay="CENTER" layoutX="351.0" layoutY="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="50.0" ripplerFill="WHITE" styleClass="menu-bar-btns" text=" ">
<graphic>
<ImageView fitHeight="25.0" fitWidth="25.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/close.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
</children>
<HBox.margin>
<Insets />
</HBox.margin>
</HBox>
</children>
<VBox.margin>
<Insets bottom="2.0" />
</VBox.margin>
</HBox>
<HBox alignment="CENTER_LEFT" prefHeight="50.0" prefWidth="774.0">
<children>
<VBox prefHeight="74.0" prefWidth="504.0">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
<children>
<Label text="Context-Free Grammar Rules" textFill="#757373">
<font>
<Font name="Calibri Bold" size="24.0" />
</font>
</Label>
<HBox>
<children>
<Label text="Theory of Computation" textFill="RED">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
</Label>
</children>
</HBox>
<HBox>
<children>
<Label textFill="#757373">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
</Label>
<Label layoutX="10.0" layoutY="10.0" prefHeight="55.0" prefWidth="346.0" text="Developed By: Alireza Haqani / Danial Bazmandeh" textFill="#00a1ff">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
<HBox.margin>
<Insets />
</HBox.margin>
</Label>
</children>
</HBox>
</children>
</VBox>
<HBox alignment="CENTER_RIGHT" HBox.hgrow="ALWAYS">
<children>
<JFXButton fx:id="openBtn" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="100.0" styleClass="content-area-circle-btns" text="Open">
<font>
<Font name="System Bold" size="12.0" />
</font>
<graphic>
<ImageView fitHeight="14.0" fitWidth="14.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/circle.png" />
</image>
</ImageView>
</graphic>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</JFXButton>
<JFXButton fx:id="editBtn" contentDisplay="CENTER" layoutX="10.0" layoutY="17.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="35.0" styleClass="content-area-circle-btns" text=" ">
<font>
<Font name="System Bold" size="12.0" />
</font>
<graphic>
<ImageView fitHeight="14.0" fitWidth="14.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/edit.png" />
</image>
</ImageView>
</graphic>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</JFXButton>
<JFXButton fx:id="deleteBtn" contentDisplay="CENTER" layoutX="110.0" layoutY="17.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="35.0" prefWidth="35.0" styleClass="content-area-circle-btns" text=" ">
<font>
<Font name="System Bold" size="12.0" />
</font>
<graphic>
<ImageView fitHeight="14.0" fitWidth="14.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/deleteTrash.png" />
</image>
</ImageView>
</graphic>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</JFXButton>
</children>
<HBox.margin>
<Insets left="20.0" />
</HBox.margin>
</HBox>
</children>
<VBox.margin>
<Insets />
</VBox.margin>
<padding>
<Insets bottom="10.0" top="10.0" />
</padding>
</HBox>
<AnchorPane prefHeight="652.0" prefWidth="774.0">
<children>
<JFXTextArea fx:id="txtInput" focusColor="#1e3d9a" layoutX="152.0" layoutY="385.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="118.0" prefWidth="519.0" promptText="Enter the grammar production rules..." scrollLeft="15.0">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
</JFXTextArea>
<JFXButton fx:id="submitBtn" layoutX="229.0" layoutY="518.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="39.0" prefWidth="150.0" styleClass="content-area-circle-btns" text=" Submit">
<font>
<Font name="System Bold" size="14.0" />
</font>
<graphic>
<ImageView fitHeight="25.0" fitWidth="23.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/checked.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXTextArea fx:id="txtFixed" editable="false" focusColor="#1e3d9a" layoutX="152.0" layoutY="94.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="224.0" prefWidth="519.0" promptText=" ***WELCOME***" scrollLeft="15.0">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
</JFXTextArea>
<Label layoutX="152.0" layoutY="343.0" prefHeight="34.0" prefWidth="492.0" text="Correct Form: <START> -> <VARIABLE>terminal | terminal" textFill="RED">
<font>
<Font name="Comic Sans MS Bold" size="16.0" />
</font>
</Label>
<Label fx:id="lblNotif" alignment="CENTER" contentDisplay="CENTER" layoutX="166.0" layoutY="570.0" prefHeight="34.0" prefWidth="492.0" textAlignment="CENTER" textFill="RED">
<font>
<Font name="Comic Sans MS Bold" size="16.0" />
</font>
</Label>
<JFXButton fx:id="calculateBtn" layoutX="444.0" layoutY="518.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="39.0" prefWidth="150.0" styleClass="content-area-circle-btns" text=" Calculate">
<font>
<Font name="System Bold" size="14.0" />
</font>
</JFXButton>
<JFXTextArea fx:id="txtExpression" focusColor="#1e3d9a" layoutX="14.0" layoutY="14.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="32.0" prefWidth="159.0" promptText="Enter expression..." scrollLeft="15.0">
<font>
<Font name="Calibri Bold" size="16.0" />
</font>
</JFXTextArea>
<ImageView fitHeight="27.0" fitWidth="24.0" layoutX="470.0" layoutY="526.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@pictures/calculator_colored.png" />
</image>
</ImageView>
</children>
</AnchorPane>
</children>
</VBox>
</children>
</Pane>
</center>
</BorderPane>