本文整理汇总了Java中org.eclipse.gef.editpolicies.ResizableEditPolicy类的典型用法代码示例。如果您正苦于以下问题:Java ResizableEditPolicy类的具体用法?Java ResizableEditPolicy怎么用?Java ResizableEditPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResizableEditPolicy类属于org.eclipse.gef.editpolicies包,在下文中一共展示了ResizableEditPolicy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eraseSourceFeedback
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#eraseSourceFeedback(org.eclipse.gef.Request)
*/
public void eraseSourceFeedback(Request request) {
if (isActive()) {
EditPolicyIterator iter = getEditPolicyIterator();
while (iter.hasNext()) {
EditPolicy nextEditPolicy = iter.next();
if(nextEditPolicy instanceof ResizableEditPolicy) {
List<Object> feedbackList = getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null == feedbackList || feedbackList.isEmpty()){
continue;
}
}
nextEditPolicy.eraseSourceFeedback(request);
}
}
}
示例2: getPrimaryDragEditPolicy
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
/**
* @generated
*/
@Override
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
if (result instanceof ResizableEditPolicy) {
ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.NONE);
}
return result;
}
示例3: createChildEditPolicy
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
if(child instanceof NodeElementEditPart){
return new ResizableEditPolicy();
}else{
return new NonResizableEditPolicy();
}
}
示例4: deactivateEditPolicies
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#deactivateEditPolicies()
*/
protected void deactivateEditPolicies() {
EditPolicyIterator iter = getEditPolicyIterator();
while (iter.hasNext()) {
EditPolicy nextEditPolicy = iter.next();
if(nextEditPolicy instanceof ResizableEditPolicy) {
List<Object> feedbackList = getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null == feedbackList || feedbackList.isEmpty()){
continue;
}
}
nextEditPolicy.deactivate();
}
}
示例5: getPrimaryDragEditPolicy
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
/**
* @generated
*/
public EditPolicy getPrimaryDragEditPolicy() {
EditPolicy result = super.getPrimaryDragEditPolicy();
if (result instanceof ResizableEditPolicy) {
ResizableEditPolicy ep = (ResizableEditPolicy) result;
ep.setResizeDirections(PositionConstants.NONE);
}
return result;
}
示例6: createChildEditPolicy
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
protected EditPolicy createChildEditPolicy( EditPart child )
{
return new ResizableEditPolicy( ) {
protected IFigure createDragSourceFeedbackFigure( )
{
// Use a ghost rectangle for feedback
Figure r = new Figure( ) {
protected void paintFigure( Graphics graphics )
{
Rectangle rect = getBounds( ).getCopy( );
graphics.setXORMode( true );
graphics.setForegroundColor( ColorConstants.white );
graphics.setBackgroundColor( ColorManager.getColor( 31,
31,
31 ) );
graphics.translate( getLocation( ) );
PointList outline = new PointList( );
outline.addPoint( 0, 0 );
outline.addPoint( rect.width, 0 );
outline.addPoint( rect.width - 1, 0 );
outline.addPoint( rect.width - 1, rect.height - 1 );
outline.addPoint( 0, rect.height - 1 );
graphics.fillPolygon( outline );
// draw the inner outline
PointList innerLine = new PointList( );
innerLine.addPoint( rect.width - 0 - 1, 0 );
innerLine.addPoint( rect.width - 0 - 1, 0 );
innerLine.addPoint( rect.width - 1, 0 );
innerLine.addPoint( rect.width - 0 - 1, 0 );
innerLine.addPoint( 0, 0 );
innerLine.addPoint( 0, rect.height - 1 );
innerLine.addPoint( rect.width - 1, rect.height - 1 );
innerLine.addPoint( rect.width - 1, 0 );
graphics.drawPolygon( innerLine );
graphics.drawLine( rect.width - 0 - 1,
0,
rect.width - 1,
0 );
graphics.translate( getLocation( ).getNegated( ) );
}
};
r.setBounds( getInitialFeedbackBounds( ) );
addFeedback( r );
return r;
}
};
}
示例7: createChildEditPolicy
import org.eclipse.gef.editpolicies.ResizableEditPolicy; //导入依赖的package包/类
protected EditPolicy createChildEditPolicy(EditPart child) {
ResizableEditPolicy policy = new ResizableEditPolicy();
policy.setResizeDirections(PositionConstants.EAST_WEST);
return policy;
}