本文整理汇总了Java中org.eclipse.gef.editparts.LayerManager类的典型用法代码示例。如果您正苦于以下问题:Java LayerManager类的具体用法?Java LayerManager怎么用?Java LayerManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LayerManager类属于org.eclipse.gef.editparts包,在下文中一共展示了LayerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eraseTargetFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
@Override
public void eraseTargetFeedback(final Request request) {
final LayerManager manager = (LayerManager) getHost().getRoot();
final IFigure layer = manager.getLayer(LayerConstants.PRIMARY_LAYER);
getFeedbackLayer().setBounds(layer.getBounds());
final List list = getFeedbackLayer().getChildren();
for (final Iterator iter = list.iterator(); iter.hasNext();) {
final Object obj = iter.next();
if (obj instanceof Label) {
iter.remove();
}
}
getFeedbackLayer().repaint();
super.eraseTargetFeedback(request);
}
示例2: eraseTargetFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
@Override
public void eraseTargetFeedback(Request request) {
LayerManager manager = (LayerManager) this.getHost().getRoot();
IFigure layer = manager.getLayer(LayerConstants.PRIMARY_LAYER);
this.getFeedbackLayer().setBounds(layer.getBounds());
List list = this.getFeedbackLayer().getChildren();
for (Iterator iter = list.iterator(); iter.hasNext();) {
Object obj = iter.next();
if (obj instanceof Label) {
iter.remove();
}
}
this.getFeedbackLayer().repaint();
super.eraseTargetFeedback(request);
}
示例3: containsPoint
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
public boolean containsPoint(int x, int y) {
if (!getBounds().contains(x, y))
return false;
Rectangle r = getBounds().getCopy();
IFigure ofig = getOwner().getFigure();
Rectangle rown = ofig.getBounds().getCopy();
ofig.translateToAbsolute(rown);
IFigure feedback = LayerManager.Helper.find(getOwner()).getLayer(LayerConstants.FEEDBACK_LAYER);
feedback.translateToRelative(rown);
int offset = getOffset();
if (row && (x >= rown.x && x <= rown.x + rown.width && (y <= offset || y >= r.y + r.height - offset)))
return true;
if (col && (y >= rown.y && y <= rown.y + rown.height && (x <= offset || x >= r.x + r.width - offset)))
return true;
return false;
}
示例4: eraseTargetFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
@Override
public void eraseTargetFeedback(Request request) {
final LayerManager manager = (LayerManager) getHost().getRoot();
final IFigure layer = manager.getLayer(LayerConstants.PRIMARY_LAYER);
getFeedbackLayer().setBounds(layer.getBounds());
final List<?> list = getFeedbackLayer().getChildren();
for (final Iterator<?> iter = list.iterator(); iter.hasNext();) {
final Object obj = iter.next();
if (obj instanceof Label) {
iter.remove();
}
}
getFeedbackLayer().repaint();
super.eraseTargetFeedback(request);
}
示例5: findHandleAt
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* @see GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt(Point p) {
LayerManager layermanager = (LayerManager) getEditPartRegistry().get(
LayerManager.ID);
if (layermanager == null)
return null;
List list = new ArrayList(3);
list.add(layermanager.getLayer(LayerConstants.PRIMARY_LAYER));
list.add(layermanager.getLayer(LayerConstants.CONNECTION_LAYER));
list.add(layermanager.getLayer(LayerConstants.FEEDBACK_LAYER));
IFigure handle = getLightweightSystem().getRootFigure()
.findFigureAtExcluding(p.x, p.y, list);
if (handle instanceof Handle)
return (Handle) handle;
return null;
}
示例6: getExclusionSet
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* Returns a list of all the edit parts in the
* {@link AbstractTool#getOperationSet() operation set}, plus the
* {@link org.eclipse.draw2d.ConnectionLayer}.
*
* @see org.eclipse.gef.tools.TargetingTool#getExclusionSet()
*/
protected Collection getExclusionSet() {
if (exclusionSet == null) {
List set = getOperationSet();
exclusionSet = new ArrayList(set.size() + 1);
for (int i = 0; i < set.size(); i++) {
GraphicalEditPart editpart = (GraphicalEditPart) set.get(i);
exclusionSet.add(editpart.getFigure());
}
LayerManager layerManager = (LayerManager) getCurrentViewer()
.getEditPartRegistry().get(LayerManager.ID);
if (layerManager != null) {
exclusionSet.add(layerManager
.getLayer(LayerConstants.CONNECTION_LAYER));
}
}
return exclusionSet;
}
示例7: findHandleAt
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* @see GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt( Point p )
{
LayerManager layermanager = (LayerManager) getEditPartRegistry( ).get( LayerManager.ID );
if ( layermanager == null )
return null;
List list = new ArrayList( 3 );
// list.add(layermanager.getLayer(LayerConstants.PRIMARY_LAYER));
list.add( layermanager.getLayer( LayerConstants.CONNECTION_LAYER ) );
list.add( layermanager.getLayer( LayerConstants.FEEDBACK_LAYER ) );
IFigure handle = getLightweightSystem( ).getRootFigure( )
.findFigureAtExcluding( p.x, p.y, list );
if ( handle instanceof Handle )
return (Handle) handle;
return null;
}
示例8: outputImageFile
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* Outputs a D-Case diagram to a PDF file.
*
* @param pdfFileName a PDF file name.
* @param monitor the progress monitor to use to display progress and receive requests for cancellation.
*/
@SuppressWarnings("unchecked")
private void outputImageFile(String pdfFileName, IProgressMonitor monitor) {
try {
List<?> editparts = getSelectedObjects();
CopyToImageUtil copyToImageUtil = new CopyToImageUtil();
if (editparts.size() == 1
&& editparts.get(0) instanceof DiagramEditPart) {
copyToImageUtil.copyToImage((DiagramEditPart) editparts.get(0),
new Path(pdfFileName), ImageFileFormat.PDF, monitor);
} else {
DiagramImageUtils.zOrderSort(
(List<GraphicalEditPart>) editparts,
LayerManager.Helper.find(getDiagramEditPart())
.getLayer(LayerConstants.PRINTABLE_LAYERS));
copyToImageUtil.copyToImage(getDiagramEditPart(), editparts,
new Path(pdfFileName), ImageFileFormat.PDF, monitor);
}
} catch (CoreException e) {
throw new DcaseSystemException(Messages.CopyToEpsRunnable_1, e,
MessageTypeImpl.COPY_TO_EPS_FAILED);
}
}
示例9: saveEditorContentsAsImage
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
private static void saveEditorContentsAsImage(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format) {
ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) viewer.getEditPartRegistry().get(LayerManager.ID);
IFigure rootFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS);// rootEditPart.getFigure();
Rectangle rootFigureBounds = rootFigure.getBounds();
Control figureCanvas = viewer.getControl();
GC figureCanvasGC = new GC(figureCanvas);
Image img = new Image(null, rootFigureBounds.width, rootFigureBounds.height);
GC imageGC = new GC(img);
imageGC.setBackground(figureCanvasGC.getBackground());
imageGC.setForeground(figureCanvasGC.getForeground());
imageGC.setFont(figureCanvasGC.getFont());
imageGC.setLineStyle(figureCanvasGC.getLineStyle());
imageGC.setLineWidth(figureCanvasGC.getLineWidth());
imageGC.setXORMode(figureCanvasGC.getXORMode());
Graphics imgGraphics = new SWTGraphics(imageGC);
rootFigure.paint(imgGraphics);
ImageData[] imgData = new ImageData[1];
imgData[0] = img.getImageData();
ImageLoader imgLoader = new ImageLoader();
imgLoader.data = imgData;
imgLoader.save(saveFilePath, format);
figureCanvasGC.dispose();
imageGC.dispose();
img.dispose();
}
示例10: eraseFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* @see org.eclipse.gef.tools.DirectEditManager#eraseFeedback()
*/
@Override
protected void eraseFeedback() {
// if (getEditPart().getParent() != null) {
// LayerManager.Helper.find(getEditPart()).getLayer(LayerConstants.FEEDBACK_LAYER).getChildren().clear();
// }
if( null != getEditPart() && null != getEditPart().getParent() ) {
List<Object> feedbackList = LayerManager.Helper.find(getEditPart()).getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null != feedbackList && !feedbackList.isEmpty()){
super.eraseFeedback();
}
}
IWorkbench workbench;
IWorkbenchWindow workbenchWindow = null;
IWorkbenchPage workbenchPage = null;
IEditorPart editorPart = null;
workbench = PlatformUI.getWorkbench();
if(null != workbench){
workbenchWindow = workbench.getActiveWorkbenchWindow();
}
if(null != workbenchWindow){
workbenchPage = workbenchWindow.getActivePage();
}
if(null != workbenchPage){
editorPart = workbenchPage.getActiveEditor();
}
if(null != editorPart){
if(editorPart instanceof AbstractDiagramEditor){
Diagram diagram = ((AbstractDiagramEditor)editorPart).getDiagram();
if(DiagramType.SEQUENCE_DIAGRAM.equals( diagram.getType() ) ){
List<Object> removeChildren = LayerManager.Helper.find(getEditPart()).getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null != removeChildren && !removeChildren.isEmpty()){
super.eraseFeedback();
}
}
}
}
}
示例11: eraseFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* @see org.eclipse.gef.tools.DirectEditManager#eraseFeedback()
*/
@Override
protected void eraseFeedback() {
// super.eraseFeedback();
List<Object> feedbackList = LayerManager.Helper.find(getEditPart()).getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null != feedbackList && !feedbackList.isEmpty()){
super.eraseFeedback();
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:13,代码来源:ActivityPartitionDirectEditorManager.java
示例12: eraseFeedback
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
/**
* Asks the source edit part to erase source feedback.
*/
protected void eraseFeedback() {
if (showingFeedback) {
LayerManager.Helper.find(getEditPart())
.getLayer(LayerConstants.FEEDBACK_LAYER)
.remove(getCellEditorFrame());
cellEditorFrame = null;
getEditPart().eraseSourceFeedback(getDirectEditRequest());
showingFeedback = false;
}
}
示例13: createDiagramPage
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
private void createDiagramPage() {
try {
diagramEditor = new ActivitiDiagramEditor();
int index = addPage(diagramEditor, getEditorInput());
setPageText(index, ActivitiMultiPageEditor.DIAGRAM_PANE_TILE);
GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
if (graphicalViewer != null && graphicalViewer.getEditPartRegistry() != null) {
ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) graphicalViewer.getEditPartRegistry().get(LayerManager.ID);
IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);
gridFigure.setVisible(false);
}
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested Activiti Diagram editor", null, e.getStatus());
}
}
示例14: createPartControl
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
GraphicalViewer graphicalViewer = (GraphicalViewer) getAdapter(GraphicalViewer.class);
if (graphicalViewer != null && graphicalViewer.getEditPartRegistry() != null) {
ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) graphicalViewer.getEditPartRegistry().get(LayerManager.ID);
IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);
gridFigure.setVisible(false);
}
}
示例15: paintBorder
import org.eclipse.gef.editparts.LayerManager; //导入依赖的package包/类
@Override
protected void paintBorder(Graphics graphics) {
graphics.setForegroundColor(ColorConstants.darkGray);
Rectangle r = getBounds().getCopy();
IFigure ofig = getOwner().getFigure();
Rectangle rown = ofig.getBounds().getCopy();
if (offset != 0)
rown = rown.resize(offset, offset);
ofig.translateToAbsolute(rown);
IFigure feedback = LayerManager.Helper.find(getOwner()).getLayer(LayerConstants.FEEDBACK_LAYER);
feedback.translateToRelative(rown);
int off2 = Y_OFFSET / 2;
if (row) {
int y2 = r.y + off2;
int x1 = rown.x + VLINEWIDTH / 2;
int x2 = rown.x + rown.width - VLINEWIDTH / 2 + 1;
drawHBorder(graphics, off2, y2, rown.x + off2, rown.x + rown.width - off2 + 1, x1, x2);
drawHBorder(graphics, off2, r.y + r.height - off2, rown.x + off2, rown.x + rown.width - off2 + 1, x1, x2);
}
// if (col) {
graphics.drawLine(r.x + off2, rown.y + off2, r.x + off2, rown.y + rown.height - off2 + 1);
graphics.drawLine(r.x + r.width - off2, rown.y + off2, r.x + r.width - off2, rown.y + rown.height - off2 + 1);
// }
}