[openrtm-commit:03255] r819 - in trunk/rtmtools/jp.go.aist.rtm.systemeditor: . src/jp/go/aist/rtm/systemeditor/_debug src/jp/go/aist/rtm/systemeditor/manager src/jp/go/aist/rtm/systemeditor/restoration src/jp/go/aist/rtm/systemeditor/ui/action src/jp/go/aist/rtm/systemeditor/ui/dialog src/jp/go/aist/rtm/systemeditor/ui/editor/action src/jp/go/aist/rtm/systemeditor/ui/editor/command src/jp/go/aist/rtm/systemeditor/ui/editor/dnd src/jp/go/aist/rtm/systemeditor/ui/editor/editpart src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/direct src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/factory src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 3月 21日 (水) 14:54:06 JST
Author: ga
Date: 2018-03-21 14:54:06 +0900 (Wed, 21 Mar 2018)
New Revision: 819
Added:
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECConnectionEditPart.java
Modified:
trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/_debug/AbstractPolygon.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/manager/ComponentIconStore.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/CombineActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortPopupMenuActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionDelegate.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionHandler.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/ChangeComponentDirectionAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/MoveComponentAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndCreateRestoreAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndQuickRestoreAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndRestoreAction.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/ClearLineConstraintCommand.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CombineCommand.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CreateCommand.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/dnd/SystemDiagramDropTargetListener.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/AbstractEditPart.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ComponentEditPart.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECEditPart.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ToolTipHelper.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/direct/NameDirectEditManager.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/factory/SystemDiagramEditPartFactory.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/ECSelectionEditPolicy.java
Log:
Modified EC Tab.
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml 2018-03-21 05:54:06 UTC (rev 819)
@@ -20,6 +20,7 @@
<editpart seq="400" targetclass="jp.go.aist.rtm.toolscommon.model.component.PortConnector" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.PortConnectorEditPart" />
<editpart seq="600" targetclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECEditPart$OwnEC" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECEditPart$OwnECEditPart" />
<editpart seq="610" targetclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECEditPart$PartEC" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECEditPart$PartECEditPart" />
+ <editpart seq="620" targetclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECConnectionEditPart" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ECConnectionEditPart$ECConnection" />
<editpart seq="1000" targetclass="jp.go.aist.rtm.toolscommon.model.component.Component" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.ComponentEditPart" />
<editpart seq="1500" targetclass="jp.go.aist.rtm.toolscommon.model.component.SystemDiagram" editpartclass="jp.go.aist.rtm.systemeditor.ui.editor.editpart.SystemDiagramEditPart" />
</extension>
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/_debug/AbstractPolygon.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/_debug/AbstractPolygon.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/_debug/AbstractPolygon.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -22,7 +22,6 @@
this.points = points;
}
- @SuppressWarnings("unchecked")
public boolean containsPoint(int x, int y) {
if (!getBounds().contains(x, y))
return false;
@@ -48,7 +47,7 @@
return true;
}
- List children = getChildren();
+ List<?> children = getChildren();
for (int i = 0; i < children.size(); i++)
if (((IFigure) children.get(i)).containsPoint(x, y))
return true;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/manager/ComponentIconStore.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/manager/ComponentIconStore.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/manager/ComponentIconStore.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -208,6 +208,8 @@
}
xmlString += s;
}
+ reader.close();
+
IconProfileHandler handler = new IconProfileHandler();
ComponentIconStore result = handler.parse(xmlString);
return result;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -96,10 +96,9 @@
* @param result
* @param systemDiagram
*/
- @SuppressWarnings("unchecked")
private static void processAllPing(Result result,
SystemDiagram systemDiagram) {
- for (Iterator iter = systemDiagram.eAllContents(); iter.hasNext();) {
+ for (Iterator<?> iter = systemDiagram.eAllContents(); iter.hasNext();) {
Object obj = iter.next();
if (obj instanceof CorbaComponent) {
CorbaComponent c = (CorbaComponent) obj;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/CombineActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/CombineActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/CombineActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -85,11 +85,10 @@
action.setEnabled(isEnable());
}
- @SuppressWarnings("unchecked")
private boolean isEnable() {
selectedComponents = new ArrayList<Component>();
if (selection instanceof IStructuredSelection) {
- for (Iterator iterator = ((IStructuredSelection) selection)
+ for (Iterator<?> iterator = ((IStructuredSelection) selection)
.iterator(); iterator.hasNext();) {
Object part = iterator.next();
if (part instanceof ComponentEditPart) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -90,7 +90,7 @@
prepareProfile(profile, factory);
//候補コンポーネントの取得
NameServerManager ns = NameServerManagerImpl.getInstance();
- EList nscomps = ns.getNodes();
+ EList<?> nscomps = ns.getNodes();
List<CorbaComponent> componentCandidates = new ArrayList<CorbaComponent>();
componentCandidates = DeployUtil.searchComponentList(nscomps, componentCandidates);
@@ -309,7 +309,7 @@
private CorbaComponent searchActiveCompByManager(NameServerManager ns, ObjectFactory factory,
Component target, org.openrtp.namespaces.rts.version02.Component propTarget) {
CorbaComponent result = null;
- EList nscomps;
+ EList<?> nscomps;
//設定したManager情報を検索
java.util.List<RTCManager> managerCandidates = DeployUtil.searchManager(target);
String refId = target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_TARGET);
@@ -323,7 +323,7 @@
}
if(propTarget==null ) return result;
//
- EList createds = actManager.getComponentInstanceNamesR();
+ EList<?> createds = actManager.getComponentInstanceNamesR();
jp.go.aist.rtm.toolscommon.model.component.Component created = null;
Property prop = factory.createProperty();
for(int index=0;index<createds.size();index++) {
@@ -598,7 +598,6 @@
action.setEnabled(isEnable());
}
- @SuppressWarnings("unchecked")
private boolean isEnable() {
if (selection instanceof IStructuredSelection) {
if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -78,7 +78,6 @@
action.setEnabled(isEnable());
}
- @SuppressWarnings("unchecked")
private boolean isEnable() {
if (selection instanceof IStructuredSelection) {
if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -74,7 +74,6 @@
action.setEnabled(isEnable());
}
- @SuppressWarnings("unchecked")
private boolean isEnable() {
if (selection instanceof IStructuredSelection) {
if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -52,11 +52,10 @@
action.setEnabled(isEnable());
}
- @SuppressWarnings("unchecked")
private boolean isEnable() {
selectedComponents = new ArrayList<Component>();
if (selection instanceof IStructuredSelection) {
- for (Iterator iterator = ((IStructuredSelection) selection)
+ for (Iterator<?> iterator = ((IStructuredSelection) selection)
.iterator(); iterator.hasNext();) {
Object part = iterator.next();
if (part instanceof ComponentEditPart) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortPopupMenuActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortPopupMenuActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortPopupMenuActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -34,7 +34,6 @@
private PortEditPart portPart;
- @SuppressWarnings("unchecked")
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
compositeComponent = null;
if (targetPart instanceof AbstractSystemDiagramEditor) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionDelegate.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionDelegate.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -94,10 +94,9 @@
}
}
- @SuppressWarnings("unchecked")
public void run(final IAction action) {
- for (Iterator iter = ((IStructuredSelection) selection).iterator(); iter
+ for (Iterator<?> iter = ((IStructuredSelection) selection).iterator(); iter
.hasNext();) {
final CorbaComponent component = (CorbaComponent) iter.next();
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionHandler.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionHandler.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/IComponentActionHandler.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -26,7 +26,6 @@
public class IComponentActionHandler extends AbstractHandler {
- @SuppressWarnings("unchecked")
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = HandlerUtil.getActivePartChecked(event);
@@ -34,7 +33,7 @@
List<CorbaComponent> components = new ArrayList<CorbaComponent>();
if (selection instanceof IStructuredSelection) {
- for (Iterator iter = ((IStructuredSelection) selection).iterator(); iter
+ for (Iterator<?> iter = ((IStructuredSelection) selection).iterator(); iter
.hasNext();) {
Object o = AdapterUtil.getAdapter(iter.next(), Component.class);
if (!(o instanceof CorbaComponent)) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -117,8 +117,8 @@
public void widgetSelected(SelectionEvent e) {
int selectionIndex = additionalTableViewer.getTable().getSelectionIndex();
if (selectionIndex >= 0
- && ((List) additionalTableViewer.getInput()).size() >= selectionIndex + 1) {
- ((List) additionalTableViewer.getInput()).remove(selectionIndex);
+ && ((List<?>) additionalTableViewer.getInput()).size() >= selectionIndex + 1) {
+ ((List<?>) additionalTableViewer.getInput()).remove(selectionIndex);
additionalTableViewer.refresh();
}
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -67,7 +67,7 @@
tabComponent.setText("Component");
//
NameServerManager ns = NameServerManagerImpl.getInstance();
- EList nscomps = ns.getNodes();
+ EList<?> nscomps = ns.getNodes();
componentCandidates = DeployUtil.searchComponentList(nscomps, componentCandidates);
listComp = new List(tabFolder,SWT.SINGLE|SWT.BORDER|SWT.V_SCROLL);
for(int index=0;index<componentCandidates.size();index++) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/ChangeComponentDirectionAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/ChangeComponentDirectionAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/ChangeComponentDirectionAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -3,7 +3,6 @@
import java.util.HashMap;
import java.util.List;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.systemeditor.ui.editor.editpolicy.EditPolicyConstraint;
import jp.go.aist.rtm.toolscommon.model.component.Component;
@@ -52,8 +51,7 @@
return cmd.canExecute();
}
- @SuppressWarnings("unchecked")
- protected Command createCommand(List selectedEditParts) {
+ protected Command createCommand(List<?> selectedEditParts) {
if (selectedEditParts.isEmpty())
return null;
if (!(selectedEditParts.get(0) instanceof EditPart))
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/MoveComponentAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/MoveComponentAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/MoveComponentAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -2,8 +2,6 @@
import java.util.List;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
-
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.RequestConstants;
@@ -107,8 +105,7 @@
* @param selectedEditParts 対象のEditPart
* @return 作成したコマンド
*/
- @SuppressWarnings("unchecked")
- protected Command createMoveCommand(List selectedEditParts) {
+ protected Command createMoveCommand(List<?> selectedEditParts) {
if (selectedEditParts.isEmpty())
return null;
if (!(selectedEditParts.get(0) instanceof EditPart))
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -1,6 +1,5 @@
package jp.go.aist.rtm.systemeditor.ui.editor.action;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
import org.eclipse.gef.ui.actions.EditorPartAction;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndCreateRestoreAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndCreateRestoreAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndCreateRestoreAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -1,10 +1,9 @@
package jp.go.aist.rtm.systemeditor.ui.editor.action;
+import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
+
import org.eclipse.gef.ui.actions.EditorPartAction;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
-import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
-
/**
* RTSプロファイルを読み込んで、コンポーネント生成まで行うアクション
*/
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndQuickRestoreAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndQuickRestoreAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndQuickRestoreAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -1,6 +1,5 @@
package jp.go.aist.rtm.systemeditor.ui.editor.action;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
import org.eclipse.gef.ui.actions.EditorPartAction;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndRestoreAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndRestoreAction.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/action/OpenAndRestoreAction.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -1,6 +1,5 @@
package jp.go.aist.rtm.systemeditor.ui.editor.action;
-import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
import org.eclipse.gef.ui.actions.EditorPartAction;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/ClearLineConstraintCommand.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/ClearLineConstraintCommand.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/ClearLineConstraintCommand.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -19,7 +19,6 @@
public class ClearLineConstraintCommand extends Command {
private ModelElement model;
- @SuppressWarnings("unchecked")
private Map<PortConnector, Map> oldRoutingConstraint = new IdentityHashMap<PortConnector, Map>();
/**
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CombineCommand.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CombineCommand.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CombineCommand.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -20,7 +20,6 @@
// 複合RTC
private Component target;
- @SuppressWarnings("unchecked")
@Override
/**
* {@inheritDoc}
@@ -39,8 +38,7 @@
parent.addComponent(target);
}
- @SuppressWarnings("unchecked")
- private void removeConnections(EList components) {
+ private void removeConnections(EList<?> components) {
for (Object o : components) {
Component c = (Component)o;
for (Object o2 :c.getPorts()) {
@@ -53,7 +51,6 @@
}
}
- @SuppressWarnings("unchecked")
private void adjustParentDiagram(List<Component> selectedComponents) {
Component parentCompositeComponent = parent.getCompositeComponent();
if (parentCompositeComponent == null) return;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CreateCommand.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CreateCommand.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/command/CreateCommand.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -42,13 +42,12 @@
}
}
- @SuppressWarnings("unchecked")
private void setComponentsConstraint(Component component) {
List<Integer> counts = new ArrayList<Integer>();
int count = 0;
counts.add(count);
Integer temp = counts.get(counts.size() - 1);
- for (Iterator iterator = component.getAllComponents().iterator(); iterator
+ for (Iterator<?> iterator = component.getAllComponents().iterator(); iterator
.hasNext();) {
Component tempComponent = (Component) iterator.next();
if (tempComponent.getConstraint() == null) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/dnd/SystemDiagramDropTargetListener.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/dnd/SystemDiagramDropTargetListener.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/dnd/SystemDiagramDropTargetListener.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -17,7 +17,7 @@
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
+import org.eclipse.jface.util.LocalSelectionTransfer;
/**
* システムダイアグラムのDropTargetListener
@@ -34,7 +34,7 @@
* EditPartViewer
*/
public SystemDiagramDropTargetListener(EditPartViewer viewer) {
- super(viewer, LocalSelectionTransfer.getInstance());
+ super(viewer, LocalSelectionTransfer.getTransfer());
}
public boolean isOnline() {
@@ -101,7 +101,7 @@
@Override
protected void handleDrop() {
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer
- .getInstance().getSelection();
+ .getTransfer().getSelection();
getCurrentEvent().data = selection;
super.handleDrop();
}
@@ -114,7 +114,7 @@
// オンラインエディタへは NameServiceViewから DnD可能
// オフラインエディタへは RepositoryViewから DnD可能
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer
- .getInstance().getSelection();
+ .getTransfer().getSelection();
Iterator<?> iter = selection.iterator();
while (iter.hasNext()) {
Object obj = iter.next();
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/AbstractEditPart.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/AbstractEditPart.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/AbstractEditPart.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -69,7 +69,7 @@
/**
* モデルのオブジェクトに委譲している
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
Object result = AdapterUtil.getAdapter(getModel(), key);
@@ -76,7 +76,6 @@
if (result == null) {
result = super.getAdapter(key);
}
-
return result;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ComponentEditPart.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ComponentEditPart.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ComponentEditPart.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -414,9 +414,8 @@
refreshComponent();
((SystemDiagramEditPart) getParent()).refreshSystemDiagram();
} else if (ComponentPackage.eINSTANCE
- .getCorbaComponent_RTCComponentProfile().equals(
+ .getCorbaComponent_ComponentState().equals(
notification.getFeature())) {
- // コンポーネントの状態通知 (featureは仮)
refreshComponent();
} else if (CorePackage.eINSTANCE.getModelElement_Constraint().equals(
notification.getFeature())
Added: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECConnectionEditPart.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECConnectionEditPart.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECConnectionEditPart.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -0,0 +1,106 @@
+package jp.go.aist.rtm.systemeditor.ui.editor.editpart;
+
+import jp.go.aist.rtm.systemeditor.ui.editor.editpart.router.EditableManhattanConnectorRouter;
+import jp.go.aist.rtm.toolscommon.model.component.ExecutionContext;
+import jp.go.aist.rtm.toolscommon.util.AdapterUtil;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ECConnectionEditPart extends AbstractConnectionEditPart {
+
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ECConnectionEditPart.class);
+
+ public ECConnectionEditPart(ActionRegistry actionRegistry) {
+ super();
+ LOGGER.trace("new: actionRegistry=<{}>", actionRegistry);
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ LOGGER.trace("createEditPolicies");
+ // TODO 自動生成されたメソッド・スタブ
+
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ LOGGER.trace("createFigure");
+ PolylineConnection result = new PolylineConnection();
+ result.setLineWidth(1);
+ result.setLineDash(new float[] { 0.5f, 0.3f });
+ result.setConnectionRouter(new EditableManhattanConnectorRouter());
+ return result;
+ }
+
+ @Override
+ public void activate() {
+ LOGGER.trace("activate:");
+ super.activate();
+ // ((ModelElement) getModel()).eAdapters().add(this.modelListener);
+ }
+
+ @Override
+ public void deactivate() {
+ LOGGER.trace("deactivate:");
+ super.deactivate();
+ // ((ModelElement) getModel()).eAdapters().remove(this.modelListener);
+ }
+
+ @Override
+ public ECConnection getModel() {
+ return (ECConnection) super.getModel();
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ // refreshBendPoint();
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ Object result = AdapterUtil.getAdapter(getModel(), key);
+ if (result == null) {
+ result = super.getAdapter(key);
+ }
+ return result;
+ }
+
+ /**
+ *
+ */
+ public static class ECConnection {
+
+ private ExecutionContext source;
+ private ExecutionContext target;
+
+ public ECConnection(ExecutionContext source, ExecutionContext target) {
+ this.source = source;
+ this.target = target;
+ }
+
+ public ExecutionContext getSource() {
+ return this.source;
+ }
+
+ public void setSource(ExecutionContext source) {
+ this.source = source;
+ }
+
+ public ExecutionContext getTarget() {
+ return this.target;
+ }
+
+ public void setTarget(ExecutionContext target) {
+ this.target = target;
+ }
+ }
+
+}
Property changes on: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECConnectionEditPart.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECEditPart.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECEditPart.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ECEditPart.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -2,19 +2,25 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import jp.go.aist.rtm.systemeditor.manager.SystemEditorPreferenceManager;
import jp.go.aist.rtm.systemeditor.ui.editor.editpolicy.ECSelectionEditPolicy;
import jp.go.aist.rtm.systemeditor.ui.editor.figure.ECFigure;
-import jp.go.aist.rtm.toolscommon.model.component.ComponentPackage;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
import jp.go.aist.rtm.toolscommon.model.component.CorbaExecutionContext;
import jp.go.aist.rtm.toolscommon.model.component.ExecutionContext;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.NodeEditPart;
@@ -29,11 +35,9 @@
*
* @param <F>
*/
-public abstract class ECEditPart<F extends IFigure> extends AbstractEditPart
- implements NodeEditPart {
+public abstract class ECEditPart<F extends IFigure> extends AbstractEditPart implements NodeEditPart {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ECEditPart.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ECEditPart.class);
public ECEditPart(ActionRegistry actionRegistry) {
super(actionRegistry);
@@ -50,8 +54,7 @@
@Override
protected void createEditPolicies() {
LOGGER.trace("createEditPolicies");
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
- new ECSelectionEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ECSelectionEditPolicy());
}
@Override
@@ -71,8 +74,7 @@
@Override
protected void refreshVisuals() {
getFigure().setBackgroundColor(ColorHelper.getECBodyColor(getModel()));
- getFigure()
- .setForegroundColor(ColorHelper.getECBorderColor(getModel()));
+ getFigure().setForegroundColor(ColorHelper.getECBorderColor(getModel()));
getFigure().setToolTip(ToolTipHelper.getECToolTip(getModel()));
}
@@ -96,8 +98,7 @@
public void activate() {
LOGGER.trace("activate");
super.activate();
- SystemEditorPreferenceManager.getInstance().addPropertyChangeListener(
- preferenceChangeListener);
+ SystemEditorPreferenceManager.getInstance().addPropertyChangeListener(preferenceChangeListener);
}
@Override
@@ -104,10 +105,209 @@
public void deactivate() {
LOGGER.trace("deactivate");
super.deactivate();
- SystemEditorPreferenceManager.getInstance()
- .removePropertyChangeListener(preferenceChangeListener);
+ SystemEditorPreferenceManager.getInstance().removePropertyChangeListener(preferenceChangeListener);
}
+ private class Adapter extends AdapterImpl {
+ @Override
+ public void notifyChanged(Notification msg) {
+ LOGGER.trace("notifyChanged: msg=<{}>", msg);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isActive()) {
+ refresh();
+ }
+ }
+ });
+ }
+ }
+
+ public static class ECFinder {
+
+ private ExecutionContext ec;
+ private Component comp;
+ private SystemDiagram diagram;
+
+ public ECFinder(ExecutionContext ec) {
+ this.ec = ec;
+ getDiagram();
+ }
+
+ public Component getComponent() {
+ if (this.comp != null) {
+ return this.comp;
+ }
+ if (this.ec == null || !(this.ec.eContainer() instanceof Component)) {
+ return null;
+ }
+ this.comp = (Component) this.ec.eContainer();
+ return this.comp;
+ }
+
+ public SystemDiagram getDiagram() {
+ if (this.diagram != null) {
+ return this.diagram;
+ }
+ Component comp = getComponent();
+ if (comp == null) {
+ return null;
+ }
+ if (comp == null || !(comp.eContainer() instanceof SystemDiagram)) {
+ return null;
+ }
+ this.diagram = (SystemDiagram) comp.eContainer();
+ return this.diagram;
+ }
+
+ public boolean isOwnedEC() {
+ Component comp = getComponent();
+ if (comp == null) {
+ return false;
+ }
+ return comp.getExecutionContextHandler().getId(this.ec) != null;
+ }
+
+ public boolean isPartEC() {
+ Component comp = getComponent();
+ if (comp == null) {
+ return false;
+ }
+ return comp.getParticipationContextHandler().getId(this.ec) != null;
+ }
+
+ public List<ExecutionContext> getPartECList() {
+ List<ExecutionContext> ret = new ArrayList<>();
+ if (!isOwnedEC()) {
+ return ret;
+ }
+ for (Component c : this.ec.getParticipants()) {
+ if (!this.diagram.getComponents().contains(c)) {
+ continue;
+ }
+ for (ExecutionContext pe : c.getParticipationContexts()) {
+ if (this.comp.equals(pe.getOwner())) {
+ ret.add(pe);
+ }
+ }
+ }
+ return ret;
+ }
+
+ public ExecutionContext getOwnedEC() {
+ if (!isPartEC()) {
+ return null;
+ }
+ Component oc = this.ec.getOwner();
+ if (!this.diagram.getComponents().contains(oc)) {
+ return null;
+ }
+ for (ExecutionContext oe : oc.getExecutionContexts()) {
+ if (oe.getParticipants().contains(this.comp)) {
+ return oe;
+ }
+ }
+ return null;
+ }
+
+ }
+
+ @Override
+ protected List<?> getModelTargetConnections() {
+ List<ECConnectionEditPart.ECConnection> ret = new ArrayList<>();
+
+ ECFinder finder = new ECFinder(getModel());
+ ExecutionContext oe = finder.getOwnedEC();
+ if (oe != null) {
+ ret.add(new ECConnectionEditPart.ECConnection(oe, getModel()));
+ }
+
+ return ret;
+ }
+
+ @Override
+ protected List<?> getModelSourceConnections() {
+ List<ECConnectionEditPart.ECConnection> ret = new ArrayList<>();
+
+ ECFinder finder = new ECFinder(getModel());
+ for (ExecutionContext pe : finder.getPartECList()) {
+ ret.add(new ECConnectionEditPart.ECConnection(getModel(), pe));
+ }
+
+ return ret;
+ }
+
+ @Override
+ protected void refreshSourceConnections() {
+ LOGGER.trace("refreshSourceConnections: this=<{}>", getModel());
+
+ Map<Object, ConnectionEditPart> modelToEditPart = new HashMap<>();
+ List<?> editParts = getSourceConnections();
+ List<?> modelObjects = getModelSourceConnections();
+ if (modelObjects == null) {
+ modelObjects = new ArrayList<>();
+ }
+ List<ConnectionEditPart> trash = new ArrayList<>();
+
+ int i = 0;
+ for (i = 0; i < editParts.size(); i++) {
+ ConnectionEditPart editPart = (ConnectionEditPart) editParts.get(i);
+ Object model = editPart.getModel();
+ if (modelObjects.contains(model)) {
+ modelToEditPart.put(model, editPart);
+ } else {
+ trash.add(editPart);
+ }
+ }
+ // Add new EditParts
+ for (i = 0; i < modelObjects.size(); i++) {
+ Object model = modelObjects.get(i);
+ if (!modelToEditPart.containsKey(model)) {
+ ConnectionEditPart editPart = createOrFindConnection(model);
+ addSourceConnection(editPart, 0);
+ }
+ }
+ // Remove the remaining EditParts
+ for (i = 0; i < trash.size(); i++) {
+ removeSourceConnection((ConnectionEditPart) trash.get(i));
+ }
+ }
+
+ @Override
+ protected void refreshTargetConnections() {
+ LOGGER.trace("refreshTargetConnections: this=<{}>", getModel());
+
+ Map<Object, ConnectionEditPart> mapModelToEditPart = new HashMap<>();
+ List<?> connections = getTargetConnections();
+ List<?> modelObjects = getModelTargetConnections();
+ if (modelObjects == null)
+ modelObjects = new ArrayList<>();
+ List<ConnectionEditPart> trash = new ArrayList<>();
+
+ int i = 0;
+ for (i = 0; i < connections.size(); i++) {
+ ConnectionEditPart editPart = (ConnectionEditPart) connections.get(i);
+ Object model = editPart.getModel();
+ if (modelObjects.contains(model)) {
+ mapModelToEditPart.put(model, editPart);
+ } else {
+ trash.add(editPart);
+ }
+ }
+ // Add new EditParts
+ for (i = 0; i < modelObjects.size(); i++) {
+ Object model = modelObjects.get(i);
+ if (!mapModelToEditPart.containsKey(model)) {
+ ConnectionEditPart editPart = createOrFindConnection(model);
+ addTargetConnection(editPart, 0);
+ }
+ }
+ // Remove the remaining Connection EditParts
+ for (i = 0; i < trash.size(); i++) {
+ removeTargetConnection((ConnectionEditPart) trash.get(i));
+ }
+ }
+
/**
* Owned EC の EditPart
*/
@@ -119,8 +319,7 @@
@Override
public ExecutionContext getModel() {
- return (ExecutionContext) ((ECEditPart.OwnEC) super
- .getWrappedModel()).getModel();
+ return (ExecutionContext) ((ECEditPart.OwnEC) super.getWrappedModel()).getModel();
}
@Override
@@ -129,7 +328,7 @@
IFigure result = new ECFigure.OwnECFigure(getModel());
- // 代表の ECの場合は選択中として描画 (仮)
+ // 代表EC の場合は選択中として描画
CorbaComponent comp = (CorbaComponent) getModel().eContainer();
if (comp != null) {
CorbaExecutionContext cec = (CorbaExecutionContext) getModel();
@@ -144,15 +343,13 @@
}
@Override
- public ConnectionAnchor getSourceConnectionAnchor(
- ConnectionEditPart connection) {
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
// TODO 自動生成されたメソッド・スタブ
return null;
}
@Override
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connection) {
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
// TODO 自動生成されたメソッド・スタブ
return null;
}
@@ -171,18 +368,6 @@
@Override
public void notifyChanged(Notification notification) {
- if (ComponentPackage.eINSTANCE.getExecutionContext_StateL().equals(
- notification.getFeature())) {
- PlatformUI.getWorkbench().getDisplay()
- .asyncExec(new Runnable() {
- @Override
- public void run() {
- if (isActive()) {
- refreshVisuals();
- }
- }
- });
- }
}
}
@@ -190,8 +375,7 @@
/**
* Participant ECの EditPartを表します。
*/
- public static class PartECEditPart extends
- ECEditPart<ECFigure.PartECFigure> {
+ public static class PartECEditPart extends ECEditPart<ECFigure.PartECFigure> {
public PartECEditPart(ActionRegistry actionRegistry) {
super(actionRegistry);
@@ -199,8 +383,7 @@
@Override
public ExecutionContext getModel() {
- return (ExecutionContext) ((ECEditPart.PartEC) super
- .getWrappedModel()).getModel();
+ return (ExecutionContext) ((ECEditPart.PartEC) super.getWrappedModel()).getModel();
}
@Override
@@ -209,20 +392,27 @@
IFigure result = new ECFigure.PartECFigure(getModel());
+ // 代表EC の場合は選択中として描画
+ CorbaComponent comp = (CorbaComponent) getModel().eContainer();
+ if (comp != null) {
+ CorbaExecutionContext cec = (CorbaExecutionContext) getModel();
+ if (cec == comp.getPrimaryExecutionContext()) {
+ result = new ECFigure.SelectedPartECFigure(getModel());
+ }
+ }
+
result.setLocation(new Point(0, 0));
return result;
}
@Override
- public ConnectionAnchor getSourceConnectionAnchor(
- ConnectionEditPart connection) {
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
// TODO 自動生成されたメソッド・スタブ
return null;
}
@Override
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connection) {
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
// TODO 自動生成されたメソッド・スタブ
return null;
}
@@ -241,18 +431,6 @@
@Override
public void notifyChanged(Notification notification) {
- if (ComponentPackage.eINSTANCE.getExecutionContext_StateL().equals(
- notification.getFeature())) {
- PlatformUI.getWorkbench().getDisplay()
- .asyncExec(new Runnable() {
- @Override
- public void run() {
- if (isActive()) {
- refreshVisuals();
- }
- }
- });
- }
}
}
@@ -259,8 +437,7 @@
/**
* Owned ECのモデルのラッパを表します。<br>
- * ※モデル上は Owned/Participantの ECに違いはなく、Componentの関連によって決まるが、 モデルと
- * EditPartの対応付けで別クラスにする必要があり、ここでラップクラスを設けます。
+ * ※モデル上は Owned/Participantの ECに違いはなく、Componentの関連によって決まるが、 モデルと EditPartの対応付けで別クラスにする必要があり、ここでラップクラスを設けます。
*/
public static class OwnEC {
@@ -278,8 +455,7 @@
/**
* Participant ECのモデルのラッパを表します。<br>
- * ※モデル上は Owned/Participantの ECに違いはなく、Componentの関連によって決まるが、 モデルと
- * EditPartの対応付けで別クラスにする必要があり、ここでラップクラスを設けます。
+ * ※モデル上は Owned/Participantの ECに違いはなく、Componentの関連によって決まるが、 モデルと EditPartの対応付けで別クラスにする必要があり、ここでラップクラスを設けます。
*/
public static class PartEC {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ToolTipHelper.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ToolTipHelper.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/ToolTipHelper.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -15,8 +15,7 @@
*/
public class ToolTipHelper {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ToolTipHelper.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ToolTipHelper.class);
private static final String CRLF = "\r\n";
@@ -36,9 +35,13 @@
CorbaComponent comp = (CorbaComponent) ec.eContainer();
if (comp != null) {
sb.append(CRLF);
- sb.append("component state: ").append(
- nv(cec.getComponentStateName(comp)));
+ sb.append("component state: ").append(nv(cec.getComponentStateName(comp)));
}
+ String type = cec.getProperty("type");
+ if (type != null && !type.isEmpty()) {
+ sb.append(CRLF);
+ sb.append("type: ").append(type);
+ }
}
return buildPanel(sb.toString());
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/direct/NameDirectEditManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/direct/NameDirectEditManager.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/direct/NameDirectEditManager.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -11,8 +11,7 @@
Object model;
- @SuppressWarnings("unchecked")
- public NameDirectEditManager(GraphicalEditPart source, Class editorType,
+ public NameDirectEditManager(GraphicalEditPart source, Class<?> editorType,
CellEditorLocator locator) {
super(source, editorType, locator);
this.model = source.getModel();
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/factory/SystemDiagramEditPartFactory.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/factory/SystemDiagramEditPartFactory.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpart/factory/SystemDiagramEditPartFactory.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -120,9 +120,8 @@
return result;
}
- @SuppressWarnings("unchecked")
private EditPart newEditPart(Object object) {
- Class clazz = getMappingEditPartClass(object.getClass());
+ Class<?> clazz = getMappingEditPartClass(object.getClass());
EditPart result = null;
if (clazz != null) {
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/ECSelectionEditPolicy.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/ECSelectionEditPolicy.java 2018-03-19 07:09:54 UTC (rev 818)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/ECSelectionEditPolicy.java 2018-03-21 05:54:06 UTC (rev 819)
@@ -3,7 +3,10 @@
import jp.go.aist.rtm.toolscommon.model.component.Component;
import jp.go.aist.rtm.toolscommon.model.component.ExecutionContext;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gef.requests.SelectionRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -12,19 +15,24 @@
*/
public class ECSelectionEditPolicy extends SelectionEditPolicy {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ECSelectionEditPolicy.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ECSelectionEditPolicy.class);
+ private Request selectionRequest = null;
+
@Override
protected void hideSelection() {
- LOGGER.info("hideSelection: host={} model={}", getHost(), getHost().getModel());
-
+ LOGGER.debug("hideSelection: host={} model={}", getHost(), getHost().getModel());
}
@Override
protected void showSelection() {
- LOGGER.info("showSelection: host={} model={}", getHost(), getHost().getModel());
+ LOGGER.debug("showSelection: host={} model={}", getHost(), getHost().getModel());
+ if (this.selectionRequest != null) {
+ this.selectionRequest = null;
+ return;
+ }
+
ExecutionContext ec = (ExecutionContext) getHost().getModel();
Component comp = (Component) ec.eContainer();
@@ -33,4 +41,22 @@
}
}
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ // セレクションのリクエストを保持する
+ // 直接選択時は SelectionRequest、範囲選択時は MARQUEE_REQUESTが指定が発行されるので、
+ // これを保持し、直接選択時のみ showSelectionを実行する
+ if (!(request instanceof SelectionRequest)) {
+ this.selectionRequest = request;
+ } else {
+ this.selectionRequest = null;
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ @Override
+ public void eraseTargetFeedback(Request request) {
+ super.eraseTargetFeedback(request);
+ }
+
}
openrtm-commit メーリングリストの案内