Skip to content

Instantly share code, notes, and snippets.

@shin1ogawa
Created February 22, 2009 13:49
Show Gist options
  • Save shin1ogawa/68474 to your computer and use it in GitHub Desktop.
Save shin1ogawa/68474 to your computer and use it in GitHub Desktop.
/**
* TODO for shin1ogawa
*
* @param diagramIndex ダイアグラムエディタのインデックス(エディタ内のタブインデックス)
* @param nodeAdapter ノードに対応する{@link NodeAdapter}
* @param nodeProfile 追加する{@link NodeProfile}
*/
public void addNodeProfile(int diagramIndex, final NodeAdapter nodeAdapter, final NodeProfile nodeProfile) {
DiagramPresentations diagramPresentations = getRootModel().getAdapter(DiagramPresentations.class);
final DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(diagramIndex);
Command redoCommand = new AddProfileToDiaglamCommand(getRootModel(), nodeAdapter, nodeProfile);
Command undoCommand = redoCommand.execute(new CommandProcessor() {
public void process(Command command) {
diagramPresentationModel.getFigureProfiles().put(nodeAdapter, nodeProfile);
}
});
redoStack.push(redoCommand);
undoStack.push(undoCommand);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment