Re-arranged the client controller perspective.
authorG S Senthil Kumar <senthil.gs@samsung.com>
Thu, 11 Feb 2016 06:58:04 +0000 (12:28 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 15 Feb 2016 01:43:48 +0000 (01:43 +0000)
1. Removed the unused MultiResourceOrchestrationView from Client Controller
   perspective and moved properties view to that location.
2. This changeset also includes showing 1 fractional digit for
   attribute values of type double in drop-down box of attributes
   table in Attributes View.

Change-Id: I218cefb746125a184bfcc358845a1cfb2c3729dd
Signed-off-by: G S Senthil Kumar <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4985
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/simulator/java/eclipse-plugin/ClientControllerPlugin/plugin.xml
service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/manager/ResourceManager.java
service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/perspective/PerspectiveFactory.java
service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/view/MultiResourceOrchestrationView.java [deleted file]
service/simulator/java/eclipse-plugin/ServiceProviderPlugin/src/oic/simulator/serviceprovider/manager/ResourceManager.java

index 1bc294b..47f7e5d 100644 (file)
             restorable="true">
         </view>
         <view category="oic.simulator.clientcontroller.category"
-            class="oic.simulator.clientcontroller.view.MultiResourceOrchestrationView"
-            icon="icons/oic_logo_16x16.png"
-            id="oic.simulator.clientcontroller.view.orchestration"
-            name="Multi-Resource Automation"
-            restorable="true">
-        </view>
-        <view category="oic.simulator.clientcontroller.category"
             class="oic.simulator.clientcontroller.view.LogView"
             icon="icons/oic_logo_16x16.png"
             id="oic.simulator.clientcontroller.view.log"
@@ -70,9 +63,6 @@
                 id="oic.simulator.clientcontroller.view.attribute">
             </viewShortcut>
             <viewShortcut
-                id="oic.simulator.clientcontroller.view.orchestration">
-            </viewShortcut>
-            <viewShortcut
                 id="oic.simulator.clientcontroller.view.log">
             </viewShortcut>
         </perspectiveExtension>
index 0425477..a2735c4 100644 (file)
@@ -16,6 +16,7 @@
 
 package oic.simulator.clientcontroller.manager;
 
+import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -1194,13 +1195,16 @@ public class ResourceManager {
 
     public List<String> getAllValues(DoubleProperty dblProperty,
             AttributeProperty.Type type) {
+        NumberFormat formatter = NumberFormat.getInstance();
         List<String> values = new ArrayList<String>();
 
         if (dblProperty.hasRange()) {
             double min = (double) dblProperty.min();
             double max = (double) dblProperty.max();
-            for (double iVal = min; iVal <= max; iVal = iVal + 1) {
-                values.add(String.valueOf(iVal));
+            for (double val = min; val <= max; val += 0.1) {
+                formatter.setMaximumFractionDigits(1);
+                formatter.setMinimumFractionDigits(1);
+                values.add(formatter.format(val));
             }
         } else if (dblProperty.hasValues()) {
             for (Double val : dblProperty.getValues()) {
index 2658a46..1e2ff50 100644 (file)
@@ -22,7 +22,6 @@ import org.eclipse.ui.IPerspectiveFactory;
 import oic.simulator.clientcontroller.view.AttributeView;
 import oic.simulator.clientcontroller.view.LogView;
 import oic.simulator.clientcontroller.view.MetaPropertiesView;
-import oic.simulator.clientcontroller.view.MultiResourceOrchestrationView;
 import oic.simulator.clientcontroller.view.ResourceManagerView;
 
 /**
@@ -43,15 +42,13 @@ public class PerspectiveFactory implements IPerspectiveFactory {
     }
 
     private void addViews() {
-        factory.addView(ResourceManagerView.VIEW_ID, IPageLayout.LEFT, 0.3f,
+        factory.addView(ResourceManagerView.VIEW_ID, IPageLayout.LEFT, 0.28f,
                 factory.getEditorArea());
-        factory.addView(MetaPropertiesView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
-                ResourceManagerView.VIEW_ID);
         factory.addView(AttributeView.VIEW_ID, IPageLayout.LEFT, 0.7f,
                 factory.getEditorArea());
         factory.addView(LogView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
                 AttributeView.VIEW_ID);
-        factory.addView(MultiResourceOrchestrationView.VIEW_ID,
-                IPageLayout.RIGHT, 0.6f, AttributeView.VIEW_ID);
+        factory.addView(MetaPropertiesView.VIEW_ID, IPageLayout.RIGHT, 0.6f,
+                AttributeView.VIEW_ID);
     }
 }
diff --git a/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/view/MultiResourceOrchestrationView.java b/service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/view/MultiResourceOrchestrationView.java
deleted file mode 100644 (file)
index ef67547..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2015 Samsung Electronics All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package oic.simulator.clientcontroller.view;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * This class manages and shows the multi-resource automation view in the
- * perspective.
- */
-public class MultiResourceOrchestrationView extends ViewPart {
-
-    public static final String VIEW_ID = "oic.simulator.clientcontroller.view.orchestration";
-
-    @Override
-    public void createPartControl(Composite arg0) {
-    }
-
-    @Override
-    public void setFocus() {
-    }
-
-}
index a1bed35..ac01be2 100644 (file)
@@ -19,6 +19,7 @@ package oic.simulator.serviceprovider.manager;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.swt.widgets.Display;
 
+import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
@@ -1638,13 +1639,16 @@ public class ResourceManager {
 
     public List<String> getAllValues(DoubleProperty dblProperty,
             AttributeProperty.Type type) {
+        NumberFormat formatter = NumberFormat.getInstance();
         List<String> values = new ArrayList<String>();
 
         if (dblProperty.hasRange()) {
             double min = (double) dblProperty.min();
             double max = (double) dblProperty.max();
-            for (double iVal = min; iVal <= max; iVal = iVal + 1) {
-                values.add(String.valueOf(iVal));
+            for (double val = min; val <= max; val += 0.1) {
+                formatter.setMaximumFractionDigits(1);
+                formatter.setMinimumFractionDigits(1);
+                values.add(formatter.format(val));
             }
         } else if (dblProperty.hasValues()) {
             for (Double val : dblProperty.getValues()) {