Newer
Older
AlgebraicDataflowArchitectureModel / AlgebraicDataflowArchitectureModel / src / application / actions / ShowDependentableMediatorAction.java
k-fujii on 12 Mar 2 KB コメントを追記.
package application.actions;

import java.awt.event.ActionEvent;

import com.mxgraph.model.mxCell;
import com.mxgraph.swing.mxGraphComponent;

import application.editor.stages.ControlFlowDelegationStage;
import application.editor.stages.ControlFlowDelegationStageStatus;
import models.controlFlowModel.CallEdgeAttribute;

public class ShowDependentableMediatorAction extends AbstractPopupAction {	
	private ControlFlowDelegationStage stage = null;
	
	/*************************************************************
	/*************************************************************
	 *  [ *constructor ]
	/*************************************************************
	 */
	public ShowDependentableMediatorAction(final ControlFlowDelegationStage stage, final mxGraphComponent graphComponent, final mxCell targetCell) {
		super(/*propName*/"dependsOnMediator", targetCell, graphComponent);
		this.stage = stage;		
	}

	/*************************************************************
	/************************************************************
	 * [ *public ]
	/*************************************************************
	 * DoM適用可能範囲の表示まで実行する. 
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		super.actionPerformed(e);
		showDependentableNodesBySelectedEdge(targetCell);
		stage.setState(ControlFlowDelegationStageStatus.SHOWING_DEPENDENTABLE_NODES);
		// ⇒ 移行のDoM実行操作は, 【ControlFlowStageEditor】で実行される. 
	}

	/*************************************************************
	/*************************************************************
	 * [ *private ] 	
	/*************************************************************
	 * 選択されたセルの, DoM実行な仲介者オブジェクトを表示する. 
	 */
	private void showDependentableNodesBySelectedEdge(Object cellObj) {
			CallEdgeAttribute callEdgeAttr = (CallEdgeAttribute)graphComponent.getGraph().getModel().getValue(cellObj);	
			if(callEdgeAttr == null) return;
			
			ControlFlowDelegationStage cfdStage = (ControlFlowDelegationStage)stage;	
			cfdStage.showDependentableNodes(callEdgeAttr);
	}	
}