Advertisement
m4v1

Untitled

Sep 25th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.18 KB | None | 0 0
  1.       productionItem.onAction = new EventHandler[ActionEvent] {
  2.         override def handle(event: ActionEvent): Unit = {
  3.           val secondLayout = new StackPane
  4.           val secondScene = new Scene(secondLayout, 300, 200) {
  5.             val data = new ObservableBuffer[SimpleGrammarRule]()
  6.             for (it <- grammar.GrammarRules) {
  7.               for(it2 <- it.Productions){
  8.                 val temp = new SimpleGrammarRule
  9.                 temp.Name = it.Name
  10.                 temp.Production = it2
  11.                 data.+=(temp)
  12.               }
  13.             }
  14.  
  15.             val table = new TableView(data)
  16.  
  17.             val col1 = new TableColumn[SimpleGrammarRule, String]("Name")
  18.             col1.cellValueFactory = cdf => StringProperty(cdf.value.Name)
  19.             val col2 = new TableColumn[SimpleGrammarRule, String]("Production")
  20.             col2.cellValueFactory = cdf => StringProperty(cdf.value.Production)
  21.             table.columns.+=(col1, col2)
  22.  
  23.             root = table
  24.           }
  25.           val secondStage = new Stage()
  26.           secondStage.title = "Transition List"
  27.           secondStage.setScene(secondScene)
  28.           secondStage.show()
  29.         }
  30.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement