1
0
mirror of https://github.com/klmp200/sierpinski-fractales.git synced 2024-12-22 07:11:07 +00:00

Internationalisation

This commit is contained in:
Antoine Bartuccio 2017-06-13 10:22:42 +02:00
parent 9e2814d7df
commit d5e76f437b
6 changed files with 22 additions and 17 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# Explanation of demo + structure
file -> packages

View File

@ -4,10 +4,9 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.Pane?>
<Pane fx:id="mainPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="608.0" prefWidth="813.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="io.sarl.demos.sierpinski.gui.FXMLViewerController">
<Pane fx:id="mainPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="653.0" prefWidth="615.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="io.sarl.demos.sierpinski.gui.FXMLViewerController">
<children>
<Canvas fx:id="drawZone" height="600.0" layoutX="199.0" layoutY="4.0" rotate="180.0" scaleX="-1.0" width="600.0" />
<Button layoutX="26.0" layoutY="45.0" mnemonicParsing="false" onAction="#actionSetup" text="Setup" />
<Button fx:id="multiplyButton" disable="true" layoutX="26.0" layoutY="89.0" mnemonicParsing="false" onAction="#actionMultiply" text="Multiply" />
<Canvas fx:id="drawZone" height="600.0" layoutX="8.0" layoutY="3.0" rotate="180.0" scaleX="-1.0" width="600.0" />
<Button fx:id="multiplyButton" layoutX="14.0" layoutY="612.0" mnemonicParsing="false" onAction="#actionMultiply" text="%DivideButtonText" />
</children>
</Pane>

View File

@ -1,27 +1,32 @@
package io.sarl.demos.sierpinski
import javafx.application.Application
import javafx.stage.Stage
import javafx.fxml.FXMLLoader
import io.sarl.demos.sierpinski.gui.FXMLViewerController
import java.net.URL
import java.util.ResourceBundle
import javafx.application.Application
import javafx.fxml.FXMLLoader
import javafx.fxml.JavaFXBuilderFactory
import javafx.scene.Parent
import javafx.scene.Scene
import io.sarl.demos.sierpinski.gui.FXMLViewerController
import javafx.stage.Stage
class FractalesFXApplications extends Application {
private var loader: FXMLLoader
private var loader : FXMLLoader
private val bundle : ResourceBundle = ResourceBundle.getBundle(
FractalesFXApplications.getPackage.name.replaceAll("\\.", "/") + "/" + FractalesFXApplications.simpleName);
@Override
public def start(stage: Stage) throws Exception {
var location: URL = getClass().getResource("FractalesFXApplication.fxml")
loader = new FXMLLoader()
loader.setLocation(location)
loader.setBuilderFactory(new JavaFXBuilderFactory)
loader.resources = bundle
var root: Parent = loader.load(location.openStream) as Parent
var scene: Scene = new Scene(root)
scene.stylesheets.add(class.getResource("ViewerController.css").toExternalForm)
stage.setTitle("SARL Demo: Sierpinski Fractal Animation")
stage.setTitle(bundle.getString("TITLE"))
stage.setScene(scene)
stage.show
}

View File

@ -0,0 +1,2 @@
TITLE=SARL Demo: Sierpinski Fractals Animation
DivideButtonText=Divide

View File

@ -0,0 +1,2 @@
TITLE=SARL Démo: Animation des Fractales de Sierpinski
DivideButtonText=Diviser

View File

@ -7,7 +7,6 @@ import javafx.fxml.FXML
import javafx.scene.canvas.Canvas
import javafx.scene.control.Button
import io.sarl.lang.core.Event
import javafx.^event.ActionEvent
import io.sarl.demos.sierpinski.agents.Fractal
import io.janusproject.Boot
import io.sarl.demos.sierpinski.objects.Square
@ -50,18 +49,14 @@ class FXMLViewerController implements EventListener {
}
}
@FXML protected def actionSetup() {
@FXML protected def actionMultiply() {
if (!setuped){
multiplyButton.setDisable(false)
Launcher.main(
new Square(new Vector2D(0.0, 0.0),
600.0
), this )
setuped = true
}
}
@FXML protected def actionMultiply() {
var m = new Multiply
m.source = new Address(ispace.spaceID, id)
this.ispace.emit(m)