当前位置: 首页>>代码示例>>Java>>正文


Java RootEditPart类代码示例

本文整理汇总了Java中org.eclipse.gef.RootEditPart的典型用法代码示例。如果您正苦于以下问题:Java RootEditPart类的具体用法?Java RootEditPart怎么用?Java RootEditPart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RootEditPart类属于org.eclipse.gef包,在下文中一共展示了RootEditPart类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeOverview

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Initialize overview.
 */
protected void initializeOverview() {
	LightweightSystem lws = new J2DLightweightSystem(overview);

	RootEditPart rep = editor.getGraphicalViewer().getRootEditPart();
	if (rep instanceof MainDesignerRootEditPart) {
		ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
		thumbnail = new JSSScrollableThumbnail((Viewport) root.getFigure(), (MRoot)getViewer().getContents().getModel());
		thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
		lws.setContents(thumbnail);
		disposeListener = new DisposeListener() {
			public void widgetDisposed(DisposeEvent e) {
				if (thumbnail != null) {
					thumbnail.deactivate();
					thumbnail = null;
				}
			}
		};
		editor.getEditor().addDisposeListener(disposeListener);
	}
	lws.setControl(overview);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:JDReportOutlineView.java

示例2: initializeOverview

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Initialize the graphical overview.
 * 
 */
protected void initializeOverview() {
    if (multieditor.getCurrentPage() == null) {
        overview.setVisible(false);
        thumbnail.deactivate();
        thumbnail = null;
        return;
    }

    RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        refreshThumbnail((ScalableFreeformRootEditPart) rep);

        disposeListener = new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                if (thumbnail != null) {
                    thumbnail.deactivate();
                    thumbnail = null;
                }
            }
        };
        ((FigureCanvas) multieditor.getCurrentPage().getGraphicalViewer().getControl()).addDisposeListener(disposeListener);
    }
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:28,代码来源:UrnOutlinePage.java

示例3: pageChanged

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Refresh the overview thumbnail when the map changes.
 */
public void pageChanged() {
    if (multieditor.getCurrentPage() == null) {
        overview.setVisible(false);
        thumbnail.deactivate();
        thumbnail = null;
        return;
    }

    RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        refreshThumbnail((ScalableFreeformRootEditPart) rep);
    }

    refreshDefinitions(false);

}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:20,代码来源:UrnOutlinePage.java

示例4: getViewer

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
public EditPartViewer getViewer() {
	RootEditPart root = getRoot();
	if (root == null) {
		return null;
	}
	return root.getViewer();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:GraphTreeEditPart.java

示例5: getOverviewOutlinePage

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
protected OverviewOutlinePage getOverviewOutlinePage() {
	if(null == overviewOutlinePage && null != getGraphicalViewer()) {
		RootEditPart rootEditPart = getGraphicalViewer().getRootEditPart();
		if(rootEditPart instanceof ScalableRootEditPart) {
			overviewOutlinePage =
				new OverviewOutlinePage(
						(ScalableRootEditPart) rootEditPart);
		}
	}
	return overviewOutlinePage;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:12,代码来源:RevisionGraphEditor.java

示例6: getDiagramEditPart

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * 
 * platformUi에서 다이어그램 EditPart를 가져온다.
 * 
 * @return EditPart
 */
public static EditPart getDiagramEditPart() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    if (!checkNull(workbench)) {
        return null;
    }
    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
    if (!checkNull(workbenchWindow)) {
        return null;
    }
    IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
    if (!checkNull(workbenchPage)) {
        return null;
    }
    IEditorPart editorPart = workbenchPage.getActiveEditor();
    if (!checkNull(editorPart)) {
        return null;
    }
    if (!(editorPart instanceof AbstractDiagramEditor)) {
        return null;
    }
    GraphicalViewer graphicalViewer = ((AbstractDiagramEditor) editorPart).getDiagramGraphicalViewer();
    if (!checkNull(graphicalViewer)) {
        return null;
    }
    RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
    if (!checkNull(rootEditPart)) {
        return null;
    }
    EditPart editPart = rootEditPart.getContents();
    if (!checkNull(editPart)) {
        return null;
    }

    return editPart;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:ProjectUtil.java

示例7: getRoot

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
 */
@Override
public RootEditPart getRoot() {
    if (getParent() != null && getParent().getParent() != null) {
        return super.getRoot();
    } else {
        return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow()
            .getActivePage()
            .getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
    }
    // return super.getRoot();
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:ScrollableEditPart.java

示例8: getRoot

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
 */
@Override
public RootEditPart getRoot() {
    if (getParent() != null && getParent().getParent() != null) {
        return super.getRoot();
    } else {
        return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow()
            .getActivePage()
            .getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:15,代码来源:LifeLineEditPart.java

示例9: getMapMode

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
protected IMapMode getMapMode() {
	RootEditPart root = getHost().getRoot();
	if (root instanceof DiagramRootEditPart) {
		DiagramRootEditPart dgrmRoot = (DiagramRootEditPart) root;
		return dgrmRoot.getMapMode();
	}

	return MapModeUtil.getMapMode();
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:10,代码来源:FeedbackGraphicalNodeEditPolicy.java

示例10: appendSelection

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
 */
public void appendSelection(EditPart editpart) {
	if (editpart instanceof RootEditPart)
		editpart = ((RootEditPart) editpart).getContents();
	setFocus(editpart);
	super.appendSelection(editpart);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:JDRulerComposite.java

示例11: createEditPolicies

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Creates and installs pertinent EditPolicies.
 */
@Override
protected void createEditPolicies() {
	super.createEditPolicies();
	installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
	installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
	//Overwrite the policy that handle the delete, so i have a custom delete command to close the subeditor
	installEditPolicy(EditPolicy.COMPONENT_ROLE, new CloseSubeditorDeletePolicy());
	// If this editpart is the contents of the viewer, then it is not deletable!
	if (getParent() instanceof RootEditPart)
		installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:ContainerTreeEditPart.java

示例12: createEditPolicies

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Creates and installs pertinent EditPolicies.
 */
@Override
protected void createEditPolicies() {
	super.createEditPolicies();
	installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
	installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
	// If this editpart is the contents of the viewer, then it is not deletable!
	if (getParent() instanceof RootEditPart)
		installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:NotDragableContainerTreeEditPart.java

示例13: createEditPolicies

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
 * Creates and installs pertinent EditPolicies.
 */
protected void createEditPolicies() {
	super.createEditPolicies();
	installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDStyleContainerEditPolicy());
	installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDStyleTreeContainerEditPolicy());
	// If this editpart is the contents of the viewer, then it is not deletable!
	if (getParent() instanceof RootEditPart)
		installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:StyleContainerTreeEditPart.java

示例14: handleMove

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
@Override
protected boolean handleMove() {
	try {
		EditPartViewer viewer = getCurrentViewer();
		if (viewer instanceof TimelineViewer) {
			TimelineViewer timelineViewer = (TimelineViewer) viewer;
			RootEditPart rootEditPart = timelineViewer.getRootEditPart();
			List children = rootEditPart.getChildren();
			if ((children.size() != 1) || !(children.get(0) instanceof SplitScroller)) {
				// Don't update the cursor time while in the horizontal scroller.
				// Scrolling and updating the cursor time together interact very poorly.
				// The effect seen was that the scrollbar would follow the cursor until
				// the mouse was released at which point the scrollbar would snap to the
				// right, hiding what the user had revealed.
				TimelineUtils.updateCursorTime(timelineViewer, this);
			}
		}
		String tooltipPreference = TimelineConstants.TIMELINE_PREFERENCES.getString(TimelinePreferencePage.P_TOOLTIP_SPEED);
		Tooltip value = Tooltip.valueOf(tooltipPreference);
		if (value == Tooltip.FAST) {
			handleHover();
		}
	} catch (Exception e) {
		LogUtil.error("handleMove", e);
	}		
	return super.handleMove();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:28,代码来源:TimelineTool.java

示例15: getRoot

import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
@Override
public RootEditPart getRoot() {
	if (getParent() == null) {
		return null;
	}
	return super.getRoot();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:8,代码来源:TimelineViewerEditPart.java


注:本文中的org.eclipse.gef.RootEditPart类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。