[openrtm-commit:01938] r622 - in tags/RELEASE_1_1_2/rtmtools: . jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/configurationwrapper

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 5月 23日 (月) 12:02:11 JST


Author: kawauchi
Date: 2016-05-23 12:02:11 +0900 (Mon, 23 May 2016)
New Revision: 622

Modified:
   tags/RELEASE_1_1_2/rtmtools/
   tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConfigurationDialog.java
   tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/ConfigurationView.java
   tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/configurationwrapper/ComponentConfigurationWrapper.java
Log:
r621 has been merged from trunk.


Property changes on: tags/RELEASE_1_1_2/rtmtools
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/work_kawauchi/rtmtools:518-526
/trunk/rtmtools:617,619
   + /branches/work_kawauchi/rtmtools:518-526
/trunk/rtmtools:617,619,621

Modified: tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConfigurationDialog.java
===================================================================
--- tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConfigurationDialog.java	2016-05-23 02:40:26 UTC (rev 621)
+++ tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConfigurationDialog.java	2016-05-23 03:02:11 UTC (rev 622)
@@ -80,7 +80,9 @@
 	private boolean firstApply;
 
 	private TabItem currentTabItem;
-	
+
+	private List<String> tabbedIdList;
+
 	Text errorText;
 
 	public ConfigurationDialog(ConfigurationView view) {
@@ -202,13 +204,28 @@
 
 		tabFolder = new TabFolder(mainComposite, SWT.NONE);
 		tabFolder.setLayoutData(gd);
+		this.tabbedIdList = new ArrayList<>();
 
-		for (ConfigurationSetConfigurationWrapper cs : this.copiedConfig
-				.getConfigurationSetList()) {
-			TabItem item = new TabItem(tabFolder, SWT.NONE);
-			item.setText(cs.getId());
+		for (ConfigurationSetConfigurationWrapper cs : this.copiedConfig.getConfigurationSetList()) {
+			if (this.copiedConfig.getActiveConfigSet() != null
+					&& this.copiedConfig.getActiveConfigSet().getId().equals(cs.getId())) {
+				// Active ConfigSetは先頭タブへ追加
+				TabItem item = new TabItem(tabFolder, SWT.NONE, 0);
+				item.setText(cs.getId());
+				this.tabbedIdList.add(0, cs.getId());
+				continue;
+			}
+			if (!cs.isSecret()) {
+				// 隠しConfigSetをタブへ追加
+				TabItem item = new TabItem(tabFolder, SWT.NONE);
+				item.setText(cs.getId());
+				this.tabbedIdList.add(cs.getId());
+			}
 		}
+
 		if (tabFolder.getItemCount() > 0) {
+			// 先頭タブのActive ConfigSetを選択
+			this.tabFolder.setSelection(0);
 			this.selectConfigSet(0);
 		}
 
@@ -254,11 +271,21 @@
 		nameText.setText(configSet.getId());
 
 		for (NamedValueConfigurationWrapper nv : configSet.getNamedValueList()) {
-			createNamedValueComposite(configSetComposite, nv);
+			if (!nv.isSecret()) {
+				createNamedValueComposite(configSetComposite, nv);
+			}
 		}
+		if (this.view.isCheckedDetailNamedValue()) {
+			// NameValueの詳細表示が有効な場合は、隠しNameValueも追加
+			for (NamedValueConfigurationWrapper nv : configSet.getNamedValueList()) {
+				if (nv.isSecret()) {
+					createNamedValueComposite(configSetComposite, nv);
+				}
+			}
+		}
 
 		// スクロールの初期サイズ
-		scroll.setMinHeight(configSetComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 10);
+		scroll.setMinHeight(configSetComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 50);
 
 		return scroll;
 	}
@@ -1015,11 +1042,11 @@
 			return;
 		}
 		currentTabItem = tabFolder.getItem(index);
+		String currentId = this.tabbedIdList.get(index);
 		// 選択タブに対応するConfigurationSetを検索
 		selectedConfigSet = null;
-		for (ConfigurationSetConfigurationWrapper cs : copiedConfig
-				.getConfigurationSetList()) {
-			if (cs.getId().equals(currentTabItem.getText())) {
+		for (ConfigurationSetConfigurationWrapper cs : copiedConfig.getConfigurationSetList()) {
+			if (cs.getId().equals(currentId)) {
 				selectedConfigSet = cs;
 				break;
 			}

Modified: tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/ConfigurationView.java
===================================================================
--- tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/ConfigurationView.java	2016-05-23 02:40:26 UTC (rev 621)
+++ tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/ConfigurationView.java	2016-05-23 03:02:11 UTC (rev 622)
@@ -381,6 +381,20 @@
 	}
 
 	/**
+	 * @return ConfiguratoinSetの詳細表示が有効な場合はtrue
+	 */
+	public boolean isCheckedDetailConfigurationSet() {
+		return this.detailConfigurationSetCheckButton.getSelection();
+	}
+
+	/**
+	 * @return NamedValueの詳細表示が有効な場合はtrue
+	 */
+	public boolean isCheckedDetailNamedValue() {
+		return this.detailNamedValueCheckButton.getSelection();
+	}
+
+	/**
 	 * 編集後の新しいConfigurationSetを作成する。
 	 * <p>
 	 * 
@@ -1441,7 +1455,7 @@
 		return result;
 	}
 
-	/**  編集用のコンフィグを返す */
+	/** 編集用のコンフィグを返す */
 	public ComponentConfigurationWrapper getComponentConfig() {
 		return copiedComponent;
 	}

Modified: tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/configurationwrapper/ComponentConfigurationWrapper.java
===================================================================
--- tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/configurationwrapper/ComponentConfigurationWrapper.java	2016-05-23 02:40:26 UTC (rev 621)
+++ tags/RELEASE_1_1_2/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/configurationview/configurationwrapper/ComponentConfigurationWrapper.java	2016-05-23 03:02:11 UTC (rev 622)
@@ -20,25 +20,23 @@
 
 	public static ComponentConfigurationWrapper create(Component target) {
 		ComponentConfigurationWrapper result = new ComponentConfigurationWrapper();
-		List<ConfigurationSetConfigurationWrapper> configurationSetList = result.getConfigurationSetList();
+		List<ConfigurationSetConfigurationWrapper> configSetList = result.getConfigurationSetList();
+		List<ConfigurationSetConfigurationWrapper> secretConfigSetList = new ArrayList<>();
 
 		// パラメータ名−widget種別
-		Map<String, String> widgets = new HashMap<String, String>();
+		Map<String, String> widgets = new HashMap<>();
 		// configurationSet名−制約条件マップ(パラメータ名−制約)
-		Map<String, Map<String, String>> conditions = new HashMap<String, Map<String, String>>();
+		Map<String, Map<String, String>> conditions = new HashMap<>();
 
-		for (Object o : target.getConfigurationSets()) {
-			ConfigurationSet cs = (ConfigurationSet) o;
+		for (ConfigurationSet cs : target.getConfigurationSets()) {
 			if (cs.getId().equals("__widget__")) {
-				for (Object o2 : cs.getConfigurationData()) {
-					NameValue nv = (NameValue) o2;
+				for (NameValue nv : cs.getConfigurationData()) {
 					widgets.put(nv.getName(), nv.getValueAsString());
 				}
 			} else if (cs.getId().startsWith("__")) {
 				String key = cs.getId().substring(2);
-				Map<String, String> kc = new HashMap<String, String>();
-				for (Object o2 : cs.getConfigurationData()) {
-					NameValue nv = (NameValue) o2;
+				Map<String, String> kc = new HashMap<>();
+				for (NameValue nv : cs.getConfigurationData()) {
 					kc.put(nv.getName(), nv.getValueAsString());
 				}
 				conditions.put(key, kc);
@@ -48,39 +46,53 @@
 		result.widgetSetting = widgets;
 		result.conditionSetting = conditions;
 
-		for (ConfigurationSet configurationSet : target.getConfigurationSets()) {
-			ConfigurationSetConfigurationWrapper configurationSetConfigurationWrapper = new ConfigurationSetConfigurationWrapper(
-					configurationSet, configurationSet.getId());
-			List<NamedValueConfigurationWrapper> namedValueList = configurationSetConfigurationWrapper
-					.getNamedValueList();
+		for (ConfigurationSet cs : target.getConfigurationSets()) {
+			ConfigurationSetConfigurationWrapper configSetWrapper = new ConfigurationSetConfigurationWrapper(cs,
+					cs.getId());
+			List<NamedValueConfigurationWrapper> namedValueList = configSetWrapper.getNamedValueList();
+			List<NamedValueConfigurationWrapper> secretNamedValueList = new ArrayList<>();
 
 			// configurationSetに対応する制約条件(なければデフォルトを使用)
 			Map<String, String> conds = null;
-			if (!configurationSet.getId().startsWith("__")) {
-				conds = conditions.get(configurationSet.getId());
+			if (!cs.getId().startsWith("__")) {
+				conds = conditions.get(cs.getId());
 				if (conds == null) {
 					conds = conditions.get("constraints__");
 				}
 			}
-			for (NameValue nameValue : configurationSet.getConfigurationData()) {
-				NamedValueConfigurationWrapper namedValueConfigurationWrapper = new NamedValueConfigurationWrapper(
-						nameValue.getName(), nameValue.getValue(), nameValue.getTypeName());
+			for (NameValue nv : cs.getConfigurationData()) {
+				NamedValueConfigurationWrapper namedValueWrapper = new NamedValueConfigurationWrapper(nv.getName(),
+						nv.getValue(), nv.getTypeName());
 				if (conds != null) {
-					String type = widgets.get(nameValue.getName());
-					String cond = conds.get(nameValue.getName());
-					namedValueConfigurationWrapper.setWidgetAndCondition(type, cond);
+					String type = widgets.get(nv.getName());
+					String cond = conds.get(nv.getName());
+					namedValueWrapper.setWidgetAndCondition(type, cond);
 				}
-				namedValueList.add(namedValueConfigurationWrapper);
-				Collections.sort(namedValueList);
+				if (namedValueWrapper.isSecret()) {
+					secretNamedValueList.add(namedValueWrapper);
+				} else {
+					namedValueList.add(namedValueWrapper);
+				}
 			}
+			// 隠しNamedValueは後方へ整列
+			Collections.sort(namedValueList);
+			namedValueList.addAll(secretNamedValueList);
 
 			if (target.getActiveConfigurationSet() != null
-					&& target.getActiveConfigurationSet().getId().equals(configurationSet.getId())) {
-				result.setActiveConfigSet(configurationSetConfigurationWrapper);
+					&& target.getActiveConfigurationSet().getId().equals(cs.getId())) {
+				result.setActiveConfigSet(configSetWrapper);
 			}
-			configurationSetList.add(configurationSetConfigurationWrapper);
-			Collections.sort(configurationSetList);
+
+			if (configSetWrapper.isSecret()) {
+				secretConfigSetList.add(configSetWrapper);
+			} else {
+				configSetList.add(configSetWrapper);
+			}
 		}
+		// 隠しConfiguratoinSetは後方へ整列
+		Collections.sort(configSetList);
+		configSetList.addAll(secretConfigSetList);
+
 		return result;
 	}
 



More information about the openrtm-commit mailing list