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


Java EditPartViewer.getControl方法代码示例

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


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

示例1: display

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * Cause the tooltip shell to activate for the provided host.
 * Intentionally does not retain the host, to assist in garbage collection.
 * 
 * @param host
 * @param location
 */
public void display(GraphicalEditPart host, Point location) {
	if (Tooltip.NONE != getTooltipMode() && windowActive) {
		EditPartViewer viewer = GEFUtils.getViewerSafely(host);
		if (viewer != null) {
			Control control = viewer.getControl();
			if (!control.isDisposed()) {
				if (host.getFigure() != figure) {
					activateTooltip(host, control, location);
				}
			}
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:TooltipShellManager.java

示例2: getDisplay

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * Get the active display thread for the given edit part.
 * @param editPart
 * @return the active display thread for the given edit part.
 */
private static Display getDisplay(EditPart editPart) {
	Display display = null;
	if(editPart != null) {
		EditPartViewer editPartViewer = editPart.getViewer();
		if(editPartViewer != null) {
			Control control = editPartViewer.getControl();
			if(control != null) {
				display = control.getDisplay();
			}
		}
	}

	return display;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:HeatMapDataEditPartHoverEditPolicy.java

示例3: reactivate

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * Calls <code>deactivate()</code> and then <code>activate()</code>.
 */
protected void reactivate() {
	// Fix for Bug# 91448
	EditPartViewer viewer = getCurrentViewer();
	deactivate();
	activate();
	if (viewer != null) {
		Control c = viewer.getControl();
		if (c != null && !c.isDisposed() && c.isFocusControl())
			setViewer(viewer);
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:AbstractTool.java

示例4: doubleClick

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
private void doubleClick(final Tool theTool, final EditPartViewer theEditPartViewer) {
	final Event theEvent = new Event();
	theEvent.widget = theEditPartViewer.getControl();
	final MouseEvent mouseEvent = new MouseEvent(theEvent);
	mouseEvent.button = 1;
	theTool.mouseDoubleClick(mouseEvent, theEditPartViewer);
}
 
开发者ID:timezra,项目名称:UML-Testing-Tool,代码行数:8,代码来源:ClassDiagramPaletteTest.java

示例5: getReportBounds

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected Result getReportBounds( Rectangle reportSize )
{
	Result revValue = new Result( );
	revValue.reportSize.y = MINTOPSPACE;
	revValue.reportSize.width = reportSize.width;
	revValue.reportSize.height = reportSize.height;

	EditPartViewer viewer = owner.getViewer( );
	Scrollable control = viewer == null ? null : (Scrollable)viewer.getControl( );
	Rectangle containerSize = control == null ? new Rectangle( )
			: new Rectangle( control.getClientArea( ) );

	PrecisionDimension dim = new PrecisionDimension( containerSize.width,
			containerSize.height );

	double scale = getZoomManager( ).getZoom( );
	dim.performScale( 1 / scale );
	if ( dim.width > reportSize.width + MINLEFTSPACE + MINRIGHTSPACE )
	{
		revValue.reportSize.x = ( dim.width - reportSize.width ) / 2;
		revValue.rightSpace = ( dim.width - reportSize.width ) / 2;
	}
	else
	{
		revValue.reportSize.x = MINLEFTSPACE;
		revValue.rightSpace = MINRIGHTSPACE;
	}

	if ( dim.height > reportSize.height + MINTOPSPACE + MINBOTTOMSPACE )
	{
		revValue.bottomSpace = dim.height - reportSize.height
				- revValue.reportSize.y;
	}
	else
	{
		revValue.bottomSpace = MINBOTTOMSPACE;
	}

	return revValue;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:41,代码来源:AbstractPageFlowLayout.java

示例6: run

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public void run( )
{
	if (!getSourceEditPart( ).isActive( ))
	{
		return;
	}
	EditPartViewer viewer = getSourceEditPart( ).getViewer( );
	EditPart parent = getSourceEditPart( ).getParent( );
	if ( activeHelper == this
			&& getSourceEditPart( ).isActive( )
			&& viewer.getControl( ) != null
			&& !viewer.getControl( ).isDisposed( ) )
	{
		
		viewer.getControl().removeFocusListener(focus);
		
		viewer.getControl().removeKeyListener(key);
		if ( viewer.getSelectedEditParts( ).size( ) == 1 )
		{
			if ( parent.getAdapter( IDelaySelectionDragTracker.class ) != null )
			{
				proxy = (IDelaySelectionDragTracker) parent.getAdapter( IDelaySelectionDragTracker.class );
				if ( viewer instanceof DeferredGraphicalViewer )
					( (DeferredGraphicalViewer) viewer ).setSelection( new StructuredSelection( proxy.getSourceEditPart( ) ),
							true );

				if ( getSourceEditPart( ) != getEditPartUnderMouse( ) )
				{
					IFigure figure = ( (GraphicalEditPart) getSourceEditPart( ) ).getFigure( );
					Rectangle center = figure.getBounds( ).getCopy( );
					figure.translateToAbsolute( center );
					proxy.setStartLocation( center.getCenter( ) );
				}
				else
				{
					proxy.setStartLocation( getStartLocation( ) );
				}
				//
				proxy.setState( STATE_DRAG_IN_PROGRESS );
			}
			setFlag( FLAG_DELAY_SELECTION, true );
		}
		else
		{
			setFlag( FLAG_DELAY_SELECTION, false );
		}
	}
	else
	{
		setFlag( FLAG_DELAY_SELECTION, false );
	}
	activeHelper = null;

}
 
开发者ID:eclipse,项目名称:birt,代码行数:55,代码来源:ReportElementDragTracker.java


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