I have 2 different errors in the following method.
public void setProjectValues(){
 if (Model.getFacade().isAModel(TargetManager.getInstance().getTarget())){
     LOG.info("setProjectValues 1");
 
setProjectName(Model.getFacade().getName(TargetManager.getInstance().getTarget()));
 }
 LOG.info("setProjectValues 3");
 TabDepthsProps tabDProps=(TabDepthsProps)((DetailsPane) 
ProjectBrowser.getInstance().getDetailsPane()).getTab(TabDepthsProps.class);
 LOG.info("setProjectValues 4");
 DepthsPropPanelModel tmm=(DepthsPropPanelModel) 
tabDProps.getPanel(DepthsPropPanelPackage.class);
 LOG.info("setProjectValues 5");
 LOG.info("description="+tmm.getDescription());
    }
 
 The first think that this method has to do is to take model name. It works if 
the model is selected, but if I select any other element i.e. class diagram it 
generates the following error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Must 
have an MDR element supplied. Received a 
org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram
 at org.argouml.model.mdr.FacadeMDRImpl.getName(FacadeMDRImpl.java:3963)
 at 
depths.uml.ui.ActionSaveDepthsGraphicsInRepository.trySaveProject(ActionSaveDepthsGraphicsInRepository.java:193)
 at 
depths.uml.ui.ActionSaveDepthsGraphicsInRepository.actionPerformed(ActionSaveDepthsGraphicsInRepository.java:95)
 at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)11000  
INFO [AWT-EventQueue-0] uploadFileToRepository (FTPConnectionManager.java:84)
 at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
 at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
 at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
 at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1216)
 at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1257)
 at java.awt.Component.processMouseEvent(Component.java:6038)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
 at java.awt.Component.processEvent(Component.java:5803)
 at java.awt.Container.processEvent(Container.java:2058)
 at java.awt.Component.dispatchEventImpl(Component.java:4410)
 at java.awt.Container.dispatchEventImpl(Container.java:2116)
 at java.awt.Component.dispatchEvent(Component.java:4240)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
 at java.awt.Container.dispatchEventImpl(Container.java:2102)
 at java.awt.Window.dispatchEventImpl(Window.java:2429)
 at java.awt.Component.dispatchEvent(Component.java:4240)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
 at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
 at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
 at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
 
 If I select model it passes but generates the following error when I try to 
access the field description in my tab. 
 My classes are:
 TabDepthsProps extends AbstractArgoJPanel implements TabModelTarget. It is 
similar to the TabProps. It is added to the DetailsPane
 DepthsPropPanelModel extends DepthsPropPanelPackage which extends PropPanel.
 DepthsPropPanelModel is added to the panels with method createPropPanel in the 
cases when modelElement is instance of Model or any of the UML diagrams.
 Here is the error that I get:
 
 
 33187  INFO [AWT-EventQueue-0] setProjectValues 5 (Project.java:69)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
 at depths.ont.project.Project.setProjectValues(Project.java:70)
 at 
depths.uml.ui.ActionSaveDepthsGraphicsInRepository.trySaveProject(ActionSaveDepthsGraphicsInRepository.java:196)
 at 
depths.uml.ui.ActionSaveDepthsGraphicsInRepository.actionPerformed(ActionSaveDepthsGraphicsInRepository.java:95)
 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
 at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
 at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
 at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
 at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1216)
 at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1257)
 at java.awt.Component.processMouseEvent(Component.java:6038)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
 at java.awt.Component.processEvent(Component.java:5803)
 at java.awt.Container.processEvent(Container.java:2058)
 at java.awt.Component.dispatchEventImpl(Component.java:4410)
 at java.awt.Container.dispatchEventImpl(Container.java:2116)
 at java.awt.Component.dispatchEvent(Component.java:4240)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
 at java.awt.Container.dispatchEventImpl(Container.java:2102)
 at java.awt.Window.dispatchEventImpl(Window.java:2429)
 at java.awt.Component.dispatchEvent(Component.java:4240)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
 at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
 at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
 at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Zoran




----- Original Message ----
From: Tom Morris <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, April 23, 2008 12:54:15 AM
Subject: Re: [argouml-dev] Model name

On Tue, Apr 22, 2008 at 5:20 PM, Zoran Jeremic <[EMAIL PROTECTED]> wrote:

> I have created my own tab in DetailsPane which extends AbstractArgoJPanel.
> It creates  the same panel (extends PropPanel) for each type of diagram. I'm
> not sure how can I access a field (UMLTextArea2) in this panel for each
> specific case.
> Actually, the problem is not to access the field itself, but rather to find
> desired prop panel.

I don't understand your question.  If you're creating the PropPanel,
then you should save a reference to the field so you can access it
later.  If it's a private field in the superclass without an accessor
that you need to reach, we may not to introduce a getter for it.

Please make your question more specific, preferably with some code
that doesn't work the way you want it to.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Reply via email to