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


Java ScalableFreeformRootEditPart类代码示例

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


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

示例1: initializeGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
protected void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
	FileEditorInput inp = (FileEditorInput) getEditorInput();
	setPartName(inp.getFile().getName());
	try {
		String path = inp.getFile().getLocation().toOSString();
		String text = FileUtils.readFileToString(new File(path));
		CompositeNode node = parse(text);
		root = new CompositeEditPart(node, inp.getFile().getProject().getFullPath().toOSString());
		getGraphicalViewer().setContents(root);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:InitAssemblyEditor.java

示例2: initializeGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
protected void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
	FileEditorInput inp = (FileEditorInput) getEditorInput();
	setPartName(inp.getFile().getName());
	try {
		String path = inp.getFile().getLocation().toOSString();
		String text = FileUtils.readFileToString(new File(path));
		LogicalSystemNode node = parse(text);
		root = new LogicalSystemEditPart(node, inp.getFile().getProject().getFullPath().toOSString());
		getGraphicalViewer().setContents(root);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:IntLogicalSysEditor.java

示例3: initializeGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
public void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
	FileEditorInput inp = (FileEditorInput) getEditorInput();
	setPartName(inp.getFile().getName());
	try {
		String path = inp.getFile().getLocation().toOSString();
		String text = FileUtils.readFileToString(new File(path));
		CompositeNode node = parse(text);
		root = new CompositeEditPart(node, inp.getFile().getProject().getFullPath().toOSString());
		getGraphicalViewer().setContents(root);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:IntFinalAssemblyEditor.java

示例4: initializeGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
public void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
	FileEditorInput inp = (FileEditorInput) getEditorInput();
	setPartName(inp.getFile().getName());
	try {
		String path = inp.getFile().getLocation().toOSString();
		String text = FileUtils.readFileToString(new File(path));
		DeploymentNode node = parse(text);
		root = new DeploymentEditPart(node, inp.getFile().getProject().getFullPath().toOSString());
		getGraphicalViewer().setContents(root);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:IntDeploymentEditor.java

示例5: initializeGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
public void initializeGraphicalViewer() {
	super.initializeGraphicalViewer();
	getGraphicalViewer().setRootEditPart(new ScalableFreeformRootEditPart());
	FileEditorInput inp = (FileEditorInput) getEditorInput();
	setPartName(inp.getFile().getName());
	try {
		String path = inp.getFile().getLocation().toOSString();
		String text = FileUtils.readFileToString(new File(path));
		ComponentImplementationNode node = parse(text);
		root = new ComponentImplementationEditPart(node, inp.getFile().getProject().getFullPath().toOSString());
		getGraphicalViewer().setContents(root);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:CompImplEditor.java

示例6: getColumnIndex

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
private int getColumnIndex(final DirectEditRequest editRequest) {
    final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
    final double zoom = zoomManager.getZoom();

    final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();

    Column column = (Column) columnEditPart.getModel();
    final TableView newTableView = (TableView) getHost().getParent().getModel();

    final List<Column> columns = newTableView.getColumns();

    if (column.getColumnHolder() instanceof ColumnGroup) {
        column = (ColumnGroup) column.getColumnHolder();
    }
    int index = columns.indexOf(column);

    final Rectangle columnRectangle = getColumnRectangle();
    final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);

    if (editRequest.getLocation().y >= center) {
        index++;
    }

    return index;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:26,代码来源:ColumnSelectionHandlesEditPolicy.java

示例7: getTableLocationMap

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
private static Map<TableView, Location> getTableLocationMap(final ScalableFreeformRootEditPart rootEditPart, final int translateX, final int translateY, final ERDiagram diagram) {
    final Map<TableView, Location> tableLocationMap = new HashMap<TableView, Location>();

    final Category category = diagram.getCurrentCategory();

    for (final Object child : rootEditPart.getContents().getChildren()) {
        final NodeElementEditPart editPart = (NodeElementEditPart) child;
        final NodeElement nodeElement = (NodeElement) editPart.getModel();
        if (!(nodeElement instanceof TableView)) {
            continue;
        }

        if (category == null || category.isVisible(nodeElement, diagram)) {
            final IFigure figure = editPart.getFigure();
            final Rectangle figureRectangle = figure.getBounds();

            final Location location = new Location(figureRectangle.x + translateX, figureRectangle.y + translateY, figureRectangle.width, figureRectangle.height);
            tableLocationMap.put((TableView) nodeElement, location);
        }
    }

    return tableLocationMap;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:24,代码来源:ImageInfo.java

示例8: showThumbnail

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
private void showThumbnail() {
	// RootEditPartのビューをソースとしてサムネイルを作成
	ScalableFreeformRootEditPart editPart = (ScalableFreeformRootEditPart) this.graphicalViewer
			.getRootEditPart();

	if (this.thumbnail != null) {
		this.thumbnail.deactivate();
	}

	this.thumbnail = new ScrollableThumbnail((Viewport) editPart
			.getFigure());
	this.thumbnail.setSource(editPart
			.getLayer(LayerConstants.PRINTABLE_LAYERS));

	this.lws.setContents(this.thumbnail);

}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:ERDiagramOutlinePage.java

示例9: getColumnIndex

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
	ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
			.getHost().getRoot()).getZoomManager();
	double zoom = zoomManager.getZoom();

	IFigure figure = ((TableViewEditPart) this.getHost()).getFigure();

	int center = (int) (figure.getBounds().y + (figure.getBounds().height / 2)
			* zoom);

	int index = 0;

	if (editRequest.getLocation().y >= center) {
		TableView newTableView = (TableView) this.getHost().getModel();

		index = newTableView.getColumns().size();
	}

	return index;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:21,代码来源:TableViewComponentEditPolicy.java

示例10: showSizeOnDropFeedback

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void showSizeOnDropFeedback(CreateRequest request) {
	Point p = new Point(request.getLocation().getCopy());

	ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
			.getHost().getRoot()).getZoomManager();
	double zoom = zoomManager.getZoom();

	IFigure feedback = getSizeOnDropFeedback(request);

	Dimension size = request.getSize().getCopy();
	feedback.translateToRelative(size);
	feedback.setBounds(new Rectangle((int) (p.x * zoom),
			(int) (p.y * zoom), size.width, size.height)
			.expand(getCreationFeedbackOffset(request)));
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:ERDiagramLayoutEditPolicy.java

示例11: initializeOverview

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
/**
 * Initialize overview.
 */
protected void initializeOverview() {
	LightweightSystem lws = new J2DLightweightSystem(overview);

	RootEditPart rep = editor.getGraphicalViewer().getRootEditPart();
	if (rep instanceof MainDesignerRootEditPart) {
		ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
		thumbnail = new JSSScrollableThumbnail((Viewport) root.getFigure(), (MRoot)getViewer().getContents().getModel());
		thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
		lws.setContents(thumbnail);
		disposeListener = new DisposeListener() {
			public void widgetDisposed(DisposeEvent e) {
				if (thumbnail != null) {
					thumbnail.deactivate();
					thumbnail = null;
				}
			}
		};
		editor.getEditor().addDisposeListener(disposeListener);
	}
	lws.setControl(overview);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:JDReportOutlineView.java

示例12: getAdapter

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class type) {
    if (type == ZoomManager.class) {
        return ((ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart()).getZoomManager();
    }
    if (type == IContentOutlinePage.class) {
        return outlinePage;
    }
    if (type == IGotoMarker.class) {
        return gotoMaker;
    }
    if (type == IPropertySheetPage.class) {
        return propertySheetPage;
    }
    return super.getAdapter(type);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:17,代码来源:MainDiagramEditor.java

示例13: getColumnIndex

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
    final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
    final double zoom = zoomManager.getZoom();
    final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();
    ERColumn column = (ERColumn) columnEditPart.getModel();
    final TableView newTableView = (TableView) getHost().getParent().getModel();
    final List<ERColumn> columns = newTableView.getColumns();
    if (column.getColumnHolder() instanceof ColumnGroup) {
        column = (ColumnGroup) column.getColumnHolder();
    }
    int index = columns.indexOf(column);
    final Rectangle columnRectangle = getColumnRectangle();
    final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
    if (editRequest.getLocation().y >= center) {
        index++;
    }
    return index;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:19,代码来源:ColumnSelectionHandlesEditPolicy.java

示例14: initializeOverview

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
protected void initializeOverview()
{
    LightweightSystem lws = new LightweightSystem(mOverview);
    RootEditPart rep = getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart)rep;
        mThumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
        mThumbnail.setBorder(new MarginBorder(3));
        mThumbnail.setSource(root
                        .getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(mThumbnail);
        mDisposeListener = new DisposeListener() {
            public void widgetDisposed(DisposeEvent e)
            {
                if (mThumbnail != null) {
                    mThumbnail.deactivate();
                    mThumbnail = null;
                }
            }
        };
        getEditor().addDisposeListener(mDisposeListener);
    }
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:24,代码来源:InstallOptionsDesignEditor.java

示例15: configureGraphicalViewer

import org.eclipse.gef.editparts.ScalableFreeformRootEditPart; //导入依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();
	GraphicalViewer viewer = getGraphicalViewer();

	viewer.setRootEditPart(new ScalableFreeformRootEditPart());
	viewer.setEditPartFactory(new FormDesignerEditPartFactory(this));
	ContextMenuProvider provider = new FormContextMenuProvider(viewer,
			actionIds, getActionRegistry());
	viewer.setContextMenu(provider);

	viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));

	((FigureCanvas) viewer.getControl())
			.setScrollBarVisibility(FigureCanvas.ALWAYS);
}
 
开发者ID:snakerflow,项目名称:snaker-designer,代码行数:17,代码来源:SnakerFormDesignerEditor.java


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