Beispiel #1
0
 public boolean requestInput(long currenttime) {
   this.deadline.setText(dformat.format(new Date(currenttime + 300000)));
   this.aborted = true;
   this.pack();
   this.setLocation(SGUI.calculateMiddlePosition(getFrame(), this));
   this.setVisible(true);
   return !aborted;
 }
/** Show the rule engine of a BDI agent. */
public class BDIAgentRuleEngineDebuggerPanel implements IDebuggerPanel {
  // -------- constants --------

  /** The image icons. */
  protected static final UIDefaults icons =
      new UIDefaults(
          new Object[] {
            "show_rete", SGUI.makeIcon(SHelp.class, "/jadex/tools/common/images/bug_small.png")
          });

  // -------- IDebuggerPanel methods --------

  /** The gui component. */
  protected JComponent retepanel;

  // -------- IDebuggerPanel methods --------

  /**
   * Called to initialize the panel. Called on the swing thread.
   *
   * @param jcc The jcc.
   * @param bpp The breakpoint panel.
   * @param id The component identifier.
   * @param access The external access of the component.
   */
  public void init(
      IControlCenter jcc, IBreakpointPanel bpp, IComponentIdentifier name, IExternalAccess access) {
    BDIInterpreter bdii = ((ElementFlyweight) access).getInterpreter();
    this.retepanel = new RetePanel(bdii.getRuleSystem(), null, bpp);
  }

  /**
   * The title of the panel (name of the tab).
   *
   * @return The tab title.
   */
  public String getTitle() {
    return "Rule Engine";
  }

  /**
   * The icon of the panel.
   *
   * @return The icon (or null, if none).
   */
  public Icon getIcon() {
    return icons.getIcon("show_rete");
  }

  /**
   * The component to be shown in the gui.
   *
   * @return The component to be displayed.
   */
  public JComponent getComponent() {
    return retepanel;
  }

  /**
   * The tooltip text of the panel, if any.
   *
   * @return The tooltip text, or null.
   */
  public String getTooltipText() {
    return "Show the rule engine.";
  }
}