From 90a195a3eefa60ba96226a4823ecd4e4ae55b580 Mon Sep 17 00:00:00 2001 From: Normen Hansen Date: Thu, 22 Jan 2015 16:35:38 +0100 Subject: [PATCH] - Move OgreXML Support layer registration to Annotations --- sdk/jme3-ogrexml/manifest.mf | 1 - .../nbproject/genfiles.properties | 8 +- .../com/jme3/gde/ogrexml/Bundle.properties | 5 - .../gde/ogrexml/OgreMaterialDataObject.java | 8 + .../jme3/gde/ogrexml/OgreMaterialResolver.xml | 12 - .../jme3/gde/ogrexml/OgreSceneDataObject.java | 35 +++ .../jme3/gde/ogrexml/OgreSceneResolver.xml | 17 -- .../jme3/gde/ogrexml/OgreXMLDataObject.java | 35 +++ .../com/jme3/gde/ogrexml/OgreXMLResolver.xml | 17 -- .../ogrexml/OgreXMLSkeletonDataObject.java | 9 + .../gde/ogrexml/OgreXMLSkeletonResolver.xml | 16 -- .../com/jme3/gde/ogrexml/OgreXMLTemplate.xml | 2 - .../src/com/jme3/gde/ogrexml/layer.xml | 250 ------------------ 13 files changed, 91 insertions(+), 324 deletions(-) delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialResolver.xml delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneResolver.xml delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLResolver.xml delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonResolver.xml delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLTemplate.xml delete mode 100644 sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/layer.xml diff --git a/sdk/jme3-ogrexml/manifest.mf b/sdk/jme3-ogrexml/manifest.mf index 6d29650e6..bd815a294 100644 --- a/sdk/jme3-ogrexml/manifest.mf +++ b/sdk/jme3-ogrexml/manifest.mf @@ -1,6 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: com.jme3.gde.ogrexml/1 OpenIDE-Module-Implementation-Version: 0 -OpenIDE-Module-Layer: com/jme3/gde/ogrexml/layer.xml OpenIDE-Module-Localizing-Bundle: com/jme3/gde/ogrexml/Bundle.properties diff --git a/sdk/jme3-ogrexml/nbproject/genfiles.properties b/sdk/jme3-ogrexml/nbproject/genfiles.properties index 727863938..5495c4022 100644 --- a/sdk/jme3-ogrexml/nbproject/genfiles.properties +++ b/sdk/jme3-ogrexml/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=29e515b0 +build.xml.data.CRC32=fb143d7c build.xml.script.CRC32=a910387a -build.xml.stylesheet.CRC32=a56c6a5b@2.66.1 +build.xml.stylesheet.CRC32=a56c6a5b@2.67.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=29e515b0 +nbproject/build-impl.xml.data.CRC32=fb143d7c nbproject/build-impl.xml.script.CRC32=2abbef60 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.66.1 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1 diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/Bundle.properties b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/Bundle.properties index 63db5e196..5ef6fa36b 100644 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/Bundle.properties +++ b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/Bundle.properties @@ -1,10 +1,5 @@ -LBL_OgreScene_loader_name=OgreScene Files OpenIDE-Module-Display-Category=jMonkeyEngine OpenIDE-Module-Long-Description=\ This plugin provides OgreXML importing and file type support OpenIDE-Module-Name=OgreXML Support OpenIDE-Module-Short-Description=Provides OgreXML Importing and File Type Support -Services/MIMEResolver/OgreSceneResolver.xml=OgreScene Files -Services/MIMEResolver/OgreXMLResolver.xml=OgreXML Mesh Files -Services/MIMEResolver/OgreXMLSkeletonResolver.xml=OgreXML Skeleton Files -Templates/Other/OgreSceneTemplate.scene=Empty OgreScene file diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialDataObject.java b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialDataObject.java index 5488686d3..0213dff2a 100644 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialDataObject.java +++ b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialDataObject.java @@ -34,12 +34,20 @@ package com.jme3.gde.ogrexml; import com.jme3.gde.core.assets.AssetDataObject; import java.io.IOException; import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.MultiFileLoader; import org.openide.nodes.CookieSet; import org.openide.nodes.Node; import org.openide.text.DataEditorSupport; +@MIMEResolver.ExtensionRegistration( + displayName="OgreXML Material", + mimeType="text/ogrematerial", + extension={ "material" } +) +@DataObject.Registration(displayName = "OgreXML Material", mimeType = "text/ogrematerial", iconBase = "com/jme3/gde/ogrexml/ogre-logo.png") public class OgreMaterialDataObject extends AssetDataObject { public OgreMaterialDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialResolver.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialResolver.xml deleted file mode 100644 index 4e9f0ea89..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreMaterialResolver.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneDataObject.java b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneDataObject.java index 751fdee88..254bf3cf7 100644 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneDataObject.java +++ b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneDataObject.java @@ -33,10 +33,45 @@ package com.jme3.gde.ogrexml; import com.jme3.gde.core.assets.SpatialAssetDataObject; import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.MultiFileLoader; +@MIMEResolver.NamespaceRegistration( + displayName = "OgreXML Scene", + mimeType = "text/ogrescene+xml", + elementNS = {"scene"}, + acceptedExtension = { "scene", "xml" }, + checkedExtension = { "scene", "xml" } +) +@DataObject.Registration(displayName = "OgreXML Scene", mimeType = "text/ogrescene+xml", iconBase = "com/jme3/gde/ogrexml/ogre-scene.png") +@ActionReferences(value = { + @ActionReference(id = + @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.ConvertModel"), path = "Loaders/text/ogrescene+xml/Actions", position = 10), + @ActionReference(id = + @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.OpenModel"), path = "Loaders/text/ogrescene+xml/Actions", position = 20), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 200, separatorBefore = 100), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 300, separatorAfter = 400), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 500), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.RenameAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 600, separatorAfter = 700), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 800, separatorAfter = 900), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 1000, separatorAfter = 1100), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 1200), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/text/ogrescene+xml/Actions", position = 1300) +}) public class OgreSceneDataObject extends SpatialAssetDataObject { public OgreSceneDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneResolver.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneResolver.xml deleted file mode 100644 index 79aea733b..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneResolver.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLDataObject.java b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLDataObject.java index f64989eca..4e44e7620 100644 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLDataObject.java +++ b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLDataObject.java @@ -40,12 +40,47 @@ import java.io.IOException; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.NotifyDescriptor.Confirmation; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.MultiFileLoader; import org.openide.util.Exceptions; +@MIMEResolver.NamespaceRegistration( + displayName = "OgreXML File", + mimeType = "text/ogrexml+xml", + elementNS = {"mesh"}, + acceptedExtension = { "xml", "meshxml" }, + checkedExtension = {"xml", "meshxml"} +) +@DataObject.Registration(displayName = "OgreXML File", mimeType = "text/ogrexml+xml", iconBase = "com/jme3/gde/ogrexml/ogre-logo.png") +@ActionReferences(value = { + @ActionReference(id = + @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.ConvertModel"), path = "Loaders/text/ogrexml+xml/Actions", position = 10), + @ActionReference(id = + @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.OpenModel"), path = "Loaders/text/ogrexml+xml/Actions", position = 20), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 200, separatorBefore = 100), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 300, separatorAfter = 400), + @ActionReference(id = + @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 500), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.RenameAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 600, separatorAfter = 700), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 800, separatorAfter = 900), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 1000, separatorAfter = 1100), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 1200), + @ActionReference(id = + @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/text/ogrexml+xml/Actions", position = 1300) +}) public class OgreXMLDataObject extends SpatialAssetDataObject { public OgreXMLDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLResolver.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLResolver.xml deleted file mode 100644 index 99804483a..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLResolver.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonDataObject.java b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonDataObject.java index 27022caf8..24d66491d 100644 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonDataObject.java +++ b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonDataObject.java @@ -34,9 +34,18 @@ package com.jme3.gde.ogrexml; import com.jme3.gde.core.assets.SpatialAssetDataObject; import java.io.IOException; import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.MultiFileLoader; +@MIMEResolver.NamespaceRegistration( + displayName = "OgreXML Skeleton", + mimeType = "text/ogrexmlskeleton+xml", + elementNS = {"skeleton"}, + acceptedExtension = {"xml", "skeleton"} +) +@DataObject.Registration(displayName = "OgreXML Skeleton", mimeType = "text/ogrexmlskeleton+xml", iconBase = "com/jme3/gde/ogrexml/ogre-logo.png") public class OgreXMLSkeletonDataObject extends SpatialAssetDataObject { public OgreXMLSkeletonDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonResolver.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonResolver.xml deleted file mode 100644 index 7830e39a7..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLSkeletonResolver.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLTemplate.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLTemplate.xml deleted file mode 100644 index 381197470..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLTemplate.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/layer.xml b/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/layer.xml deleted file mode 100644 index 4e894dc5f..000000000 --- a/sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/layer.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -