本文整理汇总了Java中org.eclipse.gef.requests.AlignmentRequest类的典型用法代码示例。如果您正苦于以下问题:Java AlignmentRequest类的具体用法?Java AlignmentRequest怎么用?Java AlignmentRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AlignmentRequest类属于org.eclipse.gef.requests包,在下文中一共展示了AlignmentRequest类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAlignmentCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
private Command createAlignmentCommand() {
final AlignmentRequest request = new AlignmentRequest(RequestConstants.REQ_ALIGN);
request.setAlignmentRectangle(calculateAlignmentRectangle(request));
request.setAlignment(alignment);
final List editparts = getOperationSet(request);
if (editparts.size() < 2)
return null;
final CompoundCommand command = new CompoundCommand();
command.setDebugLabel(getText());
for (int i = 0; i < editparts.size(); i++) {
final EditPart editpart = (EditPart) editparts.get(i);
command.add(editpart.getCommand(request));
}
return command;
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:17,代码来源:ERDiagramAlignmentAction.java
示例2: createAlignmentCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
private Command createAlignmentCommand() {
AlignmentRequest request = new AlignmentRequest(
RequestConstants.REQ_ALIGN);
request.setAlignmentRectangle(calculateAlignmentRectangle(request));
request.setAlignment(alignment);
List editparts = getOperationSet(request);
if (editparts.size() < 2)
return null;
CompoundCommand command = new CompoundCommand();
command.setDebugLabel(getText());
for (int i = 0; i < editparts.size(); i++) {
EditPart editpart = (EditPart) editparts.get(i);
command.add(editpart.getCommand(request));
}
return command;
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:ERDiagramAlignmentAction.java
示例3: getConstraintFor
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
@Override
protected Object getConstraintFor(ChangeBoundsRequest request,
GraphicalEditPart child) {
if (request instanceof AlignmentRequest) {
return super.getConstraintFor(request, child);
}
final Rectangle rect = (Rectangle) super.getConstraintFor(request,
child);
final Rectangle cons = getCurrentConstraintFor(child);
final int newTreePosition = TreeLayoutUtil.getNewTreeNodePosition(
request.getLocation(),
TreeLayoutUtil.getSiblings((IGraphicalEditPart) child));
if (cons instanceof TreeLayoutConstraint) {
final TreeLayoutConstraint treeLayoutConstraint = (TreeLayoutConstraint) cons;
return new TreeLayoutConstraint(rect,
treeLayoutConstraint.isRoot(), newTreePosition);
}
return new TreeLayoutConstraint(rect, false, newTreePosition);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:21,代码来源:TreeLayoutEditPolicy.java
示例4: createAlignmentCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
private Command createAlignmentCommand() {
final AlignmentRequest request = new AlignmentRequest(RequestConstants.REQ_ALIGN);
request.setAlignmentRectangle(calculateAlignmentRectangle(request));
request.setAlignment(alignment);
final List<?> editparts = getOperationSet(request);
if (editparts.size() < 2)
return null;
final CompoundCommand command = new CompoundCommand();
command.setDebugLabel(getText());
for (int i = 0; i < editparts.size(); i++) {
final EditPart editpart = (EditPart) editparts.get(i);
command.add(editpart.getCommand(request));
}
return command;
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:17,代码来源:ERDiagramAlignmentAction.java
示例5: getCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
@Override
public Command getCommand(Request request) {
Object type = request.getType();
if (!canMove()) {
return null;
}
if (getHost()==null || getHost().getParent() == null) {
// SPF-9135 NPE: GEF 3.6 superclass will try to access getHost().getParent().getCommand(req)
return null;
}
if (REQ_MOVE.equals(type) && isDragAllowed())
return getMoveCommand((ChangeBoundsRequest)request);
if (REQ_MOVE_INITIATED.equals(type))
return forwardToParent((ChangeBoundsRequest)request, REQ_MOVE_CHILDREN_INITIATED);
if (REQ_MOVE_COMPLETED.equals(type))
return forwardToParent((ChangeBoundsRequest)request, REQ_MOVE_CHILDREN_COMPLETED);
if (REQ_ORPHAN.equals(type))
return getOrphanCommand(request);
if (REQ_ALIGN.equals(type))
return getAlignCommand((AlignmentRequest)request);
return null;
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:TimelineNodeMoveEditPolicy.java
示例6: getCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
/**
* Factors out RESIZE and ALIGN requests, otherwise calls <code>super</code>
* .
*
* @see org.eclipse.gef.EditPolicy#getCommand(Request)
*/
public Command getCommand(Request request) {
if (REQ_RESIZE_CHILDREN.equals(request.getType()))
return getResizeChildrenCommand((ChangeBoundsRequest) request);
if (REQ_ALIGN_CHILDREN.equals(request.getType()))
return getAlignChildrenCommand((AlignmentRequest) request);
return super.getCommand(request);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:ConstrainedLayoutEditPolicy.java
示例7: getCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
/**
* @see org.eclipse.gef.EditPolicy#getCommand(org.eclipse.gef.Request)
*/
public Command getCommand(Request request) {
Object type = request.getType();
if (REQ_MOVE.equals(type) && isDragAllowed())
return getMoveCommand((ChangeBoundsRequest) request);
if (REQ_ORPHAN.equals(type))
return getOrphanCommand(request);
if (REQ_ALIGN.equals(type))
return getAlignCommand((AlignmentRequest) request);
return null;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:16,代码来源:NonResizableEditPolicy.java
示例8: getAlignCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
/**
* Returns the command contribution to an alignment request
*
* @param request
* the alignment request
* @return the contribution to the alignment
*/
protected Command getAlignCommand(AlignmentRequest request) {
AlignmentRequest req = new AlignmentRequest(REQ_ALIGN_CHILDREN);
req.setEditParts(getHost());
req.setAlignment(request.getAlignment());
req.setAlignmentRectangle(request.getAlignmentRectangle());
return getHost().getParent().getCommand(req);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:NonResizableEditPolicy.java
示例9: getAlignChildrenCommand
import org.eclipse.gef.requests.AlignmentRequest; //导入依赖的package包/类
/**
* Returns the command to align a group of children. By default, this is
* treated the same as a resize, and
* {@link #getResizeChildrenCommand(ChangeBoundsRequest)} is returned.
*
* @param request
* the AligmentRequest
* @return the command to perform alignment
*/
protected Command getAlignChildrenCommand(AlignmentRequest request) {
return getResizeChildrenCommand(request);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:13,代码来源:ConstrainedLayoutEditPolicy.java
注:本文中的org.eclipse.gef.requests.AlignmentRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论