• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MouseWheelHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initializeGraphicalViewer() {
    final GraphicalViewer viewer = getGraphicalViewer();
    viewer.setEditPartFactory(editPartFactory);

    initViewerAction(viewer);
    initDragAndDrop(viewer);

    viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
    viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);

    final MenuManager menuMgr = new ERDiagramPopupMenuManager(getActionRegistry(), diagram);

    extensionLoader.addERDiagramPopupMenu(menuMgr, getActionRegistry());

    viewer.setContextMenu(menuMgr);

    viewer.setContents(diagram);

    outlineMenuMgr = new ERDiagramOutlinePopupMenuManager(diagram, getActionRegistry(), outlinePage.getOutlineActionRegistory(), outlinePage.getViewer());
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:27,代码来源:ERDiagramEditor.java


示例2: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initializeGraphicalViewer() {
	GraphicalViewer viewer = this.getGraphicalViewer();
	viewer.setEditPartFactory(editPartFactory);

	this.initViewerAction(viewer);
	this.initDragAndDrop(viewer);

	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
	viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);

	MenuManager menuMgr = new ERDiagramPopupMenuManager(
			this.getActionRegistry(), this.diagram, this);

	this.extensionLoader.addERDiagramPopupMenu(menuMgr,
			this.getActionRegistry());

	viewer.setContextMenu(menuMgr);

	viewer.setContents(diagram);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:28,代码来源:ERDiagramEditor.java


示例3: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
@Override
protected void initializeGraphicalViewer() {
    final GraphicalViewer viewer = getGraphicalViewer();
    viewer.setEditPartFactory(editPartFactory);
    initViewerAction(viewer);
    initDragAndDrop(viewer);
    viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
    viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);

    prepareERDiagramPopupMenu(viewer);

    prepareERDiagramOutlinePopupMenu();

    this.gotoMaker = new ERDiagramGotoMarker(this);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:18,代码来源:MainDiagramEditor.java


示例4: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * 初始化View
 */
@Override
protected void initializeGraphicalViewer() {
	GraphicalViewer viewer = this.getGraphicalViewer();
	viewer.setEditPartFactory(editPartFactory);
	
	this.initViewerAction(viewer);
	
	
	super.getGraphicalViewer().addDropTargetListener(
			new DiagramTemplateTransferDropTargetListener(super.getGraphicalViewer()));
	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
	viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);
	 GraphicalViewer view=getGraphicalViewer();
	viewer.setContents(diagram);

}
 
开发者ID:winture,项目名称:wt-studio,代码行数:23,代码来源:BODesignerEditor.java


示例5: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * 初始化View
 */
@Override
protected void initializeGraphicalViewer() {
	GraphicalViewer viewer = this.getGraphicalViewer();
	viewer.setEditPartFactory(editPartFactory);
	
	this.initViewerAction(viewer);
	
	super.getGraphicalViewer().addDropTargetListener(
			new DiagramTemplateTransferDropTargetListener(super.getGraphicalViewer()));
	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
	viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);
	 GraphicalViewer view=getGraphicalViewer();
	viewer.setContents(diagram);

}
 
开发者ID:winture,项目名称:wt-studio,代码行数:22,代码来源:FunctionDesignerEditor.java


示例6: prepareZoomContributions

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
private void prepareZoomContributions(GraphicalViewer viewer) {

		ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();

		// set clipping strategy for connection layer
		ConnectionLayer connectionLayer = (ConnectionLayer) root
				.getLayer(LayerConstants.CONNECTION_LAYER);
		connectionLayer
		.setClippingStrategy(new ViewportAwareConnectionLayerClippingStrategy(
				connectionLayer));

		List<String> zoomLevels = new ArrayList<String>(3);
		zoomLevels.add(ZoomManager.FIT_ALL);
		zoomLevels.add(ZoomManager.FIT_WIDTH);
		zoomLevels.add(ZoomManager.FIT_HEIGHT);
		root.getZoomManager().setZoomLevelContributions(zoomLevels);

		IAction zoomIn = new ZoomInAction(root.getZoomManager());
		IAction zoomOut = new ZoomOutAction(root.getZoomManager());
		viewer.setRootEditPart(root);
		getActionRegistry().registerAction(zoomIn);
		getActionRegistry().registerAction(zoomOut);

		//zoom on key strokes: ctrl++ and ctrl--
		IHandlerService service = 
				(IHandlerService)getEditorSite().getService(IHandlerService. class);

		service.activateHandler(zoomIn.getActionDefinitionId(),
				new ActionHandler(zoomIn));

		service.activateHandler(zoomOut.getActionDefinitionId(),
				new ActionHandler(zoomOut));

		// Scroll-wheel Zoom
		getGraphicalViewer().setProperty(
				MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
				MouseWheelZoomHandler.SINGLETON);
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:39,代码来源:ELTGraphicalEditor.java


示例7: configInitData

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
private void configInitData() {
	getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
	getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
	IFigure gridLayer = rootEditPart.getLayer(LayerConstants.GRID_LAYER);
	gridLayer.setForegroundColor(GRID_COLOR);
	getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:DbToolGefEditor.java


示例8: enableZoomWithMouseWheel

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * Adds zoom support to the zoom manager via the mouse wheel. 
 */
protected void enableZoomWithMouseWheel() {
	// Zoom
	ZoomManager manager = (ZoomManager) getGraphicalViewer().getProperty(
			ZoomManager.class.toString());
	if (manager != null)
		manager.setZoom(1);


	// Scroll-wheel Zoom
	getGraphicalViewer().setProperty(
			MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:17,代码来源:DwGraphicalViewerWithZoomSupport.java


示例9: configureGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();
	GraphicalViewer viewer = getGraphicalViewer();
	ScalableRootEditPart root = new ScalableRootEditPart();
	viewer.setRootEditPart(root);
	viewer.setEditPartFactory(new GraphEditPartFactory(viewer));
	viewer.setContents("Loading graph... This can take several minutes");
	ContextMenuProvider cmProvider = new RevisionGraphMenuProvider(viewer, this);
	viewer.setContextMenu(cmProvider);
	getSite().setSelectionProvider(viewer);
	IEditorInput input = getEditorInput();
	if(input instanceof FileEditorInput) {
		FileEditorInput fileEditorInput = (FileEditorInput) input;
		showGraphFor(fileEditorInput.getFile());
	} else if(input instanceof RevisionGraphEditorInput) {
		RevisionGraphEditorInput editorInput = (RevisionGraphEditorInput) input;
		showGraphFor(editorInput);
	}
	
	// zoom stuff
	ZoomManager zoomManager = ((ScalableRootEditPart) viewer.getRootEditPart()).getZoomManager();
	IAction zoomIn = new ZoomInAction(zoomManager);
	IAction zoomOut = new ZoomOutAction(zoomManager);
	getActionRegistry().registerAction(zoomIn);
	getActionRegistry().registerAction(zoomOut);
	// keyboard
	getSite().getKeyBindingService().registerAction(zoomIn); // FIXME, deprecated
	getSite().getKeyBindingService().registerAction(zoomOut); // FIXME, deprecated
	List zoomContributions = Arrays.asList(new String[] { 
		     ZoomManager.FIT_ALL, 
		     ZoomManager.FIT_HEIGHT, 
		     ZoomManager.FIT_WIDTH });
	zoomManager.setZoomLevelContributions(zoomContributions);
	// mouse wheel
	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:38,代码来源:RevisionGraphEditor.java


示例10: initializeGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initializeGraphicalViewer() {
	GraphicalViewer viewer = this.getGraphicalViewer();
	viewer.setEditPartFactory(editPartFactory);

	this.initViewerAction(viewer);
	this.initDragAndDrop(viewer);

	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),
			MouseWheelZoomHandler.SINGLETON);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
	viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
	viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, true);

	MenuManager menuMgr = new ERDiagramPopupMenuManager(
			this.getActionRegistry(), this.diagram);

	this.extensionLoader.addERDiagramPopupMenu(menuMgr,
			this.getActionRegistry());

	viewer.setContextMenu(menuMgr);

	viewer.setContents(diagram);

	this.outlineMenuMgr = new ERDiagramOutlinePopupMenuManager(
			this.diagram, this.getActionRegistry(),
			this.outlinePage.getOutlineActionRegistory(),
			this.outlinePage.getViewer());
}
 
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:33,代码来源:ERDiagramEditor.java


示例11: configureGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	ArrayList<String> zoomContributions;
	// configure viewer
	super.configureGraphicalViewer();

	MenuManager menu = SankeyMenu.create(this);
	getGraphicalViewer().setContextMenu(menu);

	GraphicalViewer viewer = getGraphicalViewer();
	viewer.setEditPartFactory(new SankeyEditPartFactory());
	ScalableRootEditPart rootEditPart = new ScalableRootEditPart();
	viewer.setRootEditPart(rootEditPart);

	ZoomManager zoomManager = rootEditPart.getZoomManager();

	// append zoom actions to action registry
	getActionRegistry().registerAction(new ZoomInAction(zoomManager));
	getActionRegistry().registerAction(new ZoomOutAction(zoomManager));

	zoomContributions = new ArrayList<>();
	zoomContributions.add(ZoomManager.FIT_ALL);
	zoomContributions.add(ZoomManager.FIT_HEIGHT);
	zoomContributions.add(ZoomManager.FIT_WIDTH);
	zoomManager.setZoomLevelContributions(zoomContributions);

	// create key handler
	KeyHandler keyHandler = new KeyHandler();
	keyHandler.put(KeyStroke.getPressed('+', SWT.KEYPAD_ADD, 0),
			getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
	keyHandler.put(KeyStroke.getPressed('-', SWT.KEYPAD_SUBTRACT, 0),
			getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
	viewer.setKeyHandler(keyHandler);

	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.NONE),
			MouseWheelZoomHandler.SINGLETON);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:38,代码来源:SankeyDiagram.java


示例12: configureGraphicalViewer

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();

	GraphicalViewer graphicalViewer = getGraphicalViewer();

	MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();

	graphicalViewer.setRootEditPart(rootEditPart);
	// set EditPartFactory
	graphicalViewer.setEditPartFactory(createEditParFactory());

	graphicalViewer.setKeyHandler(new GraphicalViewerKeyHandler(graphicalViewer));

	graphicalViewer.setContextMenu(createContextMenuProvider(graphicalViewer));

	ZoomManager zoomManager = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());

	getActionRegistry().registerAction(new ZoomInAction(zoomManager));
	getActionRegistry().registerAction(new ZoomOutAction(zoomManager));
	getActionRegistry().registerAction(new ZoomActualAction(zoomManager));
	
	graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
	graphicalViewer.setProperty("JRCONTEXT", jrContext);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:AGraphicEditor.java


示例13: createAdditionalActions

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * Creates the additional actions.
 */
protected void createAdditionalActions() {
	GraphicalViewer graphicalViewer = getGraphicalViewer();
	// Show Grid Action
	Boolean isGridVisible = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWGRID, true);
	Boolean isSnapToGuides = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGUIDES, true);
	Boolean isSnapToGrid = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGRID, true);
	Boolean isSnapToGeometry = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGEOMETRY,
			true);

	int gspaceX = jrContext.getPropertyInteger(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEX, 10);
	int gspaceY = jrContext.getPropertyInteger(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEY, 10);

	graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, isSnapToGrid.booleanValue());
	graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, isGridVisible.booleanValue());
	graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ORIGIN, new Point(30, 30));
	graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(gspaceX, gspaceY));
	graphicalViewer.setProperty(SnapToGuidesAction.ID, isSnapToGuides);
	graphicalViewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, isSnapToGeometry.booleanValue());

	IAction showGrid = new ShowGridAction(jrContext);
	getActionRegistry().registerAction(showGrid);

	SnapToGridAction snapGridAction = new SnapToGridAction(jrContext);
	getActionRegistry().registerAction(snapGridAction);

	SizeGridAction sizeGridAction = new SizeGridAction(jrContext);
	getActionRegistry().registerAction(sizeGridAction);

	// snap to geometry
	IAction snapAction = new SnapToGeometryAction(jrContext);
	getActionRegistry().registerAction(snapAction);

	snapAction = new SnapToGuidesAction(jrContext);
	getActionRegistry().registerAction(snapAction);

	// show rullers
	IAction showRulers = new ShowRullersAction(jrContext);
	getActionRegistry().registerAction(showRulers);
	// zoom manager actions
	ZoomManager zoomManager = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());

	getActionRegistry().registerAction(new ZoomInAction(zoomManager));
	getActionRegistry().registerAction(new ZoomOutAction(zoomManager));
	getActionRegistry().registerAction(new  ZoomActualAction(zoomManager));
	graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);

	// set context menu
	graphicalViewer.setContextMenu(new AppContextMenuProvider(graphicalViewer, getActionRegistry()));

	graphicalViewer.setProperty("JRCONTEXT", jrContext);

	LayoutManager.addActions(getActionRegistry(), this, getSelectionActions());

	JaspersoftStudioPlugin.getDecoratorManager().registerActions(getActionRegistry(), getSelectionActions(),
			getGraphicalViewer(), this);
	JaspersoftStudioPlugin.getEditorSettingsManager().registerActions(getActionRegistry(), jrContext);
	

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:63,代码来源:AbstractVisualEditor.java


示例14: GraphicalViewerImpl

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * Constructs a GraphicalViewerImpl with the default root editpart.
 */
public GraphicalViewerImpl() {
	createDefaultRoot();
	setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.NONE),
			MouseWheelDelegateHandler.SINGLETON);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:9,代码来源:GraphicalViewerImpl.java


示例15: configureZoomManager

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
void configureZoomManager() {
	getZoomManager().setZoomLevels(ZOOM_LEVELS);
	getZoomManager().setZoomAnimationStyle(ZoomManager.ANIMATE_ZOOM_IN_OUT);
	viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.NONE), MouseWheelZoomHandler.SINGLETON);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:6,代码来源:GraphConfig.java


示例16: performViewerMouseWheel

import org.eclipse.gef.MouseWheelHandler; //导入依赖的package包/类
/**
 * Delegates mouse-wheel event handling to registered
 * {@link MouseWheelHandler MouseWheelHandlers} based on the given Event's
 * statemask. Does nothing if there are no matching handlers found.
 * 
 * @param event
 *            the SWT scroll event
 * @param viewer
 *            the originating viewer
 * @since 3.1
 */
protected void performViewerMouseWheel(Event event, EditPartViewer viewer) {
	MouseWheelHandler handler = (MouseWheelHandler) viewer
			.getProperty(MouseWheelHandler.KeyGenerator
					.getKey(event.stateMask));
	if (handler != null)
		handler.handleMouseWheel(event, viewer);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:AbstractTool.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Reader类代码示例发布时间:2022-05-22
下一篇:
Java PGNotification类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap