예제 #1
0
 @Override
 public void mouseClicked(MouseEvent e) {
   if (myService != null) {
     myService.lastTabVisited = this.getText();
   }
   dispatchMouseEvent(e);
 }
예제 #2
0
  /** closes window and puts the panel back into the tabbed pane */
  public void dockPanel() {
    // docking panel will move the data of the frame to serializable
    // position
    // FIXME - very hacked
    // myService.undockedPanels.get(boundServiceName).savePosition();
    // myService.undockedPanels.get(boundServiceName).isDocked();

    parent.add(myPanel);
    parent.setTabComponentAt(parent.getTabCount() - 1, this);
    if (undocked != null) {
      undocked.dispose();
      undocked = null;
    }

    // frame.pack(); - call pack
    myService.getFrame().pack();
    myService.save();
  }
예제 #3
0
  @Override
  public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();
    // parent.getSelectedComponent()
    if (boundServiceName.equals(getText())) {
      // Service Frame
      ServiceInterface sw = Runtime.getService(getText());
      if ("info".equals(cmd)) {
        BareBonesBrowserLaunch.openURL("http://myrobotlab.org/service/" + sw.getSimpleName());

      } else if ("detach".equals(cmd)) {
        undockPanel();
      } else if ("release".equals(cmd)) {
        myService.send(Runtime.getInstance().getName(), "releaseService", boundServiceName);
      } else if ("prevent export".equals(cmd)) {
        myService.send(boundServiceName, "allowExport", false);
        allowExportMenuItem.setIcon(Util.getImageIcon("allowExport.png"));
        allowExportMenuItem.setActionCommand("allow export");
        allowExportMenuItem.setText("allow export");
      } else if ("allow export".equals(cmd)) {
        myService.send(boundServiceName, "allowExport", true);
        allowExportMenuItem.setIcon(Util.getImageIcon("preventExport.png"));
        allowExportMenuItem.setActionCommand("prevent export");
        allowExportMenuItem.setText("prevent export");
      }
    } else {
      // Sub Tabbed sub pane
      ServiceInterface sw = Runtime.getService(boundServiceName);
      if ("info".equals(cmd)) {
        BareBonesBrowserLaunch.openURL(
            "http://myrobotlab.org/service/" + sw.getSimpleName() + "#" + getText());

      } else if ("detach".equals(cmd)) {
        undockPanel();
      }
    }
  }