如果我们的节点被作为连接的端点,那么它通常需要安装EditPolicy.GRAPHICAL_NODE_ROLE策略,策略类通常是继承GraphicalNodeEditPolicy类
eg:
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, CustomGraphicalNodeEditPolicy):
它有四个需要实现的抽象方法。分别是
eg:
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, CustomGraphicalNodeEditPolicy):
它有四个需要实现的抽象方法。分别是
//当点击连线创建工具条时此方法被调用,创建连线
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
}
//当点击连线创建工具条时此方法被调用,创建连线
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
}
//修改源节点时调用
protected Command getReconnectSourceCommand(ReconnectRequest request) {
}
//修改目标节点时调用
protected Command getReconnectTargetCommand(ReconnectRequest request) {
}