net.sf.taverna.t2.workbench.helper.Helper类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中net.sf.taverna.t2.workbench.helper.Helper类的一些代码示例,展示了Helper类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper类的具体详情如下:
包路径:net.sf.taverna.t2.workbench.helper.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

  1. public void actionPerformed(ActionEvent arg0) {
  2. Helper.showHelp(panel);
  3. }
  4. });

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Display the default home page help.
  3. *
  4. * @param e
  5. */
  6. public static void displayDefaultHelp(AWTEvent e) {
  7. showID("home");
  8. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Get the singleton instance of Helper. In theory there could be more than
  3. * one.
  4. *
  5. * @return
  6. */
  7. private static Helper getInstance() {
  8. if (instance == null) {
  9. instance = new Helper();
  10. }
  11. return instance;
  12. }

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Show the help most associated with the specific component within the container.
  3. *
  4. * @param rootpanecontainer
  5. * @param c
  6. */
  7. static void showHelpWithinContainer(
  8. final RootPaneContainer rootpanecontainer, final Component c) {
  9. getInstance();
  10. showHelp(c);
  11. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Show the help most associated with the specific component within the container.
  3. *
  4. * @param rootpanecontainer
  5. * @param c
  6. */
  7. static void showHelpWithinContainer(
  8. final RootPaneContainer rootpanecontainer, final Component c) {
  9. getInstance();
  10. if ((dialog == null) || !dialog.getOwner().equals(rootpanecontainer)) {
  11. if (dialog != null) {
  12. dialog.setVisible(false);
  13. oldSize = dialog.getSize();
  14. logger.info("Size of dialog was x=" + oldSize.width + " y="
  15. + oldSize.height);
  16. }
  17. if (dialogMap.containsKey(rootpanecontainer)) {
  18. dialog = dialogMap.get(rootpanecontainer);
  19. initializeDialog(dialog);
  20. } else {
  21. dialog = createDialog(rootpanecontainer);
  22. }
  23. }
  24. showHelp(c);
  25. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Set up a key-press catcher for the specified component such that when F1
  3. * is pressed it should help for the component where the cursor is.
  4. *
  5. * @param rootpanecontainer
  6. */
  7. public static void setKeyCatcher(final RootPaneContainer rootpanecontainer) {
  8. AbstractAction theAction = new AbstractAction() {
  9. public void actionPerformed(ActionEvent arg0) {
  10. Component component = (Component) rootpanecontainer;
  11. Container container = (Container) rootpanecontainer;
  12. logger.info("frame action F1 pressed with source "
  13. + arg0.getSource().getClass().getName());
  14. Point mousePosition = MouseInfo.getPointerInfo().getLocation();
  15. Point framePosition = component.getLocation();
  16. Point relativePosition = (Point) mousePosition.clone();
  17. relativePosition.translate(-framePosition.x, -framePosition.y);
  18. Component c = container.findComponentAt(relativePosition);
  19. if (c != null) {
  20. logger.info("F1 pressed in a " + c.getClass().getName());
  21. }
  22. showHelpWithinContainer(rootpanecontainer, c);
  23. }
  24. };
  25. JRootPane pane = rootpanecontainer.getRootPane();
  26. setKeyCatcher(pane, theAction);
  27. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. public void actionPerformed(ActionEvent arg0) {
  2. Helper.showHelpWithinContainer(dialog, dialog);
  3. }
  4. }));

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Show in the current dialog the entry (if any) corresponding to the
  3. * specified id.
  4. *
  5. * @param id
  6. */
  7. private static void showID(String id) {
  8. getInstance();
  9. if (dialog == null) {
  10. dialog = createDialog(null);
  11. }
  12. dialog.setVisible(true);
  13. if (!HelpCollator.isEmptyHelp()) {
  14. jhelp.setCurrentID(id);
  15. }
  16. }

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Show in the current dialog the entry (if any) corresponding to the
  3. * specified id.
  4. *
  5. * @param id
  6. */
  7. public static void showID(String id) {
  8. getInstance();
  9. URL result;
  10. try {
  11. result = HelpCollator.getURLFromID(id);
  12. if (result == null) {
  13. result = HelpCollator.getURLFromID("home");
  14. }
  15. Desktop.getDesktop().browse(result.toURI());
  16. } catch (BadIDException e) {
  17. logger.warn(e);
  18. } catch (MalformedURLException e) {
  19. logger.error(e);
  20. } catch (IOException e) {
  21. logger.error(e);
  22. } catch (URISyntaxException e) {
  23. logger.error(e);
  24. }
  25. }

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Set up a key-press catcher for the specified component such that when F1
  3. * is pressed it should help for the component where the cursor is.
  4. *
  5. * @param rootpanecontainer
  6. */
  7. public static void setKeyCatcher(final RootPaneContainer rootpanecontainer) {
  8. AbstractAction theAction = new AbstractAction() {
  9. public void actionPerformed(ActionEvent arg0) {
  10. Component component = (Component) rootpanecontainer;
  11. Container container = (Container) rootpanecontainer;
  12. logger.info("frame action F1 pressed with source "
  13. + arg0.getSource().getClass().getName());
  14. Point mousePosition = MouseInfo.getPointerInfo().getLocation();
  15. Point framePosition = component.getLocation();
  16. Point relativePosition = (Point) mousePosition.clone();
  17. relativePosition.translate(-framePosition.x, -framePosition.y);
  18. Component c = container.findComponentAt(relativePosition);
  19. if (c != null) {
  20. logger.info("F1 pressed in a " + c.getClass().getName());
  21. }
  22. showHelpWithinContainer(rootpanecontainer, c);
  23. }
  24. };
  25. JRootPane pane = rootpanecontainer.getRootPane();
  26. setKeyCatcher(pane, theAction);
  27. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. public void actionPerformed(ActionEvent arg0) {
  2. Helper.showHelpWithinContainer(dialog, dialog);
  3. }
  4. }));

代码示例来源:origin: net.sf.taverna.t2.ui-activities/interaction-activity-ui

  1. @Override
  2. public void actionPerformed(final ActionEvent arg0) {
  3. Helper.showHelp(panel);
  4. }
  5. });

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Create a HelpEnabledDialog, register it (if possible) with the
  3. * HelpCollator and attach a keycatcher.
  4. *
  5. * @param owner
  6. * @param title
  7. * @param modal
  8. * @param id
  9. * @throws HeadlessException
  10. */
  11. public HelpEnabledDialog(Dialog owner, String title, boolean modal,
  12. String id) throws HeadlessException {
  13. super(owner, title, modal);
  14. if (id != null) {
  15. HelpCollator.registerComponent(this, id);
  16. } else if (owner != null) {
  17. HelpCollator.registerComponent(this, owner.getClass()
  18. .getCanonicalName()
  19. + "-dialog");
  20. }
  21. Helper.setKeyCatcher(this);
  22. }

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. /**
  2. * Display the default home page help.
  3. *
  4. * @param e
  5. */
  6. public static void displayDefaultHelp(AWTEvent e) {
  7. showID("home");
  8. }

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. public void actionPerformed(ActionEvent arg0) {
  2. Component component = (Component) rootpanecontainer;
  3. Container container = (Container) rootpanecontainer;
  4. logger.info("frame action F1 pressed with source "
  5. + arg0.getSource().getClass().getName());
  6. Point mousePosition = MouseInfo.getPointerInfo().getLocation();
  7. Point framePosition = component.getLocation();
  8. Point relativePosition = (Point) mousePosition.clone();
  9. relativePosition.translate(-framePosition.x, -framePosition.y);
  10. Component c = container.findComponentAt(relativePosition);
  11. if (c != null) {
  12. logger.info("F1 pressed in a " + c.getClass().getName());
  13. }
  14. showHelpWithinContainer(rootpanecontainer, c);
  15. }

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Get the singleton instance of Helper. In theory there could be more than
  3. * one.
  4. *
  5. * @return
  6. */
  7. private static Helper getInstance() {
  8. if (instance == null) {
  9. instance = new Helper();
  10. }
  11. return instance;
  12. }

代码示例来源:origin: net.sf.taverna.t2.ui-activities/component-activity-ui

  1. @Override
  2. public void actionPerformed(ActionEvent arg0) {
  3. showHelp(panel);
  4. }
  5. }));

代码示例来源:origin: net.sf.taverna.t2.ui-api/helper-api

  1. /**
  2. * Create a HelpEnabledDialog, register it (if possible) with the
  3. * HelpCollator and attach a keycatcher.
  4. *
  5. * @param owner
  6. * @param title
  7. * @param modal
  8. * @param id
  9. * @throws HeadlessException
  10. */
  11. public HelpEnabledDialog(Dialog owner, String title, boolean modal,
  12. String id) throws HeadlessException {
  13. super(owner, title, modal);
  14. if (id != null) {
  15. HelpCollator.registerComponent(this, id);
  16. } else if (owner != null) {
  17. HelpCollator.registerComponent(this, owner.getClass()
  18. .getCanonicalName()
  19. + "-dialog");
  20. }
  21. Helper.setKeyCatcher(this);
  22. }

代码示例来源:origin: net.sf.taverna.t2.ui-exts/retry-ui

  1. @Override
  2. public void actionPerformed(ActionEvent e) {
  3. Helper.showID(RetryConfigureAction.class.getCanonicalName());
  4. }};

代码示例来源:origin: net.sf.taverna.t2.workbench/helper

  1. public void actionPerformed(ActionEvent arg0) {
  2. Component component = (Component) rootpanecontainer;
  3. Container container = (Container) rootpanecontainer;
  4. logger.info("frame action F1 pressed with source "
  5. + arg0.getSource().getClass().getName());
  6. Point mousePosition = MouseInfo.getPointerInfo().getLocation();
  7. Point framePosition = component.getLocation();
  8. Point relativePosition = (Point) mousePosition.clone();
  9. relativePosition.translate(-framePosition.x, -framePosition.y);
  10. Component c = container.findComponentAt(relativePosition);
  11. if (c != null) {
  12. logger.info("F1 pressed in a " + c.getClass().getName());
  13. }
  14. showHelpWithinContainer(rootpanecontainer, c);
  15. }

相关文章