本文整理汇总了Java中org.eclipse.gef.EditPartViewer.getContents方法的典型用法代码示例。如果您正苦于以下问题:Java EditPartViewer.getContents方法的具体用法?Java EditPartViewer.getContents怎么用?Java EditPartViewer.getContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.EditPartViewer
的用法示例。
在下文中一共展示了EditPartViewer.getContents方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseDown
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
@Override
public void mouseDown(MouseEvent e, EditPartViewer viewer) {
if (viewer.getContents() instanceof AbstractModelEditPart) {
// マウスポインタがクリックされた位置を記録する。コピーしたオブジェクトの貼り付け位置として使う、等。
final AbstractModelEditPart editPart = (AbstractModelEditPart) viewer.getContents();
final IERDiagram diagram = (IERDiagram) editPart.getModel();
diagram.setMousePoint(new Point(e.x, e.y));
editPart.getFigure().translateToRelative(diagram.getMousePoint());
final ERFluteMultiPageEditor multiPageEditor = diagram.getEditor();
final int QUICK_OUTLINE_OPEN_BUTTON = 2;
if (e.button == QUICK_OUTLINE_OPEN_BUTTON && multiPageEditor != null) {
final MainDiagramEditor mainDiagramEditor = (MainDiagramEditor) multiPageEditor.getActiveEditor();
mainDiagramEditor.runERDiagramQuickOutlineAction();
}
}
super.mouseDown(e, viewer);
}
示例2: mouseDown
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
@Override
public void mouseDown(final MouseEvent e, final EditPartViewer viewer) {
if (viewer.getContents() instanceof ERDiagramEditPart) {
final ERDiagramEditPart editPart = (ERDiagramEditPart) viewer.getContents();
final ERDiagram diagram = (ERDiagram) editPart.getModel();
diagram.mousePoint = new Point(e.x, e.y);
editPart.getFigure().translateToRelative(diagram.mousePoint);
}
super.mouseDown(e, viewer);
}
示例3: mouseDown
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
@Override
public void mouseDown(MouseEvent e, EditPartViewer viewer) {
if (viewer.getContents() instanceof ERDiagramEditPart) {
ERDiagramEditPart editPart = (ERDiagramEditPart) viewer
.getContents();
ERDiagram diagram = (ERDiagram) editPart.getModel();
diagram.mousePoint = new Point(e.x, e.y);
editPart.getFigure().translateToRelative(diagram.mousePoint);
}
super.mouseDown(e, viewer);
}
示例4: refresh
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Refresh.
*/
void refresh() {
final EditPartViewer viewer = getViewer();
final EditPart contents = viewer.getContents();
if (contents != null) {
contents.refresh();
}
}
示例5: refresh
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Refresh.
*/
void refresh() {
final EditPartViewer viewer = getViewer();
final EditPart contents = viewer.getContents();
if (contents != null) {
contents.refresh();
}
}