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


Java GraphicalViewer.setKeyHandler方法代码示例

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


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

示例1: configureGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();
	getGraphicalViewer().getControl().setBackground(ColorConstants.button);

	GraphicalViewer graphicalViewer = getGraphicalViewer();
	MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();

	graphicalViewer.setRootEditPart(rootEditPart);
	// set EditPartFactory
	graphicalViewer.setEditPartFactory(new JasperDesignEditPartFactory());

	// set rulers providers
	RulerProvider provider = new ReportRulerProvider(new ReportRuler(true, RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER, provider);

	provider = new ReportRulerProvider(new ReportRuler(false, RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER, provider);

	Boolean isRulerVisible = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER);

	graphicalViewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, isRulerVisible);

	createAdditionalActions();
	graphicalViewer.setKeyHandler(new JSSGraphicalViewerKeyHandler(graphicalViewer));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:CrosstabEditor.java

示例2: initializeGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	GraphicalViewer viewer=this.getGraphicalViewer();
	viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
	this.getActionRegistry().registerAction(new ToggleGridAction(viewer));
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:GraphicalEditorPage.java

示例3: configureGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
 * Hook the evolution factory into the editor logic and override the standard edit part factory
 */
@Override
public void configureGraphicalViewer() {
	super.configureGraphicalViewer();

	GraphicalViewer viewer = getGraphicalViewer();
	viewer.setEditPartFactory(new DwFeatureModelEditorEditPartFactory(viewer, this));
	viewer.setContextMenu(new DwGraphicalFeatureModelEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry()));
	viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer).setParent(getCommonKeyHandler()));
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:13,代码来源:DwGraphicalFeatureModelEditor.java

示例4: configureGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
 */
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    GraphicalViewer viewer = getGraphicalViewer();
    viewer.setEditPartFactory(createDiagramEditPartFactory());
    viewer.setRootEditPart(createRootEditPart());
    viewer.setKeyHandler(createKeyHandler(viewer));
    viewer.setContextMenu(createContextMenuProvider(viewer, getActionRegistry()));

    // viewer.getKeyHandler().put(KeyStroke.getPressed(SWT.DEL, 127, 0),
    // getActionRegistry().getAction(GEFActionConstants.DELETE));
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:15,代码来源:AbstractDiagramEditor.java

示例5: configureGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();
	getGraphicalViewer().getControl().setBackground(ColorConstants.button);

	GraphicalViewer graphicalViewer = getGraphicalViewer();
	MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();

	graphicalViewer.setRootEditPart(rootEditPart);
	// set EditPartFactory
	graphicalViewer.setEditPartFactory(new JasperDesignEditPartFactory());

	// set rulers providers
	RulerProvider provider = new ReportRulerProvider(new ReportRuler(true,
			RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER,
			provider);

	provider = new ReportRulerProvider(new ReportRuler(false,
			RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,
			provider);

	Boolean isRulerVisible = jrContext
			.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER);

	graphicalViewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY,
			isRulerVisible);

	createAdditionalActions();
	graphicalViewer.setKeyHandler(new JSSGraphicalViewerKeyHandler(
			graphicalViewer));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:34,代码来源:ListEditor.java

示例6: configureGraphicalViewer

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的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


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