From 51cfaba39d41ef9eb15fbf6d199231ae83149036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Galland?= Date: Sat, 5 Oct 2019 10:38:38 +0800 Subject: [PATCH] [core] Delete io.sarl.javafx from the SDK. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Galland --- .../io.sarl.javafx/META-INF/MANIFEST.MF | 13 -- .../OSGI-INF/l10n/bundle.properties | 3 - .../io.sarl.javafx/build.properties | 10 - main/apiplugins/io.sarl.javafx/pom.xml | 111 ---------- .../src/io/sarl/javafx/FXBehaviors.sarl | 113 ---------- .../src/io/sarl/javafx/FxApplication.sarl | 69 ------ .../src/io/sarl/javafx/FxEvents.sarl | 32 --- .../io/sarl/javafx/FxViewerController.sarl | 201 ------------------ .../src/io/sarl/javafx/Messages.sarl | 49 ----- .../src/io/sarl/javafx/messages.properties | 1 - main/apiplugins/pom.xml | 1 - main/externalmaven/io.sarl.maven.sdk/pom.xml | 4 - main/features/io.sarl.lib/feature.xml | 12 +- 13 files changed, 2 insertions(+), 617 deletions(-) delete mode 100644 main/apiplugins/io.sarl.javafx/META-INF/MANIFEST.MF delete mode 100644 main/apiplugins/io.sarl.javafx/OSGI-INF/l10n/bundle.properties delete mode 100644 main/apiplugins/io.sarl.javafx/build.properties delete mode 100644 main/apiplugins/io.sarl.javafx/pom.xml delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FXBehaviors.sarl delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxApplication.sarl delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxEvents.sarl delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxViewerController.sarl delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/Messages.sarl delete mode 100644 main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/messages.properties diff --git a/main/apiplugins/io.sarl.javafx/META-INF/MANIFEST.MF b/main/apiplugins/io.sarl.javafx/META-INF/MANIFEST.MF deleted file mode 100644 index a236540417..0000000000 --- a/main/apiplugins/io.sarl.javafx/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: io.sarl.javafx;singleton:=true -Automatic-Module-Name: io.sarl.javafx -Bundle-Version: 0.10.0.qualifier -Bundle-Vendor: %Bundle-Vendor -Bundle-Name: %Bundle-Name -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: io.sarl.javafx -Require-Bundle: io.sarl.util;bundle-version="0.10.0", - io.sarl.core;bundle-version="0.10.0", - org.eclipse.osgi;bundle-version="3.15.0" - diff --git a/main/apiplugins/io.sarl.javafx/OSGI-INF/l10n/bundle.properties b/main/apiplugins/io.sarl.javafx/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 415270dd91..0000000000 --- a/main/apiplugins/io.sarl.javafx/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for io.sarl.core -Bundle-Vendor = SARL.io -Bundle-Name = SARL JavaFX \ No newline at end of file diff --git a/main/apiplugins/io.sarl.javafx/build.properties b/main/apiplugins/io.sarl.javafx/build.properties deleted file mode 100644 index bed81581ee..0000000000 --- a/main/apiplugins/io.sarl.javafx/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -source.. = src,\ - src-gen -src.excludes = **/*.sarlbin -bin.includes = META-INF/,\ - OSGI-INF/,\ - . -bin.excludes = **/*.java._trace,\ - **/*.sarlbin,\ - **/*.sarl -jre.compilation.profile = JavaSE-1.8 diff --git a/main/apiplugins/io.sarl.javafx/pom.xml b/main/apiplugins/io.sarl.javafx/pom.xml deleted file mode 100644 index e656336c34..0000000000 --- a/main/apiplugins/io.sarl.javafx/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - 4.0.0 - - io.sarl - io.sarl.plugins.api - 0.10.0-SNAPSHOT - - io.sarl.javafx - eclipse-plugin - SDK JavaFX Library - - - - - io.sarl.maven - sarl-maven-plugin - - - - sarl-compiler-init - initialize - - initialize - - - - sarl-compiler-compile - compile - - compile - - - - sarl-compiler-clean - clean - - clean - - - - - true - ${compiler.level} - ${compiler.level} - ${project.build.sourceEncoding} - src/ - src-gen/ - true - true - true - true - - - - - - - - - - - default-profile - - true - - - - - org.eclipse.tycho - tycho-source-plugin - - - - - - maven-release-of-javafx-plugin - - - publicSarlApiModuleSet - true - - - - - - - org.arakhne.afc.maven - tag-replacer - - - ${project.basedir}/src - ${project.basedir}/src-gen - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - ${project.build.directory}/generated-sources/java - - - - - - - - - diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FXBehaviors.sarl b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FXBehaviors.sarl deleted file mode 100644 index dcb0068171..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FXBehaviors.sarl +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.javafx - -import java.util.concurrent.atomic.AtomicBoolean - -import io.sarl.lang.core.Agent -import io.sarl.core.Behaviors -import io.sarl.core.Destroy -import io.sarl.core.Initialize -import io.sarl.core.InnerContextAccess -import io.sarl.core.Lifecycle -import io.sarl.core.MemberLeft -import io.sarl.util.OpenEventSpace - -/** Specific behavior for an agent that supports killing from a JavaFX application. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ -behavior FXKillSupportBehavior { - - uses Lifecycle, InnerContextAccess - - val exited = new AtomicBoolean(false) - - /** Kill itself on Exit signal when no inner agent. - */ - on AppExit [!hasMemberAgent] { - exited.set(true) - killMe - } - - /** Transmit Exit signal to all inner agent. - */ - on AppExit [!exited.get && hasMemberAgent] { - exited.set(true) - innerContext.defaultSpace.emit(ID, new AppExit) - } - - on MemberLeft [exited.get && it.inInnerDefaultSpace && !hasMemberAgent] { - killMe - } - -} - -/** Specific behavior for an agent that enables it to interact with - * a JavaFX user interface. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ -behavior FXBehavior extends FXKillSupportBehavior { - - uses Behaviors - - val uiSpace : OpenEventSpace - - /** Constructor. - * - * @param owner the owner (agent) of the behavior. - * @param controller the JavaFX controller to be linked to. - */ - new (owner : Agent, controller : FxViewerController) { - super(owner) - this.uiSpace = controller.UISpace - } - - /** Installation. - */ - on Initialize { - this.uiSpace.register(asEventListener) - } - - /** Uninstallation. - on Destroy { - this.uiSpace.unregister(asEventListener) - } - - /** Replies the space that is dedicated to the UI. - * - * @return the space for UI. - */ - def getUISpace : OpenEventSpace { - this.uiSpace - } - -} diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxApplication.sarl b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxApplication.sarl deleted file mode 100644 index 0ec248645d..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxApplication.sarl +++ /dev/null @@ -1,69 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.javafx - -import javafx.application.Application -import javafx.fxml.FXMLLoader -import javafx.stage.Stage - -/** - * Abstract implementation of a JavaFX application that is embedding SARL agents. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ -abstract class FxApplication extends Application { - - /** The JavaFX loader. - */ - var loader : FXMLLoader - - /** Start the JavaFX application. - * - * @param stage the JavaFX stage. - */ - final override start(stage : Stage) { - this.loader = stage.doApplicationStart - stage.show - } - - /** Kill the agents and stop the JavaFX application. - */ - override stop { - if (loader !== null && loader.controller instanceof FxViewerController) { - (loader.controller as FxViewerController).safeExit - } - super.stop - } - - /** Start the application. This function must be overridden within the application software - * in order to initialize the JavaFX user interface that is dedicated to the application. - * - * @param stage the JavaFX stage. That is used for initializing JavaFX. - * @return the loader of FXML, i.e. of uuser interface, that is dedicated to the application. - */ - protected abstract def doApplicationStart(stage : Stage) : FXMLLoader - -} diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxEvents.sarl b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxEvents.sarl deleted file mode 100644 index 2c378176fd..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxEvents.sarl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.javafx - -/* Triggered when the JavaFX application needs to be exited. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ -event AppExit diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxViewerController.sarl b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxViewerController.sarl deleted file mode 100644 index d95315d36f..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/FxViewerController.sarl +++ /dev/null @@ -1,201 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.javafx; - -import io.sarl.bootstrap.SRE -import io.sarl.core.AgentSpawned -import io.sarl.lang.core.Agent -import io.sarl.lang.core.Event -import io.sarl.lang.core.EventListener -import io.sarl.util.OpenEventSpace -import io.sarl.util.OpenEventSpaceSpecification -import java.util.UUID -import javafx.application.Platform -import javafx.^event.ActionEvent -import javafx.fxml.FXML - -/** Abstract implementation of a JavaFX viewer controller. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ -abstract class FxViewerController implements EventListener { - - /** Identifier of the SARL space that is used for supporting the interactions between - * the agents and the JavaFX user interface. - */ - val id = UUID::randomUUID - - /** Event space for interacting with the agents. - */ - volatile var ^space : OpenEventSpace - - /** Emit a kill signal when the application is exited. - */ - def safeExit : void { - emitToAgents(new AppExit) - this.UISpace = null - } - - /** Method invoked by the SARL agent to register the object on a space. - * - * @param space the event space that is used for supporting the interaction between - * the SARL agents and the user interface. - */ - def setUISpace(^space : OpenEventSpace) : void { - var s = this.^space - s?.unregister(this) - s = this.^space = ^space - s?.register(this) - } - - /** Replies the space for interaction between SARL agents and UI. - * - * @return the event space that is used for supporting the interaction between - * the SARL agents and the user interface. - */ - def getUISpace : OpenEventSpace { - this.^space - } - - /** Emit an event to the agents. - * - * @param event the occurrence to send to agents. - */ - def emitToAgents(^event : Event) { - var s = ^space - if (s !== null) { - s.emit(ID, ^event) - } - } - - /** Start the agent application. - * - * @param agentType the type of the agent to launch. - * @param whenAgentLaunched the lambda that is called when the agent is really launched. - * @return the identifier of the launched agent. - */ - def startAgentApplication(agentType : Class, - whenAgentLaunched : () => void) : UUID { - var bootstrap = SRE::bootstrap - if (!bootstrap.active) { - throw new IllegalStateException(Messages::FxViewerController_0) - } - var context = bootstrap.startWithoutAgent - var rootSpace = context.defaultSpace as OpenEventSpace - this.UISpace = context.createSpace(typeof(OpenEventSpaceSpecification), ID) - new LaunchingCallback(ID, rootSpace, whenAgentLaunched) - return bootstrap.startAgent(agentType, this) - } - - /** Catch exit event from JavaFX. Stop the agents and the JavaFX user interface. - * - * @param event the JavaFx event that is the source of the exit. - */ - @FXML - def exitApplication(^event : ActionEvent) { - safeExit - Platform::exit - } - - /** Get ID of the object on the space that is used for supporting the interactions between - * the agents and the JavaFX user interface. - * - * @return the identifier of the space. - */ - def getID : UUID { - this.id - } - - /** Invoked when an event is fired within an agent and received by the JavaFX user interface. - * - * @param event the occurrence fired by an agent. - */ - dispatch def receiveEvent(^event : Event) { - // Handle all events - } - - /** Callback for launched agents. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.7 - */ - private static class LaunchingCallback implements EventListener { - - val id : UUID - - val rootSpace : OpenEventSpace - - val whenAgentLaunched : ()=>void - - /** Constructor. - * - * @param id the identifier of the space that is used for supporting the interactions between - * the agents and the JavaFX user interface. - * @param whenAgentLaunched the callback lambda expression, that is invoked when an agent is launched. - * @param rootSpace the default space in which the first application agent is spawned. This space is usually - * within the same context as the space used for the interactions between the agents and the user interface. - */ - new (id : UUID, rootSpace : OpenEventSpace, whenAgentLaunched : ()=>void) { - this.id = id - this.whenAgentLaunched = whenAgentLaunched - this.rootSpace = rootSpace - this.rootSpace.register(this) - } - - /** Get ID of the object on the space that is used for supporting the interactions between - * the agents and the JavaFX user interface. - * - * @return the identifier of the space. - */ - def getID : UUID { - this.id - } - - /** Invoked when an agent-spawned event is fired within the agent application and received by the JavaFX user interface. - * - * @param event the occurrence fired by the agent application. - */ - dispatch def receiveEvent(^event : AgentSpawned) { - this.rootSpace.unregister(this) - if (this.whenAgentLaunched !== null) { - this.whenAgentLaunched.apply - } - } - - /** Invoked when an event is fired within an agent and received by the JavaFX user interface. - * - * @param event the occurrence fired by an agent. - */ - dispatch def receiveEvent(^event : Event) { - // Handle all events without error - } - - } - -} diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/Messages.sarl b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/Messages.sarl deleted file mode 100644 index 699dcaa12e..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/Messages.sarl +++ /dev/null @@ -1,49 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.javafx - -import org.eclipse.osgi.util.NLS - -/** Messages. - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @ExcludeFromApidoc - * @since 0.7 - */ -final class Messages extends NLS { - - @SuppressWarnings("unused_private_member") - static val BUNDLE_NAME = { - val name = typeof(Messages).getPackage.name + ".messages" - // initialize resource bundle - NLS.initializeMessages(name, typeof(Messages)) - name - } - - public static var FxViewerController_0 : String - - private new { - } - -} diff --git a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/messages.properties b/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/messages.properties deleted file mode 100644 index 856e292317..0000000000 --- a/main/apiplugins/io.sarl.javafx/src/io/sarl/javafx/messages.properties +++ /dev/null @@ -1 +0,0 @@ -FxViewerController_0 = Unable to find a SRE bootstrap within the class path of the application. \ No newline at end of file diff --git a/main/apiplugins/pom.xml b/main/apiplugins/pom.xml index 68caa1c923..eb2bab4014 100644 --- a/main/apiplugins/pom.xml +++ b/main/apiplugins/pom.xml @@ -22,7 +22,6 @@ io.sarl.core io.sarl.util - io.sarl.javafx diff --git a/main/externalmaven/io.sarl.maven.sdk/pom.xml b/main/externalmaven/io.sarl.maven.sdk/pom.xml index f72b3fd5d8..d36c8db5f9 100644 --- a/main/externalmaven/io.sarl.maven.sdk/pom.xml +++ b/main/externalmaven/io.sarl.maven.sdk/pom.xml @@ -26,10 +26,6 @@ io.sarl io.sarl.util - - io.sarl - io.sarl.javafx - diff --git a/main/features/io.sarl.lib/feature.xml b/main/features/io.sarl.lib/feature.xml index 94b8b462f3..2f8e91e202 100644 --- a/main/features/io.sarl.lib/feature.xml +++ b/main/features/io.sarl.lib/feature.xml @@ -225,11 +225,10 @@ + + - - - - -