From a92a27e9f12f87c27a0321e2cb9877b1a837cbf5 Mon Sep 17 00:00:00 2001
From: ghidragon <106987263+ghidragon@users.noreply.github.com>
Date: Wed, 2 Nov 2022 14:11:32 -0400
Subject: [PATCH] GP-1981 Review fixes
---
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../ghidra/framework/options/AutoOptions.java | 24 ++++-
.../SampleTablePlugin/certification.manifest | 2 +-
...ies => sampletableplugin.theme.properties} | 0
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
Ghidra/Features/Base/certification.manifest | 3 +-
.../Base/data/file_extension_icons.xml | 44 ---------
...se.file.extensions.icons.theme.properties} | 1 -
.../AbstractCodeBrowserPlugin.java | 48 +++++-----
.../datapreview/DataTypePreviewPlugin.java | 3 +-
.../plugin/core/misc/FontAdjustPlugin.java | 3 -
.../references/EditMemoryReferencePanel.java | 2 +-
.../app/util/bean/FixedBitSizeValueField.java | 2 +-
.../GhidraApplicationConfiguration.java | 2 +-
.../framework/main/ConsoleTextPane.java | 3 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../fid/debug/FidFunctionDebugPanel.java | 3 +-
.../fid/debug/FidSearchDebugDialog.java | 5 +-
.../fid/debug/FidSearchResultFrame.java | 3 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../plugin/core/diff/DiffDetailsProvider.java | 3 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../vt/gui/wizard/NewSessionPanel.java | 2 +-
Ghidra/Framework/Docking/Module.manifest | 2 +-
Ghidra/Framework/Docking/build.gradle | 2 -
.../Docking/data/docking.theme.properties | 2 -
.../src/main/help/help/shared/Frontpage.css | 2 +-
.../topics/Theming/ThemingDeveloperDocs.html | 2 -
.../src/main/java/docking/CloseIcon.java | 93 +++++++++++++++----
.../java/docking/DockableToolBarManager.java | 4 +-
.../main/java/docking/DropDownMenuIcon.java | 69 +++++++++-----
.../DockingApplicationConfiguration.java | 2 +-
.../options/editor/IconPropertyEditor.java | 8 --
.../options/editor/OptionsTreeNode.java | 7 +-
.../docking/theme/gui/ThemeColorTable.java | 2 +-
.../java/docking/theme/gui/ThemeDialog.java | 2 +-
.../docking/theme/gui/ThemeValueEditor.java | 2 +-
.../widgets/fieldpanel/FieldPanel.java | 1 +
.../tabbedpane/DockingTabRenderer.java | 91 +-----------------
.../ghidra/docking/util/LookAndFeelUtils.java | 2 +-
.../docking/theme/gui/ThemeUtilsTest.java | 8 +-
Ghidra/Framework/Generic/Module.manifest | 1 +
Ghidra/Framework/Generic/build.gradle | 2 +-
.../generic/theme/AbstractThemeReader.java | 2 +-
.../main/java/generic/theme/ColorValue.java | 5 +-
.../main/java/generic/theme/FontModifier.java | 3 -
.../main/java/generic/theme/FontValue.java | 7 +-
.../src/main/java/generic/theme/GColor.java | 22 +++--
.../src/main/java/generic/theme/GIcon.java | 4 +-
.../src/main/java/generic/theme/GTheme.java | 2 +-
.../java/generic/theme/GThemeDefaults.java | 16 ++--
.../src/main/java/generic/theme/Gui.java | 7 +-
.../main/java/generic/theme/IconValue.java | 2 +-
.../src/main/java/generic/theme/LafType.java | 2 -
.../java/generic/theme/ThemeFileLoader.java | 2 +-
.../generic/theme/ThemePreferenceManager.java | 2 +-
.../main/java/generic/theme/ThemeValue.java | 4 +-
.../generic/theme/laf/FlatThemeGrouper.java | 52 +++++------
.../generic/theme/laf/LookAndFeelManager.java | 2 +-
.../generic/theme/laf/MacThemeGrouper.java | 10 +-
.../generic/theme/laf/MotifThemeGrouper.java | 2 +-
.../generic/theme/laf/NimbusThemeGrouper.java | 4 +-
.../java/generic/theme/laf/ThemeGrouper.java | 53 +++++++----
.../framework/options/AbstractOptions.java | 4 +
.../ghidra/framework/options/OptionType.java | 7 ++
.../src/main/java/ghidra/util/ColorUtils.java | 2 +-
.../src/main/java/ghidra/util/WebColors.java | 8 +-
.../ghidra/util/datastruct/WeakStore.java | 6 +-
.../src/main/java/resources/Icons.java | 2 +-
.../main/java/resources/ResourceManager.java | 4 +-
.../java/generic/theme/ColorValueTest.java | 4 +-
.../java/ghidra/util/HTMLUtilitiesTest.java | 6 +-
.../edge/routing/ArticulatedEdgeRouter.java | 2 +-
.../graph/support/TextAreaTestVertex.java | 3 +-
.../main/java/help/GHelpHTMLEditorKit.java | 2 +-
.../Framework/Project/certification.manifest | 4 -
.../Project/data/project.theme.properties | 6 +-
.../src/main/help/help/shared/Frontpage.css | 2 +-
GhidraDocs/languages/html/Frontpage.css | 2 +-
gradle/helpProject.gradle | 2 +-
90 files changed, 375 insertions(+), 381 deletions(-)
rename Ghidra/Extensions/SampleTablePlugin/data/{sample.plugin.theme.properties => sampletableplugin.theme.properties} (100%)
delete mode 100644 Ghidra/Features/Base/data/file_extension_icons.xml
rename Ghidra/Features/Base/data/typeinfo/{file.extensions.icons.theme.properties => base.file.extensions.icons.theme.properties} (98%)
diff --git a/Ghidra/Debug/Debugger/src/main/help/help/shared/Frontpage.css b/Ghidra/Debug/Debugger/src/main/help/help/shared/Frontpage.css
index c8616e85e8..ff855bae04 100644
--- a/Ghidra/Debug/Debugger/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Debug/Debugger/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/framework/options/AutoOptions.java b/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/framework/options/AutoOptions.java
index 13dd374b27..c364441fed 100644
--- a/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/framework/options/AutoOptions.java
+++ b/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/framework/options/AutoOptions.java
@@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.ImmutableList;
import generic.ComparableTupleRecord;
+import generic.theme.GColor;
import ghidra.framework.options.annotation.*;
import ghidra.framework.plugintool.Plugin;
import ghidra.framework.plugintool.PluginTool;
@@ -165,6 +166,7 @@ public interface AutoOptions {
catch (IllegalArgumentException | IllegalAccessException e) {
throw new AssertionError(e);
}
+
OptionType type = annotation.type();
if (type == OptionType.NO_TYPE) {
type = OptionType.getOptionType(defaultValue);
@@ -175,6 +177,7 @@ public interface AutoOptions {
"Could not determine option type from default value: " + f + " = " +
defaultValue);
}
+
String description = annotation.description();
Class extends PropertyEditor> editorClass = annotation.editor();
final PropertyEditor editor;
@@ -191,7 +194,26 @@ public interface AutoOptions {
"editor class must have accessible default constructor", e);
}
}
- options.registerOption(key.getName(), type, defaultValue, help, description, editor);
+
+ if (defaultValue instanceof GColor gColor) {
+ options.registerThemeColorBinding(key.getName(), gColor.getId(), help, description);
+ }
+ /*
+ else if ( is font option ) {
+
+ // Note: there is no font value to check against for fonts in the new Theme system.
+ // If annotation fonts are needed, then they should be bound by String id. Likely,
+ // annotation fonts are not needed now that have themes. We also probably no
+ // longer need annotation colors either.
+
+ options.registerThemeFontBinding(description, fontId, help, description);
+ }
+ */
+ else {
+ options.registerOption(key.getName(), type, defaultValue, help, description,
+ editor);
+ }
+
// TODO: Wish Ghidra would do this upon any option registration
options.putObject(key.getName(), defaultValue, type);
}
diff --git a/Ghidra/Extensions/SampleTablePlugin/certification.manifest b/Ghidra/Extensions/SampleTablePlugin/certification.manifest
index c982dd70ad..dc315f04e3 100644
--- a/Ghidra/Extensions/SampleTablePlugin/certification.manifest
+++ b/Ghidra/Extensions/SampleTablePlugin/certification.manifest
@@ -3,7 +3,7 @@
##MODULE IP: Oxygen Icons - LGPL 3.0
Module.manifest||GHIDRA||reviewed||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
-data/sample.plugin.theme.properties||GHIDRA||||END|
+data/sampletableplugin.theme.properties||GHIDRA||||END|
extension.properties||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/shared/arrow.gif||GHIDRA||reviewed||END|
diff --git a/Ghidra/Extensions/SampleTablePlugin/data/sample.plugin.theme.properties b/Ghidra/Extensions/SampleTablePlugin/data/sampletableplugin.theme.properties
similarity index 100%
rename from Ghidra/Extensions/SampleTablePlugin/data/sample.plugin.theme.properties
rename to Ghidra/Extensions/SampleTablePlugin/data/sampletableplugin.theme.properties
diff --git a/Ghidra/Extensions/SampleTablePlugin/src/main/help/help/shared/Frontpage.css b/Ghidra/Extensions/SampleTablePlugin/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Extensions/SampleTablePlugin/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Extensions/SampleTablePlugin/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Extensions/sample/src/main/help/help/shared/Frontpage.css b/Ghidra/Extensions/sample/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Extensions/sample/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Extensions/sample/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/Base/certification.manifest b/Ghidra/Features/Base/certification.manifest
index 30d629f544..11ab2393b2 100644
--- a/Ghidra/Features/Base/certification.manifest
+++ b/Ghidra/Features/Base/certification.manifest
@@ -20,7 +20,6 @@ data/base.icons.theme.properties||GHIDRA||||END|
data/base.listing.theme.properties||GHIDRA||||END|
data/base.programgraph.theme.properties||GHIDRA||||END|
data/base.theme.properties||GHIDRA||||END|
-data/file_extension_icons.xml||GHIDRA||||END|
data/functionTags.xml||GHIDRA||||END|
data/ms_pe_rich_products.xml||GHIDRA||||END|
data/noReturnFunctionConstraints.xml||GHIDRA||||END|
@@ -81,7 +80,7 @@ data/symbols/win64/mfc80u.exports||GHIDRA||||END|
data/symbols/win64/mfc90.exports||GHIDRA||||END|
data/symbols/win64/mfc90u.exports||GHIDRA||||END|
data/symbols/win64/msvcrt.hints||GHIDRA||||END|
-data/typeinfo/file.extensions.icons.theme.properties||GHIDRA||||END|
+data/typeinfo/base.file.extensions.icons.theme.properties||GHIDRA||||END|
data/typeinfo/generic/generic_clib.gdt||GHIDRA||||END|
data/typeinfo/generic/generic_clib_64.gdt||GHIDRA||||END|
data/typeinfo/mac_10.9/mac_osx.gdt||GHIDRA||||END|
diff --git a/Ghidra/Features/Base/data/file_extension_icons.xml b/Ghidra/Features/Base/data/file_extension_icons.xml
deleted file mode 100644
index a7c59dcf98..0000000000
--- a/Ghidra/Features/Base/data/file_extension_icons.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
ex implements CodeViewerService, CodeFormatService, OptionsChangeListener, FormatModelListener, DomainObjectListener, CodeBrowserPluginInterface { - private static final String CURSOR_COLOR = "Cursor.Cursor Color - Focused"; - private static final String UNFOCUSED_CURSOR_COLOR = "Cursor.Cursor Color - Unfocused"; - private static final String BLINK_CURSOR = "Cursor.Blink Cursor"; - private static final String MOUSE_WHEEL_HORIZONTAL_SCROLLING = "Mouse.Horizontal Scrolling"; + private static final String CURSOR_COLOR_OPTIONS_NAME = "Cursor.Cursor Color - Focused"; + private static final String UNFOCUSED_CURSOR_COLOR_OPTIONS_NAME = + "Cursor.Cursor Color - Unfocused"; + private static final String BLINK_CURSOR_OPTIONS_NAME = "Cursor.Blink Cursor"; + private static final String MOUSE_WHEEL_HORIZONTAL_SCROLLING_OPTIONS_NAME = + "Mouse.Horizontal Scrolling"; //@formatter:off - public static final GColor IFOCUSED_CURSOR_COLOR = new GColor("color.cursor.focused.listing"); - public static final GColor IUNFOCUSED_CURSOR_COLOR = new GColor("color.cursor.unfocused.listing"); - public static final GColor ICURRENT_LINE_HIGHLIGHT_COLOR = new GColor("color.bg.currentline.listing"); + private static final GColor FOCUSED_CURSOR_COLOR = new GColor("color.cursor.focused.listing"); + private static final GColor UNFOCUSED_CURSOR_COLOR = new GColor("color.cursor.unfocused.listing"); + private static final GColor CURRENT_LINE_HIGHLIGHT_COLOR = new GColor("color.bg.currentline.listing"); //@formatter:on // - Icon - @@ -412,15 +414,15 @@ public abstract class AbstractCodeBrowserPlugin
ex highlightMarkers.setMarkerColor(color); } } - else if (optionName.equals(CURSOR_COLOR)) { + else if (optionName.equals(CURSOR_COLOR_OPTIONS_NAME)) { Color color = ((Color) newValue); fieldPanel.setFocusedCursorColor(color); } - else if (optionName.equals(UNFOCUSED_CURSOR_COLOR)) { + else if (optionName.equals(UNFOCUSED_CURSOR_COLOR_OPTIONS_NAME)) { Color color = ((Color) newValue); fieldPanel.setNonFocusCursorColor(color); } - else if (optionName.equals(BLINK_CURSOR)) { + else if (optionName.equals(BLINK_CURSOR_OPTIONS_NAME)) { Boolean isBlinkCursor = ((Boolean) newValue); fieldPanel.setBlinkCursor(isBlinkCursor); } @@ -436,7 +438,7 @@ public abstract class AbstractCodeBrowserPlugin
ex currentCursorMarkers.setColoringBackground(isHighlightCursorLine); } } - else if (optionName.equals(MOUSE_WHEEL_HORIZONTAL_SCROLLING)) { + else if (optionName.equals(MOUSE_WHEEL_HORIZONTAL_SCROLLING_OPTIONS_NAME)) { fieldPanel.setHorizontalScrollingEnabled((Boolean) newValue); } @@ -560,23 +562,25 @@ public abstract class AbstractCodeBrowserPlugin
ex GhidraOptions.DEFAULT_HIGHLIGHT_COLOR.getId(), helpLocation, "The highlight color in the browser."); - fieldOptions.registerThemeColorBinding(CURSOR_COLOR, IFOCUSED_CURSOR_COLOR.getId(), + fieldOptions.registerThemeColorBinding(CURSOR_COLOR_OPTIONS_NAME, + FOCUSED_CURSOR_COLOR.getId(), helpLocation, "The color of the cursor in the browser."); - fieldOptions.registerThemeColorBinding(UNFOCUSED_CURSOR_COLOR, - IUNFOCUSED_CURSOR_COLOR.getId(), + fieldOptions.registerThemeColorBinding(UNFOCUSED_CURSOR_COLOR_OPTIONS_NAME, + UNFOCUSED_CURSOR_COLOR.getId(), helpLocation, "The color of the cursor in the browser when the browser does not have focus."); - fieldOptions.registerOption(BLINK_CURSOR, true, helpLocation, + fieldOptions.registerOption(BLINK_CURSOR_OPTIONS_NAME, true, helpLocation, "When selected, the cursor will blink when the containing window is focused."); fieldOptions.registerThemeColorBinding(GhidraOptions.HIGHLIGHT_CURSOR_LINE_COLOR, - ICURRENT_LINE_HIGHLIGHT_COLOR.getId(), helpLocation, + CURRENT_LINE_HIGHLIGHT_COLOR.getId(), helpLocation, "The background color of the line where the cursor is located"); fieldOptions.registerOption(GhidraOptions.HIGHLIGHT_CURSOR_LINE, true, helpLocation, "Toggles highlighting background color of line containing the cursor"); helpLocation = new HelpLocation(getName(), "Keyboard_Controls_Shift"); - fieldOptions.registerOption(MOUSE_WHEEL_HORIZONTAL_SCROLLING, true, helpLocation, + fieldOptions.registerOption(MOUSE_WHEEL_HORIZONTAL_SCROLLING_OPTIONS_NAME, true, + helpLocation, "Enables horizontal scrolling by holding the Shift key while " + "using the mouse scroll wheel"); @@ -599,21 +603,21 @@ public abstract class AbstractCodeBrowserPlugin
ex
highlightMarkers.setMarkerColor(color);
}
- color = fieldOptions.getColor(CURSOR_COLOR, IFOCUSED_CURSOR_COLOR);
+ color = fieldOptions.getColor(CURSOR_COLOR_OPTIONS_NAME, FOCUSED_CURSOR_COLOR);
fieldPanel.setFocusedCursorColor(color);
- color = fieldOptions.getColor(UNFOCUSED_CURSOR_COLOR, IUNFOCUSED_CURSOR_COLOR);
+ color = fieldOptions.getColor(UNFOCUSED_CURSOR_COLOR_OPTIONS_NAME, UNFOCUSED_CURSOR_COLOR);
fieldPanel.setNonFocusCursorColor(color);
- Boolean isBlinkCursor = fieldOptions.getBoolean(BLINK_CURSOR, true);
+ Boolean isBlinkCursor = fieldOptions.getBoolean(BLINK_CURSOR_OPTIONS_NAME, true);
fieldPanel.setBlinkCursor(isBlinkCursor);
boolean horizontalScrollingEnabled =
- fieldOptions.getBoolean(MOUSE_WHEEL_HORIZONTAL_SCROLLING, true);
+ fieldOptions.getBoolean(MOUSE_WHEEL_HORIZONTAL_SCROLLING_OPTIONS_NAME, true);
fieldPanel.setHorizontalScrollingEnabled(horizontalScrollingEnabled);
cursorHighlightColor = fieldOptions.getColor(GhidraOptions.HIGHLIGHT_CURSOR_LINE_COLOR,
- ICURRENT_LINE_HIGHLIGHT_COLOR);
+ CURRENT_LINE_HIGHLIGHT_COLOR);
isHighlightCursorLine = fieldOptions.getBoolean(GhidraOptions.HIGHLIGHT_CURSOR_LINE, true);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datapreview/DataTypePreviewPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datapreview/DataTypePreviewPlugin.java
index da04b8bf36..df59a8d79e 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datapreview/DataTypePreviewPlugin.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datapreview/DataTypePreviewPlugin.java
@@ -29,7 +29,6 @@ import docking.action.*;
import docking.dnd.DropTgtAdapter;
import docking.dnd.Droppable;
import docking.widgets.table.AbstractSortedTableModel;
-import generic.theme.GIcon;
import ghidra.app.CorePluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.plugin.ProgramPlugin;
@@ -317,7 +316,7 @@ public class DataTypePreviewPlugin extends ProgramPlugin {
}
};
deleteAction.setPopupMenuData(new MenuData(new String[] { "Delete" }));
- deleteAction.setToolBarData(new ToolBarData(new GIcon("icon.delete")));
+ deleteAction.setToolBarData(new ToolBarData(Icons.DELETE_ICON));
deleteAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_DELETE, 0));
deleteAction.setDescription("Delete Selected Datatypes");
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/misc/FontAdjustPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/misc/FontAdjustPlugin.java
index 98f40a08b5..af5cc78ffb 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/misc/FontAdjustPlugin.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/misc/FontAdjustPlugin.java
@@ -22,7 +22,6 @@ import ghidra.app.CorePluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.framework.plugintool.*;
import ghidra.framework.plugintool.util.PluginStatus;
-import ghidra.util.Msg;
/**
* Manages the markers to display areas where changes have occurred
@@ -55,7 +54,6 @@ public class FontAdjustPlugin extends Plugin {
}
private void incrementFont(ActionContext context) {
- Msg.debug(this, "incrementFont");
ComponentProvider provider = context.getComponentProvider();
if (provider != null) {
provider.adjustFontSize(true);
@@ -63,7 +61,6 @@ public class FontAdjustPlugin extends Plugin {
}
private void decrementFont(ActionContext context) {
- Msg.debug(this, "decrementFont");
ComponentProvider provider = context.getComponentProvider();
if (provider != null) {
provider.adjustFontSize(false);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java
index 537ca427a9..bc66418267 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/EditMemoryReferencePanel.java
@@ -49,7 +49,7 @@ import ghidra.util.layout.PairLayout;
class EditMemoryReferencePanel extends EditReferencePanel {
private static final Color BUTTON_COLOR = new GColor("color.fg.button");
- private static final Icon MENU_ICON = new DropDownMenuIcon(16, 4, 4, BUTTON_COLOR);
+ private static final Icon MENU_ICON = new DropDownMenuIcon(BUTTON_COLOR);
private static final RefType[] MEM_REF_TYPES = RefTypeFactory.getMemoryRefTypes();
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/FixedBitSizeValueField.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/FixedBitSizeValueField.java
index ff3c45c27c..7381c1b29f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/FixedBitSizeValueField.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bean/FixedBitSizeValueField.java
@@ -66,7 +66,7 @@ public class FixedBitSizeValueField extends JPanel {
}
add(valueField, BorderLayout.CENTER);
- Font f2 = Gui.getFont("font.monospaced");
+ Font f2 = Gui.getFont(Font.MONOSPACED);
valueField.setFont(f2);
valueField.setMargin(new Insets(0, 2, 0, 2));
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/GhidraApplicationConfiguration.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/GhidraApplicationConfiguration.java
index e72a7a2a00..c6ec824e3d 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/framework/GhidraApplicationConfiguration.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/GhidraApplicationConfiguration.java
@@ -44,7 +44,7 @@ public class GhidraApplicationConfiguration extends HeadlessGhidraApplicationCon
@Override
protected void initializeApplication() {
Gui.initialize();
- LookAndFeelUtils.platformSpecificFixups();
+ LookAndFeelUtils.performPlatformSpecificFixups();
if (showSplashScreen) {
showUserAgreement();
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/main/ConsoleTextPane.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/main/ConsoleTextPane.java
index 84a501aa27..77891c21ae 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/framework/main/ConsoleTextPane.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/main/ConsoleTextPane.java
@@ -22,6 +22,7 @@ import javax.swing.JTextPane;
import javax.swing.text.*;
import generic.theme.GColor;
+import generic.theme.GThemeDefaults.Ids.Fonts;
import generic.theme.Gui;
import ghidra.framework.options.*;
import ghidra.framework.plugintool.PluginTool;
@@ -203,7 +204,7 @@ public class ConsoleTextPane extends JTextPane implements OptionsChangeListener
}
private void createAttribtues() {
- createAttributes(Gui.getFont("font.monospaced"));
+ createAttributes(Gui.getFont(Fonts.MONOSPACED));
}
private void createAttributes(Font font) {
diff --git a/Ghidra/Features/BytePatterns/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/BytePatterns/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/BytePatterns/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/BytePatterns/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/ByteViewer/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/ByteViewer/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/ByteViewer/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/ByteViewer/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/Decompiler/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/Decompiler/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/Decompiler/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/Decompiler/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/FileFormats/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/FileFormats/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/FileFormats/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/FileFormats/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/FunctionGraph/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/FunctionGraph/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/FunctionGraph/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/FunctionGraph/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/FunctionID/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/FunctionID/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/FunctionID/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/FunctionID/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
index 4a9912130b..68d6a58835 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
@@ -21,6 +21,7 @@ import java.awt.event.ActionListener;
import javax.swing.*;
import docking.widgets.label.GDLabel;
+import generic.theme.GThemeDefaults;
import generic.theme.Gui;
import ghidra.feature.fid.db.*;
import ghidra.feature.fid.service.FidService;
@@ -56,7 +57,7 @@ public class FidFunctionDebugPanel extends JPanel {
JButton button = new JButton(text);
button.addActionListener(listener);
button.setHorizontalAlignment(SwingConstants.LEFT);
- button.setFont(Gui.getFont("font.monospaced"));
+ Gui.registerFont(button, GThemeDefaults.Ids.Fonts.MONOSPACED);
add(button);
}
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
index 6792ca0c14..3ba1bb1279 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
@@ -21,6 +21,7 @@ import javax.swing.*;
import docking.DialogComponentProvider;
import docking.widgets.label.GDLabel;
+import generic.theme.GThemeDefaults.Ids.Fonts;
import generic.theme.Gui;
import ghidra.feature.fid.db.FidFileManager;
import ghidra.feature.fid.db.FidQueryService;
@@ -76,13 +77,13 @@ public class FidSearchDebugDialog extends DialogComponentProvider {
private JLabel getPreparedLabel(String text) {
JLabel label = new GDLabel(text, SwingConstants.RIGHT);
- label.setFont(Gui.getFont("font.monospaced"));
+ label.setFont(Gui.getFont(Fonts.MONOSPACED));
return label;
}
private JTextField getPreparedTextField() {
JTextField textField = new JTextField(25);
- textField.setFont(Gui.getFont("font.monospaced"));
+ textField.setFont(Gui.getFont(Fonts.MONOSPACED));
return textField;
}
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
index 38baae3065..1e246cedc7 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
@@ -26,6 +26,7 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import docking.widgets.table.*;
+import generic.theme.GThemeDefaults.Ids.Fonts;
import generic.theme.Gui;
import ghidra.feature.fid.db.*;
import ghidra.feature.fid.service.FidService;
@@ -65,7 +66,7 @@ public class FidSearchResultFrame extends JFrame implements FidQueryCloseListene
private void buildFrame() {
GTableCellRenderer renderer = new GTableCellRenderer();
- renderer.setFont(Gui.getFont("font.monospaced"));
+ renderer.setFont(Gui.getFont(Fonts.MONOSPACED));
int columnCount = table.getColumnCount();
for (int ii = 0; ii < columnCount; ++ii) {
Class> columnClass = table.getColumnClass(ii);
diff --git a/Ghidra/Features/GraphFunctionCalls/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/GraphFunctionCalls/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/GraphFunctionCalls/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/GraphFunctionCalls/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/PDB/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/PDB/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/PDB/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/PDB/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/ProgramDiff/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/ProgramDiff/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/ProgramDiff/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/ProgramDiff/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java
index 10609fffb8..8042e9a026 100644
--- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java
+++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffDetailsProvider.java
@@ -30,6 +30,7 @@ import docking.action.DockingAction;
import docking.action.ToolBarData;
import docking.widgets.checkbox.GCheckBox;
import generic.theme.GIcon;
+import generic.theme.GThemeDefaults.Ids.Fonts;
import generic.theme.Gui;
import ghidra.app.util.HelpTopics;
import ghidra.framework.plugintool.ComponentProviderAdapter;
@@ -294,7 +295,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
textPane.setName(DIFF_DETAILS_TEXT_AREA);
textPane.setEditable(false);
textPane.setMargin(new Insets(5, 5, 5, 5));
- Gui.registerFont(textPane, "font.monospaced");
+ Gui.registerFont(textPane, Fonts.MONOSPACED);
textPane.setOpaque(true);
textPane.setCaretPosition(0);
JScrollPane scrolledDetails = new JScrollPane(textPane);
diff --git a/Ghidra/Features/Python/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/Python/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/Python/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/Python/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/SourceCodeLookup/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/SourceCodeLookup/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/SourceCodeLookup/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/SourceCodeLookup/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/VersionTracking/src/main/help/help/shared/Frontpage.css b/Ghidra/Features/VersionTracking/src/main/help/help/shared/Frontpage.css
index b8471669f4..557c37ca39 100644
--- a/Ghidra/Features/VersionTracking/src/main/help/help/shared/Frontpage.css
+++ b/Ghidra/Features/VersionTracking/src/main/help/help/shared/Frontpage.css
@@ -28,7 +28,7 @@ body { margin-bottom: 50px; margin-left: 10px; margin-right: 10px; margin-top: 1
li { font-family:times new roman; font-size:14pt; }
h1 { color:#000080; font-family:times new roman; font-size:36pt; font-style:italic; font-weight:bold; text-align:center; }
h2 { margin: 10px; margin-top: 20px; color:#984c4c; font-family:times new roman; font-size:18pt; font-weight:bold; }
-h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; `font-size:14pt; font-weight:bold; }
+h3 { margin-left: 10px; margin-top: 20px; color:#0000ff; font-family:times new roman; font-size:14pt; font-weight:bold; }
h4 { margin-left: 10px; margin-top: 20px; font-family:times new roman; font-size:14pt; font-style:italic; }
/*
diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
index 06f14ae77a..a0b69e6f8c 100644
--- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
+++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
@@ -73,7 +73,7 @@ public class NewSessionPanel extends AbstractMageJPanel This document provides everything an application developer should know when developing
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/CloseIcon.java b/Ghidra/Framework/Docking/src/main/java/docking/CloseIcon.java
index 77f9db4ad7..48d28967e3 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/CloseIcon.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/CloseIcon.java
@@ -16,6 +16,7 @@
package docking;
import java.awt.*;
+import java.awt.geom.GeneralPath;
import javax.swing.Icon;
@@ -24,34 +25,86 @@ import javax.swing.Icon;
*/
public class CloseIcon implements Icon {
private int size;
- private int margin;
private Color color;
+ private Shape shape;
/**
- * Creates a close icon.
- * @param size the width and height of the icon
- * @param margin the margin around the "x"
- * @param color the color of the "x"
- */
- public CloseIcon(int size, int margin, Color color) {
- this.size = size;
- this.margin = margin;
+ * Creates a close icon.
+ * @param isSmall false signals to use a 16x16 size; true signals to use an 8x8 size
+ * @param color the color of the "x"
+ */
+ public CloseIcon(boolean isSmall, Color color) {
+ this.size = isSmall ? 8 : 16;
this.color = color;
+ this.shape = buildShape();
+ }
+
+ private Shape buildShape() {
+ GeneralPath path = new GeneralPath();
+
+ /*
+ We use trial and error sizing. This class allows clients to specify the icon size. At
+ the time of writing, there were only 2 sizes in use: 16 and 8 pixels. If more size
+ needs arise, we can revisit how the values below are chosen.
+ */
+
+ double margin = 2;
+ double shapeSize = 11;
+ double thickness = 1.7;
+ if (size == 8) {
+ margin = 0;
+ shapeSize = 7;
+ thickness = 1;
+ }
+
+ double p1x = margin;
+ double p1y = margin + thickness;
+ double p2x = margin + thickness;
+ double p2y = margin;
+ double p3x = margin + shapeSize;
+ double p3y = margin + shapeSize - thickness;
+ double p4x = margin + shapeSize - thickness;
+ double p4y = margin + shapeSize;
+
+ path.moveTo(p1x, p1y);
+ path.lineTo(p2x, p2y);
+ path.lineTo(p3x, p3y);
+ path.lineTo(p4x, p4y);
+ path.lineTo(p1x, p1y);
+
+ p1x = margin + shapeSize - thickness;
+ p1y = margin;
+ p2x = margin + shapeSize;
+ p2y = margin + thickness;
+ p3x = margin + thickness;
+ p3y = margin + shapeSize;
+ p4x = margin;
+ p4y = margin + shapeSize - thickness;
+
+ path.moveTo(p1x, p1y);
+ path.lineTo(p2x, p2y);
+ path.lineTo(p3x, p3y);
+ path.lineTo(p4x, p4y);
+ path.lineTo(p1x, p1y);
+
+ path.closePath();
+ return path;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
- g.setColor(color);
- int xStart = x + margin;
- int yStart = y + margin;
- int xEnd = x + size - margin;
- int yEnd = y + size - margin;
- g.drawLine(xStart, yStart, xEnd, yEnd);
- g.drawLine(xStart, yEnd, xEnd, yStart);
- g.drawLine(xStart + 1, yStart, xEnd + 1, yEnd);
- g.drawLine(xStart + 1, yEnd, xEnd + 1, yStart);
- g.drawLine(xStart - 1, yStart, xEnd - 1, yEnd);
- g.drawLine(xStart - 1, yEnd, xEnd - 1, yStart);
+
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+ try {
+ g2d.translate(x, y);
+ g2d.setColor(color);
+ g2d.fill(shape);
+ }
+ finally {
+ g2d.translate(-x, -y);
+ }
}
@Override
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DockableToolBarManager.java b/Ghidra/Framework/Docking/src/main/java/docking/DockableToolBarManager.java
index 89ef71a1e1..0116deda95 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/DockableToolBarManager.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/DockableToolBarManager.java
@@ -32,8 +32,8 @@ import ghidra.util.task.SwingUpdateManager;
*/
class DockableToolBarManager {
private static final Color BUTTON_COLOR = new GColor("color.fg.button");
- private static final Icon CLOSE_ICON = new CloseIcon(16, 4, BUTTON_COLOR);
- private static final Icon MENU_ICON = new DropDownMenuIcon(16, 4, 4, BUTTON_COLOR);
+ private static final Icon CLOSE_ICON = new CloseIcon(false, BUTTON_COLOR);
+ private Icon MENU_ICON = new DropDownMenuIcon(BUTTON_COLOR);
private GenericHeader dockableHeader;
private ToolBarManager toolBarManager;
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DropDownMenuIcon.java b/Ghidra/Framework/Docking/src/main/java/docking/DropDownMenuIcon.java
index bf9692d96a..7f07f50405 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/DropDownMenuIcon.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/DropDownMenuIcon.java
@@ -16,6 +16,7 @@
package docking;
import java.awt.*;
+import java.awt.geom.GeneralPath;
import javax.swing.Icon;
@@ -23,49 +24,71 @@ import javax.swing.Icon;
* Icon for a drop down menu button (triangle pointing down)
*/
public class DropDownMenuIcon implements Icon {
- private int size;
- private int xMargin;
- private int yMargin;
+ private static final int ICON_SIZE = 16;
+
private Color color;
+ private Shape shape;
/**
* Creates a drop down menu icon.
- * @param size the width and height of the icon
- * @param xMargin the margin around triangle base
- * @param yMargin the margin around triangle height
* @param color the color of the triangle
*/
- public DropDownMenuIcon(int size, int xMargin, int yMargin, Color color) {
- this.size = size;
- this.xMargin = xMargin;
- this.yMargin = yMargin;
+ public DropDownMenuIcon(Color color) {
this.color = color;
+ this.shape = buildShape();
+ }
+
+ private Shape buildShape() {
+
+ GeneralPath path = new GeneralPath();
+
+ double iconSize = 16;
+ double height = 6;
+ double width = 10;
+ double leftMargin = (iconSize - width) / 2;
+ double topMargin = (iconSize - height) / 2;
+
+ // draw a triangle pointing down; p1 is the bottom; p2 is the left
+ double p1x = leftMargin + (width / 2);
+ double p1y = topMargin + height;
+ double p2x = leftMargin;
+ double p2y = topMargin;
+ double p3x = leftMargin + width;
+ double p3y = topMargin;
+
+ path.moveTo(p1x, p1y);
+ path.lineTo(p2x, p2y);
+ path.lineTo(p3x, p3y);
+ path.lineTo(p1x, p1y);
+ path.closePath();
+
+ return path;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
- g.setColor(color);
- // draw a triangle pointing down
- int p1x = x + size / 2;
- int p1y = y + size - yMargin;
- int p2x = x + xMargin;
- int p2y = y + yMargin;
- int p3x = x + size - xMargin + 1;
- int p3y = y + yMargin;
- int xPoints[] = { p1x, p2x, p3x };
- int yPoints[] = { p1y, p2y, p3y };
- g.fillPolygon(xPoints, yPoints, 3);
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+ try {
+ g2d.translate(x, y);
+ g2d.setColor(color);
+ g2d.fill(shape);
+ }
+ finally {
+ g2d.translate(-x, -y);
+ }
}
@Override
public int getIconWidth() {
- return size;
+ return ICON_SIZE;
}
@Override
public int getIconHeight() {
- return size;
+ return ICON_SIZE;
}
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/framework/DockingApplicationConfiguration.java b/Ghidra/Framework/Docking/src/main/java/docking/framework/DockingApplicationConfiguration.java
index a1b8ddb290..730d0087ac 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/framework/DockingApplicationConfiguration.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/framework/DockingApplicationConfiguration.java
@@ -50,7 +50,7 @@ public class DockingApplicationConfiguration extends ApplicationConfiguration {
super.initializeApplication();
Gui.initialize();
- LookAndFeelUtils.platformSpecificFixups();
+ LookAndFeelUtils.performPlatformSpecificFixups();
if (showSplashScreen) {
SplashScreen.showSplashScreen();
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/IconPropertyEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/IconPropertyEditor.java
index 368eb43b66..68d863f44f 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/IconPropertyEditor.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/IconPropertyEditor.java
@@ -133,12 +133,6 @@ public class IconPropertyEditor extends PropertyEditorSupport {
return panel;
}
-// private void iconChanged() {
-// Icon icon = dropDown.getSelectedValue();
-// Msg.debug(this, "action listener: icon changed " + icon);
-// dropDown.getSelectedValue();
-// }
-
private void iconChanged(Icon icon) {
boolean isDropDownWindowShowing = dropDown.isMatchingListShowing();
if (!isDropDownWindowShowing) {
@@ -216,10 +210,8 @@ public class IconPropertyEditor extends PropertyEditorSupport {
previewLabel = new GDLabel("");
previewLabel.setIcon(ResourceManager.getDefaultIcon());
-// previewLabel.setPreferredSize(new Dimension(350, 50));
previewLabel.setHorizontalAlignment(SwingConstants.CENTER);
previewLabel.setVerticalAlignment(SwingConstants.CENTER);
-// previewLabel.setMinimumSize(new Dimension(300, 50));
panel.add(previewLabel, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
return panel;
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsTreeNode.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsTreeNode.java
index d95d5311e5..50355b8cc6 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsTreeNode.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsTreeNode.java
@@ -23,11 +23,12 @@ import docking.widgets.tree.GTreeLazyNode;
import docking.widgets.tree.GTreeNode;
import generic.theme.GIcon;
import ghidra.framework.options.Options;
+import resources.Icons;
class OptionsTreeNode extends GTreeLazyNode {
- private final static Icon OPEN_FOLDER_ICON = new GIcon("icon.folder.open");
- private final static Icon CLOSED_FOLDER_ICON = new GIcon("icon.folder.closed");
- private final static Icon PROPERTIES_ICON = new GIcon("icon.options.node.leaf");
+ private final static Icon OPEN_FOLDER_ICON = Icons.OPEN_FOLDER_ICON;
+ private final static Icon CLOSED_FOLDER_ICON = Icons.CLOSED_FOLDER_ICON;
+ private final static Icon PROPERTIES_ICON = new GIcon("icon.properties");
private final Options options;
private final String name;
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeColorTable.java b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeColorTable.java
index fa27f8e86a..c06f729bef 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeColorTable.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeColorTable.java
@@ -107,7 +107,7 @@ public class ThemeColorTable extends JPanel implements ActionContextProvider {
@Override
public ActionContext getActionContext(MouseEvent e) {
- if (e.getSource() == table) {
+ if (e != null && e.getSource() == table) {
ColorValue currentValue = filterTable.getSelectedRowObject();
if (currentValue == null) {
return null;
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeDialog.java
index 46bd4d9490..61bd67731d 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeDialog.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeDialog.java
@@ -79,7 +79,7 @@ public class ThemeDialog extends DialogComponentProvider {
.enabledWhen(c -> c.isChanged())
.popupWhen(c -> true)
.helpLocation(new HelpLocation("Theming", "Restore_Value"))
- .onAction(c -> c.getThemeValue().makeCurrentValue())
+ .onAction(c -> c.getThemeValue().installValue())
.build();
addAction(resetValueAction);
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeValueEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeValueEditor.java
index 38d8700ebd..068bd640ae 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeValueEditor.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeValueEditor.java
@@ -25,7 +25,7 @@ import docking.DockingWindowManager;
import generic.theme.ThemeValue;
/**
- * Base class for Theme properties (Colors, Fonts, and Icons)
+ * Base class for Theme property Editors (Colors, Fonts, and Icons)
*
* @param The idea is for developers to
* not use specific colors in their code, but to instead use a GColor with an id that hints at
- * its use. For example, instead of harding code a component's background color to white by coding
+ * its use. For example, instead of hard coding a component's background color to white by coding
* "component.setBackground(Color.white)", you would do something like
* "component.setBackground(new GColor("color.mywidget.bg"). Then in a
* "[module name].theme.properties" file (located in the module's data directory), you would
@@ -127,6 +127,11 @@ public class GColor extends Color {
return delegate.darker();
}
+ /**
+ * Returns true if this GColor could not find a value for its color id in the current theme
+ * and is using the default color as its delegate
+ * @return true if this GColor could not find a value for its color id in the current theme
+ */
public boolean isUnresolved() {
return delegate == ColorValue.LAST_RESORT_DEFAULT;
}
@@ -144,20 +149,17 @@ public class GColor extends Color {
return WebColors.toString(this, false);
}
+ /**
+ * Generates a more verbose toString()
+ * @return a more verbose toString()
+ */
public String toDebugString() {
Color c = delegate;
String rgb =
"(" + c.getRed() + "," + c.getGreen() + "," + c.getBlue() + "," + c.getAlpha() + ")";
+ String hexrgb = "(" + WebColors.toString(c, true) + ")";
return getClass().getSimpleName() + " [id = " + id + ", color = " +
- c.getClass().getSimpleName() + rgb + "]";
- }
-
- public String toDebugHexString() {
- Color c = delegate;
- String rgb =
- "(" + WebColors.toString(c, true) + ")";
- return getClass().getSimpleName() + " [id = " + id + ", color = " +
- c.getClass().getSimpleName() + rgb + "]";
+ c.getClass().getSimpleName() + rgb + hexrgb + "]";
}
@Override
diff --git a/Ghidra/Framework/Generic/src/main/java/generic/theme/GIcon.java b/Ghidra/Framework/Generic/src/main/java/generic/theme/GIcon.java
index ce5ee16b01..72e98b2a46 100644
--- a/Ghidra/Framework/Generic/src/main/java/generic/theme/GIcon.java
+++ b/Ghidra/Framework/Generic/src/main/java/generic/theme/GIcon.java
@@ -31,8 +31,8 @@ import resources.icons.*;
* icon table that is determined by the active {@link GTheme}.
* The idea is for developers to
* not use specific icons in their code, but to instead use a GIcon with an id that hints at
- * its use. For example, instead of harding code a label's icon by coding
- * "lable.setIcon(ResourceManager.loadImage("images/refresh.png", you would do something like
+ * its use. For example, instead of hard coding a label's icon by coding
+ * "label.setIcon(ResourceManager.loadImage("images/refresh.png", you would do something like
* label.setIcon(new GIcon("icon.refresh"). Then in a "[module name].theme.properties" file
* (located in the module's data directory), you would set the default value by adding this
* line "icon.refresh = images/refresh.png".
diff --git a/Ghidra/Framework/Generic/src/main/java/generic/theme/GTheme.java b/Ghidra/Framework/Generic/src/main/java/generic/theme/GTheme.java
index 2591a65444..fda6ea33f7 100644
--- a/Ghidra/Framework/Generic/src/main/java/generic/theme/GTheme.java
+++ b/Ghidra/Framework/Generic/src/main/java/generic/theme/GTheme.java
@@ -41,7 +41,7 @@ public class GTheme extends GThemeValueMap {
private final File file;
/**
- * Creates an new GTheme with the given name, the default {@link LookAndFeel} for the the
+ * Creates a new GTheme with the given name, the default {@link LookAndFeel} for the the
* platform and not using dark defaults. This theme will be using all the standard defaults
* from the theme.property files and the defaults from the default LookAndFeel.
* @param name the name for this GTheme
diff --git a/Ghidra/Framework/Generic/src/main/java/generic/theme/GThemeDefaults.java b/Ghidra/Framework/Generic/src/main/java/generic/theme/GThemeDefaults.java
index 72179d49ae..c95fc657c9 100644
--- a/Ghidra/Framework/Generic/src/main/java/generic/theme/GThemeDefaults.java
+++ b/Ghidra/Framework/Generic/src/main/java/generic/theme/GThemeDefaults.java
@@ -32,6 +32,14 @@ public class GThemeDefaults {
public static class Java {
public static final String BORDER = "system.color.border"; // TODO
}
+
+ public static class Fonts {
+ public static final String STANDARD = "font.standard";
+ public static final String BOLD = "font.bold";
+ public static final String ITALIC = "font.italic";
+ public static final String BOLD_ITALIC = "font.bold.italic";
+ public static final String MONOSPACED = "font.monospaced";
+ }
}
/**
@@ -125,12 +133,4 @@ public class GThemeDefaults {
}
}
}
-
- public static class Fonts {
- public static final String STANDARD = "font.standard";
- public static final String BOLD = "font.bold";
- public static final String ITALIC = "font.italic";
- public static final String BOLD_ITALIC = "font.bold.italic";
- public static final String MONOSPACED = "font.monospaced";
- }
}
diff --git a/Ghidra/Framework/Generic/src/main/java/generic/theme/Gui.java b/Ghidra/Framework/Generic/src/main/java/generic/theme/Gui.java
index 56d56235f0..ce14d3ae63 100644
--- a/Ghidra/Framework/Generic/src/main/java/generic/theme/Gui.java
+++ b/Ghidra/Framework/Generic/src/main/java/generic/theme/Gui.java
@@ -23,7 +23,8 @@ import java.util.List;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
-import com.formdev.flatlaf.*;
+import com.formdev.flatlaf.FlatDarkLaf;
+import com.formdev.flatlaf.FlatLightLaf;
import generic.theme.builtin.*;
import generic.theme.laf.LookAndFeelManager;
@@ -92,7 +93,6 @@ public class Gui {
installFlatLookAndFeels();
loadThemeDefaults();
setTheme(themePreferenceManager.getTheme());
-// LookAndFeelUtils.installGlobalOverrides();
}
/**
@@ -489,6 +489,7 @@ public class Gui {
return gIcon;
}
+ // used by
public static void setSystemDefaults(GThemeValueMap map) {
systemValues = map;
}
@@ -730,8 +731,6 @@ public class Gui {
private static void installFlatLookAndFeels() {
UIManager.installLookAndFeel(LafType.FLAT_LIGHT.getName(), FlatLightLaf.class.getName());
UIManager.installLookAndFeel(LafType.FLAT_DARK.getName(), FlatDarkLaf.class.getName());
- UIManager.installLookAndFeel(LafType.FLAT_DARCULA.getName(),
- FlatDarculaLaf.class.getName());
}
private static void loadThemeDefaults() {
diff --git a/Ghidra/Framework/Generic/src/main/java/generic/theme/IconValue.java b/Ghidra/Framework/Generic/src/main/java/generic/theme/IconValue.java
index 0af14893a0..5018daacc1 100644
--- a/Ghidra/Framework/Generic/src/main/java/generic/theme/IconValue.java
+++ b/Ghidra/Framework/Generic/src/main/java/generic/theme/IconValue.java
@@ -247,7 +247,7 @@ public class IconValue extends ThemeValue
* This class is sometimes sub-classed for a particular {@link LookAndFeel}. The subclass can
* create new groups and mappings that are unique to that LookAndFeel.
+ *
+ * Often, many of the various group source ids have the same color value. To try to group
+ * properties as defined in BasicLookAndFeel, the preferred source ids are
+ * defined for each group. These will be tried first, but if a match isn't found among the
+ * preferred sources, then all the sources will be searched for a match
*/
public class ThemeGrouper {
private static String DEFAULT_FONT_GROUP_ID = "font.default";
@@ -141,10 +146,6 @@ public class ThemeGrouper {
"ToolTip"
};
- // often the many of the various group source ids have the same color value. To try and group
- // properties as defined in BasicLookAndFeel, the preferred source ids are
- // defined for each group. These will be tried first, but if a match isn't found among the
- // preferred sources, then all the sources will be searched for a match
private static final String[] BUTTON_PREFERRED_SOURCES = {
"control",
"controlText",
@@ -225,24 +226,42 @@ public class ThemeGrouper {
groupFonts(values, groupMap);
}
- protected void defineCustomColorGroup(GThemeValueMap values, String customGroupName,
- String exemplarComponentId) {
+ /**
+ * Defines a new color id that will be used as the reference value for any specific color ids that
+ * have the same color value. This will allow all those specific colors to be changed at once.
+ * @param customGroupColorName name of a higher level group color id that will be used as the
+ * value for more specific color ids defined by the lookAndFeel.
+ * @param lookAndFeelSourceId the lookAndFeel color id whose value will be used as the value
+ * for the new custom group color id
+ * @param values the map where we store the default theme value mappings
+ */
+ protected void defineCustomColorGroup(String customGroupColorName, String lookAndFeelSourceId,
+ GThemeValueMap values) {
- colorSourceProperties.add(customGroupName);
- ColorValue colorValue = values.getColor(exemplarComponentId);
+ colorSourceProperties.add(customGroupColorName);
+ ColorValue colorValue = values.getColor(lookAndFeelSourceId);
if (colorValue != null) {
Color color = colorValue.get(values);
- values.addColor(new ColorValue(customGroupName, color));
+ values.addColor(new ColorValue(customGroupColorName, color));
}
}
- protected void defineCustomFontGroup(GThemeValueMap values, String customGroupName,
- String exemplarComponentId) {
- fontSourceProperties.add(customGroupName);
- FontValue fontValue = values.getFont(exemplarComponentId);
+ /**
+ * Defines a new font id that will be used as the reference value for any specific font ids that
+ * have the same font value. This will allow all those specific fonts to be changed at once.
+ * @param customGroupFontName name of a higher level group font id that will be used as the
+ * value of more specific font ids defined by the lookAndFeel.
+ * @param lookAndFeelSourceId the lookAndFeel font id whose value will be used as the value
+ * for the new custom group font id
+ * @param values the map where we store the default theme value mappings
+ */
+ protected void defineCustomFontGroup(String customGroupFontName, String lookAndFeelSourceId,
+ GThemeValueMap values) {
+ fontSourceProperties.add(customGroupFontName);
+ FontValue fontValue = values.getFont(lookAndFeelSourceId);
if (fontValue != null) {
Font font = fontValue.get(values);
- values.addFont(new FontValue(customGroupName, font));
+ values.addFont(new FontValue(customGroupFontName, font));
}
}
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/AbstractOptions.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/AbstractOptions.java
index a1fe2c2673..ac9e9e523e 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/AbstractOptions.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/AbstractOptions.java
@@ -854,6 +854,10 @@ public abstract class AbstractOptions implements Options {
}
private void themeChanged(ThemeEvent e) {
+ // We are only sending out OptionsChangedEvents in response to Font theme changes. We
+ // don't notify options changed for colors because we expect clients are using GColor
+ // which updates automatically, so should need to be notified via options.
+
if (!e.hasAnyFontChanged()) {
return;
}
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/OptionType.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/OptionType.java
index ec75c49e26..b7da0fddd9 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/OptionType.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/options/OptionType.java
@@ -64,6 +64,13 @@ public enum OptionType {
return stringAdapter.objectToString(object);
}
+ /**
+ * Return true if the give value is of the correct type for this option type. Note that a
+ * value of null is compatible with any class type
+ * since it is an acceptable value for any class type.
+ * @param object the object to see if it is compatible with this option type
+ * @return true if the give value is of the correct type for this option type.
+ */
public boolean isCompatible(Object object) {
return object == null || clazz.isAssignableFrom(object.getClass());
}
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/util/ColorUtils.java b/Ghidra/Framework/Generic/src/main/java/ghidra/util/ColorUtils.java
index 3ca088ff02..79d4f26d90 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/ColorUtils.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/ColorUtils.java
@@ -185,7 +185,7 @@ public class ColorUtils {
private static int blend(int colorValue1, int colorValue2, double ratio) {
double value = colorValue1 * ratio + colorValue2 * (1.0 - ratio);
int result = (int) (value + 0.5);
- return Math.max(result, 255);
+ return Math.min(result, 255);
}
/**
diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/util/WebColors.java b/Ghidra/Framework/Generic/src/main/java/ghidra/util/WebColors.java
index 4e309dd970..e8ba4ef344 100644
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/WebColors.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/WebColors.java
@@ -25,7 +25,6 @@ import java.util.Map;
* those strings back to a color.
*/
public abstract class WebColors {
-// private static final Pattern HEX_PATTERN = Pattern.compile("(0x|#)[0-9A-Fa-f]{6}");
private static final Map
* This class is thread safe.
*
diff --git a/Ghidra/Framework/Generic/src/main/java/resources/Icons.java b/Ghidra/Framework/Generic/src/main/java/resources/Icons.java
index d16b78199e..1fbb24eaa0 100644
--- a/Ghidra/Framework/Generic/src/main/java/resources/Icons.java
+++ b/Ghidra/Framework/Generic/src/main/java/resources/Icons.java
@@ -53,7 +53,7 @@ public class Icons {
public static final Icon NOT_ALLOWED_ICON = new GIcon("icon.not.allowed");
public static final Icon OPEN_FOLDER_ICON = new GIcon("icon.folder.open");
- public static final Icon CLOSED_FOLDER_ICON = new GIcon("icon.folder.open");
+ public static final Icon CLOSED_FOLDER_ICON = new GIcon("icon.folder.closed");
public static final Icon REFRESH_ICON = new GIcon("icon.refresh");
public static final Icon SORT_ASCENDING_ICON = new GIcon("icon.sort.ascending");
diff --git a/Ghidra/Framework/Generic/src/main/java/resources/ResourceManager.java b/Ghidra/Framework/Generic/src/main/java/resources/ResourceManager.java
index ccf832795c..05a040d4cb 100644
--- a/Ghidra/Framework/Generic/src/main/java/resources/ResourceManager.java
+++ b/Ghidra/Framework/Generic/src/main/java/resources/ResourceManager.java
@@ -482,7 +482,9 @@ public class ResourceManager {
/**
* Attempts to load an icon from the given path. Returns the icon or null if no icon was
- * found from the given path.
+ * found from the given path. This differs from {@link #loadImage(String)} in that
+ * loadImage will return the default Icon if one can't be found. Further, loadImage will cache
+ * even the default value, while findIcon only caches resolved icons.
*
*
* @param path the icon to load, e.g., "images/home.gif"
diff --git a/Ghidra/Framework/Generic/src/test/java/generic/theme/ColorValueTest.java b/Ghidra/Framework/Generic/src/test/java/generic/theme/ColorValueTest.java
index ce0ef48ba0..662e33e3e5 100644
--- a/Ghidra/Framework/Generic/src/test/java/generic/theme/ColorValueTest.java
+++ b/Ghidra/Framework/Generic/src/test/java/generic/theme/ColorValueTest.java
@@ -57,7 +57,7 @@ public class ColorValueTest {
}
@Test
- public void TestIndirectMultiHopValue() {
+ public void testIndirectMultiHopValue() {
values.addColor(new ColorValue("color.grandparent", Color.RED));
values.addColor(new ColorValue("color.parent", "color.grandparent"));
ColorValue value = new ColorValue("color.test", "color.parent");
@@ -69,7 +69,7 @@ public class ColorValueTest {
}
@Test
- public void TestUnresolvedIndirectValue() {
+ public void testUnresolvedIndirectValue() {
ColorValue value = new ColorValue("color.test", "color.parent");
values.addColor(value);
diff --git a/Ghidra/Framework/Generic/src/test/java/ghidra/util/HTMLUtilitiesTest.java b/Ghidra/Framework/Generic/src/test/java/ghidra/util/HTMLUtilitiesTest.java
index d45c9d2e25..d9fda2ff81 100644
--- a/Ghidra/Framework/Generic/src/test/java/ghidra/util/HTMLUtilitiesTest.java
+++ b/Ghidra/Framework/Generic/src/test/java/ghidra/util/HTMLUtilitiesTest.java
@@ -18,6 +18,8 @@ package ghidra.util;
import static ghidra.util.HTMLUtilities.*;
import static org.junit.Assert.*;
+import java.awt.Color;
+
import org.junit.Before;
import org.junit.Test;
@@ -126,13 +128,13 @@ public class HTMLUtilitiesTest {
@Test
public void testToRGBString() {
- String rgb = HTMLUtilities.toRGBString(WebColors.RED);
+ String rgb = HTMLUtilities.toRGBString(Color.RED);
assertEquals("255000000", rgb);
}
@Test
public void testToHexString() {
- String rgb = HTMLUtilities.toHexString(WebColors.RED);
+ String rgb = HTMLUtilities.toHexString(Color.RED);
assertEquals("#FF0000", rgb);
}
diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java
index 92edb50f97..f7d77557a0 100644
--- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java
+++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java
@@ -321,7 +321,7 @@ class ArticulatedEdgeRouterGhidra Theming Developer Documentation