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


Java ScrollingGraphicalViewer.createControl方法代码示例

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


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

示例1: construct

import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
@Override
public Control construct(Composite parent) {
	Composite content = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
	GridLayoutFactory.fillDefaults().applyTo(content);

	ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
	viewer.createControl(content);
	viewer.setRootEditPart(new FreeformGraphicalRootEditPart());
	viewer.setEditPartFactory(new CustomEditPartFactory());

	ContainerModel container = new ContainerModel("container-01");
	ComponentModel component1 = new ComponentModel("component-01", 0, 0);
	ComponentModel component2 = new ComponentModel("component-02", 200, 0);
	container.components.add(component1);
	container.components.add(component2);
	viewer.setContents(container);

	return content;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:21,代码来源:DiagramWithCustomId.java

示例2: createPartControl

import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
public void createPartControl(Composite parent) {
    // Create the viewer
    viewer = new ScrollingGraphicalViewer();
    viewer.setEditDomain(new UrnEditDomain(null));
    viewer.createControl(parent);

    // viewer.addSelectionChangedListener(this);
    // -- getSite().setSelectionProvider(viewer);
    getSite().getPage().addPartListener(this);
    getSite().getPage().addSelectionListener(this);

    // Set root editpart
    root = new ScalableFreeformRootEditPart();
    viewer.setRootEditPart(root);

    // Register the view
    DisplayPreferences.getInstance().registerListener(this);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:19,代码来源:KPIView.java

示例3: StackedchartsEditControl

import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
public StackedchartsEditControl(Composite parent)
{
  super(parent, SWT.NONE);

  setLayout(new FillLayout());

  editDomain = new EditDomain();

  viewer = new ScrollingGraphicalViewer();

  // connect external Drop support
  // add Dataset to Axis

  viewer.addDropTargetListener(new ProxyDropTargetListener(
      new DatasetToAxisDropTargetListener(viewer),
      new DatasetToAxisLandingDropTargetListener(viewer),
      new ScatterSetToScatterSetContainerTargetListener(viewer),
      new DatasetToChartDropTargetListener(viewer)
      ));

  viewer.createControl(this);
  editDomain.addViewer(viewer);

  viewer.getControl().setBackground(ColorConstants.listBackground);

  viewer.setEditPartFactory(new StackedChartsEditPartFactory());

  // emf edit domain
  adapterFactory =
      new ComposedAdapterFactory(
          ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
  BasicCommandStack commandStack = new BasicCommandStack();
  adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
  adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
  adapterFactory
      .addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
  emfEditingDomain =
      new AdapterFactoryEditingDomain(adapterFactory, commandStack);

}
 
开发者ID:debrief,项目名称:limpet,代码行数:41,代码来源:StackedchartsEditControl.java

示例4: construct

import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
@Override
public Control construct(Composite parent) {
	Composite content = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
	GridLayoutFactory.fillDefaults().applyTo(content);

	ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
	viewer.createControl(content);
	viewer.setRootEditPart(new FreeformGraphicalRootEditPart());
	viewer.setEditPartFactory(new SimplePartFactory());
	viewer.setContents(new SimpleModel());

	return content;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:15,代码来源:DiagramItemWithImage.java

示例5: createCubeArea

import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
private Composite createCubeArea( Composite parent )
{
	Composite viewerContent = new Composite( parent, SWT.BORDER );
	GridData gd = new GridData( GridData.FILL_BOTH );
	gd.widthHint = 500;
	gd.heightHint = 300;
	viewerContent.setLayoutData( gd );
	viewerContent.setLayout( new FillLayout( ) );
	viewer = new ScrollingGraphicalViewer( );
	EditDomain editDomain = new EditDomain( );
	ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart( );
	viewer.setRootEditPart( root );
	viewer.setEditDomain( editDomain );
	viewer.createControl( viewerContent );
	viewer.getControl( ).setBackground( ColorConstants.listBackground );
	factory = new GraphicalEditPartsFactory( );
	viewer.setEditPartFactory( factory );
	viewer.setKeyHandler( new GraphicalViewerKeyHandler( viewer ) );
	viewer.addSelectionChangedListener( new ISelectionChangedListener( ) {

		public void selectionChanged( SelectionChangedEvent event )
		{
			if ( event.getSelection( ) != null )
			{
				StructuredSelection selection = (StructuredSelection) event.getSelection( );
				if ( selection.getFirstElement( ) instanceof HierarchyNodeEditPart
						|| selection.getFirstElement( ) instanceof DatasetNodeEditPart )
				{
					Object obj = selection.getFirstElement( );
					if ( obj instanceof HierarchyNodeEditPart )
					{
						TabularHierarchyHandle hierarchy = (TabularHierarchyHandle) ( (HierarchyNodeEditPart) obj ).getModel( );
						if ( hierarchy.getPrimaryKeys( ) != null
								&& hierarchy.getPrimaryKeys( ).size( ) > 0 )
						{
							filterButton.setEnabled( false );
						}
						else
							filterButton.setEnabled( true );
					}
					else
						filterButton.setEnabled( true );
				}
				else
					filterButton.setEnabled( false );
			}
			else
				filterButton.setEnabled( false );
		}
	} );
	load( );
	return viewerContent;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:54,代码来源:LinkGroupsPage.java


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