Я учусь разработать диаграмму классов для java, и это моя первая попытка. Не могли бы вы рассказать мне, все ли в порядке.Java Class Diagram
Вот исходный код
public class DiceRoll1 extends JFrame implements ActionListener {
private JTextField txtNotation;
private JButton btRoll, btShuffle;
private List<Integer> dealtCard;
private History history;
public DiceRoll1() {
initComponents();
dealtCard = new ArrayList<>();
history = new History();
}
public void initComponents() {
//designing the userform
setSize(400, 500);
setLayout(new FlowLayout());
setTitle("Dice Roll");
txtNotation = new JTextField("2d6");
btRoll = new JButton("Roll");
btShuffle = new JButton("Shuffle");
txtNotation.setColumns(20);
getContentPane().add(txtNotation);
getContentPane().add(btRoll);
getContentPane().add(btShuffle);
btRoll.addActionListener(this);
btShuffle.addActionListener(this);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
new DiceRoll().setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
JButton source = (JButton) e.getSource();
if (source.equals(btRoll)) {
} else if (source.equals(btShuffle)) {
}
}
public void displayOutput(String message) {
System.out.println(message);
}
}
Вот схема, что я нарисовал с помощью Visio профессиональный:
Предлагаю вам загрузить оценочную копию профессионального инструмента, такого как MagicDraw или Sparx EA. Эти инструменты облегчают создание правильного UML. Если вы спросите продавца, они обычно дают вам более длительный период eval без ограничений. –
Спасибо за информацию, @JimL. –