diff options
author | martin | 2014-07-31 16:12:05 +0000 |
---|---|---|
committer | martin | 2014-07-31 16:12:05 +0000 |
commit | bcaf3bdea55ae88a44171de3b9d607eedbf021bf (patch) | |
tree | b4e97e25ce69e9f8174fd8779a9479e5425020ea | |
parent | 9f81df621a2e1f9b070f548872a580da53691c93 (diff) | |
download | org.eclipse.efxclipse-gradienteditor.tar.gz org.eclipse.efxclipse-gradienteditor.tar.xz org.eclipse.efxclipse-gradienteditor.zip |
gradient editor initial commit, unstable & not feature completegradienteditor
74 files changed, 6524 insertions, 10 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core.databinding/src/org/eclipse/fx/core/databinding/JFXBeanProperties.java b/bundles/runtime/org.eclipse.fx.core.databinding/src/org/eclipse/fx/core/databinding/JFXBeanProperties.java index bbe773c84..8c75dd44b 100755 --- a/bundles/runtime/org.eclipse.fx.core.databinding/src/org/eclipse/fx/core/databinding/JFXBeanProperties.java +++ b/bundles/runtime/org.eclipse.fx.core.databinding/src/org/eclipse/fx/core/databinding/JFXBeanProperties.java @@ -19,8 +19,6 @@ import org.eclipse.fx.core.databinding.internal.AnonymousFXBeanValueProperty; import org.eclipse.fx.core.databinding.internal.FXBeanPropertyHelper;
import org.eclipse.fx.core.databinding.internal.FXBeanValueProperty;
import org.eclipse.fx.core.databinding.internal.FXBeanValuePropertyDecorator;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
/**
* Factory to create property descriptions
@@ -33,7 +31,7 @@ public class JFXBeanProperties { * the name of the property (nested properties are separated with a .)
* @return the property
*/
- public static @NonNull IJFXBeanValueProperty value(@NonNull String propertyName) {
+ public static IJFXBeanValueProperty value(String propertyName) {
return value(null, propertyName, null);
}
@@ -46,7 +44,7 @@ public class JFXBeanProperties { * the type
* @return the property
*/
- public static @NonNull IJFXBeanValueProperty value(@NonNull String propertyName, Class<?> valueType) {
+ public static IJFXBeanValueProperty value(String propertyName, Class<?> valueType) {
return value(null, propertyName, valueType);
}
@@ -61,9 +59,9 @@ public class JFXBeanProperties { * the type
* @return the property
*/
- public static @NonNull IJFXBeanValueProperty value(@Nullable Class<?> beanClass, @NonNull String propertyName, @Nullable Class<?> _valueType) {
+ public static IJFXBeanValueProperty value(Class<?> beanClass, String propertyName, Class<?> _valueType) {
Class<?> valueType = _valueType;
- @NonNull String[] propertyNames = split(propertyName);
+ String[] propertyNames = split(propertyName);
if (propertyNames.length > 1) {
valueType = null;
}
@@ -78,7 +76,6 @@ public class JFXBeanProperties { property = new FXBeanValueProperty(propertyDescriptor, valueType);
}
- @NonNull
IJFXBeanValueProperty beanProperty = new FXBeanValuePropertyDecorator(property, propertyDescriptor);
for (int i = 1; i < propertyNames.length; i++) {
beanProperty = beanProperty.value(propertyNames[i]);
@@ -86,8 +83,7 @@ public class JFXBeanProperties { return beanProperty;
}
- @SuppressWarnings("null")
- private static @NonNull String[] split(@NonNull String _propertyName) {
+ private static String[] split(String _propertyName) {
String propertyName = _propertyName;
if (propertyName.indexOf('.') == -1)
return new String[] { propertyName };
diff --git a/bundles/runtime/org.eclipse.fx.emf.databinding/src/org/eclipse/fx/emf/databinding/edit/EMFEditFXProperties.java b/bundles/runtime/org.eclipse.fx.emf.databinding/src/org/eclipse/fx/emf/databinding/edit/EMFEditFXProperties.java index fcda9b5e5..1cbcdb257 100755 --- a/bundles/runtime/org.eclipse.fx.emf.databinding/src/org/eclipse/fx/emf/databinding/edit/EMFEditFXProperties.java +++ b/bundles/runtime/org.eclipse.fx.emf.databinding/src/org/eclipse/fx/emf/databinding/edit/EMFEditFXProperties.java @@ -129,6 +129,7 @@ public class EMFEditFXProperties { return this.feature.getName();
}
+
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.class Binary files differnew file mode 100644 index 000000000..a3862dc48 --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.class diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.class Binary files differnew file mode 100644 index 000000000..417ac8d03 --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.class diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/ELifecycleService.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/ELifecycleService.class Binary files differnew file mode 100644 index 000000000..c26a27fdb --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/ELifecycleService.class diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/LifecycleAddon.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/LifecycleAddon.class Binary files differnew file mode 100644 index 000000000..432f2d330 --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/LifecycleAddon.class diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreClose.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreClose.class Binary files differnew file mode 100644 index 000000000..f4fc94c41 --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreClose.class diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreShow.class b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreShow.class Binary files differnew file mode 100644 index 000000000..9d4186c72 --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/bin/org/eclipse/fx/ui/lifecycle/annotations/PreShow.class diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/.gitignore b/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/.gitignore new file mode 100644 index 000000000..95542a1dc --- /dev/null +++ b/bundles/runtime/org.eclipse.fx.ui.workbench.base/src/org/eclipse/fx/ui/workbench/base/.gitignore @@ -0,0 +1 @@ +/AbstractE4Application.java diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/.project b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/.project new file mode 100644 index 000000000..d015a072e --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.fx.ide.gradient.app.feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/build.properties b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/build.properties new file mode 100644 index 000000000..b045d3976 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/feature.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/feature.xml new file mode 100644 index 000000000..909bf372d --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/feature.xml @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.eclipse.fx.ide.gradient.app.feature" + label="e(fx)clipse Gradient editor Application Feature" + version="1.0.0.qualifier" + provider-name="${BundleProject_bundleVendor}"> + + <description url="http://www.efxclipse.org"> + TODO FILL WITH CONTENT + </description> + + <copyright url="http://www.efxclipse.org"> + TODO FILL WITH CONTENT + </copyright> + + <license url="http://www.efxclipse.org"> + TODO FILL WITH CONTENT + </license> + + <plugin + id="org.eclipse.fx.ide.gradient.app" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.fx.osgi" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.fx.javafx" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.fx.core.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.observable" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.property" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.app" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.common" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.launcher" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.registry" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.ds" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.event" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.util" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi.services" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.ibm.icu" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.jobs" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.preferences" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.contenttype" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.fx.ide.gradient.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.fx.ide.gradient.model" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.fx.ide.gradient.ui" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/pom.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/pom.xml new file mode 100644 index 000000000..1a45a138a --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.feature/pom.xml @@ -0,0 +1,16 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <name>e(fx)clipse Gradient editor - application feature</name> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.feature</artifactId> + <packaging>eclipse-feature</packaging> + + <parent> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.releng</artifactId> + <relativePath>../org.eclipse.fx.ide.gradient.app.releng/pom.xml</relativePath> + <version>1.0.0-SNAPSHOT</version> + </parent> + +</project>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/.project b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/.project new file mode 100644 index 000000000..b2d1843fc --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.fx.ide.gradient.app.product</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product new file mode 100644 index 000000000..3a703a591 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?pde version="3.5"?> + +<product name="e(fx)clipse Gradient editor" uid="org.eclipse.fx.ide.gradient.app.product" id="org.eclipse.fx.ide.gradient.app.product" application="org.eclipse.fx.ide.gradient.app.application" version="1.0.0" useFeatures="true" includeLaunchers="false"> + + <configIni use="default"> + </configIni> + <launcherArgs> + <programArgs>-nosplash</programArgs> + <vmArgs>-Dosgi.framework.extensions=org.eclipse.fx.osgi</vmArgs> + </launcherArgs> + + <windowImages/> + + <features> + <feature id="org.eclipse.fx.ide.gradient.app.feature" version="1.0.0.qualifier"/> + </features> + <configurations> + <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" /> + <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" /> + <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" /> + </configurations> +</product> + diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product.launch b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product.launch new file mode 100644 index 000000000..977a10274 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product.launch @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench"> +<setAttribute key="additional_plugins"/> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="true"/> +<booleanAttribute key="automaticAdd" value="false"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="false"/> +<booleanAttribute key="clearws" value="false"/> +<booleanAttribute key="clearwslog" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/org.eclipse.fx.ide.gradient.app.product.product"/> +<booleanAttribute key="default" value="false"/> +<stringAttribute key="featureDefaultLocation" value="workspace"/> +<stringAttribute key="featurePluginResolution" value="workspace"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../runtime-org.eclipse.fx.ide.gradient.app.product"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.pde.ui.launcher.PDESourceLookupDirector"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;archive detectRoot=&quot;true&quot; path=&quot;/opt/jdk1.8.0_05/javafx-src.zip&quot;/&gt;&#10;" typeId="org.eclipse.debug.core.containerType.externalArchive"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;default/&gt;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> +<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nl ${target.nl} -consoleLog -nosplash"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.framework.extensions=org.eclipse.fx.osgi"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.fx.ide.gradient.app.product"/> +<stringAttribute key="productFile" value="/org.eclipse.fx.ide.gradient.app.product/org.eclipse.fx.ide.gradient.app.product.product"/> +<setAttribute key="selected_features"> +<setEntry value="org.eclipse.fx.ide.gradient.app.feature:default"/> +</setAttribute> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useCustomFeatures" value="true"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="true"/> +<booleanAttribute key="useProduct" value="true"/> +<booleanAttribute key="usefeatures" value="false"/> +</launchConfiguration> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/pom.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/pom.xml new file mode 100644 index 000000000..67aac90de --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.product/pom.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <name>e(fx)clipse Gradient editor - application product</name> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.product</artifactId> + <packaging>eclipse-repository</packaging> + + <parent> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.releng</artifactId> + <relativePath>../org.eclipse.fx.ide.gradient.app.releng/pom.xml</relativePath> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-p2-director-plugin</artifactId> + <version>${tycho-version}</version> + <executions> + <execution> + <id>materialize-products</id> + <goals> + <goal>materialize-products</goal> + </goals> + </execution> + <execution> + <id>archive-products</id> + <goals> + <goal>archive-products</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/.project b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/.project new file mode 100644 index 000000000..ffb091966 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/.project @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.fx.ide.gradient.app.releng</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/build.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/build.xml new file mode 100644 index 000000000..799a3e685 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/build.xml @@ -0,0 +1,51 @@ +<project name="native-build" default="do-deploy" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> + <property name="eclipse-app-dir" value="../org.eclipse.fx.ide.gradient.app.product/target/products/org.eclipse.fx.ide.gradient.app.product/noenv/noenv/noenv" /> + + <target name="init-fx-tasks"> + <taskdef name="fxosgilauncher" classpath="org.eclipse.fx.ide.ant.jar" classname="org.eclipse.fx.ide.ant.FXOsgiLaunchTask" /> + <path id="fxant"> + <filelist> + <file name="${java.home}\..\lib\ant-javafx.jar"/> + <file name="${java.home}\lib\ant-jfxrt.jar"/> + </filelist> + </path> + <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" + uri="javafx:com.sun.javafx.tools.ant" + classpathref="fxant"/> + </target> + + <target name="do-deploy" depends="init-fx-tasks"> + <fileset id="equinox-launcher" dir="../org.eclipse.fx.ide.gradient.app.product/target/products/org.eclipse.fx.ide.gradient.app.product/noenv/noenv/noenv"> + <filename name="plugins/org.eclipse.equinox.launcher_*.jar"/> + </fileset> + <fxosgilauncher classpathref="fxant" equinoxlauncherjarref="equinox-launcher"/> + + <fx:resources id="appRes"> + <fx:fileset dir="." includes="fx-osgi-launch.jar"/> + <fx:fileset dir="${eclipse-app-dir}" includes="**/*"/> + </fx:resources> + + <fx:application id="fxApplication" + name="e(fx)clipse Gradient editor" + mainClass="org.eclipse.equinox.launcher.Main" + toolkit="swing" + + /> + + <fx:deploy + embedJNLP="false" + extension="false" + includeDT="false" + offlineAllowed="true" + outdir="${basedir}/deploy" + outfile="fix-ide" + nativeBundles="all" + updatemode="background" + > + + <fx:info title="e(fx)clipse Gradient editor" vendor=""/> + <fx:application refid="fxApplication"/> + <fx:resources refid="appRes"/> + </fx:deploy> + </target> +</project>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/org.eclipse.fx.ide.ant.jar b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/org.eclipse.fx.ide.ant.jar Binary files differnew file mode 100644 index 000000000..45ddf0390 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/org.eclipse.fx.ide.ant.jar diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/pom.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/pom.xml new file mode 100644 index 000000000..1d2cce2ab --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app.releng/pom.xml @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <name>e(fx)clipse Gradient editor - releng</name> + + <prerequisites> + <maven>3.0</maven> + </prerequisites> + + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.releng</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>pom</packaging> + <properties> + <tycho-version>0.18.0</tycho-version> + <junit-version>4.8.1</junit-version> + <mockito-version>1.8.4</mockito-version> + <platform-version>4.2</platform-version> + <efx-version>0.9.0</efx-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <modules> + <module>../org.eclipse.fx.ide.gradient.app</module> + <module>../org.eclipse.fx.ide.gradient.app.feature</module> + <module>../org.eclipse.fx.ide.gradient.app.product</module> + </modules> + + <repositories> + <repository> + <id>efxclipse-repo</id> + <layout>p2</layout> + <url>http://download.eclipse.org/efxclipse/runtime-nightly/site</url> + </repository> + <repository> + <id>efxclipse-addons</id> + <layout>p2</layout> + <url>http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/</url> + </repository> + + </repositories> + + <pluginRepositories> + <pluginRepository> + <id>tycho</id> + <url>http://repository.sonatype.org/content/groups/sonatype-public-grid</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <build> + + <!-- build plugins --> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-maven-plugin</artifactId> + <version>${tycho-version}</version> + <extensions>true</extensions> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>target-platform-configuration</artifactId> + <version>${tycho-version}</version> + <configuration> + <resolver>p2</resolver> + <pomDependencies>consider</pomDependencies> + <environments> + <environment> + <os>noenv</os> + <ws>noenv</ws> + <arch>noenv</arch> + </environment> + </environments> + </configuration> + </plugin> + </plugins> + + + <!-- defines the default settings for the used plugins --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-compiler-plugin</artifactId> + <version>${tycho-version}</version> + <configuration> + <encoding>UTF-8</encoding> + <source>1.7</source> + <target>1.7</target> + <extraClasspathElements> + <extraClasspathElement> + <groupId>javafx</groupId> + <artifactId>javafx.mvn</artifactId> + <version>2.2.0-SNAPSHOT</version> + </extraClasspathElement> + </extraClasspathElements> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + <version>${tycho-version}</version> + <executions> + <execution> + <id>plugin-source</id> + <goals> + <goal>plugin-source</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-packaging-plugin</artifactId> + <version>${tycho-version}</version> + <configuration> + <archiveSite>true</archiveSite> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>${mockito-version}</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + +</project>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.classpath b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.classpath new file mode 100644 index 000000000..22f30643c --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.project b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.project new file mode 100644 index 000000000..d8b9f0573 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.fx.ide.gradient.app</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ds.core.builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/META-INF/MANIFEST.MF b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/META-INF/MANIFEST.MF new file mode 100644 index 000000000..455c8b007 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/META-INF/MANIFEST.MF @@ -0,0 +1,48 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Gradient Editor +Bundle-SymbolicName: org.eclipse.fx.ide.gradient.app; singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.fx.javafx, + org.eclipse.fx.osgi.util, + org.eclipse.fx.core.databinding, + org.eclipse.fx.ui.databinding, + org.eclipse.equinox.app, + org.eclipse.fx.ide.gradient.model, + org.eclipse.fx.emf.databinding;bundle-version="1.0.0", + org.eclipse.emf.edit;bundle-version="2.10.0", + org.eclipse.emf.databinding, + org.eclipse.core.databinding.property;bundle-version="1.4.200", + org.eclipse.fx.ide.css.cssext, + org.eclipse.fx.ide.css;bundle-version="1.0.0", + org.eclipse.fx.ide.css.ui +Import-Package: javafx.animation;version="2.0.0", + javafx.application;version="2.0.0", + javafx.beans;version="2.0.0", + javafx.beans.binding;version="2.0.0", + javafx.beans.property;version="2.0.0", + javafx.beans.value;version="2.0.0", + javafx.collections;version="2.0.0", + javafx.concurrent;version="2.0.0", + javafx.event;version="2.0.0", + javafx.fxml;version="2.0.0", + javafx.geometry;version="2.0.0", + javafx.scene;version="2.0.0", + javafx.scene.chart;version="2.0.0", + javafx.scene.control;version="2.0.0", + javafx.scene.control.cell;version="2.0.0", + javafx.scene.effect;version="2.0.0", + javafx.scene.image;version="2.0.0", + javafx.scene.input;version="2.0.0", + javafx.scene.layout;version="2.0.0", + javafx.scene.media;version="2.0.0", + javafx.scene.paint;version="2.0.0", + javafx.scene.shape;version="2.0.0", + javafx.scene.text;version="2.0.0", + javafx.scene.transform;version="2.0.0", + javafx.scene.web;version="2.0.0", + javafx.stage;version="2.0.0", + javafx.util;version="2.0.0", + org.eclipse.fx.core +Service-Component: OSGI-INF/*.xml, diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/OSGI-INF/GradientProposalContributor.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/OSGI-INF/GradientProposalContributor.xml new file mode 100755 index 000000000..9e0075344 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/OSGI-INF/GradientProposalContributor.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.ide.gradient.app.GradientProposalContributer"> + <implementation class="org.eclipse.fx.ide.gradient.app.GradientProposalContributer"/> + <service> + <provide interface="org.eclipse.fx.ide.css.cssext.proposal.CssExtProposalContributor"/> + </service> +</scr:component> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/bin/.gitignore b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/bin/.gitignore new file mode 100644 index 000000000..cf1db2eed --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/bin/.gitignore @@ -0,0 +1 @@ +/org/ diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/build.properties b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/build.properties new file mode 100644 index 000000000..f71a1b5b4 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/build.properties @@ -0,0 +1,6 @@ +bin.includes = .,\ + META-INF/,\ + plugin.xml,\ +css/ + +source.. = src/ diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/css/default.css b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/css/default.css new file mode 100644 index 000000000..a38730ef4 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/css/default.css @@ -0,0 +1 @@ +/* Main CSS-File */
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/plugin.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/plugin.xml new file mode 100644 index 000000000..5d80540d4 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/plugin.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> +<plugin> +<extension id="application" point="org.eclipse.core.runtime.applications"> + <application thread="any" cardinality="*" visible="true" > + <run class="org.eclipse.fx.ide.gradient.app.MainApplication" /> + + </application> + +</extension> +<extension id="product" point="org.eclipse.core.runtime.products"> + <product application="org.eclipse.fx.ide.gradient.app.application" name="e(fx)clipse Gradient editor" > + <property name="appName" value="e(fx)clipse Gradient editor" /> + + </product> + +</extension> +</plugin> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/pom.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/pom.xml new file mode 100644 index 000000000..f28d4e798 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/pom.xml @@ -0,0 +1,33 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <name>e(fx)clipse Gradient editor - application bundle</name> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app</artifactId> + <packaging>eclipse-plugin</packaging> + + <parent> + <groupId>org.eclipse.fx.ide.gradient</groupId> + <artifactId>org.eclipse.fx.ide.gradient.app.releng</artifactId> + <relativePath>../org.eclipse.fx.ide.gradient.app.releng/pom.xml</relativePath> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>META-INF/</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposal.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposal.java new file mode 100755 index 000000000..86224c8d1 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposal.java @@ -0,0 +1,75 @@ +package org.eclipse.fx.ide.gradient.app; + +import org.eclipse.fx.ide.css.ui.extapi.UIProposal; + +public class GradientProposal implements UIProposal { + + private String proposal; + + + @Override + public Object getAdditionalInfo() { + return null; + } + + @Override + public String getProposal() { + return proposal; + } + + @Override + public String getImageUrl() { + return null; + } + + @Override + public String getLabel() { + return "Pick Color..."; + } + + @Override + public int getPriority() { + return 3; + } + + @Override + public boolean show() { + System.err.println("start mal den editor"); + MainApplication app = new MainApplication(); + + proposal = "blabla"; + return true; +// } +// else { +// return false; +// } + } + + @Override + public boolean hide() { + return false; + } + + @Override + public Type getType() { + return Type.Value; + } + +// ConfigurableCompletionProposal dialogProposal = (ConfigurableCompletionProposal) createCompletionProposal("Pick color ...",context); +// if( dialogProposal != null ) { +// dialogProposal.setTextApplier(new ReplacementTextApplier() { +// +// @Override +// public String getActualReplacementString( +// ConfigurableCompletionProposal proposal) { +// ColorDialog dialog = new ColorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); +// RGB rgb = dialog.open(); +// if( rgb != null ) { +// return "rgb("+rgb.red+","+rgb.green+","+rgb.blue+")"; +// } +// return null; +// } +// }); +// } +// acceptor.accept(dialogProposal); +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposalContributer.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposalContributer.java new file mode 100755 index 000000000..fe683f4fe --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientProposalContributer.java @@ -0,0 +1,19 @@ +package org.eclipse.fx.ide.gradient.app; + +import org.eclipse.fx.ide.css.cssext.proposal.CssExtProposalContributor; +import org.eclipse.fx.ide.css.extapi.Proposal; + + +public class GradientProposalContributer implements CssExtProposalContributor { + + @Override + public String getRule() { + return "javafx.paint"; + } + + @Override + public Proposal getProposal() { + return new GradientProposal(); + } + +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientViewer.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientViewer.java new file mode 100644 index 000000000..fa9e5d8d6 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/GradientViewer.java @@ -0,0 +1,14 @@ +package org.eclipse.fx.ide.gradient.app; + +import javafx.beans.value.ObservableValue; +import javafx.scene.layout.Pane; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.ide.gradient.model.gradient.FxGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; + +public interface GradientViewer { + Pane getControl(); + + void bind(EditingDomain editingDomain, ObservableValue<FxGradient> gradient); +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/MainApplication.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/MainApplication.java new file mode 100644 index 000000000..78fee1803 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/MainApplication.java @@ -0,0 +1,126 @@ +package org.eclipse.fx.ide.gradient.app; + +import javafx.application.Application; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.TabPane; +import javafx.scene.layout.GridPane; +import javafx.scene.paint.Color; +import javafx.stage.Stage; + +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.equinox.app.IApplicationContext; +import org.eclipse.fx.ide.gradient.app.impl.LinearGradientDetailTab; +import org.eclipse.fx.ide.gradient.app.impl.RadialGradientDetailTab; +import org.eclipse.fx.ide.gradient.app.util.GradientConverter; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientFactory; +import org.eclipse.fx.osgi.util.AbstractJFXApplication; + +public class MainApplication extends AbstractJFXApplication { + + protected void jfxStart(IApplicationContext applicationContext, + Application jfxApplication, Stage primaryStage) { + primaryStage.setTitle("Gradient Editor"); + + ComposedAdapterFactory f = new ComposedAdapterFactory( + ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + EditingDomain editingDomain = new AdapterFactoryEditingDomain(f, + new BasicCommandStack()); + + FxLinearGradient gLin = GradientFactory.eINSTANCE + .createFxLinearGradient(); + FxStop s1 = GradientFactory.eINSTANCE.createFxStop(); + s1.setOffset(0.22); + s1.setColor(GradientConverter.convertRgbColor(new Color(1.0, 0.0, 0.0, + 0.5))); + gLin.getStops().add(s1); + FxStop s2 = GradientFactory.eINSTANCE.createFxStop(); + s2.setOffset(0.33); + s2.setColor(GradientConverter.convertRgbColor(new Color(0.0, 1.0, 0.0, + 0.5))); + gLin.getStops().add(s2); + FxStop s3 = GradientFactory.eINSTANCE.createFxStop(); + s3.setOffset(0.44); + s3.setColor(GradientConverter.convertRgbColor(new Color(0.0, 0.0, 1.0, + 0.5))); + gLin.getStops().add(s3); + + gLin.setStartX(0.2); + gLin.setEndX(0.8); + gLin.setStartY(0.2); + gLin.setEndY(0.8); + gLin.setCycleMethod(FxCycleMethod.REFLECT); + gLin.setProportional(true); + + FxRadialGradient gRad = GradientFactory.eINSTANCE + .createFxRadialGradient(); + gRad.getStops().add(EcoreUtil.copy(s1)); + + // TODO OSGI + + GridPane root = new GridPane(); + + TabPane tabPane = new TabPane(); + root.add(tabPane, 0, 0); + LinearGradientDetailTab linearDetail = new LinearGradientDetailTab(); + linearDetail.initUI(); + tabPane.getTabs().add(linearDetail); + RadialGradientDetailTab radialDetail = new RadialGradientDetailTab(); + radialDetail.initUI(); + tabPane.getTabs().add(radialDetail); + + linearDetail.bind(editingDomain, gLin); + radialDetail.bind(editingDomain, gRad); + + GridPane buttons = new GridPane(); + Button bApply = new Button(); + bApply.setText("Apply"); + bApply.setMinWidth(0.3); + buttons.add(bApply, 1, 0); + + bApply.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + try { + primaryStage.close(); + jfxApplication.stop(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + Button bCancel = new Button(); + bCancel.setText("Cancel"); + bCancel.setMinWidth(0.3); + buttons.add(bCancel, 0, 0); + bCancel.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + try { + primaryStage.close(); + jfxApplication.stop(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + root.add(buttons, 0, 1, 2, 1); + + primaryStage.setScene(new Scene(root, 600, 350)); + primaryStage.show(); + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/StopEditor.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/StopEditor.java new file mode 100644 index 000000000..ace7ca003 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/StopEditor.java @@ -0,0 +1,13 @@ +package org.eclipse.fx.ide.gradient.app; + +import javafx.collections.ObservableList; +import javafx.scene.layout.Pane; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; + +public interface StopEditor { + Pane getControl(); + + void bind(EditingDomain editingDomain, ObservableList<FxStop> stops); +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultGradientPreview.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultGradientPreview.java new file mode 100644 index 000000000..10b31a227 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultGradientPreview.java @@ -0,0 +1,45 @@ +package org.eclipse.fx.ide.gradient.app.impl; + +import java.util.Arrays; + +import javafx.beans.property.Property; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.value.ObservableValue; +import javafx.geometry.Insets; +import javafx.scene.layout.GridPane; +import javafx.scene.paint.Paint; +import javafx.scene.shape.Rectangle; + +import org.eclipse.emf.ecore.change.util.ChangeRecorder; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.ide.gradient.app.util.GradientConverter; +import org.eclipse.fx.ide.gradient.model.gradient.FxGradient; + +public class DefaultGradientPreview extends GridPane { + private Rectangle rect; + + public DefaultGradientPreview() { + setHgap(10); + setVgap(10); + setPadding(new Insets(0, 10, 0, 10)); + initUI(); + } + + private void initUI() { + // TODO flex size + + rect = new Rectangle(200, 200); + add(rect, 0, 0); + } + + public void bind(EditingDomain editingDomain, FxGradient gradient) { + + Property<Paint> v = new SimpleObjectProperty<Paint>(); + Paint convertedGradient = GradientConverter.convertGradient(gradient); + v.setValue(convertedGradient); + rect.fillProperty().bindBidirectional(v); + + ChangeRecorder cr = new ChangeRecorder(); + cr.beginRecording(Arrays.asList(gradient)); + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultStopEditor.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultStopEditor.java new file mode 100644 index 000000000..59425b483 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/DefaultStopEditor.java @@ -0,0 +1,260 @@ +package org.eclipse.fx.ide.gradient.app.impl; + +import javafx.beans.property.Property; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.value.ChangeListener; +import javafx.beans.value.ObservableValue; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.geometry.Insets; +import javafx.scene.control.Button; +import javafx.scene.control.ColorPicker; +import javafx.scene.control.ListCell; +import javafx.scene.control.ListView; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; +import javafx.util.Callback; +import javafx.util.converter.DoubleStringConverter; + +import org.eclipse.core.databinding.UpdateValueStrategy; +import org.eclipse.core.databinding.conversion.Converter; +import org.eclipse.core.databinding.observable.value.IObservableValue; +import org.eclipse.core.databinding.observable.value.WritableValue; +import org.eclipse.emf.databinding.EMFDataBindingContext; +import org.eclipse.emf.databinding.EMFProperties; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.core.databinding.AdapterFactory; +import org.eclipse.fx.core.databinding.ObservableWritableValue; +import org.eclipse.fx.emf.databinding.edit.EMFEditFXProperties; +import org.eclipse.fx.ide.gradient.app.StopEditor; +import org.eclipse.fx.ide.gradient.app.util.GradientConverter; +import org.eclipse.fx.ide.gradient.model.gradient.FxColor; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientFactory; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; +import org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor; + +public class DefaultStopEditor extends GridPane implements StopEditor { + private final IObservableValue selectedStop = new WritableValue(); + + private ListView<FxStop> stops; + private Button bAdd; + private Button bUp; + private Button bDown; + private Button bRemove; + private ColorPicker colorPicker; + private TextField offset; + + public DefaultStopEditor() { + setHgap(10); + setVgap(10); + setPadding(new Insets(0, 10, 0, 10)); + initUI(); + } + + private void initUI() { + stops = new ListView<>(); + add(stops, 0, 0, 1, 5); + stops.setCellFactory(new Callback<ListView<FxStop>, ListCell<FxStop>>() { + @Override + public ListCell<FxStop> call(ListView<FxStop> list) { + return new ColorRectCell(); + } + }); + + bAdd = new Button(); + bAdd.setText("Add"); + bAdd.setMinWidth(0.3); + add(bAdd, 1, 0); + bUp = new Button(); + bUp.setText("Up"); + add(bUp, 1, 1); + bDown = new Button(); + bDown.setText("Down"); + add(bDown, 1, 2); + bRemove = new Button(); + bRemove.setText("Remove"); + add(bRemove, 1, 3); + + colorPicker = new ColorPicker(); + add(colorPicker, 2, 0); + + offset = new TextField(); + add(offset, 2, 1); + } + + @Override + public Pane getControl() { + return this; + } + + @Override + public void bind(EditingDomain editingDomain, ObservableList<FxStop> data) { + stops.setItems(data); + if (!data.isEmpty()) { + selectedStop.setValue(data.get(0)); + // colorVal.setValue(GradientConverter.convertColor(data.get(0).getColor())); + } + stops.getSelectionModel().selectedItemProperty() + .addListener(new ChangeListener<FxStop>() { + @Override + public void changed( + ObservableValue<? extends FxStop> observable, + FxStop oldValue, FxStop newValue) { + if (oldValue!= null) + System.err.println("old " + oldValue.getOffset()); + if (newValue!= null) + System.err.println("new " + newValue.getOffset()); + + selectedStop.setValue(newValue); + } + }); + + bAdd.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + FxStop newStop = GradientFactory.eINSTANCE.createFxStop(); + newStop.setOffset(1.33); + RgbFxColor c = GradientFactory.eINSTANCE.createRgbFxColor(); + c.setBlue(1); + c.setGreen(0); + c.setOpacity(1); + c.setRed(0); + newStop.setColor(c); + data.add(newStop); + stops.getSelectionModel().select(newStop); + } + }); + + bRemove.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + FxStop toDel = stops.getSelectionModel().getSelectedItem(); + if (toDel != null) { + if (toDel == data.get(0)) { + stops.getSelectionModel().selectNext(); + } else { + stops.getSelectionModel().selectPrevious(); + } + data.remove(toDel); + } + } + }); + + bUp.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + FxStop sel = stops.getSelectionModel().getSelectedItem(); + data.toString(); + } + }); + bDown.setOnAction(new EventHandler<ActionEvent>() { + @Override + public void handle(ActionEvent t) { + FxStop sel = stops.getSelectionModel().getSelectedItem(); + data.toString(); + } + }); + bindOffset(editingDomain); + bindColorPicker(); + } + + private void bindColorPicker() { + IObservableValue colorVal = new WritableValue(); + IObservableValue fxcolorVal = EMFProperties.value( + GradientPackage.Literals.FX_STOP__COLOR).observeDetail( + selectedStop); + + UpdateValueStrategy t2m = new UpdateValueStrategy(); + t2m.setConverter(new Converter(Color.class, FxColor.class) { + @Override + public Object convert(Object fromObject) { + System.err.println("convert t 2 m " + + GradientConverter.convertRgbColor((Color) fromObject)); + return GradientConverter.convertRgbColor((Color) fromObject); + } + }); + UpdateValueStrategy m2t = new UpdateValueStrategy(); + m2t.setConverter(new Converter(FxColor.class, Color.class) { + @Override + public Object convert(Object fromObject) { + System.err.println("convert m 2 t " + + GradientConverter.convertColor((FxColor) fromObject)); + return GradientConverter.convertColor((FxColor) fromObject); + } + }); + new EMFDataBindingContext().bindValue(colorVal, fxcolorVal, t2m, m2t); + + Property<Color> colorProperty = new SimpleObjectProperty<Color>(); + ObservableWritableValue<Color> adapted = AdapterFactory.<Color> adapt(colorVal); + colorProperty.bind(adapted); + + adapted.addListener(new ChangeListener<Color>() { + @Override + public void changed(ObservableValue<? extends Color> observable, + Color oldValue, Color newValue) { + System.err.println("old color: " + oldValue); + System.err.println("new color: " + newValue); + + } + }); + + colorProperty.addListener(new ChangeListener<Color>() { + @Override + public void changed(ObservableValue<? extends Color> observable, + Color oldValue, Color newValue) { + System.err.println("colorProperty old color: " + oldValue); + System.err.println("colorProperty new color: " + newValue); + } + }); + + colorPicker.valueProperty().bindBidirectional(colorProperty); + + colorPicker.valueProperty().addListener(new ChangeListener<Color>() { + @Override + public void changed(ObservableValue<? extends Color> observable, + Color oldValue, Color newValue) { + System.err.println("colorPicker old color: " + oldValue); + System.err.println("colorPicker new color: " + newValue); + // FIXME binding does not work here + colorProperty.setValue(newValue); + } + }); + +// colorPicker.setOnAction(new EventHandler<ActionEvent>() { +// @Override +// public void handle(ActionEvent t) { +// stops.getCellFactory().call(stops).updateListView(stops); +// } +// }); + } + + private void bindOffset(EditingDomain editingDomain) { + Property<Double> offsetProperty = EMFEditFXProperties.value( + editingDomain, (EObject) selectedStop.getValue(), + GradientPackage.Literals.FX_STOP__OFFSET); + offset.textProperty().bindBidirectional(offsetProperty, + new DoubleStringConverter()); + } + + static class ColorRectCell extends ListCell<FxStop> { + @Override + public void updateItem(FxStop item, boolean empty) { + super.updateItem(item, empty); + Rectangle rect = new Rectangle(20, 20); + if (item != null) { + rect.setFill(GradientConverter.convertColor(item.getColor())); + setGraphic(rect); + setText(item.getOffset() + ""); //$NON-NLS-1$ + } else { + setGraphic(null); + setText(null); //$NON-NLS-1$ + } + } + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/LinearGradientDetailTab.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/LinearGradientDetailTab.java new file mode 100644 index 000000000..8e4e52704 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/LinearGradientDetailTab.java @@ -0,0 +1,159 @@ +package org.eclipse.fx.ide.gradient.app.impl; + +import javafx.beans.property.Property; +import javafx.beans.value.ObservableValue; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.Slider; +import javafx.scene.control.Tab; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.util.converter.NumberStringConverter; + +import org.eclipse.core.databinding.observable.list.IObservableList; +import org.eclipse.core.databinding.observable.value.IObservableValue; +import org.eclipse.core.databinding.observable.value.WritableValue; +import org.eclipse.emf.databinding.EMFProperties; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.core.databinding.AdapterFactory; +import org.eclipse.fx.emf.databinding.edit.EMFEditFXProperties; +import org.eclipse.fx.ide.gradient.app.StopEditor; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +import com.sun.javafx.collections.ImmutableObservableList; + +public class LinearGradientDetailTab extends Tab { + private StopEditor stopEditor = null; + private DefaultGradientPreview preview = null; + + private TextField startX; + private TextField endX; + private TextField startY; + private TextField endY; + private ComboBox<FxCycleMethod> cycleMethod; + + private Slider sStartX; + private Slider sEndX; + private Slider sStartY; + private Slider sEndY; + + public void initUI() { + setClosable(false); + setText("Linear"); + + GridPane contentPane = new GridPane(); + setContent(contentPane); + + preview = new DefaultGradientPreview(); + contentPane.add(preview, 0, 0); + GridPane detailPane = new GridPane(); + contentPane.add(detailPane, 0, 1); + stopEditor = new DefaultStopEditor(); + contentPane.add(stopEditor.getControl(), 1, 0, 1, 2); + + Label lStartX = new Label(); + lStartX.setText("Start X"); + detailPane.add(lStartX, 0, 1); + + startX = new TextField(); + detailPane.add(startX, 1, 1); + + sStartX = new Slider(); + sStartX.setMin(0); + sStartX.setMax(1); + detailPane.add(sStartX, 2, 1); + + Label lEndX = new Label(); + lEndX.setText("End X"); + detailPane.add(lEndX, 0, 2); + + endX = new TextField(); + detailPane.add(endX, 1, 2); + + sEndX = new Slider(); + sEndX.setMin(0); + sEndX.setMax(1); + detailPane.add(sEndX, 2, 2); + + Label lStartY = new Label(); + lStartY.setText("Start Y"); + detailPane.add(lStartY, 0, 3); + + startY = new TextField(); + detailPane.add(startY, 1, 3); + + sStartY = new Slider(); + sStartY.setMin(0); + sStartY.setMax(1); + detailPane.add(sStartY, 2, 3); + + Label lEndY = new Label(); + lEndY.setText("End Y"); + detailPane.add(lEndY, 0, 4); + + endY = new TextField(); + detailPane.add(endY, 1, 4); + + sEndY = new Slider(); + sEndY.setMin(0); + sEndY.setMax(1); + detailPane.add(sEndY, 2, 4); + + Label lCycleMethod = new Label(); + lCycleMethod.setText("Cycle Method"); + detailPane.add(lCycleMethod, 0, 5); + + cycleMethod = new ComboBox<>(); + detailPane.add(cycleMethod, 1, 5); + cycleMethod.setItems(new ImmutableObservableList<FxCycleMethod>( + FxCycleMethod.values())); + + } + + public void bind(EditingDomain editingDomain, FxLinearGradient gradient) { + Property<Number> propertyStartX = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_LINEAR_GRADIENT__START_X); + startX.textProperty().bindBidirectional(propertyStartX, + new NumberStringConverter()); + Property<Number> propertyStartY = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_LINEAR_GRADIENT__START_Y); + startY.textProperty().bindBidirectional(propertyStartY, + new NumberStringConverter()); + Property<Number> propertyEndX = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_LINEAR_GRADIENT__END_X); + endX.textProperty().bindBidirectional(propertyEndX, + new NumberStringConverter()); + Property<Number> propertyEndY = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_LINEAR_GRADIENT__END_Y); + endY.textProperty().bindBidirectional(propertyEndY, + new NumberStringConverter()); + + IObservableValue v = new WritableValue(); + v.setValue(gradient); + IObservableList stopList = EMFProperties.list( + GradientPackage.Literals.FX_GRADIENT__STOPS).observeDetail(v); + stopEditor.bind(editingDomain, AdapterFactory.adapt(stopList)); + preview.bind(editingDomain, gradient); + + // TODO bind cyclemethod, proportional + + // IObservableValue mProp = EMFProperties.value( + // GradientPackage.Literals.FX_GRADIENT__CYCLE_METHOD).observe( + // gradient); + // IObservableValue vProp = + // JFXUIProperties.singleViewSelection().observe( + // cycleMethod); + // new EMFDataBindingContext().bindValue(vProp, mProp); + + sStartX.valueProperty().bindBidirectional(propertyStartX); + sEndX.valueProperty().bindBidirectional(propertyEndX); + sStartY.valueProperty().bindBidirectional(propertyStartY); + sEndY.valueProperty().bindBidirectional(propertyEndY); + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/RadialGradientDetailTab.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/RadialGradientDetailTab.java new file mode 100644 index 000000000..a4176c235 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/impl/RadialGradientDetailTab.java @@ -0,0 +1,168 @@ +package org.eclipse.fx.ide.gradient.app.impl; + +import javafx.beans.property.Property; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.Slider; +import javafx.scene.control.Tab; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.util.converter.NumberStringConverter; + +import org.eclipse.core.databinding.observable.list.IObservableList; +import org.eclipse.core.databinding.observable.value.IObservableValue; +import org.eclipse.core.databinding.observable.value.WritableValue; +import org.eclipse.emf.databinding.EMFProperties; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.fx.core.databinding.AdapterFactory; +import org.eclipse.fx.emf.databinding.edit.EMFEditFXProperties; +import org.eclipse.fx.ide.gradient.app.StopEditor; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +import com.sun.javafx.collections.ImmutableObservableList; + +public class RadialGradientDetailTab extends Tab { + private StopEditor stopEditor = null; + private DefaultGradientPreview preview = null; + private TextField centerX; + private TextField centerY; + private TextField focusAngle; + private TextField focusDistance; + private TextField radius; + private CheckBox proportional; + private ComboBox<FxCycleMethod> cycleMethod; + + private Slider sCenterX; + private Slider sCenterY; + private Slider sFocusAngle; + private Slider sFocusDistance; + + public void initUI() { + setClosable(false); + setText("Radial"); + + + + GridPane contentPane = new GridPane(); + setContent(contentPane); + + preview = new DefaultGradientPreview(); + contentPane.add(preview, 0, 0); + GridPane detailPane = new GridPane(); + contentPane.add(detailPane, 0, 1); + stopEditor = new DefaultStopEditor(); + contentPane.add(stopEditor.getControl(), 1,0, 1, 2); + + Label lCenterX = new Label(); + lCenterX.setText("Center X"); + detailPane.add(lCenterX, 0, 1); + + centerX = new TextField(); + detailPane.add(centerX, 1, 1); + + sCenterX = new Slider(); + sCenterX.setMin(0); + sCenterX.setMax(1); + detailPane.add(sCenterX, 2, 1); + + Label lCenterY = new Label(); + lCenterY.setText("Center Y"); + detailPane.add(lCenterY, 0, 2); + + centerY = new TextField(); + detailPane.add(centerY, 1, 2); + + sCenterY = new Slider(); + sCenterY.setMin(0); + sCenterY.setMax(1); + detailPane.add(sCenterY, 2, 2); + + Label lFocusAngle = new Label(); + lFocusAngle.setText("Focus Angle"); + detailPane.add(lFocusAngle, 0, 3); + + focusAngle = new TextField(); + detailPane.add(focusAngle, 1, 3); + + sFocusAngle = new Slider(); + sFocusAngle.setMin(0); + sFocusAngle.setMax(360); // in degrees + detailPane.add(sFocusAngle, 2, 3); + + Label lFocusDistance = new Label(); + lFocusDistance.setText("Focus Distance"); + detailPane.add(lFocusDistance, 0, 4); + + focusDistance = new TextField(); + detailPane.add(focusDistance, 1, 4); + + sFocusDistance = new Slider(); + sFocusDistance.setMin(-1); + sFocusDistance.setMax(1); + detailPane.add(sFocusDistance, 2, 4); + + Label lRadius = new Label(); + lRadius.setText("Radius"); + detailPane.add(lRadius, 0, 5); + + radius = new TextField(); + detailPane.add(radius, 1, 5); + + proportional = new CheckBox(); + proportional.setText("Proportional"); + detailPane.add(proportional, 1, 6); + + Label lCycleMethod = new Label(); + lCycleMethod.setText("Cycle Method"); + detailPane.add(lCycleMethod, 0, 7); + + cycleMethod = new ComboBox<>(); + detailPane.add(cycleMethod, 1, 7); + cycleMethod.setItems(new ImmutableObservableList<FxCycleMethod>( + FxCycleMethod.values())); + } + + public void bind(EditingDomain editingDomain, FxRadialGradient gradient) { + Property<Number> propertyCenterX = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_RADIAL_GRADIENT__CENTER_X); + centerX.textProperty().bindBidirectional(propertyCenterX, + new NumberStringConverter()); + Property<Number> propertyCenterY = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_RADIAL_GRADIENT__CENTER_Y); + centerY.textProperty().bindBidirectional(propertyCenterY, + new NumberStringConverter()); + Property<Number> propertyFocusAngle = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_RADIAL_GRADIENT__FOCUS_ANGLE); + focusAngle.textProperty().bindBidirectional(propertyFocusAngle, + new NumberStringConverter()); + Property<Number> propertyFocusDistance = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_RADIAL_GRADIENT__FOCUS_DISTANCE); + focusDistance.textProperty().bindBidirectional(propertyFocusDistance, + new NumberStringConverter()); + Property<Number> propertyRadius = EMFEditFXProperties.value( + editingDomain, gradient, + GradientPackage.Literals.FX_RADIAL_GRADIENT__RADIUS); + radius.textProperty().bindBidirectional(propertyRadius, + new NumberStringConverter()); + + IObservableValue v = new WritableValue(); + v.setValue(gradient); + IObservableList stopList = EMFProperties.list( + GradientPackage.Literals.FX_GRADIENT__STOPS).observeDetail(v); + stopEditor.bind(editingDomain, AdapterFactory.adapt(stopList)); + preview.bind(editingDomain, gradient); + // TODO bind cyclemethod, proportional + + sCenterX.valueProperty().bindBidirectional(propertyCenterX); + sCenterY.valueProperty().bindBidirectional(propertyCenterY); + sFocusAngle.valueProperty().bindBidirectional(propertyFocusAngle); + sFocusDistance.valueProperty().bindBidirectional(propertyFocusDistance); + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/util/GradientConverter.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/util/GradientConverter.java new file mode 100644 index 000000000..0b6eb9307 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.app/src/org/eclipse/fx/ide/gradient/app/util/GradientConverter.java @@ -0,0 +1,147 @@ +package org.eclipse.fx.ide.gradient.app.util; + +import java.util.ArrayList; +import java.util.List; + +import javafx.scene.paint.Color; +import javafx.scene.paint.CycleMethod; +import javafx.scene.paint.LinearGradient; +import javafx.scene.paint.Paint; +import javafx.scene.paint.RadialGradient; +import javafx.scene.paint.Stop; + +import org.eclipse.fx.ide.gradient.model.gradient.FxColor; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientFactory; +import org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor; + +public class GradientConverter { + public static Paint convertGradient(FxGradient g) { + if (g == null) { + return null; + } + if (g instanceof FxLinearGradient) { + return convertLinearGradient((FxLinearGradient) g); + } else if (g instanceof FxRadialGradient) { + return convertRadialGradient((FxRadialGradient) g); + } else { + throw new UnsupportedOperationException( + "Gradient conversion not implemented for type " + g.getClass()); //$NON-NLS-1$ + } + } + + public static LinearGradient convertLinearGradient(FxLinearGradient g) { + if (g == null) { + return null; + } + return new LinearGradient(g.getStartX(), g.getStartY(), g.getEndX(), + g.getEndY(), g.isProportional(), + convertCycleMethod(g.getCycleMethod()), + convertFxStops(g.getStops())); + } + + public static RadialGradient convertRadialGradient(FxRadialGradient g) { + if (g == null) { + return null; + } + return new RadialGradient(g.getFocusAngle(), g.getFocusDistance(), + g.getCenterX(), g.getCenterY(), g.getRadius(), + g.isProportional(), convertCycleMethod(g.getCycleMethod()), + convertFxStops(g.getStops())); + } + + public static List<Stop> convertFxStops(List<FxStop> stops) { + List<Stop> fxStops = new ArrayList<Stop>(); + if (stops != null) { + for (FxStop s : stops) { + fxStops.add(convertStop(s)); + } + } + return fxStops; + } + + public static List<FxStop> convertStops(List<Stop> stops) { + List<FxStop> fxStops = new ArrayList<FxStop>(); + if (stops != null) { + for (Stop s : stops) { + fxStops.add(convertStop(s)); + } + } + return fxStops; + } + + public static Stop convertStop(FxStop s) { + if (s == null) { + return null; + } + return new Stop(s.getOffset(), convertColor(s.getColor())); + } + + public static FxStop convertStop(Stop s) { + if (s == null) { + return null; + } + FxStop stop = GradientFactory.eINSTANCE.createFxStop(); + stop.setOffset(s.getOffset()); + stop.setColor(convertRgbColor(s.getColor())); + return stop; + } + + public static Color convertColor(FxColor color) { + if (color == null) { + return null; + } + if (color instanceof RgbFxColor) { + RgbFxColor rgb = (RgbFxColor) color; + return new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue(), + rgb.getOpacity()); + } else { + throw new UnsupportedOperationException( + "Color conversion not implemented for type " + color.getClass()); //$NON-NLS-1$ + } + } + + public static RgbFxColor convertRgbColor(Color color) { + if (color == null) { + return null; + } + RgbFxColor rgb = GradientFactory.eINSTANCE.createRgbFxColor(); + rgb.setRed(color.getRed()); + rgb.setGreen(color.getGreen()); + rgb.setBlue(color.getBlue()); + rgb.setOpacity(color.getOpacity()); + return rgb; + } + + public static CycleMethod convertCycleMethod(FxCycleMethod cycleMethod) { + switch (cycleMethod) { + case NO_CYCLE: + return CycleMethod.NO_CYCLE; + case REFLECT: + return CycleMethod.REFLECT; + case REPEAT: + return CycleMethod.REPEAT; + default: + throw new UnsupportedOperationException( + "unknown cycle method: " + cycleMethod); //$NON-NLS-1$ + } + } + + public static FxCycleMethod convertCycleMethod(CycleMethod cycleMethod) { + switch (cycleMethod) { + case NO_CYCLE: + return FxCycleMethod.NO_CYCLE; + case REFLECT: + return FxCycleMethod.REFLECT; + case REPEAT: + return FxCycleMethod.REPEAT; + default: + throw new UnsupportedOperationException( + "unknown cycle method: " + cycleMethod); //$NON-NLS-1$ + } + } +} diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.classpath b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.classpath new file mode 100644 index 000000000..eca7bdba8 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.gitignore b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.gitignore new file mode 100644 index 000000000..ae3c17260 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.project b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.project new file mode 100644 index 000000000..0b7ffcbfe --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.fx.ide.gradient.model</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.settings/org.eclipse.jdt.core.prefs b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0c68a61dc --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/META-INF/MANIFEST.MF b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/META-INF/MANIFEST.MF new file mode 100644 index 000000000..b0aecfdf0 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-SymbolicName: org.eclipse.fx.ide.gradient.model;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.fx.ide.gradient.model.gradient, + org.eclipse.fx.ide.gradient.model.gradient.impl, + org.eclipse.fx.ide.gradient.model.gradient.util diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/OSGI-INF/l10n/bundle.properties b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/OSGI-INF/l10n/bundle.properties new file mode 100755 index 000000000..56a22cc62 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.fx.ide.gradient.model
+Bundle-Vendor = BestSolution.at
+Bundle-Name = JavaFX Eclipse Databinding
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/about.html b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/about.html new file mode 100644 index 000000000..c258ef55d --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2006</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/build.properties b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/build.properties new file mode 100644 index 000000000..9af4c1f8d --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + OSGI-INF/ +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.ecore b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.ecore new file mode 100644 index 000000000..4eb4758b0 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.ecore @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="gradient" nsURI="http://www.eclipse.org/efxclipse/tooling/fxgraph/Gradient" + nsPrefix="gradient"> + <eClassifiers xsi:type="ecore:EClass" name="FxGradient" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="proportional" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="cycleMethod" eType="#//FxCycleMethod"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="stops" upperBound="-1" + eType="#//FxStop" containment="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FxLinearGradient" eSuperTypes="#//FxGradient"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="startX" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="startY" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="endX" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="endY" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FxRadialGradient" eSuperTypes="#//FxGradient"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="focusAngle" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="focusDistance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="centerX" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="centerY" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="radius" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FxStop"> + <eStructuralFeatures xsi:type="ecore:EReference" name="color" eType="#//FxColor" + containment="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="offset" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FxColor" abstract="true"/> + <eClassifiers xsi:type="ecore:EClass" name="RgbFxColor" eSuperTypes="#//FxColor"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="red" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="green" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="blue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="opacity" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FxCycleMethod"> + <eLiterals name="noCycle" literal="noCycle"/> + <eLiterals name="reflect" value="1" literal="reflect"/> + <eLiterals name="repeat" value="2" literal="repeat"/> + </eClassifiers> +</ecore:EPackage> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.genmodel b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.genmodel new file mode 100644 index 000000000..bfb1b2433 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/model/Gradient.genmodel @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="" modelDirectory="/org.eclipse.fx.ide.gradient.model/src" + modelPluginID="org.eclipse.fx.ide.gradient.model" modelName="Gradient" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="7.0" copyrightFields="false" + operationReflection="true" importOrganizing="true"> + <foreignModel>Gradient.ecore</foreignModel> + <genPackages prefix="Gradient" basePackage="org.eclipse.fx.ide.gradient.model" disposableProviderFactory="true" + ecorePackage="Gradient.ecore#/"> + <genEnums typeSafeEnumCompatible="false" ecoreEnum="Gradient.ecore#//CycleMethod"> + <genEnumLiterals ecoreEnumLiteral="Gradient.ecore#//CycleMethod/noCycle"/> + <genEnumLiterals ecoreEnumLiteral="Gradient.ecore#//CycleMethod/reflect"/> + <genEnumLiterals ecoreEnumLiteral="Gradient.ecore#//CycleMethod/repeat"/> + </genEnums> + <genClasses image="false" ecoreClass="Gradient.ecore#//Gradient"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//Gradient/proportional"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//Gradient/cycleMethod"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Gradient.ecore#//Gradient/stops"/> + </genClasses> + <genClasses ecoreClass="Gradient.ecore#//LinearGradient"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//LinearGradient/startX"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//LinearGradient/startY"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//LinearGradient/endX"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//LinearGradient/endY"/> + </genClasses> + <genClasses ecoreClass="Gradient.ecore#//RadialGradient"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RadialGradient/focusAngle"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RadialGradient/focusDistance"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RadialGradient/centerX"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RadialGradient/centerY"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RadialGradient/radius"/> + </genClasses> + <genClasses ecoreClass="Gradient.ecore#//Stop"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Gradient.ecore#//Stop/color"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//Stop/offset"/> + </genClasses> + <genClasses image="false" ecoreClass="Gradient.ecore#//Color"/> + <genClasses ecoreClass="Gradient.ecore#//RGBColor"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RGBColor/red"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RGBColor/green"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RGBColor/blue"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Gradient.ecore#//RGBColor/opacity"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.properties b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.properties new file mode 100644 index 000000000..07a9e7682 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Gradient Model +providerName = www.example.org diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.xml new file mode 100644 index 000000000..749c5ed41 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/plugin.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- +--> + +<plugin> + + <extension point="org.eclipse.emf.ecore.generated_package"> + <!-- @generated Gradient --> + <package + uri="http://www.eclipse.org/efxclipse/tooling/fxgraph/Gradient" + class="org.eclipse.fx.ide.gradient.model.gradient.GradientPackage" + genModel="model/Gradient.genmodel"/> + </extension> + +</plugin> diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/pom.xml b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/pom.xml new file mode 100755 index 000000000..d1690cb0b --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/pom.xml @@ -0,0 +1,34 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <name>e(fx)clipse - IDE - Gradient model</name> + <groupId>org.eclipse.fx.ide</groupId> + <artifactId>org.eclipse.fx.ide.gradient.model</artifactId> + <packaging>eclipse-plugin</packaging> + + <parent> + <groupId>org.eclipse.fx.ide</groupId> + <artifactId>releng</artifactId> + <relativePath>../../../releng/org.eclipse.fx.ide.releng/pom.xml</relativePath> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <build> + <resources> + <!-- to ensure that the feature lookup of the ui test works --> + <resource> + <directory>.</directory> + <includes> + <include>META-INF/</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxColor.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxColor.java new file mode 100644 index 000000000..bca402848 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxColor.java @@ -0,0 +1,18 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Fx Color</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxColor() + * @model abstract="true" + * @generated + */ +public interface FxColor extends EObject { +} // FxColor diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxCycleMethod.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxCycleMethod.java new file mode 100644 index 000000000..4e2e46efb --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxCycleMethod.java @@ -0,0 +1,235 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * <!-- begin-user-doc --> + * A representation of the literals of the enumeration '<em><b>Fx Cycle Method</b></em>', + * and utility methods for working with them. + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxCycleMethod() + * @model + * @generated + */ +public enum FxCycleMethod implements Enumerator { + /** + * The '<em><b>No Cycle</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #NO_CYCLE_VALUE + * @generated + * @ordered + */ + NO_CYCLE(0, "noCycle", "noCycle"), + + /** + * The '<em><b>Reflect</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #REFLECT_VALUE + * @generated + * @ordered + */ + REFLECT(1, "reflect", "reflect"), + + /** + * The '<em><b>Repeat</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #REPEAT_VALUE + * @generated + * @ordered + */ + REPEAT(2, "repeat", "repeat"); + + /** + * The '<em><b>No Cycle</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>No Cycle</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #NO_CYCLE + * @model name="noCycle" + * @generated + * @ordered + */ + public static final int NO_CYCLE_VALUE = 0; + + /** + * The '<em><b>Reflect</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>Reflect</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #REFLECT + * @model name="reflect" + * @generated + * @ordered + */ + public static final int REFLECT_VALUE = 1; + + /** + * The '<em><b>Repeat</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>Repeat</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #REPEAT + * @model name="repeat" + * @generated + * @ordered + */ + public static final int REPEAT_VALUE = 2; + + /** + * An array of all the '<em><b>Fx Cycle Method</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static final FxCycleMethod[] VALUES_ARRAY = + new FxCycleMethod[] { + NO_CYCLE, + REFLECT, + REPEAT, + }; + + /** + * A public read-only list of all the '<em><b>Fx Cycle Method</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final List<FxCycleMethod> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the '<em><b>Fx Cycle Method</b></em>' literal with the specified literal value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static FxCycleMethod get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + FxCycleMethod result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Fx Cycle Method</b></em>' literal with the specified name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static FxCycleMethod getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + FxCycleMethod result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Fx Cycle Method</b></em>' literal with the specified integer value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static FxCycleMethod get(int value) { + switch (value) { + case NO_CYCLE_VALUE: return NO_CYCLE; + case REFLECT_VALUE: return REFLECT; + case REPEAT_VALUE: return REPEAT; + } + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final int value; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String name; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private FxCycleMethod(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getValue() { + return value; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //FxCycleMethod diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxGradient.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxGradient.java new file mode 100644 index 000000000..6d0e22ed8 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxGradient.java @@ -0,0 +1,99 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Fx Gradient</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#isProportional <em>Proportional</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getCycleMethod <em>Cycle Method</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getStops <em>Stops</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxGradient() + * @model abstract="true" + * @generated + */ +public interface FxGradient extends EObject { + /** + * Returns the value of the '<em><b>Proportional</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Proportional</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Proportional</em>' attribute. + * @see #setProportional(boolean) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxGradient_Proportional() + * @model + * @generated + */ + boolean isProportional(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#isProportional <em>Proportional</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Proportional</em>' attribute. + * @see #isProportional() + * @generated + */ + void setProportional(boolean value); + + /** + * Returns the value of the '<em><b>Cycle Method</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Cycle Method</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Cycle Method</em>' attribute. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod + * @see #setCycleMethod(FxCycleMethod) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxGradient_CycleMethod() + * @model + * @generated + */ + FxCycleMethod getCycleMethod(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getCycleMethod <em>Cycle Method</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Cycle Method</em>' attribute. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod + * @see #getCycleMethod() + * @generated + */ + void setCycleMethod(FxCycleMethod value); + + /** + * Returns the value of the '<em><b>Stops</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.fx.ide.gradient.model.gradient.FxStop}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Stops</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Stops</em>' containment reference list. + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxGradient_Stops() + * @model containment="true" + * @generated + */ + EList<FxStop> getStops(); + +} // FxGradient diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxLinearGradient.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxLinearGradient.java new file mode 100644 index 000000000..afb0528b9 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxLinearGradient.java @@ -0,0 +1,131 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Fx Linear Gradient</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartX <em>Start X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartY <em>Start Y</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndX <em>End X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndY <em>End Y</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxLinearGradient() + * @model + * @generated + */ +public interface FxLinearGradient extends FxGradient { + + /** + * Returns the value of the '<em><b>Start X</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Start X</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Start X</em>' attribute. + * @see #setStartX(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxLinearGradient_StartX() + * @model + * @generated + */ + double getStartX(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartX <em>Start X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Start X</em>' attribute. + * @see #getStartX() + * @generated + */ + void setStartX(double value); + + /** + * Returns the value of the '<em><b>Start Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Start Y</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Start Y</em>' attribute. + * @see #setStartY(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxLinearGradient_StartY() + * @model + * @generated + */ + double getStartY(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartY <em>Start Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Start Y</em>' attribute. + * @see #getStartY() + * @generated + */ + void setStartY(double value); + + /** + * Returns the value of the '<em><b>End X</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>End X</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>End X</em>' attribute. + * @see #setEndX(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxLinearGradient_EndX() + * @model + * @generated + */ + double getEndX(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndX <em>End X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>End X</em>' attribute. + * @see #getEndX() + * @generated + */ + void setEndX(double value); + + /** + * Returns the value of the '<em><b>End Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>End Y</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>End Y</em>' attribute. + * @see #setEndY(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxLinearGradient_EndY() + * @model + * @generated + */ + double getEndY(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndY <em>End Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>End Y</em>' attribute. + * @see #getEndY() + * @generated + */ + void setEndY(double value); + +} // FxLinearGradient diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxRadialGradient.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxRadialGradient.java new file mode 100644 index 000000000..d4c8c11ce --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxRadialGradient.java @@ -0,0 +1,158 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Fx Radial Gradient</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusAngle <em>Focus Angle</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusDistance <em>Focus Distance</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterX <em>Center X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterY <em>Center Y</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getRadius <em>Radius</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient() + * @model + * @generated + */ +public interface FxRadialGradient extends FxGradient { + + /** + * Returns the value of the '<em><b>Focus Angle</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Focus Angle</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Focus Angle</em>' attribute. + * @see #setFocusAngle(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient_FocusAngle() + * @model + * @generated + */ + double getFocusAngle(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusAngle <em>Focus Angle</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Focus Angle</em>' attribute. + * @see #getFocusAngle() + * @generated + */ + void setFocusAngle(double value); + + /** + * Returns the value of the '<em><b>Focus Distance</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Focus Distance</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Focus Distance</em>' attribute. + * @see #setFocusDistance(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient_FocusDistance() + * @model + * @generated + */ + double getFocusDistance(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusDistance <em>Focus Distance</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Focus Distance</em>' attribute. + * @see #getFocusDistance() + * @generated + */ + void setFocusDistance(double value); + + /** + * Returns the value of the '<em><b>Center X</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Center X</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Center X</em>' attribute. + * @see #setCenterX(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient_CenterX() + * @model + * @generated + */ + double getCenterX(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterX <em>Center X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Center X</em>' attribute. + * @see #getCenterX() + * @generated + */ + void setCenterX(double value); + + /** + * Returns the value of the '<em><b>Center Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Center Y</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Center Y</em>' attribute. + * @see #setCenterY(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient_CenterY() + * @model + * @generated + */ + double getCenterY(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterY <em>Center Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Center Y</em>' attribute. + * @see #getCenterY() + * @generated + */ + void setCenterY(double value); + + /** + * Returns the value of the '<em><b>Radius</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Radius</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Radius</em>' attribute. + * @see #setRadius(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxRadialGradient_Radius() + * @model + * @generated + */ + double getRadius(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getRadius <em>Radius</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Radius</em>' attribute. + * @see #getRadius() + * @generated + */ + void setRadius(double value); + +} // FxRadialGradient diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxStop.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxStop.java new file mode 100644 index 000000000..14c7cbe2d --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/FxStop.java @@ -0,0 +1,77 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Fx Stop</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getColor <em>Color</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getOffset <em>Offset</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxStop() + * @model + * @generated + */ +public interface FxStop extends EObject { + /** + * Returns the value of the '<em><b>Color</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Color</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Color</em>' containment reference. + * @see #setColor(FxColor) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxStop_Color() + * @model containment="true" + * @generated + */ + FxColor getColor(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getColor <em>Color</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Color</em>' containment reference. + * @see #getColor() + * @generated + */ + void setColor(FxColor value); + + /** + * Returns the value of the '<em><b>Offset</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Offset</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Offset</em>' attribute. + * @see #setOffset(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getFxStop_Offset() + * @model + * @generated + */ + double getOffset(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getOffset <em>Offset</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Offset</em>' attribute. + * @see #getOffset() + * @generated + */ + void setOffset(double value); + +} // FxStop diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientFactory.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientFactory.java new file mode 100644 index 000000000..73de04e2c --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientFactory.java @@ -0,0 +1,69 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage + * @generated + */ +public interface GradientFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + GradientFactory eINSTANCE = org.eclipse.fx.ide.gradient.model.gradient.impl.GradientFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Fx Linear Gradient</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Fx Linear Gradient</em>'. + * @generated + */ + FxLinearGradient createFxLinearGradient(); + + /** + * Returns a new object of class '<em>Fx Radial Gradient</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Fx Radial Gradient</em>'. + * @generated + */ + FxRadialGradient createFxRadialGradient(); + + /** + * Returns a new object of class '<em>Fx Stop</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Fx Stop</em>'. + * @generated + */ + FxStop createFxStop(); + + /** + * Returns a new object of class '<em>Rgb Fx Color</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Rgb Fx Color</em>'. + * @generated + */ + RgbFxColor createRgbFxColor(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + GradientPackage getGradientPackage(); + +} //GradientFactory diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientPackage.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientPackage.java new file mode 100644 index 000000000..c781c6125 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/GradientPackage.java @@ -0,0 +1,961 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientFactory + * @model kind="package" + * @generated + */ +public interface GradientPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "gradient"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/efxclipse/tooling/fxgraph/Gradient"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "gradient"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + GradientPackage eINSTANCE = org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl <em>Fx Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxGradient() + * @generated + */ + int FX_GRADIENT = 0; + + /** + * The feature id for the '<em><b>Proportional</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_GRADIENT__PROPORTIONAL = 0; + + /** + * The feature id for the '<em><b>Cycle Method</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_GRADIENT__CYCLE_METHOD = 1; + + /** + * The feature id for the '<em><b>Stops</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_GRADIENT__STOPS = 2; + + /** + * The number of structural features of the '<em>Fx Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_GRADIENT_FEATURE_COUNT = 3; + + /** + * The number of operations of the '<em>Fx Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_GRADIENT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl <em>Fx Linear Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxLinearGradient() + * @generated + */ + int FX_LINEAR_GRADIENT = 1; + + /** + * The feature id for the '<em><b>Proportional</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__PROPORTIONAL = FX_GRADIENT__PROPORTIONAL; + + /** + * The feature id for the '<em><b>Cycle Method</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__CYCLE_METHOD = FX_GRADIENT__CYCLE_METHOD; + + /** + * The feature id for the '<em><b>Stops</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__STOPS = FX_GRADIENT__STOPS; + + /** + * The feature id for the '<em><b>Start X</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__START_X = FX_GRADIENT_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Start Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__START_Y = FX_GRADIENT_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>End X</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__END_X = FX_GRADIENT_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>End Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT__END_Y = FX_GRADIENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the '<em>Fx Linear Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT_FEATURE_COUNT = FX_GRADIENT_FEATURE_COUNT + 4; + + /** + * The number of operations of the '<em>Fx Linear Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_LINEAR_GRADIENT_OPERATION_COUNT = FX_GRADIENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl <em>Fx Radial Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxRadialGradient() + * @generated + */ + int FX_RADIAL_GRADIENT = 2; + + /** + * The feature id for the '<em><b>Proportional</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__PROPORTIONAL = FX_GRADIENT__PROPORTIONAL; + + /** + * The feature id for the '<em><b>Cycle Method</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__CYCLE_METHOD = FX_GRADIENT__CYCLE_METHOD; + + /** + * The feature id for the '<em><b>Stops</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__STOPS = FX_GRADIENT__STOPS; + + /** + * The feature id for the '<em><b>Focus Angle</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__FOCUS_ANGLE = FX_GRADIENT_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Focus Distance</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__FOCUS_DISTANCE = FX_GRADIENT_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Center X</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__CENTER_X = FX_GRADIENT_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Center Y</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__CENTER_Y = FX_GRADIENT_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Radius</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT__RADIUS = FX_GRADIENT_FEATURE_COUNT + 4; + + /** + * The number of structural features of the '<em>Fx Radial Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT_FEATURE_COUNT = FX_GRADIENT_FEATURE_COUNT + 5; + + /** + * The number of operations of the '<em>Fx Radial Gradient</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_RADIAL_GRADIENT_OPERATION_COUNT = FX_GRADIENT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl <em>Fx Stop</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxStop() + * @generated + */ + int FX_STOP = 3; + + /** + * The feature id for the '<em><b>Color</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_STOP__COLOR = 0; + + /** + * The feature id for the '<em><b>Offset</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_STOP__OFFSET = 1; + + /** + * The number of structural features of the '<em>Fx Stop</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_STOP_FEATURE_COUNT = 2; + + /** + * The number of operations of the '<em>Fx Stop</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_STOP_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxColorImpl <em>Fx Color</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxColorImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxColor() + * @generated + */ + int FX_COLOR = 4; + + /** + * The number of structural features of the '<em>Fx Color</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_COLOR_FEATURE_COUNT = 0; + + /** + * The number of operations of the '<em>Fx Color</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FX_COLOR_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl <em>Rgb Fx Color</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getRgbFxColor() + * @generated + */ + int RGB_FX_COLOR = 5; + + /** + * The feature id for the '<em><b>Red</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR__RED = FX_COLOR_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Green</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR__GREEN = FX_COLOR_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Blue</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR__BLUE = FX_COLOR_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Opacity</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR__OPACITY = FX_COLOR_FEATURE_COUNT + 3; + + /** + * The number of structural features of the '<em>Rgb Fx Color</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR_FEATURE_COUNT = FX_COLOR_FEATURE_COUNT + 4; + + /** + * The number of operations of the '<em>Rgb Fx Color</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RGB_FX_COLOR_OPERATION_COUNT = FX_COLOR_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod <em>Fx Cycle Method</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxCycleMethod() + * @generated + */ + int FX_CYCLE_METHOD = 6; + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient <em>Fx Gradient</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fx Gradient</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxGradient + * @generated + */ + EClass getFxGradient(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#isProportional <em>Proportional</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Proportional</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxGradient#isProportional() + * @see #getFxGradient() + * @generated + */ + EAttribute getFxGradient_Proportional(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getCycleMethod <em>Cycle Method</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Cycle Method</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getCycleMethod() + * @see #getFxGradient() + * @generated + */ + EAttribute getFxGradient_CycleMethod(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getStops <em>Stops</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Stops</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxGradient#getStops() + * @see #getFxGradient() + * @generated + */ + EReference getFxGradient_Stops(); + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient <em>Fx Linear Gradient</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fx Linear Gradient</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient + * @generated + */ + EClass getFxLinearGradient(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartX <em>Start X</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Start X</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartX() + * @see #getFxLinearGradient() + * @generated + */ + EAttribute getFxLinearGradient_StartX(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartY <em>Start Y</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Start Y</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getStartY() + * @see #getFxLinearGradient() + * @generated + */ + EAttribute getFxLinearGradient_StartY(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndX <em>End X</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>End X</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndX() + * @see #getFxLinearGradient() + * @generated + */ + EAttribute getFxLinearGradient_EndX(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndY <em>End Y</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>End Y</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient#getEndY() + * @see #getFxLinearGradient() + * @generated + */ + EAttribute getFxLinearGradient_EndY(); + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient <em>Fx Radial Gradient</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fx Radial Gradient</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient + * @generated + */ + EClass getFxRadialGradient(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusAngle <em>Focus Angle</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Focus Angle</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusAngle() + * @see #getFxRadialGradient() + * @generated + */ + EAttribute getFxRadialGradient_FocusAngle(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusDistance <em>Focus Distance</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Focus Distance</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getFocusDistance() + * @see #getFxRadialGradient() + * @generated + */ + EAttribute getFxRadialGradient_FocusDistance(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterX <em>Center X</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Center X</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterX() + * @see #getFxRadialGradient() + * @generated + */ + EAttribute getFxRadialGradient_CenterX(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterY <em>Center Y</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Center Y</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getCenterY() + * @see #getFxRadialGradient() + * @generated + */ + EAttribute getFxRadialGradient_CenterY(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getRadius <em>Radius</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Radius</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient#getRadius() + * @see #getFxRadialGradient() + * @generated + */ + EAttribute getFxRadialGradient_Radius(); + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop <em>Fx Stop</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fx Stop</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxStop + * @generated + */ + EClass getFxStop(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getColor <em>Color</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Color</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxStop#getColor() + * @see #getFxStop() + * @generated + */ + EReference getFxStop_Color(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop#getOffset <em>Offset</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Offset</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxStop#getOffset() + * @see #getFxStop() + * @generated + */ + EAttribute getFxStop_Offset(); + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxColor <em>Fx Color</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fx Color</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxColor + * @generated + */ + EClass getFxColor(); + + /** + * Returns the meta object for class '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor <em>Rgb Fx Color</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Rgb Fx Color</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor + * @generated + */ + EClass getRgbFxColor(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getRed <em>Red</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Red</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getRed() + * @see #getRgbFxColor() + * @generated + */ + EAttribute getRgbFxColor_Red(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getGreen <em>Green</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Green</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getGreen() + * @see #getRgbFxColor() + * @generated + */ + EAttribute getRgbFxColor_Green(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getBlue <em>Blue</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Blue</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getBlue() + * @see #getRgbFxColor() + * @generated + */ + EAttribute getRgbFxColor_Blue(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getOpacity <em>Opacity</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Opacity</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getOpacity() + * @see #getRgbFxColor() + * @generated + */ + EAttribute getRgbFxColor_Opacity(); + + /** + * Returns the meta object for enum '{@link org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod <em>Fx Cycle Method</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for enum '<em>Fx Cycle Method</em>'. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod + * @generated + */ + EEnum getFxCycleMethod(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + GradientFactory getGradientFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl <em>Fx Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxGradient() + * @generated + */ + EClass FX_GRADIENT = eINSTANCE.getFxGradient(); + + /** + * The meta object literal for the '<em><b>Proportional</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_GRADIENT__PROPORTIONAL = eINSTANCE.getFxGradient_Proportional(); + + /** + * The meta object literal for the '<em><b>Cycle Method</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_GRADIENT__CYCLE_METHOD = eINSTANCE.getFxGradient_CycleMethod(); + + /** + * The meta object literal for the '<em><b>Stops</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference FX_GRADIENT__STOPS = eINSTANCE.getFxGradient_Stops(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl <em>Fx Linear Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxLinearGradient() + * @generated + */ + EClass FX_LINEAR_GRADIENT = eINSTANCE.getFxLinearGradient(); + + /** + * The meta object literal for the '<em><b>Start X</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_LINEAR_GRADIENT__START_X = eINSTANCE.getFxLinearGradient_StartX(); + + /** + * The meta object literal for the '<em><b>Start Y</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_LINEAR_GRADIENT__START_Y = eINSTANCE.getFxLinearGradient_StartY(); + + /** + * The meta object literal for the '<em><b>End X</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_LINEAR_GRADIENT__END_X = eINSTANCE.getFxLinearGradient_EndX(); + + /** + * The meta object literal for the '<em><b>End Y</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_LINEAR_GRADIENT__END_Y = eINSTANCE.getFxLinearGradient_EndY(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl <em>Fx Radial Gradient</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxRadialGradient() + * @generated + */ + EClass FX_RADIAL_GRADIENT = eINSTANCE.getFxRadialGradient(); + + /** + * The meta object literal for the '<em><b>Focus Angle</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_RADIAL_GRADIENT__FOCUS_ANGLE = eINSTANCE.getFxRadialGradient_FocusAngle(); + + /** + * The meta object literal for the '<em><b>Focus Distance</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_RADIAL_GRADIENT__FOCUS_DISTANCE = eINSTANCE.getFxRadialGradient_FocusDistance(); + + /** + * The meta object literal for the '<em><b>Center X</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_RADIAL_GRADIENT__CENTER_X = eINSTANCE.getFxRadialGradient_CenterX(); + + /** + * The meta object literal for the '<em><b>Center Y</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_RADIAL_GRADIENT__CENTER_Y = eINSTANCE.getFxRadialGradient_CenterY(); + + /** + * The meta object literal for the '<em><b>Radius</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_RADIAL_GRADIENT__RADIUS = eINSTANCE.getFxRadialGradient_Radius(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl <em>Fx Stop</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxStop() + * @generated + */ + EClass FX_STOP = eINSTANCE.getFxStop(); + + /** + * The meta object literal for the '<em><b>Color</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference FX_STOP__COLOR = eINSTANCE.getFxStop_Color(); + + /** + * The meta object literal for the '<em><b>Offset</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute FX_STOP__OFFSET = eINSTANCE.getFxStop_Offset(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxColorImpl <em>Fx Color</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.FxColorImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxColor() + * @generated + */ + EClass FX_COLOR = eINSTANCE.getFxColor(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl <em>Rgb Fx Color</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getRgbFxColor() + * @generated + */ + EClass RGB_FX_COLOR = eINSTANCE.getRgbFxColor(); + + /** + * The meta object literal for the '<em><b>Red</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RGB_FX_COLOR__RED = eINSTANCE.getRgbFxColor_Red(); + + /** + * The meta object literal for the '<em><b>Green</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RGB_FX_COLOR__GREEN = eINSTANCE.getRgbFxColor_Green(); + + /** + * The meta object literal for the '<em><b>Blue</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RGB_FX_COLOR__BLUE = eINSTANCE.getRgbFxColor_Blue(); + + /** + * The meta object literal for the '<em><b>Opacity</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RGB_FX_COLOR__OPACITY = eINSTANCE.getRgbFxColor_Opacity(); + + /** + * The meta object literal for the '{@link org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod <em>Fx Cycle Method</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod + * @see org.eclipse.fx.ide.gradient.model.gradient.impl.GradientPackageImpl#getFxCycleMethod() + * @generated + */ + EEnum FX_CYCLE_METHOD = eINSTANCE.getFxCycleMethod(); + + } + +} //GradientPackage diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/RgbFxColor.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/RgbFxColor.java new file mode 100644 index 000000000..bbd1d3be0 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/RgbFxColor.java @@ -0,0 +1,130 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient; + + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Rgb Fx Color</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getRed <em>Red</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getGreen <em>Green</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getBlue <em>Blue</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getOpacity <em>Opacity</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getRgbFxColor() + * @model + * @generated + */ +public interface RgbFxColor extends FxColor { + /** + * Returns the value of the '<em><b>Red</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Red</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Red</em>' attribute. + * @see #setRed(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getRgbFxColor_Red() + * @model + * @generated + */ + double getRed(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getRed <em>Red</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Red</em>' attribute. + * @see #getRed() + * @generated + */ + void setRed(double value); + + /** + * Returns the value of the '<em><b>Green</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Green</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Green</em>' attribute. + * @see #setGreen(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getRgbFxColor_Green() + * @model + * @generated + */ + double getGreen(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getGreen <em>Green</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Green</em>' attribute. + * @see #getGreen() + * @generated + */ + void setGreen(double value); + + /** + * Returns the value of the '<em><b>Blue</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Blue</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Blue</em>' attribute. + * @see #setBlue(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getRgbFxColor_Blue() + * @model + * @generated + */ + double getBlue(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getBlue <em>Blue</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Blue</em>' attribute. + * @see #getBlue() + * @generated + */ + void setBlue(double value); + + /** + * Returns the value of the '<em><b>Opacity</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Opacity</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Opacity</em>' attribute. + * @see #setOpacity(double) + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#getRgbFxColor_Opacity() + * @model + * @generated + */ + double getOpacity(); + + /** + * Sets the value of the '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor#getOpacity <em>Opacity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Opacity</em>' attribute. + * @see #getOpacity() + * @generated + */ + void setOpacity(double value); + +} // RgbFxColor diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxColorImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxColorImpl.java new file mode 100644 index 000000000..715b52024 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxColorImpl.java @@ -0,0 +1,41 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.fx.ide.gradient.model.gradient.FxColor; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Fx Color</b></em>'. + * <!-- end-user-doc --> + * <p> + * </p> + * + * @generated + */ +public abstract class FxColorImpl extends MinimalEObjectImpl.Container implements FxColor { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FxColorImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.FX_COLOR; + } + +} //FxColorImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxGradientImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxGradientImpl.java new file mode 100644 index 000000000..2ec06e4f6 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxGradientImpl.java @@ -0,0 +1,271 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import java.util.Collection; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Fx Gradient</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl#isProportional <em>Proportional</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl#getCycleMethod <em>Cycle Method</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxGradientImpl#getStops <em>Stops</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public abstract class FxGradientImpl extends MinimalEObjectImpl.Container implements FxGradient { + /** + * The default value of the '{@link #isProportional() <em>Proportional</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isProportional() + * @generated + * @ordered + */ + protected static final boolean PROPORTIONAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isProportional() <em>Proportional</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isProportional() + * @generated + * @ordered + */ + protected boolean proportional = PROPORTIONAL_EDEFAULT; + + /** + * The default value of the '{@link #getCycleMethod() <em>Cycle Method</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCycleMethod() + * @generated + * @ordered + */ + protected static final FxCycleMethod CYCLE_METHOD_EDEFAULT = FxCycleMethod.NO_CYCLE; + + /** + * The cached value of the '{@link #getCycleMethod() <em>Cycle Method</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCycleMethod() + * @generated + * @ordered + */ + protected FxCycleMethod cycleMethod = CYCLE_METHOD_EDEFAULT; + + /** + * The cached value of the '{@link #getStops() <em>Stops</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStops() + * @generated + * @ordered + */ + protected EList<FxStop> stops; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FxGradientImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.FX_GRADIENT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isProportional() { + return proportional; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setProportional(boolean newProportional) { + boolean oldProportional = proportional; + proportional = newProportional; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_GRADIENT__PROPORTIONAL, oldProportional, proportional)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxCycleMethod getCycleMethod() { + return cycleMethod; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCycleMethod(FxCycleMethod newCycleMethod) { + FxCycleMethod oldCycleMethod = cycleMethod; + cycleMethod = newCycleMethod == null ? CYCLE_METHOD_EDEFAULT : newCycleMethod; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_GRADIENT__CYCLE_METHOD, oldCycleMethod, cycleMethod)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<FxStop> getStops() { + if (stops == null) { + stops = new EObjectContainmentEList<FxStop>(FxStop.class, this, GradientPackage.FX_GRADIENT__STOPS); + } + return stops; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GradientPackage.FX_GRADIENT__STOPS: + return ((InternalEList<?>)getStops()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GradientPackage.FX_GRADIENT__PROPORTIONAL: + return isProportional(); + case GradientPackage.FX_GRADIENT__CYCLE_METHOD: + return getCycleMethod(); + case GradientPackage.FX_GRADIENT__STOPS: + return getStops(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GradientPackage.FX_GRADIENT__PROPORTIONAL: + setProportional((Boolean)newValue); + return; + case GradientPackage.FX_GRADIENT__CYCLE_METHOD: + setCycleMethod((FxCycleMethod)newValue); + return; + case GradientPackage.FX_GRADIENT__STOPS: + getStops().clear(); + getStops().addAll((Collection<? extends FxStop>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GradientPackage.FX_GRADIENT__PROPORTIONAL: + setProportional(PROPORTIONAL_EDEFAULT); + return; + case GradientPackage.FX_GRADIENT__CYCLE_METHOD: + setCycleMethod(CYCLE_METHOD_EDEFAULT); + return; + case GradientPackage.FX_GRADIENT__STOPS: + getStops().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GradientPackage.FX_GRADIENT__PROPORTIONAL: + return proportional != PROPORTIONAL_EDEFAULT; + case GradientPackage.FX_GRADIENT__CYCLE_METHOD: + return cycleMethod != CYCLE_METHOD_EDEFAULT; + case GradientPackage.FX_GRADIENT__STOPS: + return stops != null && !stops.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (proportional: "); + result.append(proportional); + result.append(", cycleMethod: "); + result.append(cycleMethod); + result.append(')'); + return result.toString(); + } + +} //FxGradientImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxLinearGradientImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxLinearGradientImpl.java new file mode 100644 index 000000000..e9469eb39 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxLinearGradientImpl.java @@ -0,0 +1,314 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Fx Linear Gradient</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl#getStartX <em>Start X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl#getStartY <em>Start Y</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl#getEndX <em>End X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxLinearGradientImpl#getEndY <em>End Y</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class FxLinearGradientImpl extends FxGradientImpl implements FxLinearGradient { + /** + * The default value of the '{@link #getStartX() <em>Start X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStartX() + * @generated + * @ordered + */ + protected static final double START_X_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getStartX() <em>Start X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStartX() + * @generated + * @ordered + */ + protected double startX = START_X_EDEFAULT; + /** + * The default value of the '{@link #getStartY() <em>Start Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStartY() + * @generated + * @ordered + */ + protected static final double START_Y_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getStartY() <em>Start Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStartY() + * @generated + * @ordered + */ + protected double startY = START_Y_EDEFAULT; + /** + * The default value of the '{@link #getEndX() <em>End X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEndX() + * @generated + * @ordered + */ + protected static final double END_X_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getEndX() <em>End X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEndX() + * @generated + * @ordered + */ + protected double endX = END_X_EDEFAULT; + /** + * The default value of the '{@link #getEndY() <em>End Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEndY() + * @generated + * @ordered + */ + protected static final double END_Y_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getEndY() <em>End Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEndY() + * @generated + * @ordered + */ + protected double endY = END_Y_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FxLinearGradientImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.FX_LINEAR_GRADIENT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getStartX() { + return startX; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setStartX(double newStartX) { + double oldStartX = startX; + startX = newStartX; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_LINEAR_GRADIENT__START_X, oldStartX, startX)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getStartY() { + return startY; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setStartY(double newStartY) { + double oldStartY = startY; + startY = newStartY; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_LINEAR_GRADIENT__START_Y, oldStartY, startY)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getEndX() { + return endX; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEndX(double newEndX) { + double oldEndX = endX; + endX = newEndX; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_LINEAR_GRADIENT__END_X, oldEndX, endX)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getEndY() { + return endY; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEndY(double newEndY) { + double oldEndY = endY; + endY = newEndY; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_LINEAR_GRADIENT__END_Y, oldEndY, endY)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GradientPackage.FX_LINEAR_GRADIENT__START_X: + return getStartX(); + case GradientPackage.FX_LINEAR_GRADIENT__START_Y: + return getStartY(); + case GradientPackage.FX_LINEAR_GRADIENT__END_X: + return getEndX(); + case GradientPackage.FX_LINEAR_GRADIENT__END_Y: + return getEndY(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GradientPackage.FX_LINEAR_GRADIENT__START_X: + setStartX((Double)newValue); + return; + case GradientPackage.FX_LINEAR_GRADIENT__START_Y: + setStartY((Double)newValue); + return; + case GradientPackage.FX_LINEAR_GRADIENT__END_X: + setEndX((Double)newValue); + return; + case GradientPackage.FX_LINEAR_GRADIENT__END_Y: + setEndY((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GradientPackage.FX_LINEAR_GRADIENT__START_X: + setStartX(START_X_EDEFAULT); + return; + case GradientPackage.FX_LINEAR_GRADIENT__START_Y: + setStartY(START_Y_EDEFAULT); + return; + case GradientPackage.FX_LINEAR_GRADIENT__END_X: + setEndX(END_X_EDEFAULT); + return; + case GradientPackage.FX_LINEAR_GRADIENT__END_Y: + setEndY(END_Y_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GradientPackage.FX_LINEAR_GRADIENT__START_X: + return startX != START_X_EDEFAULT; + case GradientPackage.FX_LINEAR_GRADIENT__START_Y: + return startY != START_Y_EDEFAULT; + case GradientPackage.FX_LINEAR_GRADIENT__END_X: + return endX != END_X_EDEFAULT; + case GradientPackage.FX_LINEAR_GRADIENT__END_Y: + return endY != END_Y_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (startX: "); + result.append(startX); + result.append(", startY: "); + result.append(startY); + result.append(", endX: "); + result.append(endX); + result.append(", endY: "); + result.append(endY); + result.append(')'); + return result.toString(); + } + +} //FxLinearGradientImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxRadialGradientImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxRadialGradientImpl.java new file mode 100644 index 000000000..026de56e6 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxRadialGradientImpl.java @@ -0,0 +1,366 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Fx Radial Gradient</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl#getFocusAngle <em>Focus Angle</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl#getFocusDistance <em>Focus Distance</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl#getCenterX <em>Center X</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl#getCenterY <em>Center Y</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxRadialGradientImpl#getRadius <em>Radius</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class FxRadialGradientImpl extends FxGradientImpl implements FxRadialGradient { + /** + * The default value of the '{@link #getFocusAngle() <em>Focus Angle</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFocusAngle() + * @generated + * @ordered + */ + protected static final double FOCUS_ANGLE_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getFocusAngle() <em>Focus Angle</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFocusAngle() + * @generated + * @ordered + */ + protected double focusAngle = FOCUS_ANGLE_EDEFAULT; + /** + * The default value of the '{@link #getFocusDistance() <em>Focus Distance</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFocusDistance() + * @generated + * @ordered + */ + protected static final double FOCUS_DISTANCE_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getFocusDistance() <em>Focus Distance</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFocusDistance() + * @generated + * @ordered + */ + protected double focusDistance = FOCUS_DISTANCE_EDEFAULT; + /** + * The default value of the '{@link #getCenterX() <em>Center X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCenterX() + * @generated + * @ordered + */ + protected static final double CENTER_X_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getCenterX() <em>Center X</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCenterX() + * @generated + * @ordered + */ + protected double centerX = CENTER_X_EDEFAULT; + /** + * The default value of the '{@link #getCenterY() <em>Center Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCenterY() + * @generated + * @ordered + */ + protected static final double CENTER_Y_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getCenterY() <em>Center Y</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCenterY() + * @generated + * @ordered + */ + protected double centerY = CENTER_Y_EDEFAULT; + /** + * The default value of the '{@link #getRadius() <em>Radius</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getRadius() + * @generated + * @ordered + */ + protected static final double RADIUS_EDEFAULT = 0.0; + /** + * The cached value of the '{@link #getRadius() <em>Radius</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getRadius() + * @generated + * @ordered + */ + protected double radius = RADIUS_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FxRadialGradientImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.FX_RADIAL_GRADIENT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getFocusAngle() { + return focusAngle; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFocusAngle(double newFocusAngle) { + double oldFocusAngle = focusAngle; + focusAngle = newFocusAngle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_RADIAL_GRADIENT__FOCUS_ANGLE, oldFocusAngle, focusAngle)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getFocusDistance() { + return focusDistance; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFocusDistance(double newFocusDistance) { + double oldFocusDistance = focusDistance; + focusDistance = newFocusDistance; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_RADIAL_GRADIENT__FOCUS_DISTANCE, oldFocusDistance, focusDistance)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getCenterX() { + return centerX; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCenterX(double newCenterX) { + double oldCenterX = centerX; + centerX = newCenterX; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_RADIAL_GRADIENT__CENTER_X, oldCenterX, centerX)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getCenterY() { + return centerY; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCenterY(double newCenterY) { + double oldCenterY = centerY; + centerY = newCenterY; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_RADIAL_GRADIENT__CENTER_Y, oldCenterY, centerY)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getRadius() { + return radius; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setRadius(double newRadius) { + double oldRadius = radius; + radius = newRadius; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_RADIAL_GRADIENT__RADIUS, oldRadius, radius)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_ANGLE: + return getFocusAngle(); + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_DISTANCE: + return getFocusDistance(); + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_X: + return getCenterX(); + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_Y: + return getCenterY(); + case GradientPackage.FX_RADIAL_GRADIENT__RADIUS: + return getRadius(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_ANGLE: + setFocusAngle((Double)newValue); + return; + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_DISTANCE: + setFocusDistance((Double)newValue); + return; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_X: + setCenterX((Double)newValue); + return; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_Y: + setCenterY((Double)newValue); + return; + case GradientPackage.FX_RADIAL_GRADIENT__RADIUS: + setRadius((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_ANGLE: + setFocusAngle(FOCUS_ANGLE_EDEFAULT); + return; + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_DISTANCE: + setFocusDistance(FOCUS_DISTANCE_EDEFAULT); + return; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_X: + setCenterX(CENTER_X_EDEFAULT); + return; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_Y: + setCenterY(CENTER_Y_EDEFAULT); + return; + case GradientPackage.FX_RADIAL_GRADIENT__RADIUS: + setRadius(RADIUS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_ANGLE: + return focusAngle != FOCUS_ANGLE_EDEFAULT; + case GradientPackage.FX_RADIAL_GRADIENT__FOCUS_DISTANCE: + return focusDistance != FOCUS_DISTANCE_EDEFAULT; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_X: + return centerX != CENTER_X_EDEFAULT; + case GradientPackage.FX_RADIAL_GRADIENT__CENTER_Y: + return centerY != CENTER_Y_EDEFAULT; + case GradientPackage.FX_RADIAL_GRADIENT__RADIUS: + return radius != RADIUS_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (focusAngle: "); + result.append(focusAngle); + result.append(", focusDistance: "); + result.append(focusDistance); + result.append(", centerX: "); + result.append(centerX); + result.append(", centerY: "); + result.append(centerY); + result.append(", radius: "); + result.append(radius); + result.append(')'); + return result.toString(); + } + +} //FxRadialGradientImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxStopImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxStopImpl.java new file mode 100644 index 000000000..22b6209da --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/FxStopImpl.java @@ -0,0 +1,244 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.fx.ide.gradient.model.gradient.FxColor; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Fx Stop</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl#getColor <em>Color</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.FxStopImpl#getOffset <em>Offset</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class FxStopImpl extends MinimalEObjectImpl.Container implements FxStop { + /** + * The cached value of the '{@link #getColor() <em>Color</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getColor() + * @generated + * @ordered + */ + protected FxColor color; + + /** + * The default value of the '{@link #getOffset() <em>Offset</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOffset() + * @generated + * @ordered + */ + protected static final double OFFSET_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getOffset() <em>Offset</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOffset() + * @generated + * @ordered + */ + protected double offset = OFFSET_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FxStopImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.FX_STOP; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxColor getColor() { + return color; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetColor(FxColor newColor, NotificationChain msgs) { + FxColor oldColor = color; + color = newColor; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GradientPackage.FX_STOP__COLOR, oldColor, newColor); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setColor(FxColor newColor) { + if (newColor != color) { + NotificationChain msgs = null; + if (color != null) + msgs = ((InternalEObject)color).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GradientPackage.FX_STOP__COLOR, null, msgs); + if (newColor != null) + msgs = ((InternalEObject)newColor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GradientPackage.FX_STOP__COLOR, null, msgs); + msgs = basicSetColor(newColor, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_STOP__COLOR, newColor, newColor)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getOffset() { + return offset; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOffset(double newOffset) { + double oldOffset = offset; + offset = newOffset; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.FX_STOP__OFFSET, oldOffset, offset)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case GradientPackage.FX_STOP__COLOR: + return basicSetColor(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GradientPackage.FX_STOP__COLOR: + return getColor(); + case GradientPackage.FX_STOP__OFFSET: + return getOffset(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GradientPackage.FX_STOP__COLOR: + setColor((FxColor)newValue); + return; + case GradientPackage.FX_STOP__OFFSET: + setOffset((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GradientPackage.FX_STOP__COLOR: + setColor((FxColor)null); + return; + case GradientPackage.FX_STOP__OFFSET: + setOffset(OFFSET_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GradientPackage.FX_STOP__COLOR: + return color != null; + case GradientPackage.FX_STOP__OFFSET: + return offset != OFFSET_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (offset: "); + result.append(offset); + result.append(')'); + return result.toString(); + } + +} //FxStopImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientFactoryImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientFactoryImpl.java new file mode 100644 index 000000000..71fcc020d --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientFactoryImpl.java @@ -0,0 +1,179 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.eclipse.fx.ide.gradient.model.gradient.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class GradientFactoryImpl extends EFactoryImpl implements GradientFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static GradientFactory init() { + try { + GradientFactory theGradientFactory = (GradientFactory)EPackage.Registry.INSTANCE.getEFactory(GradientPackage.eNS_URI); + if (theGradientFactory != null) { + return theGradientFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new GradientFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GradientFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case GradientPackage.FX_LINEAR_GRADIENT: return createFxLinearGradient(); + case GradientPackage.FX_RADIAL_GRADIENT: return createFxRadialGradient(); + case GradientPackage.FX_STOP: return createFxStop(); + case GradientPackage.RGB_FX_COLOR: return createRgbFxColor(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case GradientPackage.FX_CYCLE_METHOD: + return createFxCycleMethodFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case GradientPackage.FX_CYCLE_METHOD: + return convertFxCycleMethodToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxLinearGradient createFxLinearGradient() { + FxLinearGradientImpl fxLinearGradient = new FxLinearGradientImpl(); + return fxLinearGradient; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxRadialGradient createFxRadialGradient() { + FxRadialGradientImpl fxRadialGradient = new FxRadialGradientImpl(); + return fxRadialGradient; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxStop createFxStop() { + FxStopImpl fxStop = new FxStopImpl(); + return fxStop; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RgbFxColor createRgbFxColor() { + RgbFxColorImpl rgbFxColor = new RgbFxColorImpl(); + return rgbFxColor; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FxCycleMethod createFxCycleMethodFromString(EDataType eDataType, String initialValue) { + FxCycleMethod result = FxCycleMethod.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertFxCycleMethodToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GradientPackage getGradientPackage() { + return (GradientPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static GradientPackage getPackage() { + return GradientPackage.eINSTANCE; + } + +} //GradientFactoryImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientPackageImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientPackageImpl.java new file mode 100644 index 000000000..416b1ebdf --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/GradientPackageImpl.java @@ -0,0 +1,498 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.fx.ide.gradient.model.gradient.FxColor; +import org.eclipse.fx.ide.gradient.model.gradient.FxCycleMethod; +import org.eclipse.fx.ide.gradient.model.gradient.FxGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient; +import org.eclipse.fx.ide.gradient.model.gradient.FxStop; +import org.eclipse.fx.ide.gradient.model.gradient.GradientFactory; +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; +import org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class GradientPackageImpl extends EPackageImpl implements GradientPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass fxGradientEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass fxLinearGradientEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass fxRadialGradientEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass fxStopEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass fxColorEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass rgbFxColorEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EEnum fxCycleMethodEEnum = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage#eNS_URI + * @see #init() + * @generated + */ + private GradientPackageImpl() { + super(eNS_URI, GradientFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link GradientPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static GradientPackage init() { + if (isInited) return (GradientPackage)EPackage.Registry.INSTANCE.getEPackage(GradientPackage.eNS_URI); + + // Obtain or create and register package + GradientPackageImpl theGradientPackage = (GradientPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GradientPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new GradientPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theGradientPackage.createPackageContents(); + + // Initialize created meta-data + theGradientPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theGradientPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(GradientPackage.eNS_URI, theGradientPackage); + return theGradientPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFxGradient() { + return fxGradientEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxGradient_Proportional() { + return (EAttribute)fxGradientEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxGradient_CycleMethod() { + return (EAttribute)fxGradientEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFxGradient_Stops() { + return (EReference)fxGradientEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFxLinearGradient() { + return fxLinearGradientEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxLinearGradient_StartX() { + return (EAttribute)fxLinearGradientEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxLinearGradient_StartY() { + return (EAttribute)fxLinearGradientEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxLinearGradient_EndX() { + return (EAttribute)fxLinearGradientEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxLinearGradient_EndY() { + return (EAttribute)fxLinearGradientEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFxRadialGradient() { + return fxRadialGradientEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxRadialGradient_FocusAngle() { + return (EAttribute)fxRadialGradientEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxRadialGradient_FocusDistance() { + return (EAttribute)fxRadialGradientEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxRadialGradient_CenterX() { + return (EAttribute)fxRadialGradientEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxRadialGradient_CenterY() { + return (EAttribute)fxRadialGradientEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxRadialGradient_Radius() { + return (EAttribute)fxRadialGradientEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFxStop() { + return fxStopEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFxStop_Color() { + return (EReference)fxStopEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getFxStop_Offset() { + return (EAttribute)fxStopEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFxColor() { + return fxColorEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getRgbFxColor() { + return rgbFxColorEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRgbFxColor_Red() { + return (EAttribute)rgbFxColorEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRgbFxColor_Green() { + return (EAttribute)rgbFxColorEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRgbFxColor_Blue() { + return (EAttribute)rgbFxColorEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRgbFxColor_Opacity() { + return (EAttribute)rgbFxColorEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EEnum getFxCycleMethod() { + return fxCycleMethodEEnum; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GradientFactory getGradientFactory() { + return (GradientFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + fxGradientEClass = createEClass(FX_GRADIENT); + createEAttribute(fxGradientEClass, FX_GRADIENT__PROPORTIONAL); + createEAttribute(fxGradientEClass, FX_GRADIENT__CYCLE_METHOD); + createEReference(fxGradientEClass, FX_GRADIENT__STOPS); + + fxLinearGradientEClass = createEClass(FX_LINEAR_GRADIENT); + createEAttribute(fxLinearGradientEClass, FX_LINEAR_GRADIENT__START_X); + createEAttribute(fxLinearGradientEClass, FX_LINEAR_GRADIENT__START_Y); + createEAttribute(fxLinearGradientEClass, FX_LINEAR_GRADIENT__END_X); + createEAttribute(fxLinearGradientEClass, FX_LINEAR_GRADIENT__END_Y); + + fxRadialGradientEClass = createEClass(FX_RADIAL_GRADIENT); + createEAttribute(fxRadialGradientEClass, FX_RADIAL_GRADIENT__FOCUS_ANGLE); + createEAttribute(fxRadialGradientEClass, FX_RADIAL_GRADIENT__FOCUS_DISTANCE); + createEAttribute(fxRadialGradientEClass, FX_RADIAL_GRADIENT__CENTER_X); + createEAttribute(fxRadialGradientEClass, FX_RADIAL_GRADIENT__CENTER_Y); + createEAttribute(fxRadialGradientEClass, FX_RADIAL_GRADIENT__RADIUS); + + fxStopEClass = createEClass(FX_STOP); + createEReference(fxStopEClass, FX_STOP__COLOR); + createEAttribute(fxStopEClass, FX_STOP__OFFSET); + + fxColorEClass = createEClass(FX_COLOR); + + rgbFxColorEClass = createEClass(RGB_FX_COLOR); + createEAttribute(rgbFxColorEClass, RGB_FX_COLOR__RED); + createEAttribute(rgbFxColorEClass, RGB_FX_COLOR__GREEN); + createEAttribute(rgbFxColorEClass, RGB_FX_COLOR__BLUE); + createEAttribute(rgbFxColorEClass, RGB_FX_COLOR__OPACITY); + + // Create enums + fxCycleMethodEEnum = createEEnum(FX_CYCLE_METHOD); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + fxLinearGradientEClass.getESuperTypes().add(this.getFxGradient()); + fxRadialGradientEClass.getESuperTypes().add(this.getFxGradient()); + rgbFxColorEClass.getESuperTypes().add(this.getFxColor()); + + // Initialize classes, features, and operations; add parameters + initEClass(fxGradientEClass, FxGradient.class, "FxGradient", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFxGradient_Proportional(), ecorePackage.getEBoolean(), "proportional", null, 0, 1, FxGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxGradient_CycleMethod(), this.getFxCycleMethod(), "cycleMethod", null, 0, 1, FxGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFxGradient_Stops(), this.getFxStop(), null, "stops", null, 0, -1, FxGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fxLinearGradientEClass, FxLinearGradient.class, "FxLinearGradient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFxLinearGradient_StartX(), ecorePackage.getEDouble(), "startX", null, 0, 1, FxLinearGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxLinearGradient_StartY(), ecorePackage.getEDouble(), "startY", null, 0, 1, FxLinearGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxLinearGradient_EndX(), ecorePackage.getEDouble(), "endX", null, 0, 1, FxLinearGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxLinearGradient_EndY(), ecorePackage.getEDouble(), "endY", null, 0, 1, FxLinearGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fxRadialGradientEClass, FxRadialGradient.class, "FxRadialGradient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFxRadialGradient_FocusAngle(), ecorePackage.getEDouble(), "focusAngle", null, 0, 1, FxRadialGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxRadialGradient_FocusDistance(), ecorePackage.getEDouble(), "focusDistance", null, 0, 1, FxRadialGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxRadialGradient_CenterX(), ecorePackage.getEDouble(), "centerX", null, 0, 1, FxRadialGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxRadialGradient_CenterY(), ecorePackage.getEDouble(), "centerY", null, 0, 1, FxRadialGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxRadialGradient_Radius(), ecorePackage.getEDouble(), "radius", null, 0, 1, FxRadialGradient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fxStopEClass, FxStop.class, "FxStop", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFxStop_Color(), this.getFxColor(), null, "color", null, 0, 1, FxStop.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFxStop_Offset(), ecorePackage.getEDouble(), "offset", null, 0, 1, FxStop.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fxColorEClass, FxColor.class, "FxColor", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(rgbFxColorEClass, RgbFxColor.class, "RgbFxColor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getRgbFxColor_Red(), ecorePackage.getEDouble(), "red", null, 0, 1, RgbFxColor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRgbFxColor_Green(), ecorePackage.getEDouble(), "green", null, 0, 1, RgbFxColor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRgbFxColor_Blue(), ecorePackage.getEDouble(), "blue", null, 0, 1, RgbFxColor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRgbFxColor_Opacity(), ecorePackage.getEDouble(), "opacity", null, 0, 1, RgbFxColor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(fxCycleMethodEEnum, FxCycleMethod.class, "FxCycleMethod"); + addEEnumLiteral(fxCycleMethodEEnum, FxCycleMethod.NO_CYCLE); + addEEnumLiteral(fxCycleMethodEEnum, FxCycleMethod.REFLECT); + addEEnumLiteral(fxCycleMethodEEnum, FxCycleMethod.REPEAT); + + // Create resource + createResource(eNS_URI); + } + +} //GradientPackageImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/RgbFxColorImpl.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/RgbFxColorImpl.java new file mode 100644 index 000000000..2704fc507 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/impl/RgbFxColorImpl.java @@ -0,0 +1,324 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.fx.ide.gradient.model.gradient.GradientPackage; +import org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Rgb Fx Color</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl#getRed <em>Red</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl#getGreen <em>Green</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl#getBlue <em>Blue</em>}</li> + * <li>{@link org.eclipse.fx.ide.gradient.model.gradient.impl.RgbFxColorImpl#getOpacity <em>Opacity</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class RgbFxColorImpl extends FxColorImpl implements RgbFxColor { + /** + * The default value of the '{@link #getRed() <em>Red</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getRed() + * @generated + * @ordered + */ + protected static final double RED_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getRed() <em>Red</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getRed() + * @generated + * @ordered + */ + protected double red = RED_EDEFAULT; + + /** + * The default value of the '{@link #getGreen() <em>Green</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGreen() + * @generated + * @ordered + */ + protected static final double GREEN_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getGreen() <em>Green</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getGreen() + * @generated + * @ordered + */ + protected double green = GREEN_EDEFAULT; + + /** + * The default value of the '{@link #getBlue() <em>Blue</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBlue() + * @generated + * @ordered + */ + protected static final double BLUE_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getBlue() <em>Blue</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBlue() + * @generated + * @ordered + */ + protected double blue = BLUE_EDEFAULT; + + /** + * The default value of the '{@link #getOpacity() <em>Opacity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOpacity() + * @generated + * @ordered + */ + protected static final double OPACITY_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getOpacity() <em>Opacity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOpacity() + * @generated + * @ordered + */ + protected double opacity = OPACITY_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected RgbFxColorImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return GradientPackage.Literals.RGB_FX_COLOR; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getRed() { + return red; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setRed(double newRed) { + double oldRed = red; + red = newRed; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.RGB_FX_COLOR__RED, oldRed, red)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getGreen() { + return green; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setGreen(double newGreen) { + double oldGreen = green; + green = newGreen; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.RGB_FX_COLOR__GREEN, oldGreen, green)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getBlue() { + return blue; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setBlue(double newBlue) { + double oldBlue = blue; + blue = newBlue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.RGB_FX_COLOR__BLUE, oldBlue, blue)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getOpacity() { + return opacity; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOpacity(double newOpacity) { + double oldOpacity = opacity; + opacity = newOpacity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GradientPackage.RGB_FX_COLOR__OPACITY, oldOpacity, opacity)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GradientPackage.RGB_FX_COLOR__RED: + return getRed(); + case GradientPackage.RGB_FX_COLOR__GREEN: + return getGreen(); + case GradientPackage.RGB_FX_COLOR__BLUE: + return getBlue(); + case GradientPackage.RGB_FX_COLOR__OPACITY: + return getOpacity(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GradientPackage.RGB_FX_COLOR__RED: + setRed((Double)newValue); + return; + case GradientPackage.RGB_FX_COLOR__GREEN: + setGreen((Double)newValue); + return; + case GradientPackage.RGB_FX_COLOR__BLUE: + setBlue((Double)newValue); + return; + case GradientPackage.RGB_FX_COLOR__OPACITY: + setOpacity((Double)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GradientPackage.RGB_FX_COLOR__RED: + setRed(RED_EDEFAULT); + return; + case GradientPackage.RGB_FX_COLOR__GREEN: + setGreen(GREEN_EDEFAULT); + return; + case GradientPackage.RGB_FX_COLOR__BLUE: + setBlue(BLUE_EDEFAULT); + return; + case GradientPackage.RGB_FX_COLOR__OPACITY: + setOpacity(OPACITY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GradientPackage.RGB_FX_COLOR__RED: + return red != RED_EDEFAULT; + case GradientPackage.RGB_FX_COLOR__GREEN: + return green != GREEN_EDEFAULT; + case GradientPackage.RGB_FX_COLOR__BLUE: + return blue != BLUE_EDEFAULT; + case GradientPackage.RGB_FX_COLOR__OPACITY: + return opacity != OPACITY_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (red: "); + result.append(red); + result.append(", green: "); + result.append(green); + result.append(", blue: "); + result.append(blue); + result.append(", opacity: "); + result.append(opacity); + result.append(')'); + return result.toString(); + } + +} //RgbFxColorImpl diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientAdapterFactory.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientAdapterFactory.java new file mode 100644 index 000000000..5ea8792e4 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientAdapterFactory.java @@ -0,0 +1,210 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.fx.ide.gradient.model.gradient.*; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage + * @generated + */ +public class GradientAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static GradientPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GradientAdapterFactory() { + if (modelPackage == null) { + modelPackage = GradientPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected GradientSwitch<Adapter> modelSwitch = + new GradientSwitch<Adapter>() { + @Override + public Adapter caseFxGradient(FxGradient object) { + return createFxGradientAdapter(); + } + @Override + public Adapter caseFxLinearGradient(FxLinearGradient object) { + return createFxLinearGradientAdapter(); + } + @Override + public Adapter caseFxRadialGradient(FxRadialGradient object) { + return createFxRadialGradientAdapter(); + } + @Override + public Adapter caseFxStop(FxStop object) { + return createFxStopAdapter(); + } + @Override + public Adapter caseFxColor(FxColor object) { + return createFxColorAdapter(); + } + @Override + public Adapter caseRgbFxColor(RgbFxColor object) { + return createRgbFxColorAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxGradient <em>Fx Gradient</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxGradient + * @generated + */ + public Adapter createFxGradientAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient <em>Fx Linear Gradient</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxLinearGradient + * @generated + */ + public Adapter createFxLinearGradientAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient <em>Fx Radial Gradient</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxRadialGradient + * @generated + */ + public Adapter createFxRadialGradientAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxStop <em>Fx Stop</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxStop + * @generated + */ + public Adapter createFxStopAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.FxColor <em>Fx Color</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.FxColor + * @generated + */ + public Adapter createFxColorAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor <em>Rgb Fx Color</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.fx.ide.gradient.model.gradient.RgbFxColor + * @generated + */ + public Adapter createRgbFxColorAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //GradientAdapterFactory diff --git a/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientSwitch.java b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientSwitch.java new file mode 100644 index 000000000..b4e5f3276 --- /dev/null +++ b/experimental/gradienteditor/org.eclipse.fx.ide.gradient.model/src/org/eclipse/fx/ide/gradient/model/gradient/util/GradientSwitch.java @@ -0,0 +1,218 @@ +/** + */ +package org.eclipse.fx.ide.gradient.model.gradient.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import org.eclipse.fx.ide.gradient.model.gradient.*; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.fx.ide.gradient.model.gradient.GradientPackage + * @generated + */ +public class GradientSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static GradientPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GradientSwitch() { + if (modelPackage == null) { + modelPackage = GradientPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case GradientPackage.FX_GRADIENT: { + FxGradient fxGradient = (FxGradient)theEObject; + T result = caseFxGradient(fxGradient); + if (result == null) result = defaultCase(theEObject); + return result; + } + case GradientPackage.FX_LINEAR_GRADIENT: { + FxLinearGradient fxLinearGradient = (FxLinearGradient)theEObject; + T result = caseFxLinearGradient(fxLinearGradient); + if (result == null) result = caseFxGradient(fxLinearGradient); + if (result == null) result = defaultCase(theEObject); + return result; + } + case GradientPackage.FX_RADIAL_GRADIENT: { + FxRadialGradient fxRadialGradient = (FxRadialGradient)theEObject; + T result = caseFxRadialGradient(fxRadialGradient); + if (result == null) result = caseFxGradient(fxRadialGradient); + if (result == null) result = defaultCase(theEObject); + return result; + } + case GradientPackage.FX_STOP: { + FxStop fxStop = (FxStop)theEObject; + T result = caseFxStop(fxStop); + if (result == null) result = defaultCase(theEObject); + return result; + } + case GradientPackage.FX_COLOR: { + FxColor fxColor = (FxColor)theEObject; + T result = caseFxColor(fxColor); + if (result == null) result = defaultCase(theEObject); + return result; + } + case GradientPackage.RGB_FX_COLOR: { + RgbFxColor rgbFxColor = (RgbFxColor)theEObject; + T result = caseRgbFxColor(rgbFxColor); + if (result == null) result = caseFxColor(rgbFxColor); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Fx Gradient</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Fx Gradient</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFxGradient(FxGradient object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Fx Linear Gradient</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Fx Linear Gradient</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFxLinearGradient(FxLinearGradient object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Fx Radial Gradient</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Fx Radial Gradient</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFxRadialGradient(FxRadialGradient object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Fx Stop</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Fx Stop</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFxStop(FxStop object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Fx Color</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Fx Color</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFxColor(FxColor object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Rgb Fx Color</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Rgb Fx Color</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRgbFxColor(RgbFxColor object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //GradientSwitch diff --git a/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/.gitignore b/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/.gitignore deleted file mode 100644 index 283762609..000000000 --- a/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/donotdelete diff --git a/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/donotdelete b/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/donotdelete new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/experimental/swt/org.eclipse.fx.sample.singlesource.app/bin/donotdelete |