use of com.centurylink.mdw.designer.display.Selectable in project mdw-designer by CenturyLinkCloud.
the class RunTimeDesignerCanvas method mouseReleased.
public void mouseReleased(MouseEvent arg0) {
if (arg0.getButton() == 1)
return;
if (!arg0.isPopupTrigger())
return;
Graph process = page.getProcess();
int x = arg0.getX();
int y = arg0.getY();
if (process.zoom != 100) {
x = x * 100 / process.zoom;
y = y * 100 / process.zoom;
}
Object obj = process.objectAt(x, y, getGraphics());
if (obj == null)
return;
if (obj instanceof Selectable) {
// JPopupMenu popup = this.popup_activity; // TODO
// if (popup!=null) popup.show(this, arg0.getX(), arg0.getY());
} else if (obj instanceof Link) {
}
}
use of com.centurylink.mdw.designer.display.Selectable in project mdw-designer by CenturyLinkCloud.
the class FlowchartPage method drop.
public void drop(DropTargetDropEvent e) {
if (process.isReadonly()) {
return;
}
try {
if (e.isDataFlavorSupported(DataFlavor.stringFlavor)) {
Transferable tr = e.getTransferable();
e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
String s = (String) tr.getTransferData(DataFlavor.stringFlavor);
int i = Integer.parseInt(s.substring(3));
ActivityImplementorVO nmi = model.getNodeMetaInfo().get(i);
Selectable object;
int x = e.getLocation().x;
int y = e.getLocation().y;
if (process.zoom != 100) {
x = x * 100 / process.zoom;
y = y * 100 / process.zoom;
}
if (nmi.getImplementorClassName().equals(NodeMetaInfo.PSEUDO_PROCESS_ACTIVITY)) {
String type = promptEmbeddedProcessType(process);
if (type != null)
object = process.addSubGraph(x, y, type, recordchange);
else
object = null;
} else {
object = process.addNode(nmi, x, y, recordchange);
}
e.dropComplete(true);
if (object != null) {
canvas.setSelectedObject(object);
canvas.requestFocus();
canvas.repaint();
}
} else {
e.rejectDrop();
}
} catch (IOException io) {
// io.printStackTrace();
e.rejectDrop();
} catch (UnsupportedFlavorException ufe) {
// ufe.printStackTrace();
e.rejectDrop();
}
}
use of com.centurylink.mdw.designer.display.Selectable in project mdw-designer by CenturyLinkCloud.
the class FlowchartPage method dragDropEnd.
public void dragDropEnd(DragSourceDropEvent e) {
if (Constants.isMacOsX()) {
ActivityImplementorVO nmi = model.getNodeMetaInfo().get(nodepane.getSelectedNode());
Selectable object;
Point p = canvas.getMousePosition();
int x = p.x;
int y = p.y;
if (process.zoom != 100) {
x = x * 100 / process.zoom;
y = y * 100 / process.zoom;
}
if (nmi.getImplementorClassName().equals(NodeMetaInfo.PSEUDO_PROCESS_ACTIVITY)) {
String type = promptEmbeddedProcessType(process);
if (type != null)
object = process.addSubGraph(x, y, type, recordchange);
else
object = null;
} else {
object = process.addNode(nmi, x, y, recordchange);
}
if (object != null) {
canvas.setSelectedObject(object);
canvas.requestFocus();
canvas.repaint();
}
}
}
Aggregations