gpt4 book ai didi

java - intellij uml,两个依赖但应该是一个

转载 作者:行者123 更新时间:2023-11-30 10:25:40 25 4
gpt4 key购买 nike

我尝试为我的代码生成 uml 类图。我有两个类(class):

public class GuiManager {

public void run() throws ClassNotFoundException, UnsupportedLookAndFeelException, InstantiationException, IllegalAccessException {

//@todo zmienic to na coś fajniejszego, i nie robić tego w pętli -_-
for(UIManager.LookAndFeelInfo info:UIManager.getInstalledLookAndFeels()) {
if("Windows".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}

JFrame frame = new JFrame("Warhammer RPG Helper");
frame.setContentPane(new ChooseServerGui(frame).getPanel());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}

public class Main {

public static void main(String[] args) throws ClassNotFoundException, UnsupportedLookAndFeelException, InstantiationException, IllegalAccessException {
GuiManager guiManager = new GuiManager();
guiManager.run();
}
}

我从不使用 uml,并在 intellij 中生成 uml。以下是我的 uml,intellij 生成的内容:

enter image description here

为什么我有两个箭头?

最佳答案

两个依赖项之一有一个 <<create>>刻板印象。这意味着实际创建了指向的类。这是附加信息。您可能会忽略简单的依赖关系,但同时显示两者并没有错。

也许有一个选项可以关闭 Intellij 中的两个连接器之一,但我不知道那个工具。

关于java - intellij uml,两个依赖但应该是一个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46058507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com