From f8e05e4376e1d5f00c93307605eb768281ad240b Mon Sep 17 00:00:00 2001 From: Yuuta Liang Date: Tue, 28 Nov 2023 21:08:03 -0800 Subject: Add association tags and generate UML Signed-off-by: Yuuta Liang --- src/main/ui/gui/MainUI.java | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/main/ui/gui/MainUI.java') diff --git a/src/main/ui/gui/MainUI.java b/src/main/ui/gui/MainUI.java index 9fa65ef..9a7f3f2 100644 --- a/src/main/ui/gui/MainUI.java +++ b/src/main/ui/gui/MainUI.java @@ -1,5 +1,6 @@ package ui.gui; +import annotations.Assoc; import model.GroupObserver; import model.ObservedData; import model.Observer; @@ -67,75 +68,108 @@ public class MainUI extends JFrame { /** * The root panel (Box layout). */ + @Assoc(partOf = true) private final JPanel rootPanel = new JPanel(new BoxLayout(rootPane, BoxLayout.PAGE_AXIS)); /** * Common toolbar buttons */ + @Assoc(partOf = true) private final JButton buttonToolbarLoad = btn("Load", "open.png", this::onLoad); + @Assoc(partOf = true) private final JButton buttonToolbarSave = btn("Save", "saveall.png", this::onSave); /** * Toolbar that switches with the tab. */ + @Assoc(partOf = true) private final JPanel panelContextAwareToolbar = new JPanel(new CardLayout(0, 0)); /** * Tab root. */ + @Assoc(partOf = true) private final JTabbedPane tabbedPane = new JTabbedPane(); /** * CA tab */ + @Assoc(partOf = true) private final JLabel labelCACertificate = new JLabel(); + @Assoc(partOf = true) private final JLabel labelPrivateKey = new JLabel(); + @Assoc(partOf = true) private final JButton buttonGenPrivKey = btn("Generate", 'G', this::onGeneratePrivateKey); + @Assoc(partOf = true) private final JButton buttonInstallCA = btn("Install", 'I', this::onInstallCA); + @Assoc(partOf = true) private final JButton buttonGenCSR = btn("CSR", this::onSignCSR); + @Assoc(partOf = true) private final QRPanel panelQR = new QRPanel(256); + @Assoc(partOf = true) private final JToolBar toolbarCA = new JToolBar(); + @Assoc(partOf = true) private final JButton buttonCAToolbarCRL = btn("CRL", "publisher.png", this::onCRL); /** * Certs tab */ + @Assoc(partOf = true) private JPanel panelCertsTab; + @Assoc(partOf = true) private final JTable tableCerts = new JTable(); + @Assoc(partOf = true) private final CertTableModel modelCerts = new CertTableModel(); + @Assoc(partOf = true) private final JToolBar toolbarCerts = new JToolBar(); + @Assoc(partOf = true) private final JButton buttonCertsToolbarNew = btn("Sign", "new.png", this::onIssue); + @Assoc(partOf = true) private final JButton buttonCertsToolbarRevoke = btn("Revoke", "deletetest.png", this::onRevokeCert); + @Assoc(partOf = true) private final JButton buttonCertsToolbarExport = btn("Export", "export.png", this::onExportCert); /** * Templates tab */ + @Assoc(partOf = true) private JPanel panelTmpTab; + @Assoc(partOf = true) private final JTable tableTemplates = new JTable(); + @Assoc(partOf = true) private final TemplateTableModel modelTemplates = new TemplateTableModel(); + @Assoc(partOf = true) private final JToolBar toolbarTemplates = new JToolBar(); + @Assoc(partOf = true) private final JButton buttonTemplatesToolbarNew = btn("New", "new.png", this::onNewTemplate); + @Assoc(partOf = true) private final JButton buttonTemplatesToolbarEnable = btn("Enable", "enable.png", this::onEnableTemplate); + @Assoc(partOf = true) private final JButton buttonTemplatesToolbarDisable = btn("Disable", "disable.png", this::onDisableTemplate); + @Assoc(partOf = true) private final JButton buttonTemplatesToolbarDelete = btn("Delete", "deletetest.png", this::onDeleteTemplate); /** * Logs region */ + @Assoc(partOf = true) private final JPanel panelLogs; + @Assoc(partOf = true) private final JTable tableAuditLogs = new JTable(); + @Assoc(partOf = true) private final LogTableModel modelAuditLogs = new LogTableModel(); /** * Status region */ + @Assoc(partOf = true) private final JLabel labelStatus = new JLabel(); private ObservedData unsaved = new ObservedData<>(false, this::acceptUnsaved); /** * CA and observers */ + @Assoc(partOf = true) private CertificationAuthority ca; private final GroupObserver obs = new GroupObserver(); -- cgit v1.2.3