xl-project/doc/diagramOffGui.md

193 lines
4.3 KiB
Markdown
Raw Normal View History

2024-05-11 19:49:12 +02:00
```mermaid
---
title: gui
---
classDiagram
class JPanel
class BorderPanel {
#Borderpanel()
}
class SheetPanel {
+SheetPanel(int rows, int columns)
}
class StatusPanel {
#StatusPanel(StatusLabel statusLabel)
}
class GridPanel {
+GridPanel(int rows, int columns)
}
class RowLabels {
-RowLabels(int row)
}
class SlotLabels {
-List~SlotLabel~ labelList
+SlotLabels(int rows, int cols)
}
JPanel <|-- BorderPanel
JPanel <|-- GridPanel
GridPanel <|-- RowLabels
BorderPanel <|-- SheetPanel
BorderPanel <|-- StatusPanel
GridPanel <|-- SlotLabels
```
```mermaid
classDiagram
class JLabel
class Observer
class ColoredLabel {
+ColoredLabel(String text)
+ColoredLabel(String text, Color color)
+ColoredLabel(String text, Color color, int alignment)
}
class SlotLabel {
+SlotLabel()
}
class CurrentLabel {
+CurrentLabel()
}
class StatusLabel {
+StatusLabel()
+update(Observable observable, Object object)
}
<<interface>> Observer
ColoredLabel <|-- SlotLabel
JLabel <|-- ColoredLabel
ColoredLabel <|-- CurrentLabel
ColoredLabel <|-- StatusLabel
Observer <-- StatusLabel
```
```mermaid
classDiagram
class JFrame
class XL {
-static final int ROWS = 10, COLUMNS = 8
-XLCounter counter
-StatusLabel statusLabel
-XLList xlList
+XL(XL oldXL)
+XL(XLList xlList, XLCounter counter)
+rename(String title)
+main(String[] args)
}
class JTextField
class Editor {
+Editor()
}
class XLCounter {
-int counter
+increment()
+toString()
}
class Observable
class Iterable
class XLList {
-List~XL~ list
+add(XL xl)
+isEmpty() boolean
+iterator() Iterator~XL~
+last() XL
+remove(Xl xl)
+setChanged()
}
<<interface>> Iterable
JTextField <|-- Editor
JFrame <|-- XL
Observable <|-- XLList
Iterable <-- XLList
2024-05-11 20:52:18 +02:00
```
```mermaid
---
title: gui.menu
---
classDiagram
class ClearAllMenuItem {
+ClearAllMenuItem()
+actionPerformed(ActionEvent e)
}
class ClearMenuItem {
+ClearMenuItem()
+actionPerformed(ActionEvent e)
}
class CloseMenuItem {
-XL xl
-XLList xlList
+CloseMenuItem(XL xl, XLList, xlList)
+actionPerformed(ActionEvent event)
}
class LoadMenuItem {
+LoadMenuItem(XL xl, StatusLabel statusLabel)
#action(String path)
#openDialog(JFileChooser fileChooser) int
}
class NewMenuItem {
-XL xl
+NewMenuItem(XL xl)
+actionPerformed(ActionEvent event)
}
class OpenMenuItem {
#StatusLabel statusLabel
#XL xl
#OpenMenuItem(XL xl, StatusLabel statusLabel, String title)
#action(String path)
+actionPerformed(ActionEvent event)
#openDialog(JFileChooser fileChooser)
}
class SaveMenuItem {
+SaveMenuItem(XL xl, StatusLabel statusLabel)
#action(String path)
#openDialog(JFileChooser fileChooser)
}
class WindowMenuItem {
-XL xl
+WindowMenuItem(XL xl)
+actionPerformed(ActionEvent event)
}
class JMenuItem
class ActionListener
<<interface>> ActionListener
JMenuItem <|-- ClearAllMenuItem
ActionListener <-- ClearAllMenuItem
JMenuItem <|-- ClearMenuItem
ActionListener <-- ClearMenuItem
JMenuItem <|-- CloseMenuItem
ActionListener <-- CloseMenuItem
OpenMenuItem <|-- LoadMenuItem
JMenuItem <|-- NewMenuItem
ActionListener <-- NewMenuItem
JMenuItem <|-- OpenMenuItem
ActionListener <-- OpenMenuItem
OpenMenuItem <|-- SaveMenuItem
JMenuItem <|-- WindowMenuItem
ActionListener <-- WindowMenuItem
```
```mermaid
classDiagram
class JMenu
class Observer
class WindowMenu {
-XLList xlList
+WindowMenu(XLList xlList)
+update(Observable observable, Object object)
}
class JMenuBar
class XLMenuBar {
+XLMenuBar(XL xl, XLList xlList, StatusLabel statusLabel)
}
<<interface>> Observer
JMenuBar <|-- XLMenuBar
JMenu <|-- WindowMenu
Observer <-- WindowMenu
```