コード例 #1
0
ファイル: ImageJTask.java プロジェクト: CBOUWER93/Icy-Kernel
    public void updateAction(boolean ij) {
      if (toIJ != ij) {
        final RichTooltip toolTip = new RichTooltip();
        toIJ = ij;

        if (ij) {
          toolTip.setTitle("Convert to ImageJ");
          toolTip.addDescriptionSection("Convert the selected Icy sequence to ImageJ image.");
          toolTip.addFooterSection("Icy needs to be in detached mode to enabled this feature.");

          // convert to IJ image
          button.setText("Convert to IJ");
          // button.setIcon(new IcyIcon("icon_icy_ij_2", false));
          button.setIcon(new IcyIcon("to_ij", true));
          button.setActionRichTooltip(toolTip);
          button.removeActionListener(toICYAction);
          button.addActionListener(toIJAction);
        } else {
          toolTip.setTitle("Convert to Icy");
          toolTip.addDescriptionSection("Convert the selected ImageJ image to Icy sequence.");
          toolTip.addFooterSection("Icy needs to be in detached mode to enabled this feature.");

          // convert to ICY sequence
          button.setText("Convert to Icy");
          // button.setIcon(new IcyIcon("icon_ij_icy_2", false));
          button.setIcon(new IcyIcon("to_icy", true));
          button.setActionRichTooltip(toolTip);
          button.removeActionListener(toIJAction);
          button.addActionListener(toICYAction);
        }
      }
    }
コード例 #2
0
ファイル: ActionItem.java プロジェクト: Depter/JRLib
  public RichTooltip createTooltip() {
    String body = (String) getValue(TOOLTIP_BODY);
    if (body == null) {
      body = (String) getValue(Action.LONG_DESCRIPTION);
    }
    if (body == null) {
      body = getDescription();
    }
    if (body == null) {
      return null;
    }

    String title = (String) getValue(TOOLTIP_TITLE);
    if (title == null) {
      title = getText();
    }

    RichTooltip tooltip = new RichTooltip(title, body);

    String titleIcon = (String) getValue(TOOLTIP_ICON);
    if (titleIcon != null) {
      tooltip.setMainImage(ImageUtilities.loadImage(titleIcon));
    } else {
      tooltip.setMainImage(getLargeImage());
    }

    String footer = (String) getValue(TOOLTIP_FOOTER);
    if (footer != null) {
      tooltip.addFooterSection(footer);
      String footerIcon = (String) getValue(TOOLTIP_FOOTER_ICON);
      if (footerIcon != null) {
        tooltip.setFooterImage(ImageUtilities.loadImage(footerIcon));
      }
    }
    return tooltip;
  }