/** * ************************************************************************* * * Install a mouse * handler */ private DialogAndInProcessCmd stepSetToMode() { // Legacy belt-and-supenders code: if (!LinkSupport.amIValidForTargetOrSource( intersect, (isForTarget) ? LinkSupport.IS_FOR_TARGET : LinkSupport.IS_FOR_SOURCE, isForModule, rcxT_)) { return (new DialogAndInProcessCmd(DialogAndInProcessCmd.Progress.DONE, this)); } DialogAndInProcessCmd retval = new DialogAndInProcessCmd(DialogAndInProcessCmd.Progress.INSTALL_MOUSE_MODE, this); if (isForTarget) { retval.suPanelMode = (isForModule) ? PanelCommands.Mode.RELOCATE_NET_MOD_TARGET : PanelCommands.Mode.RELOCATE_TARGET; } else { retval.suPanelMode = (isForModule) ? PanelCommands.Mode.RELOCATE_NET_MOD_SOURCE : PanelCommands.Mode.RELOCATE_SOURCE; } return (retval); }
/** * ************************************************************************* * * Answer if we are * enabled for a popup case * */ @Override public boolean isValid( Intersection inter, boolean isSingleSeg, boolean canSplit, DataAccessContext rcx) { if (!isSingleSeg) { return (false); } return (LinkSupport.amIValidForTargetOrSource( inter, (isForTarget_) ? LinkSupport.IS_FOR_TARGET : LinkSupport.IS_FOR_SOURCE, isForModules_, rcx)); }
/** * ************************************************************************* * * Do the * relocation */ private DialogAndInProcessCmd stepRelocateSource() { // // Go and find if we intersect anything. // List<Intersection.AugmentedIntersection> augs = appState_.getGenomePresentation().intersectItem(x, y, rcxT_, true, false); Intersection.AugmentedIntersection ai = (new IntersectionChooser(true, rcxT_)).selectionRanker(augs); Intersection inter = ((ai == null) || (ai.intersect == null)) ? null : ai.intersect; // // If we don't intersect anything, we need to bag it. // if (inter == null) { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.REJECT, this)); } Object sub = inter.getSubID(); if (sub == null) { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.REJECT, this)); } String id = inter.getObjectID(); Node node = rcxT_.getGenome().getNode(id); if (node == null) { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.REJECT, this)); } if (!(sub instanceof Intersection.PadVal)) { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.REJECT, this)); } List<Intersection.PadVal> pads = inter.getPadCand(); if (LinkSupport.changeLinkSource(appState_, intersect, inter, pads, id, rcxT_)) { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.ACCEPT, this)); } else { return (new DialogAndInProcessCmd(ServerControlFlowHarness.ClickResult.REJECT, this)); } }