From 9f40060b48748f6d512d7734f7346906046324f6 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Wed, 4 Sep 2013 11:44:59 -0500 Subject: [PATCH] Issue #2310 Switch awipstools to load using bundles. Change-Id: I9a24e6359bd43bfb7c8f84686348f532748503c4 Former-commit-id: 0b330e7c36d1602d2251ba509867a149b37c39fd [formerly 6f29122c14d587143a5240b672780f614aa87965] [formerly ecf667fce97fb8c9fde2fe45a693380ee0227ed9] [formerly ecf667fce97fb8c9fde2fe45a693380ee0227ed9 [formerly d75fdcb916240760522d2f7d1b7200381de3d834]] [formerly 87b6474106687db36933158cd9075f40e7c7530d [formerly ecf667fce97fb8c9fde2fe45a693380ee0227ed9 [formerly d75fdcb916240760522d2f7d1b7200381de3d834] [formerly 87b6474106687db36933158cd9075f40e7c7530d [formerly afc80cb00cce9b22f1ecd730b60da1de1afbfb2e]]]] Former-commit-id: 87b6474106687db36933158cd9075f40e7c7530d Former-commit-id: 83943cb20243ecf8a1468c4f17ff6327ce8c8cae [formerly 0f540dd74f1e8e6723b36d8b78e242b7a0b0b4ec] [formerly 19cc13d9bff7bbb0d5ca1a0c728a1cc296a24738 [formerly a6661a88318be1b4d67eb8f05ac35615515cb25a]] Former-commit-id: 19cc13d9bff7bbb0d5ca1a0c728a1cc296a24738 Former-commit-id: 5998b5aa02e06d87f6f462adae461abba87ab608 --- .../build.properties | 3 +- .../localization/bundles/tools/Points.xml | 35 +++ .../points/ui/action/PointsToolAction.java | 37 +-- .../menus/widgets/BundleContributionItem.java | 39 ++- .../META-INF/MANIFEST.MF | 29 +-- .../localization/bundles/tools/AzRan.xml | 35 +++ .../localization/bundles/tools/Baselines.xml | 35 +++ .../localization/bundles/tools/ChooseById.xml | 49 ++++ .../bundles/tools/DistanceBearing.xml | 35 +++ .../bundles/tools/DistanceScale.xml | 35 +++ .../bundles/tools/EstimatedActualVelocity.xml | 35 +++ .../bundles/tools/FeatureFollowingZoom.xml | 35 +++ .../localization/bundles/tools/Home.xml | 35 +++ .../localization/bundles/tools/RangeRings.xml | 35 +++ .../localization/bundles/tools/VRShear.xml | 35 +++ .../menus/tools/baseToolsMenu.xml | 57 ++-- cave/com.raytheon.viz.awipstools/plugin.xml | 11 +- .../ui/action/AzimuthToolAction.java | 43 ++-- .../ui/action/BaselinesToolAction.java | 44 ++-- .../ui/action/ChooseByIdAction.java | 136 ++-------- .../ui/action/DistanceBearingToolAction.java | 37 ++- .../ui/action/DistanceSpeedAction.java | 31 ++- .../ui/action/DistanceToolAction.java | 36 ++- .../action/EstimatedActualVelocityAction.java | 34 +-- .../ui/action/FeatureFollowingZoomAction.java | 33 +-- .../awipstools/ui/action/HomeToolAction.java | 120 +-------- .../ui/action/PutHomeCursorAction.java | 35 +-- .../ui/action/RangeRingsAction.java | 37 ++- .../viz/awipstools/ui/action/ShearAction.java | 243 ------------------ .../awipstools/ui/action/VRShearAction.java | 35 ++- .../ui/dialog/ChooseByIdDialog.java | 149 ++++------- .../ui/dialog/PutHomeCursorDialog.java | 76 +++--- .../viz/awipstools/ui/layer/ShearLayer.java | 242 +++++++++++++++-- .../viz/ui/tools/map/AbstractMapTool.java | 52 +--- cave/com.raytheon.viz.ui/plugin.xml | 21 ++ .../viz/ui/actions/LoadBundleHandler.java | 175 +++++++++++++ 36 files changed, 1181 insertions(+), 973 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.points/localization/bundles/tools/Points.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/AzRan.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/Baselines.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/ChooseById.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceBearing.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceScale.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/EstimatedActualVelocity.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/FeatureFollowingZoom.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/Home.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/RangeRings.xml create mode 100644 cave/com.raytheon.viz.awipstools/localization/bundles/tools/VRShear.xml delete mode 100644 cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ui/action/ShearAction.java create mode 100644 cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/actions/LoadBundleHandler.java diff --git a/cave/com.raytheon.uf.viz.points/build.properties b/cave/com.raytheon.uf.viz.points/build.properties index c6baffa001..18219bddae 100644 --- a/cave/com.raytheon.uf.viz.points/build.properties +++ b/cave/com.raytheon.uf.viz.points/build.properties @@ -2,4 +2,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - icons/ + icons/,\ + localization/ diff --git a/cave/com.raytheon.uf.viz.points/localization/bundles/tools/Points.xml b/cave/com.raytheon.uf.viz.points/localization/bundles/tools/Points.xml new file mode 100644 index 0000000000..651416ba50 --- /dev/null +++ b/cave/com.raytheon.uf.viz.points/localization/bundles/tools/Points.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Interactive Points + com.raytheon.uf.viz.points.ui.layer.PointsToolLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/ui/action/PointsToolAction.java b/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/ui/action/PointsToolAction.java index 10f57c8c67..e7f9b86d3a 100644 --- a/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/ui/action/PointsToolAction.java +++ b/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/ui/action/PointsToolAction.java @@ -19,40 +19,31 @@ **/ package com.raytheon.uf.viz.points.ui.action; -import com.raytheon.uf.viz.core.rsc.tools.GenericToolsResourceData; -import com.raytheon.uf.viz.core.rsc.tools.action.AbstractGenericToolAction; -import com.raytheon.uf.viz.points.ui.layer.PointsToolLayer; +import com.raytheon.viz.ui.actions.LoadBundleHandler; /** * Handles the Points Tool Action. * *
  * 
- *  SOFTWARE HISTORY
+ * SOFTWARE HISTORY
  * 
- *  Date         Ticket#     Engineer    Description
- *  ------------ ----------  ----------- --------------------------
- *  Oct032007    #455        ebabin      Initial Creation.
- *  14Oct2009    #810        bsteffen    Fix for grabbing points.
- *  10-21-09     #1711       bsteffen    Refactor to common MovableTool model
+ * Date          Ticket#  Engineer    Description
+ * ------------- -------- ----------- --------------------------
+ * Aug 30, 2013  2310     bsteffen    Rewritten to extend LoadBundleHandler.
  * 
  * 
* - * @author ebabin - * @version 1 + * @author bsteffen + * @version 2.0 + * @deprecated Use {@link LoadBundleHandler} with + * bundleFile="bundles/tools/Points.xml". */ -public class PointsToolAction extends AbstractGenericToolAction { - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.viz.awipstools.ui.action.MapToolAction#getResourceData() - */ - @Override - protected GenericToolsResourceData getResourceData() { - return new GenericToolsResourceData( - PointsToolLayer.DEFAULT_NAME, PointsToolLayer.class); +@Deprecated +public class PointsToolAction extends LoadBundleHandler { + public PointsToolAction(){ + super("bundles/tools/Points.xml"); } + } diff --git a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/BundleContributionItem.java b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/BundleContributionItem.java index 2182b83826..3f1afdaa1b 100644 --- a/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/BundleContributionItem.java +++ b/cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/BundleContributionItem.java @@ -29,6 +29,7 @@ import java.util.TimeZone; import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.action.ContributionItem; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Event; @@ -58,11 +59,7 @@ import com.raytheon.uf.viz.core.procedures.BundleUtil.BundleDataItem; import com.raytheon.uf.viz.core.rsc.URICatalog; import com.raytheon.uf.viz.core.rsc.URICatalog.IURIRefreshCallback; import com.raytheon.uf.viz.ui.menus.xml.BundleMenuContribution; -import com.raytheon.viz.ui.BundleLoader; -import com.raytheon.viz.ui.BundleLoader.BundleInfoType; -import com.raytheon.viz.ui.BundleProductLoader; -import com.raytheon.viz.ui.UiUtil; -import com.raytheon.viz.ui.editor.AbstractEditor; +import com.raytheon.viz.ui.actions.LoadBundleHandler; /** * Provides an Eclipse menu contribution that loads a bundle, and is decorated @@ -83,10 +80,13 @@ import com.raytheon.viz.ui.editor.AbstractEditor; *
  * 
  * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 12, 2009            chammack     Initial creation
- * Jan 14, 2013 1442       rferrel      Add Simulated Time Change Listener.
+ * Date          Ticket#  Engineer    Description
+ * ------------- -------- ----------- --------------------------
+ * Mar 12, 2009           chammack    Initial creation
+ * Jan 14, 2013  1442     rferrel     Add Simulated Time Change Listener.
+ * Aug 30, 2013  2310     bsteffen    Move loading of bundle to
+ *                                    LoadBundleHandler.
+ * 
  * 
  * 
* @@ -397,20 +397,13 @@ public class BundleContributionItem extends ContributionItem { private void loadBundle(Event event) { try { - Bundle bundle = BundleLoader.getBundle( - this.menuContribution.xml.bundleFile, substitutions, - BundleInfoType.FILE_LOCATION); - AbstractEditor editor = UiUtil.createOrOpenEditor( - this.menuContribution.xml.editorType, bundle.getDisplays()); - BundleLoader loader; - if (this.menuContribution.xml.fullBundleLoad == null - || this.menuContribution.xml.fullBundleLoad == false) { - loader = new BundleProductLoader(editor, bundle); - } else { - loader = new BundleLoader(editor, bundle); + boolean fullBundleLoad = false; + if (this.menuContribution.xml.fullBundleLoad != null) { + fullBundleLoad = this.menuContribution.xml.fullBundleLoad; } - loader.schedule(); - + new LoadBundleHandler(this.menuContribution.xml.bundleFile, + substitutions, this.menuContribution.xml.editorType, + fullBundleLoad).execute(null); if (this.menuContribution.xml.command != null) { ICommandService service = (ICommandService) PlatformUI .getWorkbench().getService(ICommandService.class); @@ -430,7 +423,7 @@ public class BundleContributionItem extends ContributionItem { } } - } catch (VizException e) { + } catch (ExecutionException e) { statusHandler.handle(Priority.PROBLEM, "Error loading bundle : " + this.menuContribution.xml.bundleFile, e); } diff --git a/cave/com.raytheon.viz.awipstools/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.awipstools/META-INF/MANIFEST.MF index 697787bce2..8f1c6c42af 100644 --- a/cave/com.raytheon.viz.awipstools/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.awipstools/META-INF/MANIFEST.MF @@ -9,23 +9,19 @@ Eclipse-BuddyPolicy: registered, ext, global Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.viz.core, com.raytheon.uf.common.serialization Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, - com.raytheon.viz.core, org.apache.commons.lang, - org.geotools, - com.raytheon.viz.ui.tools.map, com.raytheon.viz.ui, javax.measure, com.raytheon.uf.common.pointdata, - javax.vecmath;bundle-version="1.3.1", - com.raytheon.uf.common.serialization, - com.raytheon.uf.common.awipstools;bundle-version="1.12.1112", - com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1112", - com.raytheon.uf.viz.d2d.core, - com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0", - com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174", - com.raytheon.uf.viz.d2d.ui, - com.raytheon.uf.viz.points;bundle-version="1.0.0", - com.raytheon.uf.viz.core.rsc;bundle-version="1.0.0" + com.raytheon.uf.common.dataplugin.radar, + com.raytheon.uf.viz.core.maps, + com.raytheon.uf.viz.points, + com.raytheon.uf.viz.core.rsc, + com.raytheon.uf.viz.core, + com.raytheon.uf.common.geospatial, + com.raytheon.uf.common.datastorage, + com.raytheon.uf.common.dataplugin, + com.raytheon.uf.common.util Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.viz.awipstools, com.raytheon.viz.awipstools.capabilities, @@ -35,7 +31,8 @@ Export-Package: com.raytheon.viz.awipstools, com.raytheon.viz.awipstools.ui.action, com.raytheon.viz.awipstools.ui.display, com.raytheon.viz.awipstools.ui.layer -Import-Package: com.raytheon.uf.common.topo, - com.raytheon.uf.viz.d2d.core, - com.raytheon.uf.viz.d2d.ui.dialogs.procedures Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: com.raytheon.viz.core, + com.raytheon.viz.core.interval, + com.raytheon.viz.core.rsc, + com.raytheon.viz.core.rsc.jts diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/AzRan.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/AzRan.xml new file mode 100644 index 0000000000..0a90b4124f --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/AzRan.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Az/Ran Overlay + com.raytheon.viz.awipstools.ui.layer.AzimuthToolLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Baselines.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Baselines.xml new file mode 100644 index 0000000000..9c9ef16aef --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Baselines.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Interactive Baselines + com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/ChooseById.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/ChooseById.xml new file mode 100644 index 0000000000..4050bad000 --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/ChooseById.xml @@ -0,0 +1,49 @@ + + + + + + + + + + Home Location + com.raytheon.viz.awipstools.ui.layer.HomeToolLayer + + + + + + Interactive Points + com.raytheon.uf.viz.points.ui.layer.PointsToolLayer + + + + + + Interactive Baselines + com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceBearing.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceBearing.xml new file mode 100644 index 0000000000..95d61873ab --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceBearing.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Distance Bearing + com.raytheon.viz.awipstools.ui.layer.DistanceBearingToolLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceScale.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceScale.xml new file mode 100644 index 0000000000..5cba4d2a14 --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/DistanceScale.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Distance Scale + com.raytheon.viz.awipstools.common.DistanceTool + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/EstimatedActualVelocity.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/EstimatedActualVelocity.xml new file mode 100644 index 0000000000..33626cfa7f --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/EstimatedActualVelocity.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Estimated Act Vel + com.raytheon.viz.awipstools.ui.layer.EstimatedActualVelocityLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/FeatureFollowingZoom.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/FeatureFollowingZoom.xml new file mode 100644 index 0000000000..f2703c5161 --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/FeatureFollowingZoom.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Feature Following Zoom + com.raytheon.viz.awipstools.ui.layer.FeatureFollowingZoomLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Home.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Home.xml new file mode 100644 index 0000000000..3ed985fc95 --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/Home.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Home Location + com.raytheon.viz.awipstools.ui.layer.HomeToolLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/RangeRings.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/RangeRings.xml new file mode 100644 index 0000000000..2e0409b7d3 --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/RangeRings.xml @@ -0,0 +1,35 @@ + + + + + + + + + + Range Rings + com.raytheon.viz.awipstools.ui.layer.RangeRingsLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/bundles/tools/VRShear.xml b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/VRShear.xml new file mode 100644 index 0000000000..9d6515372e --- /dev/null +++ b/cave/com.raytheon.viz.awipstools/localization/bundles/tools/VRShear.xml @@ -0,0 +1,35 @@ + + + + + + + + + + VR Shear + com.raytheon.viz.awipstools.ui.layer.VRShearLayer + + + + + + \ No newline at end of file diff --git a/cave/com.raytheon.viz.awipstools/localization/menus/tools/baseToolsMenu.xml b/cave/com.raytheon.viz.awipstools/localization/menus/tools/baseToolsMenu.xml index a981b11ce0..05ba77e34e 100644 --- a/cave/com.raytheon.viz.awipstools/localization/menus/tools/baseToolsMenu.xml +++ b/cave/com.raytheon.viz.awipstools/localization/menus/tools/baseToolsMenu.xml @@ -19,37 +19,32 @@ further_licensing_information. --> - - - + + + + - + - - - - - + + + + + - + - + - + - +