Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/org.eclipse.fx.demo.media/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/.classpath7
-rw-r--r--demos/org.eclipse.fx.demo.media/.gitignore1
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/.project34
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/.settings/org.eclipse.pde.core.prefs3
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/Application.e4xmi56
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/IP-TODOS.txt23
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/META-INF/MANIFEST.MF56
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/OSGI-INF/l10n/bundle.properties3
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/build.properties8
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/css/default.css81
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/css/theme1/images/grunge_wall.pngbin0 -> 108721 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/css/theme1/images/low_contrast_linen.pngbin0 -> 22749 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/css/theme2.css81
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/css/theme2/images/purty_wood.pngbin0 -> 222357 bytes
-rw-r--r--demos/org.eclipse.fx.demo.media/icons/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/22/games-config-background.pngbin0 -> 1135 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/22/kaffeine.pngbin0 -> 1349 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/22/player-volume.pngbin0 -> 971 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/games-config-background.pngbin0 -> 3468 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/kaffeine.pngbin0 -> 3601 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/perspective/camera-photo.pngbin0 -> 7566 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/perspective/preferences-system.pngbin0 -> 17677 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/perspective/video-projector.pngbin0 -> 11067 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/player-volume.pngbin0 -> 2701 bytes
-rw-r--r--demos/org.eclipse.fx.demo.media/icons/resources/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/resources/movs/.gitignore2
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/resources/movs/file.txt1
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/resources/movs/mov1.flvbin0 -> 790652 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/resources/pics/pic1.jpgbin0 -> 4918396 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/icons/resources/pics/pic2.jpgbin0 -> 2884625 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product82
-rw-r--r--demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product_workspace.launch34
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/plugin.xml38
-rw-r--r--demos/org.eclipse.fx.demo.media/src/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/Activator.java30
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/addon/PerspectiveAnimationAddon.java83
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/handlers/PerspectiveSwitcher.java29
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/Media.java66
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/MediaType.java7
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxgraph45
-rw-r--r--demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxml22
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPart.java38
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPartControler.java147
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaListPart.java133
-rwxr-xr-xdemos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaPart.java241
47 files changed, 1358 insertions, 0 deletions
diff --git a/demos/org.eclipse.fx.demo.media/.DS_Store b/demos/org.eclipse.fx.demo.media/.DS_Store
new file mode 100644
index 000000000..cef7221ae
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.DS_Store
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/.classpath b/demos/org.eclipse.fx.demo.media/.classpath
new file mode 100755
index 000000000..b1dabee38
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.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.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/demos/org.eclipse.fx.demo.media/.gitignore b/demos/org.eclipse.fx.demo.media/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/demos/org.eclipse.fx.demo.media/.project b/demos/org.eclipse.fx.demo.media/.project
new file mode 100755
index 000000000..67146a825
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.demo.media</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.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/demos/org.eclipse.fx.demo.media/.settings/org.eclipse.jdt.core.prefs b/demos/org.eclipse.fx.demo.media/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 000000000..f42de363a
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.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.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/demos/org.eclipse.fx.demo.media/.settings/org.eclipse.pde.core.prefs b/demos/org.eclipse.fx.demo.media/.settings/org.eclipse.pde.core.prefs
new file mode 100755
index 000000000..f29e940a0
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/demos/org.eclipse.fx.demo.media/Application.e4xmi b/demos/org.eclipse.fx.demo.media/Application.e4xmi
new file mode 100755
index 000000000..6fde1edd3
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/Application.e4xmi
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_4jxxUBo_EeKkV9yRGUW3Gw" elementId="org.eclipse.e4.ide.application" bindingContexts="_4jxxURo_EeKkV9yRGUW3Gw">
+ <children xsi:type="basic:TrimmedWindow" xmi:id="_4jyYZho_EeKkV9yRGUW3Gw" elementId="org.efxclipse.e4.mainWindow" label="org.eclipse.fx.demo.media" x="30" y="30" width="1024" height="768">
+ <persistedState key="fx.scene.3d" value="true"/>
+ <children xsi:type="advanced:PerspectiveStack" xmi:id="_PBYm0BpAEeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.perspectivestack.0">
+ <children xsi:type="advanced:Perspective" xmi:id="_Q_WvYBpAEeKkV9yRGUW3Gw" elementId="perspective.images" label="Images">
+ <children xsi:type="basic:PartSashContainer" xmi:id="_4jyYZxo_EeKkV9yRGUW3Gw" horizontal="true">
+ <tags>media-container</tags>
+ <children xsi:type="basic:PartStack" xmi:id="_4jyYaRo_EeKkV9yRGUW3Gw" elementId="content.stack" containerData="0.8"/>
+ <children xsi:type="basic:Part" xmi:id="_4jyYaBo_EeKkV9yRGUW3Gw" containerData="0.2" contributionURI="bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.parts.MediaListPart"/>
+ </children>
+ </children>
+ <children xsi:type="advanced:Perspective" xmi:id="_TPNSIBpAEeKkV9yRGUW3Gw" elementId="perspective.videos" label="Videos">
+ <children xsi:type="basic:PartSashContainer" xmi:id="_o8RbgBpAEeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.partsashcontainer.0" horizontal="true">
+ <tags>media-container</tags>
+ <children xsi:type="basic:PartStack" xmi:id="_qrR7ABpAEeKkV9yRGUW3Gw" elementId="content.stack" containerData="0.8"/>
+ <children xsi:type="basic:Part" xmi:id="_p8fiYBpAEeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.part.0" containerData="0.2" contributionURI="bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.parts.MediaListPart"/>
+ </children>
+ </children>
+ <children xsi:type="advanced:Perspective" xmi:id="_JAaF4Bt_EeKkV9yRGUW3Gw" elementId="perspective.configuration" label="Configuration">
+ <children xsi:type="basic:Part" xmi:id="_KV-xsBt_EeKkV9yRGUW3Gw" elementId="configuration" contributionURI="bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.parts.ConfigurationPart"/>
+ </children>
+ </children>
+ <trimBars xmi:id="_4jyYaho_EeKkV9yRGUW3Gw" elementId="left_trim" side="Left">
+ <children xsi:type="menu:ToolBar" xmi:id="_4jyYaxo_EeKkV9yRGUW3Gw" elementId="org.efxclipse.e4.maintoolbar">
+ <children xsi:type="menu:HandledToolItem" xmi:id="_m6AL0Bt_EeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.handledtoolitem.0" iconURI="platform:/plugin/org.eclipse.fx.demo.media/icons/perspective/preferences-system.png" command="_gvNokBpCEeKkV9yRGUW3Gw">
+ <parameters xmi:id="_r_XjIBt_EeKkV9yRGUW3Gw" elementId="targetPerspectiveId" name="targetPerspectiveId" value="perspective.configuration"/>
+ </children>
+ <children xsi:type="menu:ToolBarSeparator" xmi:id="_I8410BuVEeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.toolbarseparator.0"/>
+ <children xsi:type="menu:HandledToolItem" xmi:id="_4jyYbBo_EeKkV9yRGUW3Gw" elementId="org.efxclipse.e4.toolitem.open" iconURI="platform:/plugin/org.eclipse.fx.demo.media/icons/perspective/camera-photo.png" command="_gvNokBpCEeKkV9yRGUW3Gw">
+ <parameters xmi:id="_HOvFsBpHEeKkV9yRGUW3Gw" elementId="targetPerspectiveId" name="targetPerspectiveId" value="perspective.images"/>
+ </children>
+ <children xsi:type="menu:HandledToolItem" xmi:id="_4jy_cBo_EeKkV9yRGUW3Gw" elementId="org.efxclipse.e4.toolitem.save" iconURI="platform:/plugin/org.eclipse.fx.demo.media/icons/perspective/video-projector.png" command="_gvNokBpCEeKkV9yRGUW3Gw">
+ <parameters xmi:id="_M_pUYBpHEeKkV9yRGUW3Gw" elementId="targetPerspectiveId" name="targetPerspectiveId" value="perspective.videos"/>
+ </children>
+ </children>
+ </trimBars>
+ </children>
+ <handlers xmi:id="_qXDFgBpCEeKkV9yRGUW3Gw" elementId="org.eclipse.fx.demo.media.handler.0" contributionURI="bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.handlers.PerspectiveSwitcher" command="_gvNokBpCEeKkV9yRGUW3Gw"/>
+ <bindingTables xmi:id="_4jyYYRo_EeKkV9yRGUW3Gw" bindingContext="_4jxxURo_EeKkV9yRGUW3Gw"/>
+ <rootContext xmi:id="_4jxxURo_EeKkV9yRGUW3Gw" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
+ <children xmi:id="_4jxxUho_EeKkV9yRGUW3Gw" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
+ <children xmi:id="_4jxxUxo_EeKkV9yRGUW3Gw" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
+ </rootContext>
+ <commands xmi:id="_gvNokBpCEeKkV9yRGUW3Gw" elementId="open.perspective" commandName="Open Perspective">
+ <parameters xmi:id="_ATUywBpHEeKkV9yRGUW3Gw" elementId="targetPerspectiveId" name="targetPerspectiveId" optional="false"/>
+ </commands>
+ <addons xmi:id="_4jxxVBo_EeKkV9yRGUW3Gw" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
+ <addons xmi:id="_4jxxVRo_EeKkV9yRGUW3Gw" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
+ <addons xmi:id="_4jxxVho_EeKkV9yRGUW3Gw" elementId="org.eclipse.fx.ui.keybindings.e4.service" contributionURI="bundleclass://org.eclipse.fx.ui.keybindings.e4/org.eclipse.fx.ui.keybindings.e4.BindingServiceAddon"/>
+ <addons xmi:id="_4jxxVxo_EeKkV9yRGUW3Gw" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
+ <addons xmi:id="_4jxxWBo_EeKkV9yRGUW3Gw" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
+ <addons xmi:id="_4jxxWRo_EeKkV9yRGUW3Gw" elementId="org.eclipse.fx.ui.keybindings.e4.model" contributionURI="bundleclass://org.eclipse.fx.ui.keybindings.e4/org.eclipse.fx.ui.keybindings.e4.BindingProcessingAddon"/>
+ <addons xmi:id="_u8hucBuYEeKlzrHlbHdKDg" elementId="prespective.transitions.addon" contributionURI="bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.addon.PerspectiveAnimationAddon"/>
+ <addons xmi:id="_3c-AUL89EeKIBMNbSVZPsw" elementId="org.eclipse.e4.ui.workbench.addons.HandlerProcessingAddon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
+</application:Application>
diff --git a/demos/org.eclipse.fx.demo.media/IP-TODOS.txt b/demos/org.eclipse.fx.demo.media/IP-TODOS.txt
new file mode 100755
index 000000000..deb475199
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/IP-TODOS.txt
@@ -0,0 +1,23 @@
+Subtle Pattners (reative Commons Attribution-ShareAlike 3.0 Unported License):
+-------------------------------------------------------------------------------
+css/theme1/images/grunge_wall.png (http://subtlepatterns.com/?s=grunge_wall&submit=Search)
+css/theme1/images/low_contrast.png (http://subtlepatterns.com/?s=low_contrast&submit=Search)
+css/theme2/images/purty_wood.png (http://subtlepatterns.com/?s=purty_wood&submit=Search)
+
+Oxygene (LGPL):
+---------------
+From: svn -r 760421 co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/oxygen-icons
+
+icons/22/games-config-background.png
+icons/22/tool-animator.png
+icons/22/player-volume.png
+icons/perspective/camera-photo.png
+icons/perspective/preferences-system.png
+icons/perspective/video-projector.png
+icons/games-config-background.png
+icons/player-volume.png
+icons/tool-animator.png
+
+Dojo (Apache 2.0):
+------------------
+icons/resources/movs/mov1.flv (Video from http://svn.dojotoolkit.org/src/demos/trunk/video/media/)
diff --git a/demos/org.eclipse.fx.demo.media/META-INF/MANIFEST.MF b/demos/org.eclipse.fx.demo.media/META-INF/MANIFEST.MF
new file mode 100755
index 000000000..d511acbc5
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/META-INF/MANIFEST.MF
@@ -0,0 +1,56 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.fx.demo.media; singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.fx.demo.media.Activator
+Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="0.10.1",
+ org.eclipse.e4.core.services;bundle-version="1.0.0",
+ org.eclipse.e4.core.di;bundle-version="1.1.0",
+ org.eclipse.e4.ui.di;bundle-version="0.10.1",
+ org.eclipse.e4.core.di.extensions;bundle-version="0.11.0",
+ org.eclipse.e4.core.contexts;bundle-version="1.1.0",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.core.databinding.observable;bundle-version="1.4.1",
+ org.eclipse.core.databinding.property;bundle-version="1.4.100",
+ org.eclipse.e4.ui.workbench;bundle-version="0.10.2",
+ org.eclipse.equinox.common;bundle-version="3.6.100",
+ org.eclipse.e4.ui.services;bundle-version="0.10.1",
+ org.eclipse.equinox.preferences;bundle-version="3.5.0",
+ org.eclipse.fx.ui.workbench.renderers.base,
+ org.eclipse.fx.ui.animation,
+ org.eclipse.fx.ui.di,
+ org.eclipse.fx.ui.services
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+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.embed.swing;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",
+ javax.annotation;version="1.0.0",
+ javax.inject;version="1.0.0",
+ org.osgi.framework;version="1.3.0"
+Bundle-ActivationPolicy: lazy
diff --git a/demos/org.eclipse.fx.demo.media/OSGI-INF/l10n/bundle.properties b/demos/org.eclipse.fx.demo.media/OSGI-INF/l10n/bundle.properties
new file mode 100755
index 000000000..fb074383f
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.fx.demo.media
+product.name = org.eclipse.fx.demo.media
+Bundle-Name = Media \ No newline at end of file
diff --git a/demos/org.eclipse.fx.demo.media/build.properties b/demos/org.eclipse.fx.demo.media/build.properties
new file mode 100755
index 000000000..040638a95
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/build.properties
@@ -0,0 +1,8 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ css/default.css,\
+ Application.e4xmi,\
+ OSGI-INF/
+source.. = src/
diff --git a/demos/org.eclipse.fx.demo.media/css/default.css b/demos/org.eclipse.fx.demo.media/css/default.css
new file mode 100755
index 000000000..ad19bfaf0
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/css/default.css
@@ -0,0 +1,81 @@
+.MWindow {
+ -light-black: rgb(74, 75, 78);
+ -dark-highlight: rgb(87, 89, 92);
+ -dark-black: rgb(39, 40, 40);
+ -darkest-black: rgb(5, 5, 5);
+ -mid-gray: rgb(216, 222, 227);
+ -fx-background-color: -mid-gray;
+}
+
+.MTrimBar {
+ -fx-background-color:
+ linear-gradient(to bottom, derive(-fx-base,+50%),derive(-fx-base,-40%), derive(-fx-base,-20%));
+}
+
+#left_trim .tool-bar {
+ -fx-orientation: vertical;
+}
+
+.tool-bar {
+ -fx-background-color: transparent;
+ -fx-padding: .9em 0.416667em .9em 0.416667em;
+}
+
+.tool-bar .button {
+ -fx-background-color: transparent;
+ -fx-padding: 4;
+}
+
+.tool-bar .button:hover {
+ -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
+ -fx-color: -fx-hover-base;
+}
+
+.MPart {
+ -fx-background-image: url("theme1/images/grunge_wall.png");
+}
+
+.MPartStack {
+ -fx-background-image: url("theme1/images/low_contrast_linen.png");
+}
+
+.MPerspectiveStack {
+ -fx-background-image: url("theme1/images/low_contrast_linen.png");
+}
+
+.media-container {
+ -fx-background-color: null;
+ -fx-background-insets: 0;
+ -fx-padding: 0;
+}
+.media-container *.split-pane-divider{
+ -fx-padding: 0 1 0 0;
+ -fx-background-color: transparent, #333333;
+ -fx-background-insets: 0 -3 0 -3, 0;
+ -fx-border-color: null;
+}
+.media-container *.horizontal-grabber {
+ -fx-padding: 0;
+ -fx-shape: "";
+}
+
+.mediaList {
+ -fx-background-color:
+ linear-gradient(to bottom, derive(-fx-base,+50%),derive(-fx-base,-40%), derive(-fx-base,-20%));
+}
+
+.mediaList .list-cell {
+ -fx-background-color: transparent;
+}
+
+.mediaList .list-cell:selected {
+ -fx-background-color: -fx-selection-bar;
+}
+
+#switchPreview {
+ -fx-background-image: url("theme1/images/low_contrast_linen.png");
+}
+
+#configuration {
+ -fx-padding: 10px;
+} \ No newline at end of file
diff --git a/demos/org.eclipse.fx.demo.media/css/theme1/images/grunge_wall.png b/demos/org.eclipse.fx.demo.media/css/theme1/images/grunge_wall.png
new file mode 100755
index 000000000..fee4c932b
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/css/theme1/images/grunge_wall.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/css/theme1/images/low_contrast_linen.png b/demos/org.eclipse.fx.demo.media/css/theme1/images/low_contrast_linen.png
new file mode 100755
index 000000000..17b491eff
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/css/theme1/images/low_contrast_linen.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/css/theme2.css b/demos/org.eclipse.fx.demo.media/css/theme2.css
new file mode 100755
index 000000000..01e92422e
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/css/theme2.css
@@ -0,0 +1,81 @@
+.MWindow {
+ -light-black: rgb(74, 75, 78);
+ -dark-highlight: rgb(87, 89, 92);
+ -dark-black: rgb(39, 40, 40);
+ -darkest-black: rgb(5, 5, 5);
+ -mid-gray: rgb(216, 222, 227);
+ -fx-background-color: -mid-gray;
+}
+
+.MTrimBar {
+ -fx-background-color:
+ linear-gradient(to bottom, derive(rgb(194,111,41),+50%),derive(rgb(194,111,41),-40%), derive(rgb(194,111,41),-20%));
+}
+
+#left_trim .tool-bar {
+ -fx-orientation: vertical;
+}
+
+.tool-bar {
+ -fx-background-color: transparent;
+ -fx-padding: .9em 0.416667em .9em 0.416667em;
+}
+
+.tool-bar .button {
+ -fx-background-color: transparent;
+ -fx-padding: 4;
+}
+
+.tool-bar .button:hover {
+ -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
+ -fx-color: -fx-hover-base;
+}
+
+.MPart {
+ -fx-background-image: url("theme1/images/grunge_wall.png");
+}
+
+.MPartStack {
+ -fx-background-image: url("theme2/images/purty_wood.png");
+}
+
+.MPerspectiveStack {
+ -fx-background-image: url("theme2/images/purty_wood.png");
+}
+
+.media-container {
+ -fx-background-color: null;
+ -fx-background-insets: 0;
+ -fx-padding: 0;
+}
+.media-container *.split-pane-divider{
+ -fx-padding: 0 1 0 0;
+ -fx-background-color: transparent, #333333;
+ -fx-background-insets: 0 -3 0 -3, 0;
+ -fx-border-color: null;
+}
+.media-container *.horizontal-grabber {
+ -fx-padding: 0;
+ -fx-shape: "";
+}
+
+.mediaList {
+ -fx-background-color:
+ linear-gradient(to bottom, derive(rgb(194,111,41),+50%),derive(rgb(194,111,41),-40%), derive(rgb(194,111,41),-20%));
+}
+
+.mediaList .list-cell {
+ -fx-background-color: transparent;
+}
+
+.mediaList .list-cell:selected {
+ -fx-background-color: -fx-selection-bar;
+}
+
+#switchPreview {
+ -fx-background-image: url("theme1/images/low_contrast_linen.png");
+}
+
+#configuration {
+ -fx-padding: 10px;
+} \ No newline at end of file
diff --git a/demos/org.eclipse.fx.demo.media/css/theme2/images/purty_wood.png b/demos/org.eclipse.fx.demo.media/css/theme2/images/purty_wood.png
new file mode 100755
index 000000000..37fcd078e
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/css/theme2/images/purty_wood.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/.DS_Store b/demos/org.eclipse.fx.demo.media/icons/.DS_Store
new file mode 100644
index 000000000..53fb05154
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/.DS_Store
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/22/games-config-background.png b/demos/org.eclipse.fx.demo.media/icons/22/games-config-background.png
new file mode 100755
index 000000000..65e0dcb1b
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/22/games-config-background.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/22/kaffeine.png b/demos/org.eclipse.fx.demo.media/icons/22/kaffeine.png
new file mode 100755
index 000000000..01ab59d3f
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/22/kaffeine.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/22/player-volume.png b/demos/org.eclipse.fx.demo.media/icons/22/player-volume.png
new file mode 100755
index 000000000..fd0ba4841
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/22/player-volume.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/games-config-background.png b/demos/org.eclipse.fx.demo.media/icons/games-config-background.png
new file mode 100755
index 000000000..4a5680083
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/games-config-background.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/kaffeine.png b/demos/org.eclipse.fx.demo.media/icons/kaffeine.png
new file mode 100755
index 000000000..5eb32a408
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/kaffeine.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/perspective/camera-photo.png b/demos/org.eclipse.fx.demo.media/icons/perspective/camera-photo.png
new file mode 100755
index 000000000..2d231be9c
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/perspective/camera-photo.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/perspective/preferences-system.png b/demos/org.eclipse.fx.demo.media/icons/perspective/preferences-system.png
new file mode 100755
index 000000000..507444ef1
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/perspective/preferences-system.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/perspective/video-projector.png b/demos/org.eclipse.fx.demo.media/icons/perspective/video-projector.png
new file mode 100755
index 000000000..982e0bb93
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/perspective/video-projector.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/player-volume.png b/demos/org.eclipse.fx.demo.media/icons/player-volume.png
new file mode 100755
index 000000000..3b2011219
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/player-volume.png
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/.DS_Store b/demos/org.eclipse.fx.demo.media/icons/resources/.DS_Store
new file mode 100644
index 000000000..1a9ab469b
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/.DS_Store
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/movs/.gitignore b/demos/org.eclipse.fx.demo.media/icons/resources/movs/.gitignore
new file mode 100755
index 000000000..83a44c747
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/movs/.gitignore
@@ -0,0 +1,2 @@
+/bourne4.mp4
+/java_vs_net.mp4
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/movs/file.txt b/demos/org.eclipse.fx.demo.media/icons/resources/movs/file.txt
new file mode 100755
index 000000000..186511323
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/movs/file.txt
@@ -0,0 +1 @@
+Video from http://svn.dojotoolkit.org/src/demos/trunk/video/media/ \ No newline at end of file
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/movs/mov1.flv b/demos/org.eclipse.fx.demo.media/icons/resources/movs/mov1.flv
new file mode 100755
index 000000000..aa98be480
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/movs/mov1.flv
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic1.jpg b/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic1.jpg
new file mode 100755
index 000000000..0282bfe45
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic1.jpg
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic2.jpg b/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic2.jpg
new file mode 100755
index 000000000..52f0cf1ef
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/icons/resources/pics/pic2.jpg
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product b/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product
new file mode 100755
index 000000000..90ae6d9f6
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="org.eclipse.fx.demo.media" id="org.eclipse.fx.demo.media.product" application="org.eclipse.fx.ui.workbench.fx.application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <programArgs>-nosplash</programArgs>
+ <vmArgs>-Dosgi.framework.extensions=org.eclipse.fx.osgi</vmArgs>
+ </launcherArgs>
+
+ <windowImages/>
+
+ <plugins>
+ <plugin id="com.ibm.icu"/>
+ <plugin id="javax.annotation"/>
+ <plugin id="javax.inject"/>
+ <plugin id="javax.xml"/>
+ <plugin id="org.apache.commons.logging"/>
+ <plugin id="org.eclipse.core.commands"/>
+ <plugin id="org.eclipse.core.contenttype"/>
+ <plugin id="org.eclipse.core.databinding"/>
+ <plugin id="org.eclipse.core.databinding.observable"/>
+ <plugin id="org.eclipse.core.databinding.property"/>
+ <plugin id="org.eclipse.core.expressions"/>
+ <plugin id="org.eclipse.core.filesystem"/>
+ <plugin id="org.eclipse.core.jobs"/>
+ <plugin id="org.eclipse.core.resources"/>
+ <plugin id="org.eclipse.core.runtime"/>
+ <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
+ <plugin id="org.eclipse.e4.core.commands"/>
+ <plugin id="org.eclipse.e4.core.contexts"/>
+ <plugin id="org.eclipse.e4.core.di"/>
+ <plugin id="org.eclipse.e4.core.di.extensions"/>
+ <plugin id="org.eclipse.e4.core.services"/>
+ <plugin id="org.eclipse.e4.ui.di"/>
+ <plugin id="org.eclipse.e4.ui.model.workbench"/>
+ <plugin id="org.eclipse.e4.ui.services"/>
+ <plugin id="org.eclipse.e4.ui.workbench"/>
+ <plugin id="org.eclipse.emf.common"/>
+ <plugin id="org.eclipse.emf.databinding"/>
+ <plugin id="org.eclipse.emf.ecore"/>
+ <plugin id="org.eclipse.emf.ecore.change"/>
+ <plugin id="org.eclipse.emf.ecore.xmi"/>
+ <plugin id="org.eclipse.equinox.app"/>
+ <plugin id="org.eclipse.equinox.common"/>
+ <plugin id="org.eclipse.equinox.concurrent"/>
+ <plugin id="org.eclipse.equinox.ds"/>
+ <plugin id="org.eclipse.equinox.event"/>
+ <plugin id="org.eclipse.equinox.preferences"/>
+ <plugin id="org.eclipse.equinox.registry"/>
+ <plugin id="org.eclipse.equinox.util"/>
+ <plugin id="org.eclipse.fx.core"/>
+ <plugin id="org.eclipse.fx.core.databinding"/>
+ <plugin id="org.eclipse.fx.demo.media"/>
+ <plugin id="org.eclipse.fx.javafx"/>
+ <plugin id="org.eclipse.fx.osgi" fragment="true"/>
+ <plugin id="org.eclipse.fx.osgi.util"/>
+ <plugin id="org.eclipse.fx.ui.animation"/>
+ <plugin id="org.eclipse.fx.ui.application"/>
+ <plugin id="org.eclipse.fx.ui.databinding"/>
+ <plugin id="org.eclipse.fx.ui.di"/>
+ <plugin id="org.eclipse.fx.ui.dialogs"/>
+ <plugin id="org.eclipse.fx.ui.keybindings"/>
+ <plugin id="org.eclipse.fx.ui.keybindings.e4"/>
+ <plugin id="org.eclipse.fx.ui.keybindings.generic"/>
+ <plugin id="org.eclipse.fx.ui.panes"/>
+ <plugin id="org.eclipse.fx.ui.services"/>
+ <plugin id="org.eclipse.fx.ui.theme"/>
+ <plugin id="org.eclipse.fx.ui.workbench.base"/>
+ <plugin id="org.eclipse.fx.ui.workbench.fx"/>
+ <plugin id="org.eclipse.fx.ui.workbench.fx.controls"/>
+ <plugin id="org.eclipse.fx.ui.workbench.renderers.base"/>
+ <plugin id="org.eclipse.fx.ui.workbench.renderers.fx"/>
+ <plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.osgi.services"/>
+ </plugins>
+
+
+</product>
diff --git a/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product_workspace.launch b/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product_workspace.launch
new file mode 100644
index 000000000..2845025f7
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product_workspace.launch
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.fx.ui.workbench.fx.application"/>
+<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.demo.media.product"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../runtime-org.eclipse.fx.demo.media.product"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
+<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.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-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.demo.media.product"/>
+<stringAttribute key="productFile" value="/org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.product"/>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,javax.annotation@default:default,javax.inject@default:default,javax.xml@default:default,org.apache.commons.logging@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.fx.javafx@default:default,org.eclipse.fx.osgi@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.fx.core.databinding@default:default,org.eclipse.fx.core@default:default,org.eclipse.fx.demo.media@default:default,org.eclipse.fx.osgi.util@default:default,org.eclipse.fx.ui.animation@default:default,org.eclipse.fx.ui.application@default:default,org.eclipse.fx.ui.databinding@default:default,org.eclipse.fx.ui.di@default:default,org.eclipse.fx.ui.dialogs@default:default,org.eclipse.fx.ui.keybindings.e4@default:default,org.eclipse.fx.ui.keybindings.generic@default:default,org.eclipse.fx.ui.keybindings@default:default,org.eclipse.fx.ui.panes@default:default,org.eclipse.fx.ui.services@default:default,org.eclipse.fx.ui.theme@default:default,org.eclipse.fx.ui.workbench.base@default:default,org.eclipse.fx.ui.workbench.fx.controls@default:default,org.eclipse.fx.ui.workbench.fx@default:default,org.eclipse.fx.ui.workbench.renderers.base@default:default,org.eclipse.fx.ui.workbench.renderers.fx@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="true"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
diff --git a/demos/org.eclipse.fx.demo.media/plugin.xml b/demos/org.eclipse.fx.demo.media/plugin.xml
new file mode 100755
index 000000000..9c1520094
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/plugin.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin>
+
+ <extension
+ id="product"
+ point="org.eclipse.core.runtime.products">
+ <product
+ name="org.eclipse.fx.demo.media"
+ application="org.eclipse.fx.ui.workbench.fx.application">
+ <property
+ name="appName"
+ value="org.eclipse.fx.demo.media">
+ </property>
+ <property
+ name="applicationXMI"
+ value="org.eclipse.fx.demo.media/Application.e4xmi">
+ </property>
+ <property
+ name="cssTheme"
+ value="default.theme">
+ </property>
+ </product>
+ </extension>
+ <extension
+ point="org.eclipse.fx.ui.theme">
+ <theme
+ basestylesheet="css/default.css"
+ id="default.theme"
+ name="Default Theme">
+ </theme>
+ <theme
+ basestylesheet="css/theme2.css"
+ id="wood.theme"
+ name="Wood Theme">
+ </theme>
+ </extension>
+
+</plugin>
diff --git a/demos/org.eclipse.fx.demo.media/src/.DS_Store b/demos/org.eclipse.fx.demo.media/src/.DS_Store
new file mode 100644
index 000000000..5df2016a4
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/.DS_Store
Binary files differ
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/Activator.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/Activator.java
new file mode 100755
index 000000000..f04d4565f
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/Activator.java
@@ -0,0 +1,30 @@
+package org.eclipse.fx.demo.media;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/addon/PerspectiveAnimationAddon.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/addon/PerspectiveAnimationAddon.java
new file mode 100755
index 000000000..89fb28d29
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/addon/PerspectiveAnimationAddon.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.demo.media.addon;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javafx.scene.Node;
+import javafx.scene.layout.BorderPane;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.fx.ui.animation.pagetransition.CenterSwitchAnimation;
+import org.eclipse.fx.ui.animation.pagetransition.animation.FadeAnimation;
+import org.eclipse.fx.ui.animation.pagetransition.animation.PageChangeAnimation;
+import org.eclipse.fx.ui.animation.pagetransition.animation.ZoomSlideAnimation;
+import org.eclipse.fx.ui.workbench.renderers.base.services.PerspectiveTransitionService;
+
+@SuppressWarnings("restriction")
+public class PerspectiveAnimationAddon {
+
+ @PostConstruct
+ void init(IEclipseContext context) {
+ TransitionImpl impl = ContextInjectionFactory.make(TransitionImpl.class, context);
+ context.set(PerspectiveTransitionService.class, impl);
+ context.set(TransitionImpl.class, impl);
+ }
+
+ public static class TransitionImpl implements PerspectiveTransitionService<BorderPane, Node> {
+ private Map<String, CenterSwitchAnimation> animations = new HashMap<String, CenterSwitchAnimation>();
+
+ @Inject
+ @Preference("perspectiveTransition")
+ @Optional
+ private String transition;
+
+ public TransitionImpl() {
+ animations.put("FadeAnimation", new FadeAnimation());
+ animations.put("PageChangeAnimation", new PageChangeAnimation());
+ animations.put("ZoomSlideAnimation", new ZoomSlideAnimation());
+ }
+
+ public Map<String, CenterSwitchAnimation> getAnimations() {
+ return Collections.unmodifiableMap(animations);
+ }
+
+ @Override
+ public AnimationDelegate<BorderPane, Node> getDelegate(MPerspective fromPerspective, MPerspective toPerspective) {
+ if( transition != null ) {
+ final String animation;
+ if( "perspective.configuration".equals(toPerspective.getElementId()) || "perspective.configuration".equals(fromPerspective.getElementId())) {
+ animation= "FadeAnimation";
+ } else {
+ animation = transition;
+ }
+
+ return new AnimationDelegate<BorderPane, Node>() {
+ @Override
+ public void animate(BorderPane container, Node control) {
+ animations.get(animation).animate(container, control);
+ }
+ };
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/handlers/PerspectiveSwitcher.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/handlers/PerspectiveSwitcher.java
new file mode 100755
index 000000000..73093b848
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/handlers/PerspectiveSwitcher.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.demo.media.handlers;
+
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+
+@SuppressWarnings("restriction")
+public class PerspectiveSwitcher {
+ @Execute
+ public void switchToPerspective(@Named("targetPerspectiveId")String perspectiveId, MApplication application, EPartService partService, EModelService modelService) {
+ MPerspective p = (MPerspective) modelService.find(perspectiveId, application);
+ partService.switchPerspective(p);
+ }
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/Media.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/Media.java
new file mode 100755
index 000000000..165a16639
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/Media.java
@@ -0,0 +1,66 @@
+package org.eclipse.fx.demo.media.model;
+
+import javafx.beans.property.ReadOnlyObjectProperty;
+import javafx.beans.property.SimpleObjectProperty;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
+
+public class Media {
+ private ReadOnlyObjectProperty<MediaType> type;
+ private SimpleStringProperty name = new SimpleStringProperty(this, "name");
+ private SimpleStringProperty url = new SimpleStringProperty(this, "url");
+
+ public Media(MediaType type) {
+ this.type = new SimpleObjectProperty<MediaType>(this, "type", type);
+ }
+
+ public Media(MediaType type, String name, String url) {
+ this(type);
+ this.name.set(name);
+ this.url.set(url);
+ }
+
+ public MediaType getType() {
+ return this.type.get();
+ }
+
+ public ReadOnlyObjectProperty<MediaType> type() {
+ return type;
+ }
+
+ public void setName(String name) {
+ this.name.set(name);
+ }
+
+ public String getName() {
+ return this.name.get();
+ }
+
+ public StringProperty name() {
+ return this.name;
+ }
+
+ public void setUrl(String url) {
+ this.url.set(url);
+ }
+
+ public String getUrl() {
+ return this.url.get();
+ }
+
+ public StringProperty url() {
+ return this.url;
+ }
+
+ public static final String serialize(Media media) {
+ return media.type.getValue().name() + "##_##" + media.name.getValue() + "##_##" + media.url.getValue();
+ }
+
+ public static final Media deserialize(String serializedObject) {
+ String[] parts = serializedObject.split("##_##");
+ Media m = new Media(MediaType.valueOf(parts[0]));
+ m.setName(parts[1]);
+ m.setUrl(parts[2]);
+ return m;
+ }
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/MediaType.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/MediaType.java
new file mode 100755
index 000000000..7947f9c5c
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/model/MediaType.java
@@ -0,0 +1,7 @@
+package org.eclipse.fx.demo.media.model;
+
+public enum MediaType {
+ MOVIE,
+ SOUND,
+ PICTURE
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxgraph b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxgraph
new file mode 100755
index 000000000..6326b70fe
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxgraph
@@ -0,0 +1,45 @@
+package org.eclipse.fx.demo.media.parts
+
+import javafx.scene.layout.GridPane
+import javafx.scene.control.Label
+import javafx.scene.control.ChoiceBox
+import javafx.scene.layout.BorderPane
+import javafx.scene.image.ImageView
+import org.eclipse.fx.demo.media.parts.ConfigurationPartControler
+
+component ConfigurationEditor styledwith "/css/default.css" controlledby ConfigurationPartControler {
+ GridPane {
+ hgap : 5,
+ vgap : 5,
+ children : [
+ Label {
+ text : "Theme",
+ static columnIndex : 0,
+ static rowIndex : 0
+ },
+ ChoiceBox id themeId {
+ static columnIndex : 1,
+ static rowIndex : 0
+ },
+ Label {
+ text : "Transition",
+ static columnIndex : 0,
+ static rowIndex : 1
+ },
+ ChoiceBox id switchType {
+ static columnIndex : 1,
+ static rowIndex : 1
+ },
+ BorderPane id switchPreview {
+ prefWidth : 200,
+ prefHeight : 150,
+ maxWidth : 200,
+ maxHeight : 150,
+ minWidth : 200,
+ minHeight : 150,
+ static columnIndex : 1,
+ static rowIndex : 2
+ }
+ ]
+ }
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxml b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxml
new file mode 100644
index 000000000..90f3af959
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Do not edit this file it is generated by e(fx)clipse from ../src/org/eclipse/fx/demo/media/parts/ConfigurationEditor.fxgraph
+-->
+
+<?import java.lang.*?>
+<?import javafx.scene.control.ChoiceBox?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.layout.BorderPane?>
+<?import javafx.scene.layout.GridPane?>
+<?scenebuilder-stylesheet /css/default.css?>
+
+<GridPane xmlns:fx="http://javafx.com/fxml" fx:controller="org.eclipse.fx.demo.media.parts.ConfigurationPartControler" hgap="5" vgap="5">
+
+ <children>
+ <Label text="Theme" GridPane.columnIndex="0" GridPane.rowIndex="0"/>
+ <ChoiceBox fx:id="themeId" GridPane.columnIndex="1" GridPane.rowIndex="0"/>
+ <Label text="Transition" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
+ <ChoiceBox fx:id="switchType" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
+ <BorderPane fx:id="switchPreview" prefWidth="200" prefHeight="150" maxWidth="200" maxHeight="150" minWidth="200" minHeight="150" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
+ </children>
+</GridPane>
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPart.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPart.java
new file mode 100755
index 000000000..c3ae54ba3
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPart.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.demo.media.parts;
+
+import java.io.IOException;
+
+import javafx.scene.layout.BorderPane;
+import javafx.scene.layout.GridPane;
+
+import javax.annotation.PostConstruct;
+
+import org.eclipse.fx.ui.di.FXMLBuilder;
+import org.eclipse.fx.ui.di.FXMLLoader;
+import org.eclipse.fx.ui.di.FXMLLoaderFactory;
+
+public class ConfigurationPart {
+
+ @PostConstruct
+ void init(BorderPane parent, @FXMLLoader FXMLLoaderFactory factory) {
+ try {
+ FXMLBuilder<GridPane> builder = factory.loadRequestorRelative("ConfigurationEditor.fxml");
+ GridPane p = builder.load();
+ parent.setTop(p);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPartControler.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPartControler.java
new file mode 100755
index 000000000..c9ed8aade
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/ConfigurationPartControler.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.demo.media.parts;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.ResourceBundle;
+
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.shape.Rectangle;
+
+import javax.inject.Inject;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.di.extensions.Preference;
+import org.eclipse.fx.demo.media.addon.PerspectiveAnimationAddon.TransitionImpl;
+import org.eclipse.fx.ui.animation.pagetransition.CenterSwitchAnimation;
+import org.eclipse.fx.ui.services.theme.Theme;
+import org.eclipse.fx.ui.services.theme.ThemeManager;
+import org.osgi.service.prefs.BackingStoreException;
+
+@SuppressWarnings("restriction")
+public class ConfigurationPartControler implements Initializable {
+ @Inject
+ TransitionImpl transitionService;
+
+ @Inject
+ @Preference("perspectiveTransition")
+ @Optional
+ String transition;
+
+ @Inject
+ ThemeManager manager;
+
+ @FXML
+ ChoiceBox<String> themeId;
+ @FXML
+ ChoiceBox<String> switchType;
+ @FXML
+ BorderPane switchPreview;
+
+
+ @Override
+ public void initialize(URL location, ResourceBundle resources) {
+ {
+ ObservableList<String> items = FXCollections.observableArrayList();
+ for( Theme t : manager.getAvailableThemes() ) {
+ items.add(t.getName());
+ }
+
+ themeId.setItems(items);
+
+ for( int i = 0; i < items.size(); i++ ) {
+ if( items.get(i).equals(manager.getCurrentTheme().getName()) ) {
+ themeId.getSelectionModel().select(i);
+ break;
+ }
+ }
+
+ themeId.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
+
+ @Override
+ public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
+ manager.setCurrentThemeId(manager.getAvailableThemes().get(newValue.intValue()).getId());
+ }
+ });
+ }
+
+ {
+ ObservableList<String> items = FXCollections.observableArrayList();
+ for (String e : transitionService.getAnimations().keySet()) {
+ items.add(e);
+ }
+ Collections.sort(items);
+ items.add(0, "<NONE>");
+ switchType.setItems(items);
+
+ final ImageView view1 = new ImageView(new Image(getClass().getClassLoader().getResourceAsStream("/icons/resources/pics/pic1.jpg")));
+ view1.setFitWidth(200);
+ view1.setFitHeight(150);
+
+ final ImageView view2 = new ImageView(new Image(getClass().getClassLoader().getResourceAsStream("/icons/resources/pics/pic2.jpg")));
+ view2.setFitWidth(200);
+ view2.setFitHeight(150);
+
+ switchPreview.setCenter(view1);
+ switchPreview.setClip(new Rectangle(200, 150));
+ if( transition == null ) {
+ switchType.getSelectionModel().select(0);
+ } else {
+ for( int i = 0; i < items.size(); i++ ) {
+ if( items.get(i).equals(transition) ) {
+ switchType.getSelectionModel().select(i);
+ break;
+ }
+ }
+ }
+ switchType.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
+
+ @Override
+ public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
+ if(! "<NONE>".equals(newValue) ) {
+ CenterSwitchAnimation a = transitionService.getAnimations().get(newValue);
+ if( a != null ) {
+ a.animate(switchPreview, switchPreview.getCenter() == view1 ? view2 : view1);
+ updateTransitionPreference(newValue);
+ } else {
+ updateTransitionPreference(null);
+ }
+ } else {
+ updateTransitionPreference(null);
+ }
+ }
+ });
+ }
+ }
+
+ private void updateTransitionPreference(String newValue) {
+ IEclipsePreferences preference = InstanceScope.INSTANCE.getNode("org.eclipse.fx.demo.media");
+ preference.put("perspectiveTransition", newValue);
+ try {
+ preference.flush();
+ } catch (BackingStoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaListPart.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaListPart.java
new file mode 100755
index 000000000..d1ba54d5c
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaListPart.java
@@ -0,0 +1,133 @@
+package org.eclipse.fx.demo.media.parts;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.control.ListCell;
+import javafx.scene.control.ListView;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.BorderPane;
+import javafx.util.Callback;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.model.application.ui.basic.MStackElement;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.fx.demo.media.model.Media;
+import org.eclipse.fx.demo.media.model.MediaType;
+
+@SuppressWarnings("restriction")
+public class MediaListPart {
+ static class MediaCell extends ListCell<Media> {
+ @Override
+ protected void updateItem(Media item, boolean empty) {
+ if( ! empty && item != null ) {
+ setText(item.getName());
+ switch (item.getType()) {
+ case MOVIE:
+ setGraphic(new ImageView("platform:/plugin/org.eclipse.fx.demo.media/icons/kaffeine.png"));
+ break;
+ case PICTURE:
+ setGraphic(new ImageView("platform:/plugin/org.eclipse.fx.demo.media/icons/games-config-background.png"));
+ break;
+ default:
+ setGraphic(new ImageView("platform:/plugin/org.eclipse.fx.demo.media/icons/player-volume.png"));
+ break;
+ }
+ }
+ super.updateItem(item, empty);
+ }
+ }
+
+
+ @Inject
+ EPartService partService;
+
+ @Inject
+ EModelService modelService;
+
+ @Inject
+ MPerspective perspective;
+
+ private ListView<Media> list;
+
+ @PostConstruct
+ void init(BorderPane pane) {
+ list = new ListView<Media>(createList("perspective.videos".equals(perspective.getElementId())));
+ list.getStyleClass().add("mediaList");
+ list.setCellFactory(new Callback<ListView<Media>, ListCell<Media>>() {
+
+ @Override
+ public ListCell<Media> call(ListView<Media> param) {
+ return new MediaCell();
+ }
+ });
+ list.setOnMouseClicked(new EventHandler<MouseEvent>() {
+
+ @Override
+ public void handle(MouseEvent event) {
+ if( event.getClickCount() > 1 ) {
+ handleOpen();
+ }
+ }
+ });
+ pane.setCenter(list);
+ }
+
+ void handleOpen() {
+ MPartStack stack = (MPartStack) modelService.find("content.stack", perspective);
+ Media m = list.getSelectionModel().getSelectedItem();
+
+ if( m != null ) {
+ String instance = Media.serialize(m);
+
+ for( MStackElement e : stack.getChildren() ) {
+ if( e instanceof MPart ) {
+ if( instance.equals(e.getPersistedState().get(MediaPart.MEDIA_OBJECT_KEY)) ) {
+ partService.activate((MPart) e);
+ return;
+ }
+ }
+ }
+
+ MPart p = MBasicFactory.INSTANCE.createPart();
+ p.setLabel(m.getName());
+ if( m.getType() == MediaType.MOVIE ) {
+ p.setIconURI("platform:/plugin/org.eclipse.fx.demo.media/icons/22/kaffeine.png");
+ } else if( m.getType() == MediaType.PICTURE ) {
+ p.setIconURI("platform:/plugin/org.eclipse.fx.demo.media/icons/22/games-config-background.png");
+ } else {
+ p.setIconURI("platform:/plugin/org.eclipse.fx.demo.media/icons/22/player-volume.png");
+ }
+
+ p.setContributionURI("bundleclass://org.eclipse.fx.demo.media/org.eclipse.fx.demo.media.parts.MediaPart");
+ p.getPersistedState().put(MediaPart.MEDIA_OBJECT_KEY, instance);
+ stack.getChildren().add(p);
+ partService.activate(p,true);
+ }
+ }
+
+ @Focus
+ void focus() {
+ list.requestFocus();
+ }
+
+ private static ObservableList<Media> createList(boolean videos) {
+ ObservableList<Media> l = FXCollections.observableArrayList();
+ if( ! videos ) {
+ l.add(new Media(MediaType.PICTURE, "Mountains 1", "platform:/plugin/org.eclipse.fx.demo.media/icons/resources/pics/pic1.jpg"));
+ l.add(new Media(MediaType.PICTURE, "Mountains 2", "platform:/plugin/org.eclipse.fx.demo.media/icons/resources/pics/pic2.jpg"));
+ } else {
+ l.add(new Media(MediaType.MOVIE, "Grog", "platform:/plugin/org.eclipse.fx.demo.media/icons/resources/movs/mov1.flv"));
+ }
+ return l;
+ }
+} \ No newline at end of file
diff --git a/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaPart.java b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaPart.java
new file mode 100755
index 000000000..2ab02cbcf
--- /dev/null
+++ b/demos/org.eclipse.fx.demo.media/src/org/eclipse/fx/demo/media/parts/MediaPart.java
@@ -0,0 +1,241 @@
+package org.eclipse.fx.demo.media.parts;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javafx.event.EventHandler;
+import javafx.scene.Node;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.input.ScrollEvent;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.media.MediaPlayer;
+import javafx.scene.media.MediaView;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.fx.demo.media.model.Media;
+import org.eclipse.fx.demo.media.model.MediaType;
+
+@SuppressWarnings("restriction")
+public class MediaPart {
+ public static final String MEDIA_OBJECT_KEY = "MediaObject";
+
+ private static final String KEY_TRANSLATE_X = "translateX";
+ private static final String KEY_TRANSLATE_Y = "translateY";
+ private static final String KEY_SCALE_FACTOR = "scale";
+
+ @Inject
+ MPart part;
+
+ @Inject
+ MPerspective perspective;
+
+ private MediaPlayer mediaPlayer;
+
+ private Node focusNode;
+
+ @PostConstruct
+ void init(BorderPane p) {
+ Media m = Media.deserialize(part.getPersistedState().get(MEDIA_OBJECT_KEY));
+ if( m.getType() == MediaType.PICTURE ) {
+ initPicture(p, m);
+ } else if( m.getType() == MediaType.MOVIE ) {
+ initMovie(p, m);
+ } else {
+ initSound(p, m);
+ }
+ }
+
+ private void initPicture(BorderPane p, Media m) {
+ final AnchorPane transformStack = new AnchorPane();
+ String scaleFactor = part.getPersistedState().get(KEY_SCALE_FACTOR);
+ String translateX = part.getPersistedState().get(KEY_TRANSLATE_X);
+ String translateY = part.getPersistedState().get(KEY_TRANSLATE_Y);
+
+ if( scaleFactor != null ) {
+ transformStack.setScaleX(Double.parseDouble(scaleFactor));
+ transformStack.setScaleY(Double.parseDouble(scaleFactor));
+ }
+
+ if( translateX != null ) {
+ transformStack.setTranslateX(Double.parseDouble(translateX));
+ }
+
+ if( translateY != null ) {
+ transformStack.setTranslateY(Double.parseDouble(translateY));
+ }
+
+
+ final ImageView v = new ImageView(m.getUrl());
+ focusNode = v;
+ transformStack.getChildren().add(v);
+ p.setCenter(transformStack);
+ p.setOnScroll(new EventHandler<ScrollEvent>() {
+
+ @Override
+ public void handle(ScrollEvent event) {
+ int direction = event.getDeltaY() < 0 || event.isShiftDown() ? -1 : 1;
+ double val = Math.max(transformStack.getScaleX() + 0.05 * direction,0.1);
+ transformStack.setScaleX(val);
+ transformStack.setScaleY(val);
+ part.getPersistedState().put(KEY_SCALE_FACTOR, val+"");
+ }
+ });
+
+ final AtomicReference<MouseEvent> deltaEvent = new AtomicReference<MouseEvent>();
+ p.setOnMousePressed(new EventHandler<MouseEvent>() {
+
+ @Override
+ public void handle(MouseEvent event) {
+ deltaEvent.set(event);
+ }
+ });
+
+ p.setOnMouseDragged(new EventHandler<MouseEvent>() {
+
+ @Override
+ public void handle(MouseEvent event) {
+ double deltaX = event.getX() - deltaEvent.get().getX();
+ double deltaY = event.getY() - deltaEvent.get().getY();
+
+ double targetX = transformStack.getTranslateX() + deltaX;
+ double targetY = transformStack.getTranslateY() + deltaY;
+ transformStack.setTranslateX(targetX);
+ transformStack.setTranslateY(targetY);
+ part.getPersistedState().put(KEY_TRANSLATE_X, targetX+"");
+ part.getPersistedState().put(KEY_TRANSLATE_Y, targetY+"");
+
+ deltaEvent.set(event);
+ }
+ });
+ }
+
+ @Inject
+ void startMovie(@Named(IServiceConstants.ACTIVE_PART) MPart activePart) {
+ if( mediaPlayer != null ) {
+ if( activePart == part ) {
+ mediaPlayer.play();
+ } else {
+ mediaPlayer.pause();
+ }
+ }
+ }
+
+ private void initMovie(BorderPane p, Media m) {
+ mediaPlayer = new MediaPlayer(new javafx.scene.media.Media(platformUriFix(m.getUrl())));
+ mediaPlayer.setAutoPlay(true);
+
+ final AnchorPane transformStack = new AnchorPane();
+ String scaleFactor = part.getPersistedState().get(KEY_SCALE_FACTOR);
+ String translateX = part.getPersistedState().get(KEY_TRANSLATE_X);
+ String translateY = part.getPersistedState().get(KEY_TRANSLATE_Y);
+
+ if( scaleFactor != null ) {
+ transformStack.setScaleX(Double.parseDouble(scaleFactor));
+ transformStack.setScaleY(Double.parseDouble(scaleFactor));
+ }
+
+ if( translateX != null ) {
+ transformStack.setTranslateX(Double.parseDouble(translateX));
+ }
+
+ if( translateY != null ) {
+ transformStack.setTranslateY(Double.parseDouble(translateY));
+ }
+
+ final MediaView mediaView = new MediaView(mediaPlayer);
+ focusNode = mediaView;
+ focusNode = mediaView;
+ transformStack.getChildren().add(mediaView);
+ p.setCenter(transformStack);
+ p.setOnScroll(new EventHandler<ScrollEvent>() {
+
+ @Override
+ public void handle(ScrollEvent event) {
+ int direction = event.getDeltaY() < 0 || event.isShiftDown() ? -1 : 1;
+ double val = Math.max(transformStack.getScaleX() + 0.05 * direction,0.1);
+ transformStack.setScaleX(val);
+ transformStack.setScaleY(val);
+ part.getPersistedState().put(KEY_SCALE_FACTOR, val+"");
+ }
+ });
+
+ final AtomicReference<MouseEvent> deltaEvent = new AtomicReference<MouseEvent>();
+ p.setOnMousePressed(new EventHandler<MouseEvent>() {
+
+ @Override
+ public void handle(MouseEvent event) {
+ deltaEvent.set(event);
+ }
+ });
+
+ p.setOnMouseDragged(new EventHandler<MouseEvent>() {
+
+ @Override
+ public void handle(MouseEvent event) {
+ double deltaX = event.getX() - deltaEvent.get().getX();
+ double deltaY = event.getY() - deltaEvent.get().getY();
+
+ double targetX = transformStack.getTranslateX() + deltaX;
+ double targetY = transformStack.getTranslateY() + deltaY;
+ transformStack.setTranslateX(targetX);
+ transformStack.setTranslateY(targetY);
+ part.getPersistedState().put(KEY_TRANSLATE_X, targetX+"");
+ part.getPersistedState().put(KEY_TRANSLATE_Y, targetY+"");
+
+ deltaEvent.set(event);
+ }
+ });
+ }
+
+ @Focus
+ void focus() {
+ if( focusNode != null ) {
+ focusNode.requestFocus();
+ }
+ }
+
+ private String platformUriFix(String uri) {
+ if( uri.startsWith("platform:") ) {
+ try {
+ URL url = new URL(uri);
+ InputStream in = url.openStream();
+ byte[] buf = new byte[1024];
+ int l;
+ File f = File.createTempFile("movie", "");
+ FileOutputStream out = new FileOutputStream(f);
+ while( (l = in.read(buf)) != -1 ) {
+ out.write(buf, 0, l);
+ }
+ out.close();
+ return f.toURI().toURL().toExternalForm();
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return uri;
+ } else {
+ return uri;
+ }
+ }
+
+ private void initSound(BorderPane p, Media m) {
+
+ }
+} \ No newline at end of file

Back to the top