本文整理汇总了Java中org.eclipse.gef.requests.CreateConnectionRequest.getNewObject方法的典型用法代码示例。如果您正苦于以下问题:Java CreateConnectionRequest.getNewObject方法的具体用法?Java CreateConnectionRequest.getNewObject怎么用?Java CreateConnectionRequest.getNewObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.CreateConnectionRequest
的用法示例。
在下文中一共展示了CreateConnectionRequest.getNewObject方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(final CreateConnectionRequest request) {
final Object object = request.getNewObject();
if (object instanceof CommentConnection) {
final CommentConnection connection = (CommentConnection) object;
final CreateConnectionCommand command = new CreateCommentConnectionCommand(connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例2: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Object object = request.getNewObject();
if (object instanceof CommentConnection) {
CommentConnection connection = (CommentConnection) object;
CreateConnectionCommand command = new CreateCommentConnectionCommand(
this.diagram, connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例3: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Object object = request.getNewObject();
if (object instanceof CommentConnection) {
CommentConnection connection = (CommentConnection) object;
CreateConnectionCommand command = new CreateCommentConnectionCommand(
connection);
command.setSource(request.getTargetEditPart());
request.setStartCommand(command);
return command;
}
return null;
}
示例4: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Table source = (Table) getHost().getModel();
Connection c = (Connection) request.getNewObject();
ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, c);
request.setStartCommand(cmd);
return cmd;
}
示例5: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
DwFeatureModelWrapped featureModel = ((DwFeatureEditPart)getHost()).getFeatureModel();
DwParentChildConnection connection = (DwParentChildConnection)request.getNewObject();
connection.setModel(featureModel);
DwParentChildConnectionCreateCommand command = new DwParentChildConnectionCreateCommand();
command.setSource((DwFeatureWrapped)getHost().getModel());
command.setConnection(connection);
command.setFeatureModel(featureModel);
request.setStartCommand(command);
return command;
}
示例6: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*/
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
CreateConnectionCommand command = new CreateConnectionCommand();
AbstractConnection connection = (AbstractConnection) request.getNewObject();
AbstractView objNode = (AbstractNode) (getHost().getModel());
if (objNode instanceof AbstractConnection) {
return null;
}
AbstractNode abstractNode = (AbstractNode) objNode;
if (!UMLPolicyManager.isConnectableFromSource(connection.getRelationType(), abstractNode.getNodeType())) {
return null;
}
ConnectionAnchor sourceAnchor = ((NodeEditPart) getHost()).getSourceConnectionAnchor(request);
command.setSourceAnchorPoint(sourceAnchor.getLocation(request.getLocation()));
command.setConnection(connection);
command.setSource((AbstractNode) getHost().getModel());
request.setStartCommand(command);
request.setSourceEditPart(getHost());
return command;
}
示例7: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
if(request.getNewObject() instanceof ColumnConnection)
{
CreateConnectionCommand command = (CreateConnectionCommand) request.getStartCommand();
FunctionColumnModel target=(FunctionColumnModel) getHost().getModel();
ColumnConnection conn=new ColumnConnection();
command.setConnection(conn);
command.setTarget(target);
return command;
}
return null;
}
示例8: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
if(request.getNewObject() instanceof ColumnConnection)
{
CreateConnectionCommand command = new CreateConnectionCommand();
FunctionColumnModel source=(FunctionColumnModel) getHost().getModel();
command.setSource(source);
request.setStartCommand(command);
return command;
}
return null;
}
示例9: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* @return a {@link CreateElementLinkCommand}
*
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*/
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
if (request.getNewObject() instanceof ElementLink) {
IntentionalElementRef source = (IntentionalElementRef) getHost().getModel();
CreateElementLinkCommand cmd = new CreateElementLinkCommand(source.getDiagram().getUrndefinition().getUrnspec(), source.getDef(),
(ElementLink) request.getNewObject());
request.setStartCommand(cmd);
return cmd;
}
return null;
}
示例10: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* @return a {@link AddBeliefLinkCommand}
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*/
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
Belief source = (Belief) getHost().getModel();
if (source.getSucc().size() == 0 && (request.getNewObject() instanceof BeliefLink)) {
AddBeliefLinkCommand cmd = new AddBeliefLinkCommand((GRLGraph) source.getDiagram(), source, (BeliefLink) request.getNewObject());
request.setStartCommand(cmd);
return cmd;
}
return null;
}
示例11: getConnectionCreateCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* @return a {@link CreateKPIModelLinkCommand}
*
* @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCreateCommand(org.eclipse.gef.requests.CreateConnectionRequest)
*/
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
if (request.getNewObject() instanceof KPIModelLink) {
KPIInformationElementRef source = (KPIInformationElementRef) getHost().getModel();
CreateKPIModelLinkCommand cmd = new CreateKPIModelLinkCommand(source.getDiagram().getUrndefinition().getUrnspec(), source.getDef(),
(KPIModelLink) request.getNewObject());
request.setStartCommand(cmd);
return cmd;
}
return null;
}