本文整理汇总了Java中org.eclipse.gef.GraphicalEditPart.getFigure方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalEditPart.getFigure方法的具体用法?Java GraphicalEditPart.getFigure怎么用?Java GraphicalEditPart.getFigure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalEditPart
的用法示例。
在下文中一共展示了GraphicalEditPart.getFigure方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isPrimaryMarqueeSelectedEditPart
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* Determines which edit parts are directly affected by the current marquee selection. Calculation is performed by
* regarding the current marquee selection rectangle ( {@link #getCurrentMarqueeSelectionRectangle()}), taking into
* consideration the current marquee behavior (contained vs. touched) that was provided (
* {@link #setMarqueeBehavior(int)} ).
*
* @param editPart
* the {@link EditPart} whose state is to be determined
* @return <code>true</code> if the {@link EditPart} should be regarded as being included in the current marquee
* selection, <code>false</code> otherwise.
*/
private boolean isPrimaryMarqueeSelectedEditPart(GraphicalEditPart editPart) {
// figure bounds are used to determine if edit part is included in
// selection
IFigure figure = editPart.getFigure();
Rectangle r = figure.getBounds().getCopy();
figure.translateToAbsolute(r);
boolean included = false;
Rectangle marqueeSelectionRectangle = getCurrentMarqueeSelectionRectangle();
// otherwise children will only be 'node' edit parts
if (marqueeBehavior == BEHAVIOR_NODES_TOUCHED) {
included = marqueeSelectionRectangle.intersects(r);
} else if (marqueeBehavior == BEHAVIOR_NODES_CONTAINED) {
included = marqueeSelectionRectangle.contains(r);
}
return included;
}
示例2: activate
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public void activate() {
super.activate();
ScalableRootEditPart root = (ScalableRootEditPart) getViewer().getRootEditPart();
ConnectionLayer connLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
GraphicalEditPart contentEditPart = (GraphicalEditPart) root.getContents();
FanRouter router = new FanRouter();
router.setSeparation(100);
ShortestPathConnectionRouter spRouter = new ShortestPathConnectionRouter(contentEditPart.getFigure());
router.setNextRouter(spRouter);
connLayer.setConnectionRouter(router);
GraphSelectionManager.ME.selectionPartChanged(this);
}
示例3: SequenceLineMoveHandle
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* SequenceLineMoveHandle
* @param owner
*/
public SequenceLineMoveHandle(GraphicalEditPart owner) {
super(owner);
if(owner.getFigure() instanceof LineFigure){
setLocator(new MoveHandleLocator(((LineFigure)owner.getFigure()).getLine()));
}
}
示例4: SequenceLineResizeHandle
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* @param owner
* @param direction
*/
public SequenceLineResizeHandle(GraphicalEditPart owner, int direction) {
super(owner, direction);
if(owner.getFigure() instanceof LineFigure){
setLocator(new RelativeHandleLocator(((LineFigure)owner.getFigure()).getLine(), direction));
}
}
示例5: getConstraintFor
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
@Override
protected Object getConstraintFor(ChangeBoundsRequest request, GraphicalEditPart child) {
// if (child instanceof IContainerPart) {
// return ((IContainerPart) child).getConstraintFor(request, child);
// }
// If we are dragging a band, we need to check the bounds and suggest a
// proper
// new location accordingly with the max and min band size.
IFigure figure = child.getFigure();
Rectangle bounds = figure.getBounds();
if (figure instanceof HandleBounds) {
bounds = ((HandleBounds) figure).getHandleBounds();
// if (request.getResizeDirection() == PositionConstants.NORTH
// || request.getResizeDirection() == PositionConstants.SOUTH)
bounds.width--;
// if (request.getResizeDirection() == PositionConstants.EAST
// || request.getResizeDirection() == PositionConstants.WEST)
bounds.height--;
}
Rectangle rect = new PrecisionRectangle(bounds);
figure.translateToAbsolute(rect);
rect = request.getTransformedRectangle(rect);
figure.translateToRelative(rect);
rect.translate(getLayoutOrigin().getNegated());
if (request.getSizeDelta().width == 0 && request.getSizeDelta().height == 0) {
Rectangle cons = getCurrentConstraintFor(child);
if (cons != null) // Bug 86473 allows for unintended use of this method
rect.setSize(cons.width, cons.height);
} else { // resize
Dimension minSize = getMinimumSizeFor(child);
if (rect.width < minSize.width) {
rect.width = minSize.width;
}
if (rect.height < minSize.height) {
rect.height = minSize.height;
}
}
return getConstraintFor(rect);
}
示例6: getCustomFeedbackFigure
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
protected IFigure getCustomFeedbackFigure(Object part) {
GraphicalEditPart elementPart = (GraphicalEditPart) part;
Figure figure = null;
if (elementPart.getFigure().getChildren().size() > 0){
int borderWidth = 0;
Color borderColor = null;
if (elementPart.getFigure().getBorder() instanceof TitaniumBackgroundBorder){
TitaniumBackgroundBorder tbb = (TitaniumBackgroundBorder)elementPart.getFigure().getBorder();
borderWidth = (int) tbb.getBorderWidth();
borderColor = tbb.getBorderColor();
}
int titleBarHeight = 0;
//necessary for titlebar delta
if (elementPart instanceof WindowEditPart){
titleBarHeight = ((WindowFigure)elementPart.getFigure()).getTitleBarHeight();
} else if (elementPart.getFigure() instanceof TableViewFigure){
TableViewFigure f = (TableViewFigure)elementPart.getFigure();
titleBarHeight = f.hasHeader() ? f.getTitleHeight() : 0;
}
if (titleBarHeight > 0){
final int headerHeight = titleBarHeight;
figure = new SmartRectangleFigure(true, borderColor, borderWidth){
public Rectangle getClientArea(Rectangle rect) {
rect.setBounds(getBounds());
rect.crop(super.getInsets());
rect.setLocation(0, -headerHeight);
return rect;
};
@Override
public Insets getInsets() {
return super.getInsets().getAdded(new Insets(headerHeight, 0,0,0));
}
};
} else {
figure = new SmartRectangleFigure(true, borderColor, borderWidth);
}
((RectangleFigure) figure).setXOR(true);
((RectangleFigure) figure).setFill(true);
figure.setBackgroundColor(ghostFillColor);
figure.setForegroundColor(ColorConstants.white);
} else {
figure = new GhostImageFigure(elementPart.getFigure(), 200);
}
//This approach don't work because feedback should not paing children!!!
/*
// We have a special case here.
if (elementPart instanceof ScrollViewEditPart) {
ScrollViewEditPart sEditPart = (ScrollViewEditPart) elementPart;
ScrollViewFigure sFigure = (ScrollViewFigure) sEditPart.getFigure();
IFigure elementFigure = sFigure.getContainer();
elementFigure.setLocation(sFigure.getLocation());
figure = new GhostImageFigure(sFigure, 200);
} else {
figure = new GhostImageFigure(elementPart.getFigure(), 200);
/*} else {
figure = new SmartRectangleFigure(true);
((RectangleFigure) figure).setXOR(true);
((RectangleFigure) figure).setFill(true);
figure.setBackgroundColor(ghostFillColor);
figure.setForegroundColor(ColorConstants.white);
}*/
//}
return figure;
}
示例7: CellMoveHandleLocator
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public CellMoveHandleLocator(GraphicalEditPart editPart) {
super(editPart.getFigure());
this.editPart = editPart;
}
示例8: BandMoveHandle
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public BandMoveHandle(GraphicalEditPart owner) {
this(owner, new MoveHandleLocator(owner.getFigure()));
}
示例9: BandButtonPadHandle
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* Creates a new {@link BandButtonPadHandle} instance.
*
* @param owner the owner edit part for the handle
*/
public BandButtonPadHandle(GraphicalEditPart owner){
super(owner, new BandButtonPadLocator(owner.getFigure()));
createButtons();
}
示例10: BandResizeHandle
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* Constructor for SectionResizeHandle.
*
* @param owner
* the owner
*/
public BandResizeHandle(GraphicalEditPart owner) {
super(owner, new BandHandleLocator(owner.getFigure()));
initialize();
}