facebook

Moving classes between packages

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #237852 Reply

    glgreen
    Member

    This message has not been recovered.

    #237907 Reply

    Kapil Kapre
    Member

    This message has not been recovered.

    #238393 Reply

    lujhuang
    Member

    I have a few java packages, and I want to create their uml counterparts. When I selected a java package and tried to drag it into the class diagram pane, MyUML won’t let me. How can I create uml packages by dragging java packages? Can you help?

    #238396 Reply

    Kapil Kapre
    Member

    @lujhuang wrote:

    I have a few java packages, and I want to create their uml counterparts. When I selected a java package and tried to drag it into the class diagram pane, MyUML won’t let me. How can I create uml packages by dragging java packages? Can you help?

    lujhuang ,
    You need to select the java files inside the package and drag them into the Class Diagram. (You can use SHIFT to select multiple java files )
    Hope this helps,
    Kapil

    #238398 Reply

    lujhuang
    Member

    @support-kapil wrote:

    You need to select the java files inside the package and drag them into the Class Diagram. (You can use SHIFT to select multiple java files )

    That I did. But I want to create uml classes in a uml package (by dragging the java classes). Right now, after I created a uml package on the class diagram pane, I can’t open it (by double clicking it), and cannot move uml classes into the uml package created. Is there any reason why I cannot add a uml class to a uml package? My env. is:

    windows xp pro w/ sp3
    eclipse 3.1.0
    myeclipse 4.0.m3 GA
    sun jdk-1.5.0_5

    [The ideal situation is that MyUML lets me drag java packages from package explorer onto the class diagram and automatically creates the corresponding uml packages, with the uml classes in them. I understand this feature is in the works, so I am not asking it right now.]

    #238401 Reply

    Kapil Kapre
    Member

    @lujhuang wrote:

    @support-kapil wrote:

    You need to select the java files inside the package and drag them into the Class Diagram. (You can use SHIFT to select multiple java files )

    That I did. But I want to create uml classes in a uml package (by dragging the java classes). Right now, after I created a uml package on the class diagram pane, I can’t open it (by double clicking it), and cannot move uml classes into the uml package created. Is there any reason why I cannot add a uml class to a uml package?

    When you drag and drop java files from the pkg explorer into the uml class diagram the UML components are placed in the correct package. (you can verify this by clicking on any class and checking the namespace) The packages created are *not* added to the uml class diagram but they *are* present in the UML model. You can see these in the outlie view and drag them in if you need. If you specifically need packages to be created and placed in a diagram automatically you can try using the UML Reverse Engineering wizard. (under UML menu). Does this help?

    #238406 Reply

    lujhuang
    Member

    I got it a little bit now, by using the wizard. However, if there are 2 classes in 2 different java packages, e.g. net.core.Engine and net.admin.EngineManager, and EngineManager has an Engine as its property, then the wizard won’t show this association. Is this true or am I not using the wizard right? What I really like to see is the association between Engine and EngineManager is captured somehow.

    Here is the playaround code:

    // EngineManager class:

    package net.lessons.myuml.engineadmin;

    import net.lessons.myuml.engine.Engine;

    public class EngineManager {

    private Engine engine;

    public Engine getEngine() {
    return engine;
    }

    public void setEngine(Engine engine) {
    this.engine = engine;
    }
    }

    // Engine class:
    package net.lessons.myuml.engine;

    public class Engine {
    }

    /// note that they are in 2 different packages

    #238420 Reply

    Kapil Kapre
    Member

    @lujhuang wrote:

    I got it a little bit now, by using the wizard. However, if there are 2 classes in 2 different java packages, e.g. net.core.Engine and net.admin.EngineManager, and EngineManager has an Engine as its property, then the wizard won’t show this association. Is this true or am I not using the wizard right? What I really like to see is the association between Engine and EngineManager is captured somehow.

    Here is the playaround code:

    // EngineManager class:

    package net.lessons.myuml.engineadmin;

    import net.lessons.myuml.engine.Engine;

    public class EngineManager {

    private Engine engine;

    public Engine getEngine() {
    return engine;
    }

    public void setEngine(Engine engine) {
    this.engine = engine;
    }
    }

    // Engine class:
    package net.lessons.myuml.engine;

    public class Engine {
    }

    /// note that they are in 2 different packages

    If you drag these two specific classes into a fresh class diagram from pkg explorer MyUML Should create the association. (Note : You need to enable Java attributes as UML Associations under UML Reveng preferences)
    Can you try that?

    #238421 Reply

    lujhuang
    Member

    @support-kapil wrote:

    If you drag these two specific classes into a fresh class diagram from pkg explorer MyUML Should create the association. (Note : You need to enable Java attributes as UML Associations under UML Reveng preferences)
    Can you try that?

    I tried that and it worked. MyUML still has some way to go to be really useful, but keep up the good work 🙂

    #238422 Reply

    Kapil Kapre
    Member

    @lujhuang wrote:

    @support-kapil wrote:

    If you drag these two specific classes into a fresh class diagram from pkg explorer MyUML Should create the association. (Note : You need to enable Java attributes as UML Associations under UML Reveng preferences)
    Can you try that?

    I tried that and it worked. MyUML still has some way to go to be really useful, but keep up the good work 🙂

    lujhuang,
    Good to hear. We are totally commited to improving the quality of this tool, so you should see us polishing up this tool in the comming releasees. We love to get feedback from our users , so if there is anything that annoys you / suggestions / bugs / etc , it would be great if you could fire a quick email to support@genuitec.com or just post here in the forums.
    Thanks,
    -Kapil

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Moving classes between packages

You must be logged in to post in the forum log in