@SuppressWarnings("unchecked") @Override public void performAction(Node[] nodes) { WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels(nodes[0])); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle("nLV Graph Configuration"); wizardDescriptor.putProperty("node", nodes[0]); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { // do something int maxLevel = (Integer) wizardDescriptor.getProperty("maxLevel"); boolean inner = (Boolean) wizardDescriptor.getProperty("inner"); AbstractDistance ad = (AbstractDistance) wizardDescriptor.getProperty("distance"); if (ad.configurable()) { ad.configure(); } OutputPanel op = new OutputPanel( nodes[0].getParentNode().getDisplayName() + ": nLV Graph (" + ad.toString() + ") Output"); Runnable job = new GraphBuilder(nodes[0], op, ad, 0, maxLevel, inner); op.open(); op.requestActive(); Thread thread = new Thread(job); thread.setDaemon(true); thread.start(); nodes[0].addNodeListener(new LocalNodeListener(op)); } panels = null; }
/** * Overridden so we can indicate the pinned state. * * @param pinned whether or not we're pinned * @author mhunsicker */ @Override public void setPinned(boolean pinned) { pinnedLabel.setVisible(pinned); super.setPinned(pinned); }
/** * Call this before you use this tab. It resets its output as well as enabling buttons * appropriately. * * @author mhunsicker */ @Override public void reset() { super.reset(); closeLabel.setEnabled(true); }