本文整理了Java中net.sf.taverna.t2.workbench.helper.Helper
类的一些代码示例,展示了Helper
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper
类的具体详情如下:
包路径:net.sf.taverna.t2.workbench.helper.Helper
类名称:Helper
[英]This class creates the dialogs for the presentation of the HelpSet held by the HelpCollator.
[中]
代码示例来源:origin: net.sf.taverna.t2.ui-impl/configuration-impl
public void actionPerformed(ActionEvent arg0) {
Helper.showHelp(panel);
}
});
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Display the default home page help.
*
* @param e
*/
public static void displayDefaultHelp(AWTEvent e) {
showID("home");
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Get the singleton instance of Helper. In theory there could be more than
* one.
*
* @return
*/
private static Helper getInstance() {
if (instance == null) {
instance = new Helper();
}
return instance;
}
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Show the help most associated with the specific component within the container.
*
* @param rootpanecontainer
* @param c
*/
static void showHelpWithinContainer(
final RootPaneContainer rootpanecontainer, final Component c) {
getInstance();
showHelp(c);
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Show the help most associated with the specific component within the container.
*
* @param rootpanecontainer
* @param c
*/
static void showHelpWithinContainer(
final RootPaneContainer rootpanecontainer, final Component c) {
getInstance();
if ((dialog == null) || !dialog.getOwner().equals(rootpanecontainer)) {
if (dialog != null) {
dialog.setVisible(false);
oldSize = dialog.getSize();
logger.info("Size of dialog was x=" + oldSize.width + " y="
+ oldSize.height);
}
if (dialogMap.containsKey(rootpanecontainer)) {
dialog = dialogMap.get(rootpanecontainer);
initializeDialog(dialog);
} else {
dialog = createDialog(rootpanecontainer);
}
}
showHelp(c);
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Set up a key-press catcher for the specified component such that when F1
* is pressed it should help for the component where the cursor is.
*
* @param rootpanecontainer
*/
public static void setKeyCatcher(final RootPaneContainer rootpanecontainer) {
AbstractAction theAction = new AbstractAction() {
public void actionPerformed(ActionEvent arg0) {
Component component = (Component) rootpanecontainer;
Container container = (Container) rootpanecontainer;
logger.info("frame action F1 pressed with source "
+ arg0.getSource().getClass().getName());
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
Point framePosition = component.getLocation();
Point relativePosition = (Point) mousePosition.clone();
relativePosition.translate(-framePosition.x, -framePosition.y);
Component c = container.findComponentAt(relativePosition);
if (c != null) {
logger.info("F1 pressed in a " + c.getClass().getName());
}
showHelpWithinContainer(rootpanecontainer, c);
}
};
JRootPane pane = rootpanecontainer.getRootPane();
setKeyCatcher(pane, theAction);
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
public void actionPerformed(ActionEvent arg0) {
Helper.showHelpWithinContainer(dialog, dialog);
}
}));
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Show in the current dialog the entry (if any) corresponding to the
* specified id.
*
* @param id
*/
private static void showID(String id) {
getInstance();
if (dialog == null) {
dialog = createDialog(null);
}
dialog.setVisible(true);
if (!HelpCollator.isEmptyHelp()) {
jhelp.setCurrentID(id);
}
}
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Show in the current dialog the entry (if any) corresponding to the
* specified id.
*
* @param id
*/
public static void showID(String id) {
getInstance();
URL result;
try {
result = HelpCollator.getURLFromID(id);
if (result == null) {
result = HelpCollator.getURLFromID("home");
}
Desktop.getDesktop().browse(result.toURI());
} catch (BadIDException e) {
logger.warn(e);
} catch (MalformedURLException e) {
logger.error(e);
} catch (IOException e) {
logger.error(e);
} catch (URISyntaxException e) {
logger.error(e);
}
}
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Set up a key-press catcher for the specified component such that when F1
* is pressed it should help for the component where the cursor is.
*
* @param rootpanecontainer
*/
public static void setKeyCatcher(final RootPaneContainer rootpanecontainer) {
AbstractAction theAction = new AbstractAction() {
public void actionPerformed(ActionEvent arg0) {
Component component = (Component) rootpanecontainer;
Container container = (Container) rootpanecontainer;
logger.info("frame action F1 pressed with source "
+ arg0.getSource().getClass().getName());
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
Point framePosition = component.getLocation();
Point relativePosition = (Point) mousePosition.clone();
relativePosition.translate(-framePosition.x, -framePosition.y);
Component c = container.findComponentAt(relativePosition);
if (c != null) {
logger.info("F1 pressed in a " + c.getClass().getName());
}
showHelpWithinContainer(rootpanecontainer, c);
}
};
JRootPane pane = rootpanecontainer.getRootPane();
setKeyCatcher(pane, theAction);
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
public void actionPerformed(ActionEvent arg0) {
Helper.showHelpWithinContainer(dialog, dialog);
}
}));
代码示例来源:origin: net.sf.taverna.t2.ui-activities/interaction-activity-ui
@Override
public void actionPerformed(final ActionEvent arg0) {
Helper.showHelp(panel);
}
});
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Create a HelpEnabledDialog, register it (if possible) with the
* HelpCollator and attach a keycatcher.
*
* @param owner
* @param title
* @param modal
* @param id
* @throws HeadlessException
*/
public HelpEnabledDialog(Dialog owner, String title, boolean modal,
String id) throws HeadlessException {
super(owner, title, modal);
if (id != null) {
HelpCollator.registerComponent(this, id);
} else if (owner != null) {
HelpCollator.registerComponent(this, owner.getClass()
.getCanonicalName()
+ "-dialog");
}
Helper.setKeyCatcher(this);
}
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
/**
* Display the default home page help.
*
* @param e
*/
public static void displayDefaultHelp(AWTEvent e) {
showID("home");
}
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
public void actionPerformed(ActionEvent arg0) {
Component component = (Component) rootpanecontainer;
Container container = (Container) rootpanecontainer;
logger.info("frame action F1 pressed with source "
+ arg0.getSource().getClass().getName());
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
Point framePosition = component.getLocation();
Point relativePosition = (Point) mousePosition.clone();
relativePosition.translate(-framePosition.x, -framePosition.y);
Component c = container.findComponentAt(relativePosition);
if (c != null) {
logger.info("F1 pressed in a " + c.getClass().getName());
}
showHelpWithinContainer(rootpanecontainer, c);
}
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Get the singleton instance of Helper. In theory there could be more than
* one.
*
* @return
*/
private static Helper getInstance() {
if (instance == null) {
instance = new Helper();
}
return instance;
}
代码示例来源:origin: net.sf.taverna.t2.ui-activities/component-activity-ui
@Override
public void actionPerformed(ActionEvent arg0) {
showHelp(panel);
}
}));
代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api
/**
* Create a HelpEnabledDialog, register it (if possible) with the
* HelpCollator and attach a keycatcher.
*
* @param owner
* @param title
* @param modal
* @param id
* @throws HeadlessException
*/
public HelpEnabledDialog(Dialog owner, String title, boolean modal,
String id) throws HeadlessException {
super(owner, title, modal);
if (id != null) {
HelpCollator.registerComponent(this, id);
} else if (owner != null) {
HelpCollator.registerComponent(this, owner.getClass()
.getCanonicalName()
+ "-dialog");
}
Helper.setKeyCatcher(this);
}
代码示例来源:origin: net.sf.taverna.t2.ui-exts/retry-ui
@Override
public void actionPerformed(ActionEvent e) {
Helper.showID(RetryConfigureAction.class.getCanonicalName());
}};
代码示例来源:origin: net.sf.taverna.t2.workbench/helper
public void actionPerformed(ActionEvent arg0) {
Component component = (Component) rootpanecontainer;
Container container = (Container) rootpanecontainer;
logger.info("frame action F1 pressed with source "
+ arg0.getSource().getClass().getName());
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
Point framePosition = component.getLocation();
Point relativePosition = (Point) mousePosition.clone();
relativePosition.translate(-framePosition.x, -framePosition.y);
Component c = container.findComponentAt(relativePosition);
if (c != null) {
logger.info("F1 pressed in a " + c.getClass().getName());
}
showHelpWithinContainer(rootpanecontainer, c);
}
内容来源于网络,如有侵权,请联系作者删除!