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


Java GraphicalViewer.setProperty方法代码示例

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


在下文中一共展示了GraphicalViewer.setProperty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
/**
 * {@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

示例3: initializeGraphicalViewer

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

示例4: initializeGraphicalViewer

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

示例5: configureGraphicalViewer

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

示例6: 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

示例7: registerActions

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void registerActions(ActionRegistry registry, List<String> selectionActions, GraphicalViewer gviewer,
		AbstractVisualEditor part) {
	gviewer.setProperty(ShowErrorsAction.ID, true);
	IAction action = new ShowErrorsAction(gviewer, part.getJrContext());
	registry.registerAction(action);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:PositionErrorDecorator.java

示例8: registerActions

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void registerActions(ActionRegistry registry, List<String> selectionActions, GraphicalViewer gviewer,
		AbstractVisualEditor part) {
	gviewer.setProperty(ShowXLSTagsAction.ID, true);
	IAction action = new ShowXLSTagsAction(gviewer, part.getJrContext());
	registry.registerAction(action);
	registerActions(registry, selectionActions, part);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:XLSElementDecorator.java

示例9: registerActions

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void registerActions(ActionRegistry registry, List<String> selectionActions, GraphicalViewer gviewer,
		AbstractVisualEditor part) {
	gviewer.setProperty(ShowPDFTagsAction.ID, true);
	IAction action = new ShowPDFTagsAction(gviewer, part.getJrContext());
	registry.registerAction(action);
	registerActions(registry, selectionActions, part);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:PDF508ElementDecorator.java

示例10: registerActions

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void registerActions(ActionRegistry registry, List<String> selectionActions, GraphicalViewer gviewer,
		AbstractVisualEditor part) {
	gviewer.setProperty(ShowCSVTagsAction.ID, true);
	IAction action = new ShowCSVTagsAction(gviewer, part.getJrContext());
	registry.registerAction(action);
	registerActions(registry, selectionActions, part);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:CSVElementDecorator.java

示例11: 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

示例12: createAdditionalActions

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


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