use of org.eclipse.gef.ConnectionEditPart in project cubrid-manager by CUBRID.
the class BrokerMonitorPart method refreshTargetConnections.
/**
* refresh Target Connections
*/
protected void refreshTargetConnections() {
super.refreshTargetConnections();
for (Object obj : getTargetConnections()) {
ConnectionEditPart ep = (ConnectionEditPart) obj;
ep.refresh();
}
}
use of org.eclipse.gef.ConnectionEditPart in project tdi-studio-se by Talend.
the class NodePart method refreshTargetConnections.
@Override
protected void refreshTargetConnections() {
int i;
ConnectionEditPart editPart;
Object model;
Map mapModelToEditPart = new HashMap();
List connections = getTargetConnections();
for (i = 0; i < connections.size(); i++) {
editPart = (ConnectionEditPart) connections.get(i);
mapModelToEditPart.put(editPart.getModel(), editPart);
}
List modelObjects = getModelTargetConnections();
if (modelObjects == null) {
modelObjects = new ArrayList();
}
for (i = 0; i < modelObjects.size(); i++) {
model = modelObjects.get(i);
if (model instanceof IConnection) {
INode sourcenode = ((IConnection) model).getSource();
INode targetnode = ((IConnection) model).getSource();
String connectorName = ((IConnection) model).getConnectorName();
if (sourcenode.getConnectorFromName(connectorName) == null && targetnode.getConnectorFromName(connectorName) == null) {
return;
}
}
if (i < connections.size() && ((EditPart) connections.get(i)).getModel() == model) {
continue;
}
editPart = (ConnectionEditPart) mapModelToEditPart.get(model);
if (editPart != null) {
reorderTargetConnection(editPart, i);
} else {
editPart = createOrFindConnection(model);
addTargetConnection(editPart, i);
}
}
// Remove the remaining Connection EditParts
List trash = new ArrayList();
for (; i < connections.size(); i++) {
trash.add(connections.get(i));
}
for (i = 0; i < trash.size(); i++) {
removeTargetConnection((ConnectionEditPart) trash.get(i));
}
}
use of org.eclipse.gef.ConnectionEditPart in project tdi-studio-se by Talend.
the class NodePart method refreshSourceConnections.
@Override
protected void refreshSourceConnections() {
int i;
ConnectionEditPart editPart;
Object model;
Map modelToEditPart = new HashMap();
List editParts = getSourceConnections();
for (i = 0; i < editParts.size(); i++) {
editPart = (ConnectionEditPart) editParts.get(i);
modelToEditPart.put(editPart.getModel(), editPart);
}
List modelObjects = getModelSourceConnections();
// List<? extends INodeConnector> connList = node.getListConnector();
if (modelObjects == null) {
modelObjects = new ArrayList();
}
for (i = 0; i < modelObjects.size(); i++) {
model = modelObjects.get(i);
if (model instanceof IConnection) {
INode sourcenode = ((IConnection) model).getSource();
INode targetnode = ((IConnection) model).getSource();
String connectorName = ((IConnection) model).getConnectorName();
if (sourcenode.getConnectorFromName(connectorName) == null && targetnode.getConnectorFromName(connectorName) == null) {
return;
}
}
if (i < editParts.size() && ((EditPart) editParts.get(i)).getModel() == model) {
continue;
}
editPart = (ConnectionEditPart) modelToEditPart.get(model);
if (editPart != null) {
reorderSourceConnection(editPart, i);
} else {
editPart = createOrFindConnection(model);
addSourceConnection(editPart, i);
}
}
// Remove the remaining EditParts
List trash = new ArrayList();
for (; i < editParts.size(); i++) {
trash.add(editParts.get(i));
}
for (i = 0; i < trash.size(); i++) {
removeSourceConnection((ConnectionEditPart) trash.get(i));
}
}
Aggregations