From c4ec9709a0ba22148e0744bbd1f037daa55666b4 Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Sun, 15 Oct 2023 10:10:37 +0200 Subject: [PATCH] Add javadoc --- .../java/bdv/ui/settings/SettingsPanel.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/bdv/ui/settings/SettingsPanel.java b/src/main/java/bdv/ui/settings/SettingsPanel.java index d5d07e6c..60c7954b 100644 --- a/src/main/java/bdv/ui/settings/SettingsPanel.java +++ b/src/main/java/bdv/ui/settings/SettingsPanel.java @@ -143,6 +143,15 @@ public void removePage( final String path ) pages.repaint(); } + /** + * Shows the settings page with the specified path. Does nothing if there is + * no settings page for the path. If (any part of) the path is collapsed in + * the tree, it is expanded. + * + * @param path + * the path of the settings page to remove. Example: + * {@code "Analyze > Tables"} + */ public void showPage( final String path ) { final TreeNode current = getSettingsPageNode( path, false ); @@ -345,6 +354,16 @@ public void mouseClicked( final MouseEvent e ) breadcrumbs.repaint(); } + /** + * Get the TreeNode for a given settings page path. + * + * @param path + * the path of the settings page to remove. Example: {@code "Analyze > Tables"} + * @param createIfNotExists + * if {@code true}, nodes for non-existing pages are created. + * + * @return TreeNode corresponding to {@code path}, or {@code null} if there is no such page. + */ private DefaultMutableTreeNode getSettingsPageNode( final String path, final boolean createIfNotExists ) { final String[] parts = path.split( ">" );