Search in sources :

Example 6 with ContainerNode

use of com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode in project cubrid-manager by CUBRID.

the class CreateContainerNodeCommand method getSize.

/**
	 * get the size
	 * 
	 * @param name String
	 * @return size
	 */
public int getSize(String name) {
    int count = diagram.getChildNodeList().size();
    int size = 0;
    for (int i = 0; i < count; i++) {
        ContainerNode node = (ContainerNode) diagram.getChildNodeList().get(i);
        if (node.getClass().getName().equals(name)) {
            size++;
        }
    }
    return size;
}
Also used : ContainerNode(com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode) Point(org.eclipse.draw2d.geometry.Point)

Example 7 with ContainerNode

use of com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode in project cubrid-manager by CUBRID.

the class DeleteNodeCommand method execute.

/**
	 * @see org.eclipse.gef.commands.Command#execute()
	 */
public void execute() {
    if (parent instanceof Diagram) {
        Diagram diagram = (Diagram) parent;
        diagram.removeNode((ContainerNode) node);
    } else if (parent instanceof ContainerNode) {
        ContainerNode containerNode = (ContainerNode) parent;
        containerNode.removeChildNode((LeafNode) node);
    }
}
Also used : LeafNode(com.cubrid.cubridmanager.ui.replication.editor.model.LeafNode) ContainerNode(com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode) Diagram(com.cubrid.cubridmanager.ui.replication.editor.model.Diagram)

Aggregations

ContainerNode (com.cubrid.cubridmanager.ui.replication.editor.model.ContainerNode)7 LeafNode (com.cubrid.cubridmanager.ui.replication.editor.model.LeafNode)4 Diagram (com.cubrid.cubridmanager.ui.replication.editor.model.Diagram)3 Point (org.eclipse.draw2d.geometry.Point)3 ArrowConnection (com.cubrid.cubridmanager.ui.replication.editor.model.ArrowConnection)2 DistributorNode (com.cubrid.cubridmanager.ui.replication.editor.model.DistributorNode)2 HostNode (com.cubrid.cubridmanager.ui.replication.editor.model.HostNode)2 MasterNode (com.cubrid.cubridmanager.ui.replication.editor.model.MasterNode)2 Node (com.cubrid.cubridmanager.ui.replication.editor.model.Node)2 SlaveNode (com.cubrid.cubridmanager.ui.replication.editor.model.SlaveNode)2 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)1 CreateContainerNodeCommand (com.cubrid.cubridmanager.ui.replication.editor.commands.CreateContainerNodeCommand)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1