Hi again guys,
I'm developing a new module to create new diagrams but it doesn't work,
so I try to extend an UMLClassDiagram only and it doesn't work too. Then
there is something wrong... This is my code:
-------------------------------------------------------
public class BPAModule implements ModuleInterface {
/**
* Logger.
*/
private static final Logger LOG =
Logger.getLogger(BPAModule.class);
private static BusinessProcessDiagramMenu _bpaAction = null;
private static JMenuItem bpai;
public BPAModule() {
}
/**
* Enable module on startup, add a new menu item to create a new diagram
*
* @return true
* @see org.argouml.moduleloader.ModuleInterface#enable()
*/
public boolean enable() {
ProjectBrowser pb = ProjectBrowser.getInstance();
GenericArgoMenuBar gmb = (GenericArgoMenuBar) pb.getJMenuBar();
JMenu createDiagramMenu = gmb.getCreateDiagramMenu();
Icon menuIcon = ResourceLoaderWrapper.lookupIconResource("icon");
// ImageIcon menuIcon = new ImageIcon(ICON_PATH);
// JMenu menu = gmb.getTools();
if (createDiagramMenu != null) {
bpai = new JMenuItem("New Business Process Alignment Diagrams",
ResourceLoaderWrapper.lookupIconResource("icon.gif"));
if (_bpaAction == null) {
_bpaAction = new BusinessProcessDiagramMenu();
bpai.addActionListener(_bpaAction);
}
createDiagramMenu.add(bpai);
}
LOG.info("*** Module initialized ***");
return true;
}
*****************************-cut-
// }
-----------------------------------------------------------------
public class BusinessProcessDiagramMenu extends ActionAddDiagram{
/**
*
* @param bpaDiName
*/
public BusinessProcessDiagramMenu(String bpaDiName) {
super(bpaDiName);
}
public
BusinessProcessDiagramMenu(){super("BusinessProcessDiagramMenu");}
/**
* @param nspublic class BusinessProcessDiagramMenu extends
ActionAddDiagram{
/**
*
* @param bpaDiName
*/
public BusinessProcessDiagramMenu(String bpaDiName) {
super(bpaDiName);
}
public
BusinessProcessDiagramMenu(){super("BusinessProcessDiagramMenu");}
/**
* @param ns
* @return businessProcessDiagram
* @see
org.argouml.uml.ui.ActionAddDiagram#createDiagram(java.lang.Object)
*/
@Override
public UMLDiagram createDiagram(Object ns){
// return new BusinessProcessDiagram(ns);
return new UMLClassDiagram(ns);
}
/**
* Test if the given namespace is a valid namespace to add the
diagram to.
*
* @param ns the namespace to check
* @return Returns <code>true</code> if valid.
*
*/
@Override
public boolean isValidNamespace(Object ns) {
return true;
}
}
* @return businessProcessDiagram
* @see
org.argouml.uml.ui.ActionAddDiagram#createDiagram(java.lang.Object)
*/
@Override
//Simple test but it doesn't work too! WHY???
public UMLDiagram createDiagram(Object ns){
// return new BusinessProcessDiagram(ns);
return new UMLClassDiagram(ns);
}
/**
* Test if the given namespace is a valid namespace to add the
diagram to.
*
* @param ns the namespace to check
* @return Returns <code>true</code> if valid.
*
*/
@Override
public boolean isValidNamespace(Object ns) {
return true;
}
}
When I click on the create diagrams menu, it doesn't happen anything.
Thanks in advance
Mux
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=2403397
To unsubscribe from this discussion, e-mail:
[[email protected]].
To be allowed to post to the list contact the mailing list moderator, email:
[[email protected]]