public boolean enable() {
    // Register into the menu.
    JToolBar toolbar =
        ((GenericArgoMenuBar) ProjectBrowser.getInstance().getJMenuBar()).getCreateDiagramToolbar();
    // there is no setIndex or similar, so we have to add
    // twice, and it moves the item instead of adding again.
    toolbarBtn = toolbar.add(newSequence);
    toolbar.add(toolbarBtn, 3);
    toolbar.updateUI();

    propPanelFactory = new SequenceDiagramPropPanelFactory();
    PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);

    LOG.info("SequenceDiagram Module enabled.");
    return true;
  }
  public boolean disable() {
    GenericArgoMenuBar menubar = (GenericArgoMenuBar) ProjectBrowser.getInstance().getJMenuBar();
    menubar.remove(menuSequence);
    menubar.updateUI();

    // remove it from the toolbar.
    JToolBar toolbar =
        ((GenericArgoMenuBar) ProjectBrowser.getInstance().getJMenuBar()).getCreateDiagramToolbar();

    toolbar.remove(toolbarBtn);
    toolbar.updateUI();

    PropPanelFactoryManager.removePropPanelFactory(propPanelFactory);

    LOG.info("SequenceDiagram Module disabled.");
    return true;
  }
Exemple #3
0
 public void init() {
   /* Set up the property panels for use case diagrams: */
   PropPanelFactory diagramFactory = new UseCaseDiagramPropPanelFactory();
   PropPanelFactoryManager.addPropPanelFactory(diagramFactory);
 }