diff --git a/Ghidra/Debug/Debugger/data/debugger.theme.properties b/Ghidra/Debug/Debugger/data/debugger.theme.properties index a4c9ab42cb..fd4f5fe7fe 100644 --- a/Ghidra/Debug/Debugger/data/debugger.theme.properties +++ b/Ghidra/Debug/Debugger/data/debugger.theme.properties @@ -60,9 +60,137 @@ color.debugger.plugin.resources.breakpoint.marker.disabled = color.debugger.plug color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective = silver color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective = color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective +icon.debugger.object.populated = object-populated.png +icon.debugger.object.unpopulated = object-unpopulated.png +icon.debugger.display.graph = breakpoint-enable.png // TODO this icon was missing 'breakpoints.png' +icon.debugger.display.graph.filtered = icon.debugger.display.graph +icon.debugger.display.xml = text-xml.png +icon.debugger.display.xml.filtered = icon.debugger.display.xml +icon.debugger.display.export.facts = closedFolder.png +icon.debugger.display.export.xml = text-xml.png +icon.debugger.display.import.facts = closedFolder.png +icon.debugger.display.import.xml = text-xml.png +icon.debugger.open.windbg.trace = text-xml.png + +icon.debugger.node.object.empty = icon.debugger.object.unpopulated +icon.debugger.node.object.event = register-marker.png +icon.debugger.node.object.populated = icon.debugger.object.populated +icon.debugger.node.object.running = object-running.png +icon.debugger.node.object.terminated = object-terminated.png + +icon.debugger.table.object = icon.table +icon.debugger.tree.object = icon.debugger.object.unpopulated + +icon.debugger = debugger.png +icon.debugger.connect = connect.png +icon.debugger.disconnect = disconnect.png +icon.debugger.process = process.png +icon.debugger.thread = thread.png +icon.debugger.processor = memory16.gif // TODO this icon was missing 'kcmprocessor.png' +icon.debugger.launch = launch.png +icon.debugger.attach = attach.png +icon.debugger.resume = continue.png +icon.debugger.terminate = stop.png +icon.debugger.kill = kill.png +icon.debugger.detach = detach.png +icon.debugger.record = record.png +icon.debugger.step.into = stepinto.png +icon.debugger.step.over = stepover.png +icon.debugger.step.back = stepback.png +icon.debugger.step.finish = stepout.png +icon.debugger.skip.over = skipover.png +icon.debugger.snap.forward = 2rightarrow.png +icon.debugger.snap.backward = 2leftarrow.png +icon.debugger.seek.present = icon.debugger.resume + +icon.debugger.breakpoint.set = breakpoint-enable.png +icon.debugger.breakpoint.clear = breakpoint-clear.png +icon.debugger.breakpoint.enable = breakpoint-enable.png +icon.debugger.breakpoint.enable.all = breakpoints-enable-all.png +icon.debugger.breakpoint.disable = breakpoint-disable.png +icon.debugger.breakpoint.disable.all = breakpoints-disable-all.png +icon.debugger.breakpoint.clear.all = breakpoints-clear-all.png +icon.debugger.breakpoint.make.effective = breakpoints-make-effective.png + +icon.debugger.provider.listing = Browser.gif +icon.debugger.provider.memory.bytes = binaryData.gif +icon.debugger.provider.console = console.png +icon.debugger.provider.registers = registers.png +icon.debugger.provider.stack = stack.png +icon.debugger.provider.breakpoints = breakpoint-mixed.png +icon.debugger.provider.modules = modules.png +icon.debugger.provider.pcode = stepinto.png +icon.debugger.provider.regions = memory16.gif +icon.debugger.provider.time = time.png +icon.debugger.provider.objects = icon.debugger.object.populated +icon.debugger.provider.model = function_graph.png + +icon.debugger.save = icon.save +icon.debugger.close = x.gif +icon.debugger.add = add.png +icon.debugger.delete = delete.png +icon.debugger.clear = erase16.png +icon.debugger.refresh = view-refresh.png +icon.debugger.filter = filter_off.png +icon.debugger.select.rows = table_go.png +icon.debugger.autoread = autoread.png + + +icon.debugger.refresh.memory = icon.debugger.refresh +icon.debugger.rename.snapshot = icon.debugger.provider.time +icon.debugger.map.identically = doubleArrow.png +icon.debugger.map.modules = modules.png +icon.debugger.map.sections = icon.debugger.map.modules +icon.debugger.map.regions = icon.debugger.map.modules +icon.debugger.block = icon.debugger.map.sections +icon.debugger.select.addresses = text_align_justify.png +icon.debugger.data.types = dataTypes.png +icon.debugger.capture.symbols = closedFolderLabels.png +icon.debugger.log.fatal = edit-bomb.png +icon.debugger.log.error = dialog-warning_red.png +icon.debugger.log.warn = dialog-warning.png +icon.debugger.sync = sync_enabled.png +icon.debugger.visibility = format-text-bold.png +icon.debugger.pin = pin.png +icon.debugger.import = imported_bookmark.gif +icon.debugger.blank = blank.png +icon.debugger.package = debugger32.png +icon.debugger.emulate = icon.debugger.process +icon.debugger.config = conf.png +icon.debugger.toggle = system-switch-user.png + +icon.debugger.diff = table_relationship.png +icon.debugger.diff.previous = up.png +icon.debugger.diff.next = down.png + +icon.debugger.edit.mode.read.only = write-disabled.png +icon.debugger.edit.mode.write.target = write-target.png +icon.debugger.edit.mode.write.trace = write-trace.png +icon.debugger.edit.mode.write.emulator = write-emulator.png + +icon.debugger.marker.register = register-marker.png +icon.debugger.marker.event = icon.debugger.marker.register + +icon.debugger.breakpoint.overlay.inconsistent = breakpoint-overlay-inconsistent.png +icon.debugger.breakpoint.marker.enabled = icon.debugger.breakpoint.enable +icon.debugger.breakpoint.marker.disabled = icon.debugger.breakpoint.disable +icon.debugger.breakpoint.marker.mixed = breakpoint-mixed.png +icon.debugger.breakpoint.marker.ineffective.enabled = breakpoint-enable-ineff.png +icon.debugger.breakpoint.marker.ineffective.disabled = breakpoint-disable-ineff.png +icon.debugger.breakpoint.marker.ineffective.mixed = breakpoint-mixed-ineff.png + +icon.debugger.unique.ref.read = cursor_arrow.gif [rotate(180)] +icon.debugger.unique.ref.write = cursor_arrow.gif + +icon.debugger.select.registers = select-registers.png +icon.debugger.enable.edits = editbytes.gif +icon.debugger.disassemble = editbytes.gif // TODO this icon was missing 'disassemble.png' + + [Dark Defaults] + diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java index d4c561ee3b..8c81153e23 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java @@ -31,6 +31,7 @@ import docking.action.builder.*; import docking.widgets.table.*; import docking.widgets.tree.GTreeNode; import generic.theme.GColor; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.DebuggerPluginPackage; import ghidra.app.plugin.core.debug.gui.breakpoint.DebuggerBreakpointsPlugin; import ghidra.app.plugin.core.debug.gui.console.DebuggerConsolePlugin; @@ -60,127 +61,128 @@ import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import resources.MultiIcon; import resources.ResourceManager; -import resources.icons.RotateIcon; public interface DebuggerResources { String OPTIONS_CATEGORY_DEBUGGER = "Debugger"; String OPTIONS_CATEGORY_WORKFLOW = "Workflow"; - ImageIcon ICON_DEBUGGER = ResourceManager.loadImage("images/debugger.png"); + Icon ICON_DEBUGGER = new GIcon("icon.debugger"); - ImageIcon ICON_CONNECTION = ResourceManager.loadImage("images/connect.png"); - ImageIcon ICON_DISCONNECT = ResourceManager.loadImage("images/disconnect.png"); + Icon ICON_CONNECTION = new GIcon("icon.debugger.connect"); + Icon ICON_DISCONNECT = new GIcon("icon.debugger.disconnect"); - ImageIcon ICON_PROCESS = ResourceManager.loadImage("images/process.png"); - ImageIcon ICON_TRACE = Trace.TRACE_ICON; - ImageIcon ICON_THREAD = ResourceManager.loadImage("images/thread.png"); - ImageIcon ICON_PROGRAM = ProgramContentHandler.PROGRAM_ICON; - ImageIcon ICON_PROCESSOR = ResourceManager.loadImage("images/kcmprocessor.png"); + Icon ICON_PROCESS = new GIcon("icon.debugger.process"); + Icon ICON_TRACE = Trace.TRACE_ICON; + Icon ICON_THREAD = new GIcon("icon.debugger.thread"); + Icon ICON_PROGRAM = ProgramContentHandler.PROGRAM_ICON; + Icon ICON_PROCESSOR = new GIcon("icon.debugger.processor"); - ImageIcon ICON_LAUNCH = ResourceManager.loadImage("images/launch.png"); - ImageIcon ICON_ATTACH = ResourceManager.loadImage("images/attach.png"); - ImageIcon ICON_RESUME = ResourceManager.loadImage("images/resume.png"); - ImageIcon ICON_INTERRUPT = ResourceManager.loadImage("images/interrupt.png"); - ImageIcon ICON_KILL = ResourceManager.loadImage("images/kill.png"); - ImageIcon ICON_DETACH = ResourceManager.loadImage("images/detach.png"); - ImageIcon ICON_RECORD = ResourceManager.loadImage("images/record.png"); + Icon ICON_INTERRUPT = ResourceManager.loadImage("images/interrupt.png"); // TODO do gColor - ImageIcon ICON_STEP_INTO = ResourceManager.loadImage("images/stepinto.png"); - ImageIcon ICON_STEP_OVER = ResourceManager.loadImage("images/stepover.png"); - ImageIcon ICON_SKIP_OVER = ResourceManager.loadImage("images/skipover.png"); - ImageIcon ICON_STEP_FINISH = ResourceManager.loadImage("images/stepout.png"); - ImageIcon ICON_STEP_BACK = ResourceManager.loadImage("images/stepback.png"); - ImageIcon ICON_STEP_LAST = ResourceManager.loadImage("images/steplast.png"); - // TODO: Draw new icons? - ImageIcon ICON_SNAP_FORWARD = ResourceManager.loadImage("images/2rightarrow.png"); - ImageIcon ICON_SNAP_BACKWARD = ResourceManager.loadImage("images/2leftarrow.png"); - ImageIcon ICON_SEEK_PRESENT = ResourceManager.loadImage("images/seek-present.png"); + Icon ICON_LAUNCH = new GIcon("icon.debugger.launch"); + Icon ICON_ATTACH = new GIcon("icon.debugger.attach"); + Icon ICON_RESUME = new GIcon("icon.debugger.resume"); + Icon ICON_TERMINATE = new GIcon("icon.debugger.terminate"); // TODO was this deleted + Icon ICON_KILL = new GIcon("icon.debugger.kill"); + Icon ICON_DETACH = new GIcon("icon.debugger.detach"); + Icon ICON_RECORD = new GIcon("icon.debugger.record"); - ImageIcon ICON_SET_BREAKPOINT = ResourceManager.loadImage("images/breakpoint-enable.png"); - ImageIcon ICON_CLEAR_BREAKPOINT = ResourceManager.loadImage("images/breakpoint-clear.png"); - ImageIcon ICON_ENABLE_BREAKPOINT = ResourceManager.loadImage("images/breakpoint-enable.png"); - ImageIcon ICON_ENABLE_ALL_BREAKPOINTS = - ResourceManager.loadImage("images/breakpoints-enable-all.png"); - ImageIcon ICON_DISABLE_BREAKPOINT = ResourceManager.loadImage("images/breakpoint-disable.png"); - ImageIcon ICON_DISABLE_ALL_BREAKPOINTS = - ResourceManager.loadImage("images/breakpoints-disable-all.png"); - ImageIcon ICON_CLEAR_ALL_BREAKPOINTS = - ResourceManager.loadImage("images/breakpoints-clear-all.png"); - ImageIcon ICON_MAKE_BREAKPOINTS_EFFECTIVE = - ResourceManager.loadImage("images/breakpoints-make-effective.png"); + Icon ICON_STEP_LAST = ResourceManager.loadImage("images/steplast.png"); // TODO GColor + + Icon ICON_STEP_INTO = new GIcon("icon.debugger.step.into"); + Icon ICON_STEP_OVER = new GIcon("icon.debugger.step.over"); + Icon ICON_SKIP_OVER = new GIcon("icon.debugger.step.back"); + Icon ICON_STEP_FINISH = new GIcon("icon.debugger.step.finish"); + Icon ICON_STEP_BACK = new GIcon("icon.debugger.skip.over"); + + Icon ICON_SNAP_FORWARD = new GIcon("icon.debugger.snap.forward"); + Icon ICON_SNAP_BACKWARD = new GIcon("icon.debugger.snap.backward"); + Icon ICON_SEEK_PRESENT = new GIcon("icon.debugger.seek.present"); + + Icon ICON_SET_BREAKPOINT = new GIcon("icon.debugger.breakpoint.set"); + Icon ICON_CLEAR_BREAKPOINT = new GIcon("icon.debugger.breakpoint.clear"); + Icon ICON_ENABLE_BREAKPOINT = new GIcon("icon.debugger.breakpoint.enable"); + Icon ICON_ENABLE_ALL_BREAKPOINTS = + new GIcon("icon.debugger.breakpoint.enable.all"); + Icon ICON_DISABLE_BREAKPOINT = new GIcon("icon.debugger.breakpoint.disable"); + Icon ICON_DISABLE_ALL_BREAKPOINTS = + new GIcon("icon.debugger.breakpoint.disable.all"); + Icon ICON_CLEAR_ALL_BREAKPOINTS = + new GIcon("icon.debugger.breakpoint.clear.all"); + Icon ICON_MAKE_BREAKPOINTS_EFFECTIVE = + new GIcon("icon.debugger.breakpoint.make.effective"); // TODO: Some overlay to indicate dynamic, or new icon altogether - ImageIcon ICON_LISTING = ResourceManager.loadImage("images/Browser.gif"); - ImageIcon ICON_MEMORY_BYTES = ResourceManager.loadImage("images/binaryData.gif"); - ImageIcon ICON_CONSOLE = ResourceManager.loadImage("images/console.png"); - ImageIcon ICON_REGISTERS = ResourceManager.loadImage("images/registers.png"); - ImageIcon ICON_STACK = ResourceManager.loadImage("images/stack.png"); - ImageIcon ICON_BREAKPOINTS = ResourceManager.loadImage("images/breakpoint-mixed.png"); - ImageIcon ICON_MODULES = ResourceManager.loadImage("images/modules.png"); - ImageIcon ICON_MAPPINGS = ICON_PROGRAM; // TODO: A better icon - ImageIcon ICON_PCODE = ResourceManager.loadImage("images/stepinto.png"); // TODO - //ResourceManager.loadImage("images/mappings.png"); - ImageIcon ICON_REGIONS = ResourceManager.loadImage("images/memory16.gif"); - ImageIcon ICON_TIME = ResourceManager.loadImage("images/time.png"); + Icon ICON_LISTING = new GIcon("icon.debugger.provider.listing"); + Icon ICON_MEMORY_BYTES = new GIcon("icon.debugger.provider.memory.bytes"); + Icon ICON_CONSOLE = new GIcon("icon.debugger.provider.console"); + Icon ICON_REGISTERS = new GIcon("icon.debugger.provider.registers"); + Icon ICON_STACK = new GIcon("icon.debugger.provider.stack"); + Icon ICON_BREAKPOINTS = new GIcon("icon.debugger.provider.breakpoints"); + Icon ICON_MODULES = new GIcon("icon.debugger.provider.modules"); + Icon ICON_MAPPINGS = ICON_PROGRAM; // TODO: A better icon + Icon ICON_PCODE = new GIcon("icon.debugger.provider.pcode"); // TODO + Icon ICON_REGIONS = new GIcon("icon.debugger.provider.regions"); + Icon ICON_TIME = new GIcon("icon.debugger.provider.time"); // TODO: Draw a real icon. object-populated duplicates breakpoint-enabled - ImageIcon ICON_OBJECTS = ResourceManager.loadImage("images/object-populated.png"); + Icon ICON_OBJECTS = new GIcon("icon.debugger.provider.objects"); - ImageIcon ICON_SAVE = ResourceManager.loadImage("images/disk.png"); - ImageIcon ICON_CLOSE = ResourceManager.loadImage("images/x.gif"); - ImageIcon ICON_ADD = ResourceManager.loadImage("images/add.png"); - ImageIcon ICON_DELETE = ResourceManager.loadImage("images/delete.png"); - ImageIcon ICON_CLEAR = ResourceManager.loadImage("images/erase16.png"); - ImageIcon ICON_REFRESH = ResourceManager.loadImage("images/view-refresh.png"); - ImageIcon ICON_FILTER = ResourceManager.loadImage("images/filter_off.png"); // Eww. - ImageIcon ICON_SELECT_ROWS = ResourceManager.loadImage("images/table_go.png"); - ImageIcon ICON_AUTOREAD = ResourceManager.loadImage("images/autoread.png"); + Icon ICON_SAVE = new GIcon("icon.debugger.save"); + Icon ICON_CLOSE = new GIcon("icon.debugger.close"); + Icon ICON_ADD = new GIcon("icon.debugger.add"); + Icon ICON_DELETE = new GIcon("icon.debugger.delete"); + Icon ICON_CLEAR = new GIcon("icon.debugger.clear"); + Icon ICON_REFRESH = new GIcon("icon.debugger.refresh"); + Icon ICON_FILTER = new GIcon("icon.debugger.filter"); // Eww. + Icon ICON_SELECT_ROWS = new GIcon("icon.debugger.select.rows"); + Icon ICON_AUTOREAD = new GIcon("icon.debugger.autoread"); - ImageIcon ICON_OBJECT_POPULATED = ResourceManager.loadImage("images/object-populated.png"); - ImageIcon ICON_OBJECT_UNPOPULATED = ResourceManager.loadImage("images/object-unpopulated.png"); + Icon ICON_OBJECT_POPULATED = new GIcon("icon.debugger.object.populated"); + Icon ICON_OBJECT_UNPOPULATED = new GIcon("icon.debugger.object.unpopulated"); // TODO: Draw a real icon. - ImageIcon ICON_REFRESH_MEMORY = ICON_REFRESH; + Icon ICON_REFRESH_MEMORY = new GIcon("icon.debugger.refresh.memory"); - ImageIcon ICON_RENAME_SNAPSHOT = ICON_TIME; + Icon ICON_RENAME_SNAPSHOT = new GIcon("icon.debugger.rename.snapshot"); // TODO: Draw an icon - ImageIcon ICON_MAP_IDENTICALLY = ResourceManager.loadImage("images/doubleArrow.png"); - ImageIcon ICON_MAP_MODULES = ResourceManager.loadImage("images/modules.png"); - ImageIcon ICON_MAP_SECTIONS = ICON_MAP_MODULES; // TODO - ImageIcon ICON_MAP_REGIONS = ICON_MAP_MODULES; // TODO - ImageIcon ICON_BLOCK = ICON_MAP_SECTIONS; // TODO + Icon ICON_MAP_IDENTICALLY = new GIcon("icon.debugger.map.identically"); + Icon ICON_MAP_MODULES = new GIcon("icon.debugger.map.modules"); + Icon ICON_MAP_SECTIONS = new GIcon("icon.debugger.map.sections"); // TODO + Icon ICON_MAP_REGIONS = new GIcon("icon.debugger.map.regions"); // TODO + Icon ICON_BLOCK = new GIcon("icon.debugger.block"); // TODO // TODO: Draw an icon - ImageIcon ICON_SELECT_ADDRESSES = ResourceManager.loadImage("images/text_align_justify.png"); + Icon ICON_SELECT_ADDRESSES = new GIcon("icon.debugger.select.addresses"); // TODO: Draw an icon? - ImageIcon ICON_DATA_TYPES = ResourceManager.loadImage("images/dataTypes.png"); + Icon ICON_DATA_TYPES = new GIcon("icon.debugger.data.types"); // TODO: Draw an icon? - ImageIcon ICON_CAPTURE_SYMBOLS = ResourceManager.loadImage("images/closedFolderLabels.png"); + Icon ICON_CAPTURE_SYMBOLS = new GIcon("icon.debugger.capture.symbols"); - ImageIcon ICON_LOG_FATAL = ResourceManager.loadImage("images/edit-bomb.png"); - ImageIcon ICON_LOG_ERROR = ResourceManager.loadImage("images/dialog-warning_red.png"); - ImageIcon ICON_LOG_WARN = ResourceManager.loadImage("images/dialog-warning.png"); + Icon ICON_LOG_FATAL = new GIcon("icon.debugger.log.fatal"); + Icon ICON_LOG_ERROR = new GIcon("icon.debugger.log.error"); + Icon ICON_LOG_WARN = new GIcon("icon.debugger.log.warn"); - ImageIcon ICON_SYNC = ResourceManager.loadImage("images/sync_enabled.png"); - ImageIcon ICON_VISIBILITY = ResourceManager.loadImage("images/format-text-bold.png"); + Icon ICON_SYNC = new GIcon("icon.debugger.sync"); + Icon ICON_VISIBILITY = new GIcon("icon.debugger.visibility"); - ImageIcon ICON_PIN = ResourceManager.loadImage("images/pin.png"); + Icon ICON_PIN = new GIcon("icon.debugger.pin"); // TODO: Find better icon? - ImageIcon ICON_IMPORT = ResourceManager.loadImage("images/imported_bookmark.gif"); - ImageIcon ICON_BLANK = ResourceManager.loadImage("images/blank.png"); - ImageIcon ICON_PACKAGE = ResourceManager.loadImage("images/debugger32.png"); - ImageIcon ICON_EMULATE = ICON_PROCESS; // TODO - ImageIcon ICON_CONFIG = ResourceManager.loadImage("images/conf.png"); - ImageIcon ICON_TOGGLE = ResourceManager.loadImage("images/system-switch-user.png"); + Icon ICON_IMPORT = new GIcon("icon.debugger.import"); + Icon ICON_BLANK = new GIcon("icon.debugger.blank"); + Icon ICON_PACKAGE = new GIcon("icon.debugger.package"); + Icon ICON_EMULATE = new GIcon("icon.debugger.emulate"); // TODO + Icon ICON_CONFIG = new GIcon("icon.debugger.config"); + Icon ICON_TOGGLE = new GIcon("icon.debugger.toggle"); - ImageIcon ICON_DIFF = ResourceManager.loadImage("images/table_relationship.png"); - ImageIcon ICON_DIFF_PREV = ResourceManager.loadImage("images/up.png"); - ImageIcon ICON_DIFF_NEXT = ResourceManager.loadImage("images/down.png"); + Icon ICON_DIFF = new GIcon("icon.debugger.diff"); + Icon ICON_DIFF_PREV = new GIcon("icon.debugger.diff.previous"); + Icon ICON_DIFF_NEXT = new GIcon("icon.debugger.diff.next"); - ImageIcon ICON_EDIT_MODE_READ_ONLY = ResourceManager.loadImage("images/write-disabled.png"); - ImageIcon ICON_EDIT_MODE_WRITE_TARGET = ResourceManager.loadImage("images/write-target.png"); - ImageIcon ICON_EDIT_MODE_WRITE_TRACE = ResourceManager.loadImage("images/write-trace.png"); - ImageIcon ICON_EDIT_MODE_WRITE_EMULATOR = - ResourceManager.loadImage("images/write-emulator.png"); + Icon ICON_EDIT_MODE_READ_ONLY = new GIcon("icon.debugger.edit.mode.read.only"); + Icon ICON_EDIT_MODE_WRITE_TARGET = new GIcon("icon.debugger.edit.mode.write.target"); + Icon ICON_EDIT_MODE_WRITE_TRACE = new GIcon("icon.debugger.edit.mode.write.trace"); + Icon ICON_EDIT_MODE_WRITE_EMULATOR = + new GIcon("icon.debugger.edit.mode.write.emulator"); String NAME_EDIT_MODE_READ_ONLY = "Control Target w/ Edits Disabled"; String NAME_EDIT_MODE_WRITE_TARGET = "Control Target"; @@ -192,82 +194,82 @@ public interface DebuggerResources { String HELP_ANCHOR_PLUGIN = "plugin"; String TITLE_PROVIDER_BREAKPOINTS = "Breakpoints"; - ImageIcon ICON_PROVIDER_BREAKPOINTS = ICON_BREAKPOINTS; + Icon ICON_PROVIDER_BREAKPOINTS = ICON_BREAKPOINTS; HelpLocation HELP_PROVIDER_BREAKPOINTS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerBreakpointsPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_CONSOLE = "Debug Console"; - ImageIcon ICON_PROVIDER_CONSOLE = ICON_CONSOLE; + Icon ICON_PROVIDER_CONSOLE = ICON_CONSOLE; HelpLocation HELP_PROVIDER_CONSOLE = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerConsolePlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_LISTING = "Dynamic"; - ImageIcon ICON_PROVIDER_LISTING = ICON_LISTING; + Icon ICON_PROVIDER_LISTING = ICON_LISTING; HelpLocation HELP_PROVIDER_LISTING = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerListingPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_MAPPINGS = "Static Mappings"; - ImageIcon ICON_PROVIDER_MAPPINGS = ICON_MAPPINGS; + Icon ICON_PROVIDER_MAPPINGS = ICON_MAPPINGS; HelpLocation HELP_PROVIDER_MAPPINGS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerStaticMappingPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_MEMORY_BYTES = "Memory"; - ImageIcon ICON_PROVIDER_MEMORY_BYTES = ICON_MEMORY_BYTES; + Icon ICON_PROVIDER_MEMORY_BYTES = ICON_MEMORY_BYTES; HelpLocation HELP_PROVIDER_MEMORY_BYTES = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerMemoryBytesPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_MODULES = "Modules"; - ImageIcon ICON_PROVIDER_MODULES = ICON_MODULES; + Icon ICON_PROVIDER_MODULES = ICON_MODULES; HelpLocation HELP_PROVIDER_MODULES = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerModulesPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_PCODE = "Pcode Stepper"; - ImageIcon ICON_PROVIDER_PCODE = ICON_PCODE; + Icon ICON_PROVIDER_PCODE = ICON_PCODE; HelpLocation HELP_PROVIDER_PCODE = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerPcodeStepperPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_REGIONS = "Regions"; - ImageIcon ICON_PROVIDER_REGIONS = ICON_REGIONS; + Icon ICON_PROVIDER_REGIONS = ICON_REGIONS; HelpLocation HELP_PROVIDER_REGIONS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerRegionsPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_REGISTERS = "Registers"; - ImageIcon ICON_PROVIDER_REGISTERS = ICON_REGISTERS; + Icon ICON_PROVIDER_REGISTERS = ICON_REGISTERS; HelpLocation HELP_PROVIDER_REGISTERS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerRegistersPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_TARGETS = "Debugger Targets"; - ImageIcon ICON_PROVIDER_TARGETS = ICON_CONNECTION; // TODO: Same icon as action + Icon ICON_PROVIDER_TARGETS = ICON_CONNECTION; // TODO: Same icon as action HelpLocation HELP_PROVIDER_TARGETS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerTargetsPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_STACK = "Stack"; - ImageIcon ICON_PROVIDER_STACK = ICON_STACK; + Icon ICON_PROVIDER_STACK = ICON_STACK; HelpLocation HELP_PROVIDER_STACK = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerStackPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_THREADS = "Threads"; - ImageIcon ICON_PROVIDER_THREADS = ICON_DEBUGGER; + Icon ICON_PROVIDER_THREADS = ICON_DEBUGGER; HelpLocation HELP_PROVIDER_THREADS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerThreadsPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_TIME = "Time"; - ImageIcon ICON_PROVIDER_TIME = ICON_TIME; + Icon ICON_PROVIDER_TIME = ICON_TIME; HelpLocation HELP_PROVIDER_TIME = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerTimePlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_OBJECTS = "Objects"; - ImageIcon ICON_PROVIDER_OBJECTS = ResourceManager.loadImage("images/time.png"); + Icon ICON_PROVIDER_OBJECTS = new GIcon("icon.debugger.provider.objects"); HelpLocation HELP_PROVIDER_OBJECTS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerObjectsPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_MODEL = "Model"; // TODO: An icon - ImageIcon ICON_PROVIDER_MODEL = ResourceManager.loadImage("images/function_graph.png"); + Icon ICON_PROVIDER_MODEL = new GIcon("icon.debugger.provider.model"); HelpLocation HELP_PROVIDER_MODEL = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerModelPlugin.class), HELP_ANCHOR_PLUGIN); String TITLE_PROVIDER_WATCHES = "Watches"; - ImageIcon ICON_PROVIDER_WATCHES = ICON_AUTOREAD; // TODO: Another icon? + Icon ICON_PROVIDER_WATCHES = ICON_AUTOREAD; // TODO: Another icon? HelpLocation HELP_PROVIDER_WATCHES = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerWatchesPlugin.class), HELP_ANCHOR_PLUGIN); @@ -285,9 +287,9 @@ public interface DebuggerResources { String OPTION_NAME_COLORS_TRACKING_MARKERS = "Colors.Tracking Markers"; Color DEFAULT_COLOR_REGISTER_MARKERS = new GColor("color.debugger.plugin.resources.register.marker"); - ImageIcon ICON_REGISTER_MARKER = ResourceManager.loadImage("images/register-marker.png"); + Icon ICON_REGISTER_MARKER = new GIcon("icon.debugger.marker.register"); - ImageIcon ICON_EVENT_MARKER = ICON_REGISTER_MARKER; // TODO: Another icon? + Icon ICON_EVENT_MARKER = new GIcon("icon.debugger.marker.event"); // TODO: Another icon? // At least rename to "marker-arrow", and then have both ref it. //@formatter:off @@ -332,19 +334,19 @@ public interface DebuggerResources { String NAME_BREAKPOINT_MARKER_INCON_DIS = "Inconsistent Disabled Breakpoint"; String NAME_BREAKPOINT_MARKER_INCON_MIX = "Inconsistent Mixed Breakpoint"; - ImageIcon ICON_BREAKPOINT_OVERLAY_INCONSISTENT = - ResourceManager.loadImage("images/breakpoint-overlay-inconsistent.png"); - ImageIcon ICON_BREAKPOINT_MARKER_ENABLED = ICON_ENABLE_BREAKPOINT; - ImageIcon ICON_BREAKPOINT_MARKER_DISABLED = ICON_DISABLE_BREAKPOINT; - ImageIcon ICON_BREAKPOINT_MARKER_MIXED = - ResourceManager.loadImage("images/breakpoint-mixed.png"); + Icon ICON_BREAKPOINT_OVERLAY_INCONSISTENT = + new GIcon("icon.debugger.breakpoint.overlay.inconsistent"); + Icon ICON_BREAKPOINT_MARKER_ENABLED = new GIcon("icon.debugger.breakpoint.marker.enabled"); + Icon ICON_BREAKPOINT_MARKER_DISABLED = new GIcon("icon.debugger.breakpoint.marker.disabled"); + Icon ICON_BREAKPOINT_MARKER_MIXED = + new GIcon("icon.debugger.breakpoint.marker.mixed"); - ImageIcon ICON_BREAKPOINT_MARKER_INEFF_EN = - ResourceManager.loadImage("images/breakpoint-enable-ineff.png"); - ImageIcon ICON_BREAKPOINT_MARKER_INEFF_DIS = - ResourceManager.loadImage("images/breakpoint-disable-ineff.png"); - ImageIcon ICON_BREAKPOINT_MARKER_INEFF_MIX = - ResourceManager.loadImage("images/breakpoint-mixed-ineff.png"); + Icon ICON_BREAKPOINT_MARKER_INEFF_EN = + new GIcon("icon.debugger.breakpoint.marker.ineffective.enabled"); + Icon ICON_BREAKPOINT_MARKER_INEFF_DIS = + new GIcon("icon.debugger.breakpoint.marker.ineffective.disabled"); + Icon ICON_BREAKPOINT_MARKER_INEFF_MIX = + new GIcon("icon.debugger.breakpoint.marker.ineffective.disabled"); Icon ICON_BREAKPOINT_MARKER_INCON_EN = new MultiIcon(ICON_BREAKPOINT_MARKER_ENABLED, ICON_BREAKPOINT_OVERLAY_INCONSISTENT); @@ -353,9 +355,8 @@ public interface DebuggerResources { Icon ICON_BREAKPOINT_MARKER_INCON_MIX = new MultiIcon(ICON_BREAKPOINT_MARKER_MIXED, ICON_BREAKPOINT_OVERLAY_INCONSISTENT); - Icon ICON_UNIQUE_REF_READ = - new RotateIcon(ResourceManager.loadImage("images/cursor_arrow.gif"), 180); // TODO - ImageIcon ICON_UNIQUE_REF_WRITE = ResourceManager.loadImage("images/cursor_arrow.gif"); // TODO + Icon ICON_UNIQUE_REF_READ = new GIcon("icon.debugger.unique.ref.read"); // TODO + Icon ICON_UNIQUE_REF_WRITE = new GIcon("icon.debugger.unique.ref.write"); // TODO Icon ICON_UNIQUE_REF_RW = new MultiIcon(ICON_UNIQUE_REF_READ, ICON_UNIQUE_REF_WRITE); // TODO //@formatter:off @@ -1045,7 +1046,7 @@ public interface DebuggerResources { String NAME = "Select Registers"; String DESCRIPTION = "Select registers to display/modify"; String GROUP = "aa"; - Icon ICON = ResourceManager.loadImage("images/select-registers.png"); + Icon ICON = new GIcon("icon.debugger.select.registers"); String HELP_ANCHOR = "select_registers"; static ActionBuilder builder(Plugin owner) { @@ -1061,7 +1062,7 @@ public interface DebuggerResources { String NAME = "Clone Window"; String DESCRIPTION = "Create a disconnected copy of this window"; String GROUP = "zzzz"; - Icon ICON = ResourceManager.loadImage("images/camera-photo.png"); + Icon ICON = new GIcon("icon.provider.clone"); String HELP_ANCHOR = "clone_window"; static ActionBuilder builder(Plugin owner) { @@ -1077,7 +1078,7 @@ public interface DebuggerResources { String NAME = "Enable Edits"; String DESCRIPTION = "Enable editing of recorded or live values"; String GROUP = "yyyy2"; - Icon ICON = ResourceManager.loadImage("images/editbytes.gif"); + Icon ICON = new GIcon("icon.debugger.enable.edits"); String HELP_ANCHOR = "enable_edits"; static ToggleActionBuilder builder(Plugin owner) { @@ -1092,7 +1093,7 @@ public interface DebuggerResources { interface DisassembleAsAction { String NAME = "Disassemble as"; String DESCRIPTION = "Disassemble using an alternative language"; - Icon ICON = ResourceManager.loadImage("images/disassemble.png"); + Icon ICON = new GIcon("icon.debugger.disassemble"); String HELP_ANCHOR = "disassemble_as"; static ActionBuilder builder(Plugin owner) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java index 2c928fe299..eb380fbce7 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; @@ -152,7 +152,7 @@ public abstract class AbstractDebuggerWrappedConsoleConnection boxes = new HashSet(); - boxes.add(box); - provider.selectPanelPosition(boxes); - } + table.getSelectionModel().addListSelectionListener(e -> { + if (e.getValueIsAdjusting()) { + return; + } + int modelRow = filterPanel.getModelRow(table.getSelectedRow()); + MemoryBox box = model.getBoxAt(modelRow); + if (box != null) { + Set boxes = new HashSet<>(); + boxes.add(box); + provider.selectPanelPosition(boxes); } }); table.addMouseListener(new MouseAdapter() { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInAAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInAAction.java index cca269873e..3d8862ea1a 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInAAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInAAction.java @@ -15,18 +15,18 @@ */ package ghidra.app.plugin.core.debug.gui.memview.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.memview.MemviewProvider; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class ZoomInAAction extends DockingAction { - private final ImageIcon ICON = ResourceManager.loadImage("images/zoom_in.png"); + private static final Icon ICON = new GIcon("icon.widget.imagepanel.zoom.in"); private MemviewProvider provider; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInTAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInTAction.java index 0effc0c1fe..71550db354 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInTAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomInTAction.java @@ -15,18 +15,18 @@ */ package ghidra.app.plugin.core.debug.gui.memview.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.memview.MemviewProvider; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class ZoomInTAction extends DockingAction { - private final ImageIcon ICON = ResourceManager.loadImage("images/zoom_in.png"); + private static final Icon ICON = new GIcon("icon.widget.imagepanel.zoom.in"); private MemviewProvider provider; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutAAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutAAction.java index f3174c729c..84a6aec075 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutAAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutAAction.java @@ -15,18 +15,18 @@ */ package ghidra.app.plugin.core.debug.gui.memview.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.memview.MemviewProvider; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class ZoomOutAAction extends DockingAction { - private final ImageIcon ICON = ResourceManager.loadImage("images/zoom_out.png"); + private static final Icon ICON = new GIcon("icon.widget.imagepanel.zoom.out"); private MemviewProvider provider; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutTAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutTAction.java index 0243042d94..3f914dfbba 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutTAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/actions/ZoomOutTAction.java @@ -15,18 +15,18 @@ */ package ghidra.app.plugin.core.debug.gui.memview.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.memview.MemviewProvider; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class ZoomOutTAction extends DockingAction { - private final ImageIcon ICON = ResourceManager.loadImage("images/zoom_out.png"); + private static final Icon ICON = new GIcon("icon.widget.imagepanel.zoom.out"); private MemviewProvider provider; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java index 94aab1d014..6518ac2d9f 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java @@ -19,10 +19,11 @@ import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.KeyBindingData; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.services.GraphDisplayBroker; @@ -33,13 +34,12 @@ import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.exception.GraphException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; public class DisplayAsGraphAction extends DisplayAsAction { protected GraphDisplayBroker graphBroker; - protected static ImageIcon ICON_GRAPH = ResourceManager.loadImage("images/breakpoints.png"); + protected static final Icon ICON_GRAPH = new GIcon("icon.debugger.display.graph"); public DisplayAsGraphAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("DisplayGraph", tool, owner, provider); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java index 2c91a29bbe..5d302c7e97 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java @@ -18,12 +18,13 @@ package ghidra.app.plugin.core.debug.gui.objects.actions; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import javax.swing.ImageIcon; +import javax.swing.Icon; import org.jdom.Element; import docking.action.KeyBindingData; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.services.ConsoleService; @@ -31,12 +32,11 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; import ghidra.util.Msg; import ghidra.util.xml.XmlUtilities; -import resources.ResourceManager; public class DisplayAsXMLAction extends DisplayAsAction { protected ConsoleService consoleService; - protected ImageIcon ICON_XML = ResourceManager.loadImage("images/text-xml.png");; + protected static final Icon ICON_XML = new GIcon("icon.debugger.display.xml"); public DisplayAsXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("DisplayXml", tool, owner, provider); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java index c6c1435bf1..3c18478b73 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java @@ -20,10 +20,11 @@ import java.awt.event.KeyEvent; import java.util.List; import java.util.Set; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.KeyBindingData; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.services.GraphDisplayBroker; @@ -34,13 +35,12 @@ import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.exception.GraphException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; public class DisplayFilteredGraphAction extends DisplayFilteredAction { protected GraphDisplayBroker graphBroker; - protected static ImageIcon ICON_GRAPH = ResourceManager.loadImage("images/breakpoints.png"); + protected static final Icon ICON_GRAPH = new GIcon("icon.debugger.display.xml.filtered"); public DisplayFilteredGraphAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java index 655b050b27..9ae256bd59 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java @@ -19,13 +19,14 @@ import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import org.apache.commons.lang3.StringUtils; import org.jdom.Element; import docking.action.KeyBindingData; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.services.ConsoleService; @@ -33,12 +34,11 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; import ghidra.util.Msg; import ghidra.util.xml.XmlUtilities; -import resources.ResourceManager; public class DisplayFilteredXMLAction extends DisplayFilteredAction { protected ConsoleService consoleService; - protected ImageIcon ICON_XML = ResourceManager.loadImage("images/text-xml.png");; + protected static final Icon ICON_XML = new GIcon("icon.debugger.display.xml.filtered"); public DisplayFilteredXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java index 419ddd2bfd..348e19aaa4 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java @@ -21,17 +21,17 @@ import java.io.*; import java.util.HashMap; import java.util.Map; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.filechooser.GhidraFileChooserMode; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.dbg.target.TargetObject; import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class ExportAsFactsAction extends ImportExportAsAction { @@ -39,8 +39,8 @@ public class ExportAsFactsAction extends ImportExportAsAction { public static String JOIN = "."; public static String SPLIT = "\\."; public static String fileExt2 = ".facts"; - protected ImageIcon ICON_FACTS = ResourceManager.loadImage("images/closedFolder.png"); - private Map files = new HashMap(); + protected static final Icon ICON_FACTS = new GIcon("icon.debugger.display.export.facts"); + private Map files = new HashMap<>(); public ExportAsFactsAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("ExportAsFacts", tool, owner, provider); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java index e4a1331c0c..71be677be1 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java @@ -20,7 +20,7 @@ import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; -import javax.swing.ImageIcon; +import javax.swing.Icon; import org.apache.commons.lang3.StringUtils; import org.jdom.Document; @@ -29,16 +29,16 @@ import org.jdom.Element; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.filechooser.GhidraFileChooserMode; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; import ghidra.util.xml.XmlUtilities; -import resources.ResourceManager; public class ExportAsXMLAction extends ImportExportAsAction { - protected ImageIcon ICON_XML = ResourceManager.loadImage("images/text-xml.png"); + protected static final Icon ICON_XML = new GIcon("icon.debugger.display.export.xml"); public ExportAsXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("ExportAsXML", tool, owner, provider); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java index 0515bce7af..9656c25871 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java @@ -20,26 +20,26 @@ import java.awt.event.KeyEvent; import java.io.*; import java.util.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.SwingUtilities; import docking.ActionContext; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.filechooser.GhidraFileChooserMode; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject; import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; import ghidra.util.Msg; -import resources.ResourceManager; public class ImportFromFactsAction extends ImportExportAsAction { - protected ImageIcon ICON_FACTS = ResourceManager.loadImage("images/closedFolder.png"); + protected static final Icon ICON_FACTS = new GIcon("icon.debugger.display.import.facts"); private Map> maps = - new LinkedHashMap>(); + new LinkedHashMap<>(); public ImportFromFactsAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("ImportFromFacts", tool, owner, provider); @@ -75,7 +75,7 @@ public class ImportFromFactsAction extends ImportExportAsAction { for (File f : dir.listFiles()) { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f))); - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); String name = f.getName(); name = name.substring(0, name.indexOf(ExportAsFactsAction.fileExt2)); maps.put(name, map); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java index af97a71ece..7fa6be2a47 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java @@ -21,7 +21,7 @@ import java.io.*; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.SwingUtilities; import org.jdom.Attribute; @@ -32,6 +32,7 @@ import docking.ActionContext; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.filechooser.GhidraFileChooserMode; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject; @@ -40,11 +41,10 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; import ghidra.util.Msg; import ghidra.util.xml.XmlUtilities; -import resources.ResourceManager; public class ImportFromXMLAction extends ImportExportAsAction { - protected ImageIcon ICON_XML = ResourceManager.loadImage("images/text-xml.png"); + protected static final Icon ICON_XML = new GIcon("icon.debugger.display.import.xml"); public ImportFromXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { super("ImportFromXML", tool, owner, provider); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java index 1b80c5877d..a46320c874 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java @@ -21,13 +21,14 @@ import java.io.File; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.SwingUtilities; import docking.ActionContext; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.filechooser.GhidraFileChooserMode; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.async.AsyncUtils; @@ -38,11 +39,10 @@ import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; import ghidra.dbg.target.TargetObject; import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; -import resources.ResourceManager; public class OpenWinDbgTraceAction extends ImportExportAsAction { - protected ImageIcon ICON_TRACE = ResourceManager.loadImage("images/text-xml.png"); + protected static final Icon ICON_TRACE = new GIcon("icon.debugger.open.windbg.trace"); private ActionContext context; public OpenWinDbgTraceAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { @@ -66,23 +66,20 @@ public class OpenWinDbgTraceAction extends ImportExportAsAction { if (f == null) { return; } - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - String[] args = new String[2]; - args[0] = ".opendump"; - args[1] = f.getAbsolutePath(); - AtomicReference launcher = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - TargetObject obj = provider.getObjectFromContext(context); - DebugModelConventions.findSuitable(TargetLauncher.class, obj).handle(seq::next); - }, launcher).then(seq -> { - launcher.get() - .launch(Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, args)) - .handle(seq::next); - seq.exit(); - }).finish(); - } + SwingUtilities.invokeLater(() -> { + String[] args = new String[2]; + args[0] = ".opendump"; + args[1] = f.getAbsolutePath(); + AtomicReference launcher = new AtomicReference<>(); + AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { + TargetObject obj = provider.getObjectFromContext(context); + DebugModelConventions.findSuitable(TargetLauncher.class, obj).handle(seq::next); + }, launcher).then(seq -> { + launcher.get() + .launch(Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, args)) + .handle(seq::next); + seq.exit(); + }).finish(); }); } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java index 813045526a..6d3320822c 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java @@ -19,9 +19,9 @@ import java.util.*; import java.util.concurrent.*; import javax.swing.Icon; -import javax.swing.ImageIcon; import docking.widgets.tree.*; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.dbg.target.*; @@ -29,17 +29,14 @@ import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode - static final ImageIcon ICON_POPULATED = - ResourceManager.loadImage("images/object-populated.png"); - static final ImageIcon ICON_EMPTY = ResourceManager.loadImage("images/object-unpopulated.png"); - static final ImageIcon ICON_RUNNING = ResourceManager.loadImage("images/object-running.png"); - static final ImageIcon ICON_TERMINATED = - ResourceManager.loadImage("images/object-terminated.png"); - static final ImageIcon ICON_EVENT = ResourceManager.loadImage("images/register-marker.png"); + static final Icon ICON_POPULATED = new GIcon("icon.debugger.node.object.populated"); + static final Icon ICON_EMPTY = new GIcon("icon.debugger.node.object.empty"); + static final Icon ICON_RUNNING = new GIcon("icon.debugger.node.object.running"); + static final Icon ICON_TERMINATED = new GIcon("icon.debugger.node.object.terminated"); + static final Icon ICON_EVENT = new GIcon("icon.debugger.node.object.event"); private ObjectContainer container; private String name; @@ -212,26 +209,20 @@ public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode public void callUpdate() { // NB: this has to be in its own thread - CompletableFuture.runAsync(new Runnable() { - @Override - public void run() { - List updateNodes = tree.update(container); - if (isRestructured()) { - setChildren(updateNodes); - } + CompletableFuture.runAsync(() -> { + List updateNodes = tree.update(container); + if (isRestructured()) { + setChildren(updateNodes); } }); } public void callModified() { // NB: this has to be in its own thread - CompletableFuture.runAsync(new Runnable() { - @Override - public void run() { - List updateNodes = tree.update(container); - for (GTreeNode n : updateNodes) { - n.fireNodeChanged(); - } + CompletableFuture.runAsync(() -> { + List updateNodes = tree.update(container); + for (GTreeNode n : updateNodes) { + n.fireNodeChanged(); } }); } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java index 0090f348c6..9b93643e92 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java @@ -20,21 +20,19 @@ import java.awt.event.MouseEvent; import java.util.*; import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import docking.widgets.table.AbstractSortedTableModel; import docking.widgets.table.EnumeratedColumnTableModel; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.dbg.target.TargetObject; import ghidra.util.Swing; import ghidra.util.table.GhidraTable; -import resources.ResourceManager; public class ObjectTable implements ObjectPane { - public static final ImageIcon ICON_TABLE = ResourceManager.loadImage("images/table.png"); + public static final Icon ICON_TABLE = new GIcon("icon.debugger.table.object"); private ObjectContainer container; private Class clazz; @@ -50,15 +48,12 @@ public class ObjectTable implements ObjectPane { this.clazz = clazz; this.model = model; - table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - if (e.getValueIsAdjusting()) { - return; - } - DebuggerObjectsProvider provider = container.getProvider(); - provider.getTool().contextChanged(provider); + table.getSelectionModel().addListSelectionListener(e -> { + if (e.getValueIsAdjusting()) { + return; } + DebuggerObjectsProvider provider = container.getProvider(); + provider.getTool().contextChanged(provider); }); table.addMouseListener(new MouseAdapter() { @Override diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java index d0a19529d9..c24777a8c1 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java @@ -21,7 +21,7 @@ import java.awt.event.MouseEvent; import java.util.*; import java.util.concurrent.atomic.AtomicReference; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; @@ -33,6 +33,7 @@ import docking.widgets.tree.GTreeNode; import docking.widgets.tree.support.GTreeSelectionEvent; import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin; import docking.widgets.tree.support.GTreeSelectionListener; +import generic.theme.GIcon; import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; import ghidra.async.AsyncUtils; @@ -40,14 +41,13 @@ import ghidra.async.TypeSpec; import ghidra.dbg.DebugModelConventions; import ghidra.dbg.target.TargetAccessConditioned; import ghidra.dbg.target.TargetObject; -import ghidra.util.*; +import ghidra.util.Msg; +import ghidra.util.Swing; import ghidra.util.task.SwingUpdateManager; -import resources.ResourceManager; public class ObjectTree implements ObjectPane { - public static final ImageIcon ICON_TREE = - ResourceManager.loadImage("images/object-unpopulated.png"); + public static final Icon ICON_TREE = new GIcon("icon.debugger.tree.object"); private ObjectNode root; private GTree tree; @@ -118,16 +118,12 @@ public class ObjectTree implements ObjectPane { } }); tree.setCellRenderer(new ObjectTreeCellRenderer(root.getProvider())); - tree.setDataTransformer(new FilterTransformer() { - - @Override - public List transform(GTreeNode t) { - if (t instanceof ObjectNode) { - ObjectNode node = (ObjectNode) t; - return List.of(node.getContainer().getDecoratedName()); - } - return null; + tree.setDataTransformer(t -> { + if (t instanceof ObjectNode) { + ObjectNode node = (ObjectNode) t; + return List.of(node.getContainer().getDecoratedName()); } + return null; }); tree.addTreeExpansionListener(new TreeExpansionListener() { @@ -329,7 +325,7 @@ public class ObjectTree implements ObjectPane { } Set currentChildren = container.getCurrentChildren(); - List childList = new ArrayList(); + List childList = new ArrayList<>(); node.setRestructured(false); for (ObjectContainer c : currentChildren) { diff --git a/Ghidra/Features/Base/certification.manifest b/Ghidra/Features/Base/certification.manifest index 1af2bdf6af..e89749965e 100644 --- a/Ghidra/Features/Base/certification.manifest +++ b/Ghidra/Features/Base/certification.manifest @@ -1002,7 +1002,6 @@ src/main/resources/images/cloudbar.jpg||GHIDRA||reviewed||END| src/main/resources/images/cloudbarReversed.jpg||GHIDRA||reviewed||END| src/main/resources/images/codeInView.gif||GHIDRA||||END| src/main/resources/images/codeNotInView.gif||GHIDRA||||END| -src/main/resources/images/collapse.gif||GHIDRA||||END| src/main/resources/images/conflictKeep.png||GHIDRA||||END| src/main/resources/images/conflictRename.png||GHIDRA||||END| src/main/resources/images/conflictReplace.png||GHIDRA||||END| @@ -1033,7 +1032,6 @@ src/main/resources/images/emptyFragment.gif||GHIDRA||||END| src/main/resources/images/emptyFragmentInView.gif||GHIDRA||||END| src/main/resources/images/enum.png||GHIDRA||||END| src/main/resources/images/erase16.png||GHIDRA||||END| -src/main/resources/images/expand.gif||GHIDRA||||END| src/main/resources/images/famfamfam_silk_icons_v013/application_cascade.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/application_get.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/application_key.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| @@ -1052,7 +1050,6 @@ src/main/resources/images/famfamfam_silk_icons_v013/cup.png||FAMFAMFAM Icons - C src/main/resources/images/famfamfam_silk_icons_v013/database.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/door.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/door_open.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| -src/main/resources/images/famfamfam_silk_icons_v013/drive.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/folder_brick.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/folder_table.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/famfamfam_silk_icons_v013/html.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| @@ -1092,9 +1089,7 @@ src/main/resources/images/ledgreen.png||Nuvola Icons - LGPL 2.1|||Nuvola icon se src/main/resources/images/ledred.png||Nuvola Icons - LGPL 2.1|||Nuvola icon set|END| src/main/resources/images/ledyellow.png||Nuvola Icons - LGPL 2.1|||Nuvola icon set|END| src/main/resources/images/link.png||Nuvola Icons - LGPL 2.1|||Nuvola icon set|END| -src/main/resources/images/list-remove.png||Oxygen Icons - LGPL 3.0||||END| src/main/resources/images/lock.gif||GHIDRA||||END| -src/main/resources/images/lock.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/magnifier.png||FAMFAMFAM Icons - CC 2.5||||END| src/main/resources/images/media-flash.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/media-playback-stop.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| @@ -1136,7 +1131,6 @@ src/main/resources/images/oxygen/16x16/text-x-bibtex.png||Oxygen Icons - LGPL 3. src/main/resources/images/oxygen/16x16/text-x-c++src.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/oxygen/16x16/text-x-chdr.png||Oxygen Icons - LGPL 3.0||||END| src/main/resources/images/oxygen/16x16/text-x-csharp.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| -src/main/resources/images/oxygen/16x16/text-x-csrc.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/oxygen/16x16/text-x-pascal.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/oxygen/16x16/text-xml.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/oxygen/48x48/multimedia-player-apple-ipod.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| @@ -1150,8 +1144,6 @@ src/main/resources/images/pencil16.png||GHIDRA||||END| src/main/resources/images/phone.png||Oxygen Icons - LGPL 3.0||||END| src/main/resources/images/pin.png||GHIDRA||||END| src/main/resources/images/pinkX.gif||GHIDRA||||END| -src/main/resources/images/plasma.png||Oxygen Icons - LGPL 3.0||||END| -src/main/resources/images/play.png||GHIDRA||||END| src/main/resources/images/play_again.png||GHIDRA||||END| src/main/resources/images/preferences-system.png||Tango Icons - Public Domain|||tango|END| src/main/resources/images/question_zero.png||GHIDRA||||END| @@ -1176,6 +1168,7 @@ src/main/resources/images/table_delete.png||FAMFAMFAM Icons - CC 2.5|||famfamfam src/main/resources/images/table_go.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/table_row_delete.png||FAMFAMFAM Icons - CC 2.5|||silk|END| src/main/resources/images/tag_yellow.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| +src/main/resources/images/text-x-csrc.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/text_list_bullets.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/text_lowercase.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/textfield.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| @@ -1200,9 +1193,6 @@ src/main/resources/images/wizard.png||Nuvola Icons - LGPL 2.1|||nuvola|END| src/main/resources/images/x-office-document-template.png||Tango Icons - Public Domain|||tango icon set|END| src/main/resources/images/x.gif||GHIDRA||||END| src/main/resources/images/xor.png||GHIDRA||||END| -src/main/resources/images/zoom.png||FAMFAMFAM Icons - CC 2.5|||silk|END| -src/main/resources/images/zoom_in.png||FAMFAMFAM Icons - CC 2.5|||silk|END| -src/main/resources/images/zoom_out.png||FAMFAMFAM Icons - CC 2.5|||silk|END| src/main/resources/pcodetest/chunk1.hinc||GHIDRA||||END| src/main/resources/pcodetest/chunk2.hinc||GHIDRA||||END| src/main/resources/pcodetest/chunk3.hinc||GHIDRA||||END| diff --git a/Ghidra/Features/Base/data/base.icons.theme.properties b/Ghidra/Features/Base/data/base.icons.theme.properties index 222ce7940a..3a6f387611 100644 --- a/Ghidra/Features/Base/data/base.icons.theme.properties +++ b/Ghidra/Features/Base/data/base.icons.theme.properties @@ -9,6 +9,7 @@ icon.base.hover.off = hoverOff.gif icon.base.hover.on = hoverOn.gif icon.base.lock = lock.gif icon.base.unlock = unlock.gif +icon.base.source.c = text-x-csrc.png icon.base.search.marker = searchm_obj.gif @@ -107,7 +108,7 @@ icon.plugin.enum.editor.apply = icon.save icon.plugin.enum.editor.delete = icon.base.delete icon.plugin.enum.editor.home = icon.home -icon.plugin.console.provider = monitor.png +icon.plugin.console.provider = icon.console icon.plugin.console.clear = icon.clear icon.plugin.console.scroll.lock = lock.png @@ -178,7 +179,7 @@ icon.plugin.instructiontable.manual.entry = icon.base.edit.bytes icon.plugin.instructiontable.binary = binaryData.gif icon.plugin.instructiontable.hex = hexData.png -icon.plugin.interpreter.provider = monitor.png +icon.plugin.interpreter.provider = icon.console icon.plugin.locationreferences.highlight = tag_yellow.png @@ -260,8 +261,8 @@ icon.plugin.register.provider = icon.plugin.register.group icon.plugin.scalartable.provider = dataW.gif -icon.plugin.scriptmanager.provider = play.png -icon.plugin.scriptmanager.run = play.png +icon.plugin.scriptmanager.provider = icon.run +icon.plugin.scriptmanager.run = icon.run icon.plugin.scriptmanager.run.again = play_again.png icon.plugin.scriptmanager.edit = accessories-text-editor.png icon.plugin.scriptmanager.edit.eclipse = eclipse.png @@ -275,7 +276,7 @@ icon.plugin.scriptmanager.api = red-cross.png icon.plugin.stringtable.provider = kmessedwords.png icon.plugin.stringtable.defined = font.png icon.plugin.stringtable.defined.partial = dialog-warning.png -icon.plugin.stringtable.undefined = magnifier.png +icon.plugin.stringtable.undefined = icon.search icon.plugin.stringtable.words = view-filter.png icon.plugin.stringtable.conflicts = dialog-warning_red.png @@ -317,7 +318,7 @@ icon.plugin.symboltable.instructions.from = I.gif icon.plugin.symboltable.data.from = D.gif icon.plugin.symboltable.referencetable.provider = table_go.png -icon.plugin.table.service = magnifier.png +icon.plugin.table.service = icon.search icon.plugin.table.service.marker = icon.base.search.marker icon.plugin.table.delete.row = table_delete.png @@ -326,7 +327,7 @@ icon.plugin.totd.provider = help-hint.png icon.plugin.viewstrings.provider = dataW.gif icon.plugin.debug.dbviewer.provider = zoom.png -icon.plugin.debug.domaineventviewer.provider = monitor.png +icon.plugin.debug.domaineventviewer.provider = icon.console icon.plugin.debug.propertymanager.provider = document-properties.png icon.plugin.debug.propertymanager.marker = searchm_pink.gif diff --git a/Ghidra/Features/Base/data/file_extension_icons.xml b/Ghidra/Features/Base/data/file_extension_icons.xml index 50b56ac3ea..a7c59dcf98 100644 --- a/Ghidra/Features/Base/data/file_extension_icons.xml +++ b/Ghidra/Features/Base/data/file_extension_icons.xml @@ -2,7 +2,7 @@ - + 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 c0f36ce47c..537ca427a9 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 @@ -28,11 +28,12 @@ import javax.swing.table.AbstractTableModel; import org.jdom.Element; +import docking.DropDownMenuIcon; import docking.widgets.checkbox.GCheckBox; import docking.widgets.combobox.GhidraComboBox; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; -import generic.theme.GIcon; +import generic.theme.GColor; import generic.theme.GThemeDefaults.Colors; import generic.theme.GThemeDefaults.Colors.Java; import ghidra.app.util.AddressInput; @@ -47,7 +48,8 @@ import ghidra.util.layout.PairLayout; class EditMemoryReferencePanel extends EditReferencePanel { - private static final Icon PULLDOWN_ICON = new GIcon("icon.pulldown"); + 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 RefType[] MEM_REF_TYPES = RefTypeFactory.getMemoryRefTypes(); @@ -102,7 +104,7 @@ class EditMemoryReferencePanel extends EditReferencePanel { toAddressField = new AddressInput(); - addrHistoryButton = new JButton(PULLDOWN_ICON); + addrHistoryButton = new JButton(MENU_ICON); addrHistoryButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ImageFactoryField.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ImageFactoryField.java index cea5fb2df7..4aa0f249f6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ImageFactoryField.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/ImageFactoryField.java @@ -1,6 +1,5 @@ /* ### * IP: GHIDRA - * REVIEWED: YES * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +15,15 @@ */ package ghidra.app.util.viewer.field; -import ghidra.app.util.viewer.format.FieldFormatModel; -import ghidra.app.util.viewer.proxy.EmptyProxy; -import ghidra.app.util.viewer.proxy.ProxyObj; - import java.awt.FontMetrics; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.widgets.fieldpanel.field.SimpleImageField; import docking.widgets.fieldpanel.support.FieldLocation; +import ghidra.app.util.viewer.format.FieldFormatModel; +import ghidra.app.util.viewer.proxy.EmptyProxy; +import ghidra.app.util.viewer.proxy.ProxyObj; /** * Class for displaying images in fields. @@ -33,77 +31,69 @@ import docking.widgets.fieldpanel.support.FieldLocation; public class ImageFactoryField extends SimpleImageField implements ListingField { private FieldFactory factory; - private ProxyObj proxy; + private ProxyObj proxy; - /** - * Constructor - * @param factory the FieldFactory that generated this field. - * @param icon the ImageIcon to display. - * @param proxy the object that this field represents. - * @param metrics the FontMetrics used to render. - * @param x the starting x position for this field. - * @param width the width of this field. - */ - public ImageFactoryField(FieldFactory factory, - ImageIcon icon, - ProxyObj proxy, - FontMetrics metrics, - int x, - int width) { - this(factory, icon, proxy, metrics, x, width, false); - } + /** + * Constructor + * @param factory the FieldFactory that generated this field. + * @param icon the ImageIcon to display. + * @param proxy the object that this field represents. + * @param metrics the FontMetrics used to render. + * @param x the starting x position for this field. + * @param width the width of this field. + */ + public ImageFactoryField(FieldFactory factory, + Icon icon, + ProxyObj proxy, + FontMetrics metrics, + int x, + int width) { + this(factory, icon, proxy, metrics, x, width, false); + } - /** - * Constructor - * @param factory the FieldFactory that generated this field. - * @param icon the ImageIcon to display. - * @param proxy the object that this field represents. - * @param metrics the FontMetrics used to render. - * @param x the starting x position for this field. - * @param width the width of this field. - * @param center centers the image if true. - */ - public ImageFactoryField(FieldFactory factory, - ImageIcon icon, - ProxyObj proxy, - FontMetrics metrics, - int x, - int width, - boolean center) { + /** + * Constructor + * @param factory the FieldFactory that generated this field. + * @param icon the ImageIcon to display. + * @param proxy the object that this field represents. + * @param metrics the FontMetrics used to render. + * @param x the starting x position for this field. + * @param width the width of this field. + * @param center centers the image if true. + */ + public ImageFactoryField(FieldFactory factory, + Icon icon, + ProxyObj proxy, + FontMetrics metrics, + int x, + int width, + boolean center) { super(icon, metrics, x, 0, width, center); this.factory = factory; this.proxy = proxy; - } + } - /** - * Returns the FieldFactory that generated this Field. - */ + @Override public FieldFactory getFieldFactory() { - return factory; - } + return factory; + } - /** - * Returns the model that contains the FieldFactory that generated this Field. - */ + @Override public FieldFormatModel getFieldModel() { - return factory.getFieldModel(); - } + return factory.getFieldModel(); + } - /** - * Returns the object that this field is associated with. - */ - public ProxyObj getProxy() { + @Override + public ProxyObj getProxy() { if (proxy == null) { return EmptyProxy.EMPTY_PROXY; } - return proxy; - } + return proxy; + } - /** - * @see ListingField#getClickedObject(FieldLocation) - */ - public Object getClickedObject( FieldLocation fieldLocation ) { - return this; - } + @Override + public Object getClickedObject(FieldLocation fieldLocation) { + return this; + } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java index 553d6a1db8..fd74443260 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java @@ -63,7 +63,6 @@ import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; import help.Help; import help.HelpService; -import resources.ResourceManager; /** * Panel that displays two listings for comparison. @@ -98,8 +97,8 @@ public class ListingCodeComparisonPanel private static final Icon CURSOR_LOC_ICON = new GIcon("icon.base.util.listingcompare.cursor"); //@formatter:on - private static final Icon HOVER_ON_ICON = new GIcon("icon.base.util.listingcompare.hover.off"); - private static final Icon HOVER_OFF_ICON = ResourceManager.loadImage("images/hoverOff.gif"); + private static final Icon HOVER_ON_ICON = new GIcon("icon.base.util.listingcompare.hover.on"); + private static final Icon HOVER_OFF_ICON = new GIcon("icon.base.util.listingcompare.hover.off"); private static final String ALL_AREA_MARKERS = "All Area Markers"; private static final String UNMATCHED_AREA_MARKERS = "Unmatched Area Markers"; diff --git a/Ghidra/Features/Base/src/main/resources/images/oxygen/16x16/text-x-csrc.png b/Ghidra/Features/Base/src/main/resources/images/text-x-csrc.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/oxygen/16x16/text-x-csrc.png rename to Ghidra/Features/Base/src/main/resources/images/text-x-csrc.png diff --git a/Ghidra/Features/BytePatterns/certification.manifest b/Ghidra/Features/BytePatterns/certification.manifest index 67172590b3..5d7f4c0f6d 100644 --- a/Ghidra/Features/BytePatterns/certification.manifest +++ b/Ghidra/Features/BytePatterns/certification.manifest @@ -1,6 +1,7 @@ ##VERSION: 2.0 ##MODULE IP: Oxygen Icons - LGPL 3.0 Module.manifest||GHIDRA||reviewed||END| +data/bytepatterns.theme.properties||GHIDRA||||END| data/test/FileBitPatternInfoReaderTestFile1.xml||GHIDRA||||END| data/test/FileBitPatternInfoReaderTestFile2.xml||GHIDRA||||END| ghidra_scripts/DumpFunctionPatternInfoScript.properties||GHIDRA||||END| diff --git a/Ghidra/Features/BytePatterns/data/bytepatterns.theme.properties b/Ghidra/Features/BytePatterns/data/bytepatterns.theme.properties new file mode 100644 index 0000000000..2991f66d52 --- /dev/null +++ b/Ghidra/Features/BytePatterns/data/bytepatterns.theme.properties @@ -0,0 +1,17 @@ + +[Defaults] + +icon.bytepatterns.send.to.clipboard = 2rightarrow.png + +icon.bytepatterns.byte.sequence.analyzer.clipboard.merged = smallRightArrow.png +icon.bytepatterns.byte.sequence.analyzer.merge = xor.png + +icon.bytepatterns.closed.pattern = 2rightarrow.png + +icon.bytepatterns.pattern.mining.analyzer = magnifier.png + +icon.bytepatterns.function.bit.patterns.disabled = ledred.png +icon.bytepatterns.function.bit.patterns.enabled = ledgreen.png + +[Dark Defaults] + diff --git a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ByteSequenceAnalyzerProvider.java b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ByteSequenceAnalyzerProvider.java index dee5126f7a..be54566d49 100644 --- a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ByteSequenceAnalyzerProvider.java +++ b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ByteSequenceAnalyzerProvider.java @@ -26,11 +26,11 @@ import docking.action.DockingAction; import docking.action.MenuData; import docking.widgets.table.GFilterTable; import generic.theme.GColor; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors; import ghidra.bitpatterns.info.*; import ghidra.util.HelpLocation; import ghidra.util.bytesearch.DittedBitSequence; -import resources.ResourceManager; /** * This is a base class for providers which allow the user to analyze sequences of bytes. @@ -158,7 +158,7 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid } }; - ImageIcon icon = ResourceManager.loadImage("images/2rightarrow.png"); + Icon icon = new GIcon("icon.bytepatterns.send.to.clipboard"); sendSelectedToClipboardAction.setPopupMenuData( new MenuData(new String[] { "Send Selected to Clipboard" }, icon)); sendSelectedToClipboardAction.setDescription( @@ -196,7 +196,7 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid } }; - ImageIcon icon = ResourceManager.loadImage("images/xor.png"); + Icon icon = new GIcon("icon.bytepatterns.byte.sequence.analyzer.merge"); mergeAction.setPopupMenuData(new MenuData(new String[] { "Merge Selected Rows" }, icon)); mergeAction.setDescription("Merges the currently selected rows"); mergeAction.setHelpLocation( @@ -234,7 +234,7 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid } }; - ImageIcon icon = ResourceManager.loadImage("images/smallRightArrow.png"); + Icon icon = new GIcon("icon.bytepatterns.byte.sequence.analyzer.clipboard.merged"); sendMergedToClipboardAction.setPopupMenuData( new MenuData(new String[] { "Send Merged to Clipboard" }, icon)); sendMergedToClipboardAction.setDescription("Sends the Merge Patterns to the Clipboard"); @@ -248,7 +248,7 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid * Creates the table to byte sequences to analyze * @param FBPplugin plugin * @param rows row objects containing sequences to analyze - * @return + * @return the model */ abstract ByteSequenceTableModel createByteSequenceTable( FunctionBitPatternsExplorerPlugin FBPplugin, List rows); diff --git a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ClosedPatternTableDialog.java b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ClosedPatternTableDialog.java index dc04c25f3d..7ca0a09c8e 100644 --- a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ClosedPatternTableDialog.java +++ b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/ClosedPatternTableDialog.java @@ -19,18 +19,18 @@ import java.awt.BorderLayout; import java.awt.Component; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.JPanel; import docking.*; import docking.action.DockingAction; import docking.action.MenuData; import docking.widgets.table.threaded.GThreadedTablePanel; +import generic.theme.GIcon; import ghidra.bitpatterns.info.ContextRegisterFilter; import ghidra.bitpatterns.info.PatternType; import ghidra.util.HelpLocation; import ghidra.util.bytesearch.DittedBitSequence; -import resources.ResourceManager; /** * This provider is used to display tables containing patterns found by @@ -114,7 +114,7 @@ public class ClosedPatternTableDialog extends DialogComponentProvider { } }; - ImageIcon icon = ResourceManager.loadImage("images/2rightarrow.png"); + Icon icon = new GIcon("icon.bytepatterns.send.to.clipboard"); sendToClipboardAction.setPopupMenuData( new MenuData(new String[] { "Send Selected Sequences to Clipboard" }, icon)); sendToClipboardAction.setDescription( diff --git a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/PatternMiningAnalyzerProvider.java b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/PatternMiningAnalyzerProvider.java index a98e544721..e083a959c7 100644 --- a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/PatternMiningAnalyzerProvider.java +++ b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/gui/PatternMiningAnalyzerProvider.java @@ -18,15 +18,15 @@ package ghidra.bitpatterns.gui; import java.awt.Component; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.bitpatterns.info.*; import ghidra.closedpatternmining.SequenceMiningParams; import ghidra.util.HelpLocation; -import resources.ResourceManager; /** * @@ -100,7 +100,7 @@ public class PatternMiningAnalyzerProvider extends ByteSequenceAnalyzerProvider } }; - ImageIcon icon = ResourceManager.loadImage("images/magnifier.png"); + Icon icon = new GIcon("icon.bytepatterns.pattern.mining.analyzer"); mineClosedPatternsAction.setPopupMenuData( new MenuData(new String[] { "Mine Sequential Patterns" }, icon)); mineClosedPatternsAction.setDescription("Mine Sequential Patterns"); diff --git a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/FunctionBitPatternsGTreeNode.java b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/FunctionBitPatternsGTreeNode.java index 2c82a4f9e2..cd9eb048a3 100644 --- a/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/FunctionBitPatternsGTreeNode.java +++ b/Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/FunctionBitPatternsGTreeNode.java @@ -20,8 +20,7 @@ import java.util.*; import javax.swing.Icon; import docking.widgets.tree.GTreeNode; -import docking.widgets.tree.GTreeNode; -import resources.ResourceManager; +import generic.theme.GIcon; /** * @@ -30,9 +29,11 @@ import resources.ResourceManager; */ public class FunctionBitPatternsGTreeNode extends GTreeNode { - private static final Icon DISABLED_ICON = ResourceManager.loadImage("images/ledred.png"); + private static final Icon DISABLED_ICON = + new GIcon("icon.bytepatterns.function.bit.patterns.disabled"); - private static final Icon ENABLED_ICON = ResourceManager.loadImage("images/ledgreen.png"); + private static final Icon ENABLED_ICON = + new GIcon("icon.bytepatterns.function.bit.patterns.enabled"); private String name; private String instruction; diff --git a/Ghidra/Features/ByteViewer/data/byteviewer.theme.properties b/Ghidra/Features/ByteViewer/data/byteviewer.theme.properties index bdf0b37724..4597060c40 100644 --- a/Ghidra/Features/ByteViewer/data/byteviewer.theme.properties +++ b/Ghidra/Features/ByteViewer/data/byteviewer.theme.properties @@ -9,6 +9,8 @@ color.cursor.focused.byteviewer.current = color.cursor.focused color.cursor.focused.byteviewer.noncurrent = black color.cursor.unfocused.byteviewer = color.cursor.unfocused +icon.plugin.byteviewer.provider = binaryData.gif +icon.plugin.byteviewer.options = wrench.png [Dark Defaults] diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerComponentProvider.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerComponentProvider.java index 49800e97af..c0d44ae871 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerComponentProvider.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerComponentProvider.java @@ -26,6 +26,7 @@ import javax.swing.JComponent; import docking.action.ToggleDockingAction; import generic.theme.GColor; +import generic.theme.GIcon; import ghidra.GhidraOptions; import ghidra.GhidraOptions.CURSOR_MOUSE_BUTTON_NAMES; import ghidra.app.plugin.core.format.*; @@ -37,7 +38,6 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.util.*; import ghidra.util.classfinder.ClassSearcher; import ghidra.util.task.SwingUpdateManager; -import resources.ResourceManager; public abstract class ByteViewerComponentProvider extends ComponentProviderAdapter implements OptionsChangeListener { @@ -116,7 +116,7 @@ public abstract class ByteViewerComponentProvider extends ComponentProviderAdapt panel = newByteViewerPanel(); bytesPerLine = DEFAULT_BYTES_PER_LINE; - setIcon(ResourceManager.loadImage("images/binaryData.gif")); + setIcon(new GIcon("icon.plugin.byteviewer.provider")); setOptions(); createActions(); diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/OptionsAction.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/OptionsAction.java index 0817d4c4af..6ba6e1c197 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/OptionsAction.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/OptionsAction.java @@ -15,17 +15,17 @@ */ package ghidra.app.plugin.core.byteviewer; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.DockingAction; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.framework.plugintool.Plugin; import ghidra.framework.plugintool.PluginTool; -import resources.ResourceManager; class OptionsAction extends DockingAction { - public static final ImageIcon OPTIONS_ICON = ResourceManager.loadImage("images/wrench.png"); + public static final Icon OPTIONS_ICON = new GIcon("icon.plugin.byteviewer.options"); private final ByteViewerComponentProvider provider; diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java index df931344fd..bd6c07bb0d 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java @@ -25,6 +25,7 @@ import javax.swing.*; import docking.ActionContext; import docking.action.*; import docking.widgets.fieldpanel.support.ViewerPosition; +import generic.theme.GIcon; import ghidra.app.events.*; import ghidra.app.nav.*; import ghidra.app.plugin.core.format.*; @@ -43,7 +44,6 @@ import ghidra.util.HelpLocation; import ghidra.util.classfinder.ClassSearcher; import ghidra.util.datastruct.WeakDataStructureFactory; import ghidra.util.datastruct.WeakSet; -import resources.ResourceManager; public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvider implements DomainObjectListener, Navigatable { @@ -77,7 +77,7 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi AbstractByteViewerPlugin plugin, String name, boolean isConnected) { super(tool, plugin, name, ByteViewerActionContext.class); this.isConnected = isConnected; - setIcon(ResourceManager.loadImage("images/binaryData.gif")); + setIcon(new GIcon("icon.plugin.byteviewer.provider")); if (!isConnected) { setTransient(); } @@ -742,7 +742,7 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi public CloneByteViewerAction() { super("ByteViewer Clone", plugin.getName()); - ImageIcon image = ResourceManager.loadImage("images/camera-photo.png"); + Icon image = new GIcon("icon.provider.clone"); setToolBarData(new ToolBarData(image, "ZZZ")); setDescription("Create a snapshot (disconnected) copy of this Bytes window "); diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ToggleEditAction.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ToggleEditAction.java index c900cae83e..fea85ae1c2 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ToggleEditAction.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ToggleEditAction.java @@ -20,8 +20,8 @@ import java.awt.event.KeyEvent; import docking.ActionContext; import docking.action.*; +import generic.theme.GIcon; import ghidra.framework.plugintool.Plugin; -import resources.ResourceManager; class ToggleEditAction extends ToggleDockingAction { private final ByteViewerComponentProvider provider; @@ -29,8 +29,7 @@ class ToggleEditAction extends ToggleDockingAction { public ToggleEditAction(ByteViewerComponentProvider provider, Plugin plugin) { super("Enable/Disable Byteviewer Editing", plugin.getName()); this.provider = provider; - setToolBarData(new ToolBarData( - ResourceManager.loadImage("images/editbytes.gif"), "Byteviewer")); + setToolBarData(new ToolBarData(new GIcon("icon.base.edit.bytes"), "Byteviewer")); setKeyBindingData(new KeyBindingData( KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK)); diff --git a/Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialogTest.java b/Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialogTest.java index c3f220b2c3..a528b49a82 100644 --- a/Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialogTest.java +++ b/Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialogTest.java @@ -64,9 +64,8 @@ public class SaveToolConfigDialogTest extends AbstractGhidraHeadedIntegrationTes private TestEnv env; private SaveToolConfigDialog saveDialog; private JTextField toolNameField; - private JList iconList; + private JList iconList; private JTextField iconNameField; - private PluginTool newtool; public SaveToolConfigDialogTest() { super(); @@ -161,11 +160,13 @@ public class SaveToolConfigDialogTest extends AbstractGhidraHeadedIntegrationTes ToolTemplate template = tc.getToolTemplate("MyTestTool"); tc.remove("MyTestTool"); - ImageIcon icon = ResourceManager.getScaledIcon( - ResourceManager.loadImage("defaultTools/images/Caution.png"), + Icon icon = ResourceManager.getScaledIcon( + ResourceManager.loadIcon("defaultTools/images/Caution.png"), ToolIconURL.LARGE_ICON_SIZE, ToolIconURL.LARGE_ICON_SIZE); - assertEquals(icon.getDescription(), template.getIcon().getDescription()); + String expected = ResourceManager.getIconName(icon); + String actual = ResourceManager.getIconName(template.getIcon()); + assertEquals(expected, actual); } @Test @@ -323,7 +324,7 @@ public class SaveToolConfigDialogTest extends AbstractGhidraHeadedIntegrationTes assertNotNull(saveDialog); toolNameField = (JTextField) findComponentByName(saveDialog, "ToolName"); - iconList = (JList) findComponentByName(saveDialog, "IconList"); + iconList = (JList) findComponentByName(saveDialog, "IconList"); iconNameField = (JTextField) findComponentByName(saveDialog, "IconName"); } diff --git a/Ghidra/Features/Decompiler/data/decompiler.theme.properties b/Ghidra/Features/Decompiler/data/decompiler.theme.properties index 4e07d637e8..1e072fd83c 100644 --- a/Ghidra/Features/Decompiler/data/decompiler.theme.properties +++ b/Ghidra/Features/Decompiler/data/decompiler.theme.properties @@ -35,7 +35,7 @@ color.bg.decompiler.pcode.dfg.edge.within.block = black color.bg.decompiler.pcode.dfg.edge.between.blocks = red -icon.decompiler.action.provider = icon.provider.clone +icon.decompiler.action.provider = decompileFunction.gif icon.decompiler.action.provider.clone = icon.provider.clone icon.decompiler.action.export = page_edit.png diff --git a/Ghidra/Features/PDB/src/main/java/pdb/symbolserver/ui/LoadPdbDialog.java b/Ghidra/Features/PDB/src/main/java/pdb/symbolserver/ui/LoadPdbDialog.java index 1255151e9c..50bde0f3b6 100644 --- a/Ghidra/Features/PDB/src/main/java/pdb/symbolserver/ui/LoadPdbDialog.java +++ b/Ghidra/Features/PDB/src/main/java/pdb/symbolserver/ui/LoadPdbDialog.java @@ -41,6 +41,7 @@ import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; import docking.widgets.textfield.HexOrDecimalInput; import docking.widgets.textfield.HintTextField; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors; import generic.theme.GThemeDefaults.Colors.Messages; import generic.theme.TempColorUtils; @@ -59,7 +60,6 @@ import ghidra.util.task.*; import pdb.PdbPlugin; import pdb.symbolserver.*; import resources.Icons; -import resources.ResourceManager; /** * A dialog that allows the user to pick or search for a Pdb file for a program. @@ -67,10 +67,8 @@ import resources.ResourceManager; public class LoadPdbDialog extends DialogComponentProvider { private static final String LAST_PDBFILE_PREFERENCE_KEY = "Pdb.LastFile"; - static final Icon MATCH_OK_ICON = - ResourceManager.loadImage("images/checkmark_green.gif", 16, 16); - static final Icon MATCH_BAD_ICON = - ResourceManager.loadImage("images/emblem-important.png", 16, 16); + static final Icon MATCH_OK_ICON = new GIcon("icon.checkmark.green"); + static final Icon MATCH_BAD_ICON = Icons.ERROR_ICON; public static final GhidraFileFilter PDB_FILES_FILTER = ExtensionFileFilter.forExtensions("Microsoft Program Databases", "pdb", "pd_", "pdb.xml"); diff --git a/Ghidra/Features/ProgramDiff/data/programdiff.theme.properties b/Ghidra/Features/ProgramDiff/data/programdiff.theme.properties index eee5b4157d..26beada9ae 100644 --- a/Ghidra/Features/ProgramDiff/data/programdiff.theme.properties +++ b/Ghidra/Features/ProgramDiff/data/programdiff.theme.properties @@ -2,6 +2,15 @@ color.bg.programdiff.highlight = moccasin +icon.plugin.programdiff.apply = pencil16.png +icon.plugin.programdiff.apply.next = pencil_arrow16.png +icon.plugin.programdiff.ignore = eraser_arrow16.png +icon.plugin.programdiff.get.diffs = Diff16.png +icon.plugin.programdiff.select.by.program = DiffSelect16.png +icon.plugin.programdiff.open.close.program = table_relationship.png +icon.plugin.programdiff.settings = settings16.gif +icon.plugin.programdiff.cursor.location = cursor_arrow.gif + [Dark Defaults] color.bg.programdiff.highlight = darkRed diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffActionManager.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffActionManager.java index 63c481b60b..3d96eb7732 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffActionManager.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffActionManager.java @@ -18,19 +18,20 @@ package ghidra.app.plugin.core.diff; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.*; import docking.tool.ToolConstants; import docking.widgets.OptionDialog; +import generic.theme.GIcon; import ghidra.app.plugin.core.codebrowser.OtherPanelContext; import ghidra.app.services.CodeViewerService; import ghidra.app.util.HelpTopics; import ghidra.program.model.listing.Program; import ghidra.util.HTMLUtilities; import ghidra.util.HelpLocation; -import resources.ResourceManager; +import resources.Icons; /** * Creates the actions for the program diff plugin. @@ -41,7 +42,6 @@ class DiffActionManager { private static final String GET_DIFF_GROUP = "GetDiff"; private static final String DIFF_INFO_GROUP = "DiffInfo"; private static final String DIFF_NAVIGATE_GROUP = "DiffNavigate"; - private static final String TOGGLE_VIEW_ICON_NAME = "images/table_relationship.png"; private static final String GROUP = "Diff"; private ProgramDiffPlugin plugin; private CodeViewerService codeViewerService; @@ -251,7 +251,7 @@ class DiffActionManager { plugin.applyDiff(); } }; - ImageIcon icon = ResourceManager.loadImage("images/pencil16.png"); + Icon icon = new GIcon("icon.plugin.programdiff.apply"); applyDiffsAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_F3, 0)); applyDiffsAction.setPopupMenuData( new MenuData(new String[] { "Apply Selection" }, icon, GROUP)); @@ -265,7 +265,7 @@ class DiffActionManager { plugin.applyDiffAndGoNext(); } }; - icon = ResourceManager.loadImage("images/pencil_arrow16.png"); + icon = new GIcon("icon.plugin.programdiff.apply.next"); String[] applyDiffsPath = { "Apply Selection and Goto Next Difference" }; applyDiffsNextAction.setPopupMenuData(new MenuData(applyDiffsPath, icon, GROUP)); applyDiffsNextAction.setKeyBindingData( @@ -281,7 +281,7 @@ class DiffActionManager { plugin.ignoreDiff(); } }; - icon = ResourceManager.loadImage("images/eraser_arrow16.png"); + icon = new GIcon("icon.plugin.programdiff.ignore"); ignoreDiffsAction.setPopupMenuData(new MenuData( new String[] { "Ignore Selection and Goto Next Difference" }, icon, GROUP)); ignoreDiffsAction.setDescription( @@ -294,9 +294,9 @@ class DiffActionManager { plugin.nextDiff(); } }; - icon = ResourceManager.loadImage("images/down.png"); + icon = Icons.DOWN_ICON; nextDiffAction.setKeyBindingData( - new KeyBindingData('N', InputEvent.CTRL_MASK | InputEvent.ALT_MASK)); + new KeyBindingData('N', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK)); nextDiffAction.setPopupMenuData( new MenuData(new String[] { "Next Difference" }, icon, DIFF_NAVIGATE_GROUP)); nextDiffAction.setToolBarData(new ToolBarData(icon, DIFF_NAVIGATE_GROUP)); @@ -308,9 +308,9 @@ class DiffActionManager { plugin.previousDiff(); } }; - icon = ResourceManager.loadImage("images/up.png"); + icon = Icons.UP_ICON; previousDiffAction.setKeyBindingData( - new KeyBindingData('P', InputEvent.CTRL_MASK | InputEvent.ALT_MASK)); + new KeyBindingData('P', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK)); previousDiffAction.setPopupMenuData( new MenuData(new String[] { "Previous Difference" }, icon, DIFF_NAVIGATE_GROUP)); previousDiffAction.setToolBarData(new ToolBarData(icon, DIFF_NAVIGATE_GROUP)); @@ -322,7 +322,7 @@ class DiffActionManager { plugin.showDiffDetails(); } }; - icon = ResourceManager.loadImage("images/xmag.png"); + icon = new GIcon("icon.search"); diffDetailsAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_F5, 0)); diffDetailsAction.setPopupMenuData( new MenuData(new String[] { "Location Details..." }, icon, DIFF_INFO_GROUP)); @@ -349,7 +349,7 @@ class DiffActionManager { plugin.diff(); } }; - icon = ResourceManager.loadImage("images/Diff16.png"); + icon = new GIcon("icon.plugin.programdiff.get.diffs"); getDiffsAction.setPopupMenuData( new MenuData(new String[] { "Get Differences..." }, icon, GET_DIFF_GROUP)); getDiffsAction.setToolBarData(new ToolBarData(icon, GET_DIFF_GROUP)); @@ -372,7 +372,7 @@ class DiffActionManager { plugin.setP1SelectionOnP2(); } }; - icon = ResourceManager.loadImage("images/DiffSelect16.png"); + icon = new GIcon("icon.plugin.programdiff.select.by.program"); p1SelectToP2Action.setDescription( "Select Program 2 highlights using selection in Program 1."); p1SelectToP2Action.setToolBarData(new ToolBarData(icon, SELECT_GROUP)); @@ -434,10 +434,10 @@ class DiffActionManager { return true; } }; - icon = ResourceManager.loadImage(TOGGLE_VIEW_ICON_NAME); + icon = new GIcon("icon.plugin.programdiff.open.close.program"); openCloseProgram2Action.setEnabled(false); openCloseProgram2Action.setKeyBindingData( - new KeyBindingData('C', InputEvent.CTRL_MASK | InputEvent.ALT_MASK)); + new KeyBindingData('C', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK)); openCloseProgram2Action.setToolBarData(new ToolBarData(icon, "zzz")); openCloseProgram2Action.setHelpLocation( new HelpLocation(HelpTopics.DIFF, OPEN_CLOSE_PROGRAM2_ACTION)); diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java index dd6ec26035..510009c51d 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java @@ -28,12 +28,12 @@ import docking.WindowPosition; import docking.widgets.VariableHeightPanel; import docking.widgets.combobox.GComboBox; import docking.widgets.label.GDLabel; +import generic.theme.GIcon; import ghidra.app.plugin.core.diff.DiffApplySettingsOptionManager.*; import ghidra.framework.plugintool.ComponentProviderAdapter; import ghidra.framework.plugintool.Plugin; import ghidra.program.util.ProgramMergeFilter; import ghidra.util.HelpLocation; -import resources.ResourceManager; /** * The DiffSettingsDialog is used to change the types of differences currently @@ -43,7 +43,7 @@ import resources.ResourceManager; public class DiffApplySettingsProvider extends ComponentProviderAdapter { public static final String APPLY_FILTER_CHANGED_ACTION = "Apply Filter Changed"; - public static final ImageIcon ICON = ResourceManager.loadImage("images/settings16.gif"); + public static final Icon ICON = new GIcon("icon.plugin.programdiff.settings"); public static final String TITLE = "Diff Apply Settings"; private ProgramDiffPlugin plugin; @@ -106,8 +106,9 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter { } public void addActions() { - plugin.getTool().addLocalAction(this, - new SaveApplySettingsAction(this, plugin.applySettingsMgr)); + plugin.getTool() + .addLocalAction(this, + new SaveApplySettingsAction(this, plugin.applySettingsMgr)); plugin.getTool().addLocalAction(this, new DiffIgnoreAllAction(this)); plugin.getTool().addLocalAction(this, new DiffReplaceAllAction(this)); plugin.getTool().addLocalAction(this, new DiffMergeAllAction(this)); @@ -351,10 +352,6 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter { listenerList.remove(listener); } - /** - * Return true if at least one of the checkboxes for the filter - * has been selected. - */ boolean hasApplySelection() { return ((applyProgramContext | applyBytes | applyCodeUnits | applyReferences | applyPlateComments | applyPreComments | applyEolComments | applyRepeatableComments | @@ -366,8 +363,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter { if (adjustingApplyFilter) { return; } - for (int i = 0; i < listenerList.size(); i++) { - ActionListener listener = listenerList.get(i); + for (ActionListener listener : listenerList) { listener.actionPerformed(new ActionEvent(this, 0, APPLY_FILTER_CHANGED_ACTION)); } } @@ -383,9 +379,6 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter { return applyPanel; } - /** - * Gets the plugin associated with this provider. - */ Plugin getPlugin() { return plugin; } 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 df3ad12388..a918b5d66c 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 @@ -29,6 +29,7 @@ import docking.WindowPosition; import docking.action.DockingAction; import docking.action.ToolBarData; import docking.widgets.checkbox.GCheckBox; +import generic.theme.GIcon; import ghidra.app.util.HelpTopics; import ghidra.framework.plugintool.ComponentProviderAdapter; import ghidra.framework.plugintool.Plugin; @@ -40,7 +41,6 @@ import ghidra.util.HelpLocation; import ghidra.util.Msg; import ghidra.util.task.SwingUpdateManager; import resources.Icons; -import resources.ResourceManager; /** * The DiffDetailsProvider is used to view the differences for an address or @@ -52,7 +52,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { public static final String FILTER_DIFFS_CHECK_BOX = "Filter Diffs Check Box"; public static final String DIFF_DETAILS_TEXT_AREA = "Diff Details Text Area"; public static final String DIFF_DETAILS_PANEL = "Diff Location Details Panel"; - public static final Icon ICON = ResourceManager.loadImage("images/xmag.png"); + public static final Icon ICON = new GIcon("icon.search"); public static final Icon REFRESH_ICON = Icons.REFRESH_ICON; public static final String TITLE = "Diff Details"; @@ -72,9 +72,6 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { private SwingUpdateManager updateManager; private ProgramLocation currentLocation; - /** - * @param plugin - */ public DiffDetailsProvider(ProgramDiffPlugin plugin) { super(plugin.getTool(), "Diff Location Details", plugin.getName()); setTitle(TITLE); @@ -91,17 +88,11 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { setUpRefreshDetailsUpdateManager(); } - /** - * @param selected - */ public void setAutoUpdate(boolean selected) { autoUpdateCB.setSelected(selected); autoUpdate = selected; } - /** - * @param selected - */ public void setFilterDiffs(boolean selected) { filterDiffsCB.setSelected(selected); filterDiffs = selected; @@ -159,9 +150,6 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { } - /** - * @param p1Location - */ protected void locationChanged(ProgramLocation p1Location) { if (isDisplayed && autoUpdate) { refreshDetails(p1Location); @@ -321,8 +309,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter { @Override public void componentHidden() { - for (int i = 0; i < listenerList.size(); i++) { - ActionListener listener = listenerList.get(i); + for (ActionListener listener : listenerList) { listener.actionPerformed(new ActionEvent(this, 0, DIFF_DETAILS_HIDDEN_ACTION)); } isDisplayed = false; diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ProgramDiffPlugin.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ProgramDiffPlugin.java index 9f92c21017..65739e4419 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ProgramDiffPlugin.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/ProgramDiffPlugin.java @@ -33,6 +33,7 @@ import docking.widgets.fieldpanel.field.Field; import docking.widgets.fieldpanel.listener.FieldMouseListener; import docking.widgets.fieldpanel.support.FieldLocation; import generic.theme.GColor; +import generic.theme.GIcon; import ghidra.GhidraOptions; import ghidra.app.CorePluginPackage; import ghidra.app.events.*; @@ -63,7 +64,6 @@ import ghidra.util.exception.VersionException; import ghidra.util.task.*; import help.Help; import help.HelpService; -import resources.ResourceManager; /** * Plugin that shows the differences between two programs, and allows the user to apply differences @@ -92,7 +92,8 @@ public class ProgramDiffPlugin extends ProgramPlugin implements ProgramLocationListener, ProgramSelectionListener, DiffControllerListener, DiffService, OptionsChangeListener, DomainObjectListener { - private ImageIcon CURSOR_LOC_ICON = ResourceManager.loadImage("images/cursor_arrow.gif"); + private static final Icon CURSOR_LOC_ICON = + new GIcon("icon.plugin.programdiff.cursor.location"); private static final String SELECTION_GROUP = "Selection Colors"; private static final String DIFF_HIGHLIGHT_COLOR_NAME = SELECTION_GROUP + Options.DELIMITER + "Difference Color"; diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/SaveApplySettingsAction.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/SaveApplySettingsAction.java index f32674487a..c9ade4e2b2 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/SaveApplySettingsAction.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/SaveApplySettingsAction.java @@ -22,7 +22,7 @@ import docking.action.DockingAction; import docking.action.ToolBarData; import ghidra.app.util.HelpTopics; import ghidra.util.HelpLocation; -import resources.ResourceManager; +import resources.Icons; /** * Action to save the current Diff Apply Settings as the new defaults to be used when new Diffs are started. @@ -45,7 +45,7 @@ class SaveApplySettingsAction extends DockingAction { super(ACTION_NAME, settingsProvider.getPlugin().getName()); this.settingsProvider = settingsProvider; this.settingsOptionMgr = settingsOptionMgr; - setToolBarData(new ToolBarData(ResourceManager.loadImage("images/disk.png"), GROUP_NAME)); + setToolBarData(new ToolBarData(Icons.SAVE_ICON, GROUP_NAME)); setEnabled(true); setDescription(DESCRIPTION); setHelpLocation(new HelpLocation(HelpTopics.DIFF, ACTION_NAME)); @@ -61,8 +61,10 @@ class SaveApplySettingsAction extends DockingAction { @Override public void actionPerformed(ActionContext context) { settingsOptionMgr.saveDefaultApplyFilter(settingsProvider.getApplyFilter()); - settingsProvider.getPlugin().getTool().setStatusInfo( - "Diff Apply Settings have been saved to the tool as the new defaults."); + settingsProvider.getPlugin() + .getTool() + .setStatusInfo( + "Diff Apply Settings have been saved to the tool as the new defaults."); } } diff --git a/Ghidra/Features/Python/data/python.theme.properties b/Ghidra/Features/Python/data/python.theme.properties index 3aa7f216fe..52757dc295 100644 --- a/Ghidra/Features/Python/data/python.theme.properties +++ b/Ghidra/Features/Python/data/python.theme.properties @@ -13,7 +13,7 @@ color.fg.plugin.python.syntax.package = darkred color.fg.plugin.python.syntax.sequence = rgb(128, 96, 64) color.fg.plugin.python.syntax.special = darkgreen - +icon.plugin.python = python.png [Dark Defaults] diff --git a/Ghidra/Features/Python/src/main/java/ghidra/python/PythonPlugin.java b/Ghidra/Features/Python/src/main/java/ghidra/python/PythonPlugin.java index 0dcbe75b7c..c0da0b8734 100644 --- a/Ghidra/Features/Python/src/main/java/ghidra/python/PythonPlugin.java +++ b/Ghidra/Features/Python/src/main/java/ghidra/python/PythonPlugin.java @@ -19,7 +19,7 @@ import java.awt.event.KeyEvent; import java.io.*; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import org.python.core.PySystemState; @@ -27,6 +27,7 @@ import docking.ActionContext; import docking.DockingUtils; import docking.action.*; import generic.jar.ResourceFile; +import generic.theme.GIcon; import ghidra.app.CorePluginPackage; import ghidra.app.plugin.PluginCategoryNames; import ghidra.app.plugin.ProgramPlugin; @@ -40,7 +41,7 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.framework.plugintool.util.PluginStatus; import ghidra.util.HelpLocation; import ghidra.util.task.*; -import resources.ResourceManager; +import resources.Icons; /** * This plugin provides the interactive Python interpreter. @@ -59,8 +60,6 @@ import resources.ResourceManager; public class PythonPlugin extends ProgramPlugin implements InterpreterConnection, OptionsChangeListener { - private final static int INPUT_THREAD_SHUTDOWN_TIMEOUT_MS = 1000; - private InterpreterConsole console; private GhidraPythonInterpreter interpreter; private PythonScript interactiveScript; @@ -72,6 +71,9 @@ public class PythonPlugin extends ProgramPlugin private final static String INCLUDE_BUILTINS_DESCRIPTION = "Whether or not to include Python's built-in functions and properties in the pop-up code completion window."; private final static boolean INCLUDE_BUILTINS_DEFAULT = true; + + private static final Icon ICON = new GIcon("icon.plugin.python"); + private boolean includeBuiltins = INCLUDE_BUILTINS_DEFAULT; /** @@ -134,7 +136,7 @@ public class PythonPlugin extends ProgramPlugin * Creates various actions for the plugin. */ private void createActions() { - + // Interrupt Interpreter DockingAction interruptAction = new DockingAction("Interrupt Interpreter", getName()) { @Override @@ -144,7 +146,7 @@ public class PythonPlugin extends ProgramPlugin }; interruptAction.setDescription("Interrupt Interpreter"); interruptAction.setToolBarData( - new ToolBarData(ResourceManager.loadImage("images/dialog-cancel.png"), null)); + new ToolBarData(Icons.NOT_ALLOWED_ICON, null)); interruptAction.setEnabled(true); interruptAction.setKeyBindingData( new KeyBindingData(KeyEvent.VK_I, DockingUtils.CONTROL_KEY_MODIFIER_MASK)); @@ -160,7 +162,7 @@ public class PythonPlugin extends ProgramPlugin }; resetAction.setDescription("Reset Interpreter"); resetAction.setToolBarData( - new ToolBarData(ResourceManager.loadImage("images/reload3.png"), null)); + new ToolBarData(Icons.REFRESH_ICON, null)); resetAction.setEnabled(true); resetAction.setKeyBindingData( new KeyBindingData(KeyEvent.VK_D, DockingUtils.CONTROL_KEY_MODIFIER_MASK)); @@ -345,8 +347,8 @@ public class PythonPlugin extends ProgramPlugin } @Override - public ImageIcon getIcon() { - return ResourceManager.loadImage("images/python.png"); + public Icon getIcon() { + return ICON; } /** diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchMarkupStatusRenderer.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchMarkupStatusRenderer.java index 5170be633b..9ca1ccf483 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchMarkupStatusRenderer.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/MatchMarkupStatusRenderer.java @@ -30,7 +30,6 @@ import ghidra.util.HTMLUtilities; import ghidra.util.WebColors; import ghidra.util.table.column.AbstractGhidraColumnRenderer; import resources.MultiIcon; -import resources.ResourceManager; import resources.icons.*; /** @@ -42,7 +41,7 @@ public class MatchMarkupStatusRenderer extends AbstractGhidraColumnRenderer otherComponentInfos = new HashSet<>(); private Image image; @@ -568,8 +570,7 @@ public class DockableHeader extends GenericHeader g2d.fillRect(othersBounds.x, othersBounds.y, othersBounds.width, othersBounds.height); - ImageIcon ghidra = ResourceManager.loadImage("images/GhidraIcon256.png"); - Image ghidraImage = ghidra.getImage(); + Image ghidraImage = DRAGON_ICON.getImageIcon().getImage(); double scale = percentComplete * 7; int gw = ghidraImage.getWidth(null); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/ErrLogExpandableDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/ErrLogExpandableDialog.java index aa8674bb60..fed06a9180 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/ErrLogExpandableDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/ErrLogExpandableDialog.java @@ -31,19 +31,18 @@ import javax.swing.tree.TreePath; import docking.widgets.label.GHtmlLabel; import docking.widgets.tree.*; import docking.widgets.tree.support.GTreeDragNDropHandler; +import generic.theme.GIcon; import ghidra.util.*; import ghidra.util.exception.MultipleCauses; import ghidra.util.html.HTMLElement; -import resources.ResourceManager; import util.CollectionUtils; public class ErrLogExpandableDialog extends AbstractErrDialog { - public static ImageIcon IMG_REPORT = ResourceManager.loadImage("images/report.png"); - public static ImageIcon IMG_EXCEPTION = ResourceManager.loadImage("images/exception.png"); - public static ImageIcon IMG_FRAME_ELEMENT = - ResourceManager.loadImage("images/StackFrameElement.png"); - public static ImageIcon IMG_STACK = ResourceManager.loadImage("images/StackFrame_Red.png"); - public static ImageIcon IMG_CAUSE = ResourceManager.loadImage("images/cause.png"); + public static Icon IMG_REPORT = new GIcon("icon.dialog.error.expandable.report"); + public static Icon IMG_EXCEPTION = new GIcon("icon.dialog.error.expandable.exception"); + public static Icon IMG_FRAME_ELEMENT = new GIcon("icon.dialog.error.expandable.frame"); + public static Icon IMG_STACK = new GIcon("icon.dialog.error.expandable.stack"); + public static Icon IMG_CAUSE = new GIcon("icon.dialog.error.expandable.cause"); private static final String SEND = "Send Report..."; private static final String DETAIL = "Details >>>"; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/ShowComponentAction.java b/Ghidra/Framework/Docking/src/main/java/docking/ShowComponentAction.java index 35d96ba10b..87dc4a7427 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/ShowComponentAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/ShowComponentAction.java @@ -16,12 +16,11 @@ package docking; import javax.swing.Icon; -import javax.swing.ImageIcon; import docking.action.*; import docking.actions.AutoGeneratedDockingAction; import ghidra.util.HelpLocation; -import resources.ResourceManager; +import resources.Icons; /** * Action for showing components. If the component is hidden it will be made visible. @@ -31,8 +30,7 @@ class ShowComponentAction extends DockingAction implements AutoGeneratedDockingAction, Comparable { private static final int MAX_LENGTH = 40; - protected static final ImageIcon EMPTY_ICON = - ResourceManager.loadImage("images/EmptyIcon16.gif"); + protected static final Icon EMPTY_ICON = Icons.EMPTY_ICON; protected static final String MENU_WINDOW = "&" + DockingWindowManager.COMPONENT_MENU_NAME; protected DockingWindowManager winMgr; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/ShowWindowAction.java b/Ghidra/Framework/Docking/src/main/java/docking/ShowWindowAction.java index ecc997bdf6..641f04ae5c 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/ShowWindowAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/ShowWindowAction.java @@ -21,13 +21,13 @@ import docking.action.DockingAction; import docking.action.MenuData; import docking.actions.AutoGeneratedDockingAction; import docking.tool.ToolConstants; +import generic.theme.GIcon; import ghidra.util.HelpLocation; -import resources.ResourceManager; class ShowWindowAction extends DockingAction implements AutoGeneratedDockingAction, Comparable { - private static final Icon ICON = ResourceManager.loadImage("images/application_xp.png"); + private static final Icon ICON = new GIcon("icon.window"); private static final String MENU_WINDOW = "&" + DockingWindowManager.COMPONENT_MENU_NAME; private static final int MAX_LENGTH = 40; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/StatusBarSpacer.java b/Ghidra/Framework/Docking/src/main/java/docking/StatusBarSpacer.java index 10bb194fc8..1225e447e0 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/StatusBarSpacer.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/StatusBarSpacer.java @@ -18,16 +18,16 @@ package docking; import javax.swing.Icon; import docking.widgets.label.GIconLabel; +import generic.theme.GIcon; import ghidra.framework.OperatingSystem; import ghidra.framework.Platform; -import resources.ResourceManager; /** * A class to handle the space requirements on the status bar that vary for different OSes. For * example, the Mac requires extra space on the status bar, due to the drag icon the Mac uses. */ public class StatusBarSpacer extends GIconLabel { - private static Icon EMPTY_ICON = ResourceManager.loadImage("images/EmptyIcon.gif"); + private static Icon EMPTY_ICON = new GIcon("icon.empty.20"); public StatusBarSpacer() { super( diff --git a/Ghidra/Framework/Docking/src/main/java/docking/actions/KeyEntryDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/actions/KeyEntryDialog.java index 6643362fb9..7e1a114377 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/actions/KeyEntryDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/actions/KeyEntryDialog.java @@ -30,7 +30,7 @@ import docking.widgets.label.GIconLabel; import generic.theme.GThemeDefaults.Colors.Messages; import generic.util.action.ReservedKeyBindings; import ghidra.util.HelpLocation; -import resources.ResourceManager; +import resources.Icons; /** * Dialog to set the key binding on an action; it is popped up when the F4 key @@ -70,7 +70,7 @@ public class KeyEntryDialog extends DialogComponentProvider { defaultPanel = new JPanel(new BorderLayout()); defaultPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5)); - JLabel imageLabel = new GIconLabel(ResourceManager.loadImage("images/information.png")); + JLabel imageLabel = new GIconLabel(Icons.INFO_ICON); bgColor = imageLabel.getBackground(); JTextPane pane = new JTextPane(); pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 2, 5)); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/framework/ApplicationInformationDisplayFactory.java b/Ghidra/Framework/Docking/src/main/java/docking/framework/ApplicationInformationDisplayFactory.java index fa4239b35e..1723bc2816 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/framework/ApplicationInformationDisplayFactory.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/framework/ApplicationInformationDisplayFactory.java @@ -24,15 +24,19 @@ import javax.swing.*; import docking.widgets.label.GIconLabel; import docking.widgets.label.GLabel; import generic.theme.GColor; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Palette; import ghidra.framework.Application; import ghidra.framework.PluggableServiceRegistry; import ghidra.util.HelpLocation; import ghidra.util.Msg; -import resources.ResourceManager; public class ApplicationInformationDisplayFactory { + private static final GIcon ICON_HOME = new GIcon("icon.docking.application.home"); + private static final GIcon ICON_16 = new GIcon("icon.docking.application.16"); + private static final GIcon ICON_128 = new GIcon("icon.base.application.128"); + static { PluggableServiceRegistry.registerPluggableService( ApplicationInformationDisplayFactory.class, new ApplicationInformationDisplayFactory()); @@ -140,14 +144,14 @@ public class ApplicationInformationDisplayFactory { return panel; } - protected ImageIcon getSplashScreenIcon128() { - return ResourceManager.loadImage("images/www_128.png"); + protected Icon getSplashScreenIcon128() { + return ICON_128; } protected List doGetWindowIcons() { List list = new ArrayList<>(); - list.add(ResourceManager.loadImage("images/www_128.png").getImage()); - list.add(ResourceManager.loadImage("images/www_16.png").getImage()); + list.add(ICON_128.getImageIcon().getImage()); + list.add(ICON_16.getImageIcon().getImage()); return list; } @@ -160,7 +164,7 @@ public class ApplicationInformationDisplayFactory { } protected Icon doGetHomeIcon() { - return ResourceManager.loadImage("images/www_16.png"); + return ICON_HOME; } protected Runnable doGetHomeCallback() { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/help/ToggleNavigationAid.java b/Ghidra/Framework/Docking/src/main/java/docking/help/ToggleNavigationAid.java index 5af1ff1b19..8bd568c358 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/help/ToggleNavigationAid.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/help/ToggleNavigationAid.java @@ -21,6 +21,7 @@ import java.awt.event.ActionEvent; import javax.swing.*; +import generic.theme.GIcon; import ghidra.framework.preferences.Preferences; import resources.MultiIcon; import resources.ResourceManager; @@ -29,9 +30,9 @@ import resources.icons.TranslateIcon; public class ToggleNavigationAid extends AbstractAction { - private static final Icon ENABLED_ICON = - ResourceManager.loadImage("images/software-update-available.png"); - private static final Icon CANCEL_ICON = ResourceManager.loadImage("images/dialog-cancel.png"); + private static final Icon ENABLED_ICON = new GIcon("icon.help.navigation.aid.enabled"); + private static final Icon DISABLED_OVERLAY_ICON = + new GIcon("icon.help.navigation.aid.disabled.overlay"); private static Icon DISABLED_ICON; private boolean showingNavigationAid = true; @@ -44,7 +45,7 @@ public class ToggleNavigationAid extends AbstractAction { "when navigating within the help system"); TranslateIcon translatedIcon = - new CenterTranslateIcon(CANCEL_ICON, ENABLED_ICON.getIconWidth()); + new CenterTranslateIcon(DISABLED_OVERLAY_ICON, ENABLED_ICON.getIconWidth()); ImageIcon disabledBaseIcon = ResourceManager.getDisabledIcon(ENABLED_ICON, 50); DISABLED_ICON = new MultiIcon(disabledBaseIcon, translatedIcon); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/menu/MultipleActionDockingToolbarButton.java b/Ghidra/Framework/Docking/src/main/java/docking/menu/MultipleActionDockingToolbarButton.java index 3e216bc6a3..1acf733b12 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/menu/MultipleActionDockingToolbarButton.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/menu/MultipleActionDockingToolbarButton.java @@ -53,7 +53,7 @@ public class MultipleActionDockingToolbarButton extends EmptyBorderButton { public MultipleActionDockingToolbarButton(MultiActionDockingActionIf action) { multipleAction = action; installMouseListeners(); - setIcon(ResourceManager.loadImage("images/core.png")); + setIcon(ResourceManager.getDefaultIcon()); } @Override diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsPanel.java index d8640fab9b..a7a14d5206 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/OptionsPanel.java @@ -40,7 +40,7 @@ import ghidra.util.layout.MiddleLayout; import ghidra.util.task.SwingUpdateManager; import help.Help; import help.HelpService; -import resources.ResourceManager; +import resources.Icons; public class OptionsPanel extends JPanel { private PropertyChangeListener changeListener; @@ -251,7 +251,7 @@ public class OptionsPanel extends JPanel { BoxLayout bl = new BoxLayout(labelPanel, BoxLayout.X_AXIS); labelPanel.setLayout(bl); labelPanel.add(Box.createHorizontalStrut(5)); - labelPanel.add(new GIconLabel(ResourceManager.loadImage("images/information.png"))); + labelPanel.add(new GIconLabel(Icons.INFO_ICON)); labelPanel.add(Box.createHorizontalStrut(5)); labelPanel.add(label); 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 6a3b5c86ff..d95d5311e5 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 @@ -21,16 +21,13 @@ import javax.swing.Icon; import docking.widgets.tree.GTreeLazyNode; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.options.Options; -import resources.ResourceManager; class OptionsTreeNode extends GTreeLazyNode { - private final static Icon OPEN_FOLDER_ICON = - ResourceManager.loadImage("images/openSmallFolder.png"); - private final static Icon CLOSED_FOLDER_ICON = - ResourceManager.loadImage("images/closedSmallFolder.png"); - private final static Icon PROPERTIES_ICON = - ResourceManager.loadImage("images/document-properties.png"); + 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 Options options; private final String name; @@ -46,7 +43,7 @@ class OptionsTreeNode extends GTreeLazyNode { @Override protected List generateChildren() { - List childList = new ArrayList(); + List childList = new ArrayList<>(); if (options.getOptionsEditor() == null) { // if hasOptionsEditor, don't show child options List childOptionsList = options.getChildOptions(); for (Options childOptions : childOptionsList) { @@ -108,7 +105,7 @@ class OptionsTreeNode extends GTreeLazyNode { public List getOptionNames() { if (options == null) { - return new ArrayList(); + return new ArrayList<>(); } return options.getLeafOptionNames(); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/util/AnimationUtils.java b/Ghidra/Framework/Docking/src/main/java/docking/util/AnimationUtils.java index b999e1747e..23e83db0f4 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/util/AnimationUtils.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/util/AnimationUtils.java @@ -25,6 +25,7 @@ import org.jdesktop.animation.timing.Animator.RepeatBehavior; import org.jdesktop.animation.timing.TimingTargetAdapter; import org.jdesktop.animation.timing.interpolation.PropertySetter; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Java; import generic.theme.GThemeDefaults.Colors.Palette; import generic.util.WindowUtilities; @@ -33,7 +34,6 @@ import ghidra.util.Msg; import ghidra.util.bean.GGlassPane; import ghidra.util.bean.GGlassPanePainter; import ghidra.util.exception.AssertException; -import resources.ResourceManager; public class AnimationUtils { @@ -1171,6 +1171,7 @@ public class AnimationUtils { private static class DragonImagePainter implements GGlassPanePainter { + private static final GIcon ICON = new GIcon("icon.dragon.256"); private Component component; private double percentComplete = 0.0; @@ -1196,9 +1197,7 @@ public class AnimationUtils { AlphaComposite.getInstance(AlphaComposite.SrcOver.getRule(), alpha); g2d.setComposite(alphaComposite); - ImageIcon ghidra = ResourceManager.loadImage("images/GhidraIcon256.png"); - Image ghidraImage = ghidra.getImage(); - + Image ghidraImage = ICON.getImageIcon().getImage(); Rectangle fullBounds = component.getBounds(); fullBounds = SwingUtilities.convertRectangle(component.getParent(), fullBounds, glassPane); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java index 6942ae9c87..b11a64651d 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/conditiontestpanel/ConditionTestPanel.java @@ -30,18 +30,21 @@ import docking.widgets.EmptyBorderButton; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.GDHtmlLabel; import docking.widgets.label.GDLabel; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Palette; import ghidra.util.HTMLUtilities; import ghidra.util.exception.CancelledException; import ghidra.util.layout.PairLayout; import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitorComponent; -import resources.ResourceManager; +import resources.Icons; public class ConditionTestPanel extends JPanel { - static final Icon ERROR_ICON = ResourceManager.loadImage("images/edit-delete.png"); - static final Icon WARNING_ICON = ResourceManager.loadImage("images/dialog-warning.png"); - static final Icon PASSED_ICON = ResourceManager.loadImage("images/checkmark_green.gif"); + + private static final GIcon RUN_ICON = new GIcon("icon.run"); + static final Icon ERROR_ICON = Icons.ERROR_ICON; + static final Icon WARNING_ICON = Icons.WARNING_ICON; + static final Icon PASSED_ICON = new GIcon("icon.checkmark.green"); private ConditionTestModel conditionTestModel; private TaskMonitorComponent taskMonitor; private List testPanelList = new ArrayList<>(); @@ -191,7 +194,7 @@ public class ConditionTestPanel extends JPanel { private Component createRunAndSummaryPanel() { JPanel panel = new JPanel(new BorderLayout()); - JButton runButton = new EmptyBorderButton(ResourceManager.loadImage("images/play.png")); + JButton runButton = new EmptyBorderButton(RUN_ICON); runButton.addActionListener(e -> conditionTestModel.runTests(taskMonitor)); JPanel buttonPanel = new JPanel(new BorderLayout()); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 0)); @@ -262,7 +265,7 @@ public class ConditionTestPanel extends JPanel { ConditionTestPanel ctPanel = new ConditionTestPanel(list); frame.getContentPane().add(ctPanel); frame.pack(); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.setVisible(true); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleImageField.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleImageField.java index 6db617874d..beeec5dbe9 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleImageField.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/SimpleImageField.java @@ -17,20 +17,20 @@ package docking.widgets.fieldpanel.field; import java.awt.*; -import javax.swing.ImageIcon; -import javax.swing.JComponent; +import javax.swing.*; import docking.widgets.fieldpanel.internal.FieldBackgroundColorManager; import docking.widgets.fieldpanel.internal.PaintContext; import docking.widgets.fieldpanel.support.DefaultRowColLocation; import docking.widgets.fieldpanel.support.RowColLocation; +import resources.ResourceManager; /** * Field to display an image. */ public class SimpleImageField implements Field { - protected ImageIcon icon; + protected ImageIcon imageIon; protected FontMetrics metrics; protected int startX; protected int width; @@ -47,7 +47,7 @@ public class SimpleImageField implements Field { * @param startY the starting y coordinate of the field. * @param width the width of the field. */ - public SimpleImageField(ImageIcon icon, FontMetrics metrics, int startX, int startY, + public SimpleImageField(Icon icon, FontMetrics metrics, int startX, int startY, int width) { this(icon, metrics, startX, startY, width, false); } @@ -61,13 +61,13 @@ public class SimpleImageField implements Field { * @param width the width of the field. * @param center flag to center the image in the field. */ - public SimpleImageField(ImageIcon icon, FontMetrics metrics, int startX, int startY, int width, + public SimpleImageField(Icon icon, FontMetrics metrics, int startX, int startY, int width, boolean center) { this.heightAbove = metrics.getMaxAscent() + metrics.getLeading(); this.height = heightAbove + metrics.getMaxDescent(); - this.icon = icon; + this.imageIon = ResourceManager.getImageIcon(icon); this.metrics = metrics; this.startX = startX; this.width = width; @@ -161,7 +161,7 @@ public class SimpleImageField implements Field { @Override public int getPreferredWidth() { - return icon.getIconWidth(); + return imageIon.getIconWidth(); } @Override @@ -189,28 +189,28 @@ public class SimpleImageField implements Field { public void paint(JComponent c, Graphics g, PaintContext context, Rectangle clip, FieldBackgroundColorManager map, RowColLocation cursorLoc, int rowHeight) { - if (icon == null) { + if (imageIon == null) { return; } - int tmpWidth = icon.getIconWidth(); - int tmpHeight = icon.getIconHeight(); + int tmpWidth = imageIon.getIconWidth(); + int tmpHeight = imageIon.getIconHeight(); int xoffset = 0; int yoffset = 0; // if we are centering the image, then compute the offsets // if (center) { - if (width > icon.getIconWidth()) { - xoffset = width / 2 - icon.getIconWidth() / 2; + if (width > imageIon.getIconWidth()) { + xoffset = width / 2 - imageIon.getIconWidth() / 2; } - if (height > icon.getIconHeight()) { - yoffset = height / 2 - icon.getIconHeight() / 2; + if (height > imageIon.getIconHeight()) { + yoffset = height / 2 - imageIon.getIconHeight() / 2; } } // check to make sure that we are not going to draw outside the - // max rectagle + // max rectangle // if (tmpWidth > width) { tmpWidth = width; @@ -221,8 +221,10 @@ public class SimpleImageField implements Field { // draw the image, scaling to fit inside specified rectangle // - g.drawImage(icon.getImage(), startX + xoffset, -heightAbove + yoffset, tmpWidth, tmpHeight, - icon.getImageObserver()); + + g.drawImage(imageIon.getImage(), startX + xoffset, -heightAbove + yoffset, tmpWidth, + tmpHeight, + null); if (cursorLoc != null) { g.setColor(context.getCursorColor()); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java index 79c2b19687..542bf21c17 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java @@ -37,9 +37,8 @@ import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import docking.widgets.list.GListCellRenderer; import generic.theme.GColor; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Palette; -import ghidra.framework.OperatingSystem; -import ghidra.framework.Platform; import ghidra.framework.preferences.Preferences; import ghidra.util.*; import ghidra.util.exception.AssertException; @@ -50,8 +49,7 @@ import ghidra.util.task.SwingUpdateManager; import ghidra.util.task.TaskMonitor; import ghidra.util.worker.Job; import ghidra.util.worker.Worker; -import resources.*; -import resources.icons.TranslateIcon; +import resources.Icons; import util.CollectionUtils; import util.HistoryList; @@ -95,37 +93,20 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi private static final int PAD = 5; - private static Icon refreshIcon = Icons.REFRESH_ICON; - private static Icon backIcon = ResourceManager.loadImage("images/left.png"); - private static Icon forwardIcon = ResourceManager.loadImage("images/right.png"); - private static Icon detailsIcon = ResourceManager.loadImage("images/table.png"); - private static Icon optionsIcon = ResourceManager.loadImage("images/document-properties.png"); - private static Icon newFolderIcon = null; - private static Icon upIcon = null; - static { - if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS || - Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.LINUX) { + private static final Icon ICON_BACK = new GIcon("icon.left"); + private static final Icon ICON_FORWARD = new GIcon("icon.right"); + private static final Icon ICON_UP = new GIcon("icon.up"); + private static final Icon ICON_DETAILS = new GIcon("icon.table"); + private static final Icon ICON_OPTIONS = new GIcon("icon.properties"); + private static final Icon ICON_NEW_FOLDER = new GIcon("icon.folder.new"); - newFolderIcon = getIcon("FileChooser.newFolderIcon"); - upIcon = getIcon("FileChooser.upFolderIcon"); - } - if (newFolderIcon == null) { - newFolderIcon = ResourceManager.loadImage("images/folder_add.png"); - } - if (upIcon == null) { - upIcon = ResourceManager.loadImage("images/up.png"); - } - } + // 32 pixel side-bar icons + private static final Icon ICON_MY_COMPUTER = new GIcon("icon.filechooser.places.my.computer"); + private static final Icon ICON_DESKTOP = new GIcon("icon.filechooser.places.desktop"); + private static final Icon ICON_HOME = new GIcon("icon.filechooser.places.home"); + private static final Icon ICON_RECENT = new GIcon("icon.filechooser.places.recent"); - private static Icon getIcon(String iconName) { - try { - return UIManager.getIcon(iconName); - } - catch (Exception e) { - // we tried; just return null - } - return null; - } + // base and overlay? /** Instruction to display only files. */ public static final int FILES_ONLY = 0; @@ -309,7 +290,7 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi } }; myComputerButton.setName("MY_COMPUTER_BUTTON"); - myComputerButton.setIcon(ResourceManager.loadImage("images/computer.png")); + myComputerButton.setIcon(ICON_MY_COMPUTER); myComputerButton.addActionListener(e -> updateMyComputer()); myComputerButton.setForeground(FOREROUND_COLOR); @@ -320,7 +301,7 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi } }; desktopButton.setName("DESKTOP_BUTTON"); - desktopButton.setIcon(ResourceManager.loadImage("images/desktop.png")); + desktopButton.setIcon(ICON_DESKTOP); desktopButton.addActionListener(e -> updateDesktop()); desktopButton.setForeground(FOREROUND_COLOR); desktopButton.setEnabled(fileChooserModel.getDesktopDirectory() != null); @@ -332,7 +313,7 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi } }; homeButton.setName("HOME_BUTTON"); - homeButton.setIcon(ResourceManager.loadImage("images/user-home.png")); + homeButton.setIcon(ICON_HOME); homeButton.addActionListener(e -> updateHome()); homeButton.setForeground(FOREROUND_COLOR); @@ -343,12 +324,7 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi } }; recentButton.setName("RECENT_BUTTON"); - Icon baseIcon = ResourceManager.loadImage("images/inode-directory.png"); - Icon overlayIcon = ResourceManager.loadImage("images/edit-undo.png"); - MultiIcon multiIcon = new MultiIcon(baseIcon); - multiIcon.addIcon(new TranslateIcon(overlayIcon, 6, 10)); - - recentButton.setIcon(multiIcon); + recentButton.setIcon(ICON_RECENT); recentButton.addActionListener(e -> updateRecent()); recentButton.setForeground(FOREROUND_COLOR); @@ -501,19 +477,19 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi } private JButton[] buildNavigationButtons() { - backButton = new EmptyBorderButton(backIcon); + backButton = new EmptyBorderButton(ICON_BACK); backButton.setName("BACK_BUTTON"); backButton.setEnabled(false); backButton.setToolTipText("Go to last folder visited"); backButton.addActionListener(e -> goBack()); - forwardButton = new EmptyBorderButton(forwardIcon); + forwardButton = new EmptyBorderButton(ICON_FORWARD); forwardButton.setName("FORWARD_BUTTON"); forwardButton.setEnabled(false); forwardButton.setToolTipText("Go to previous folder visited"); forwardButton.addActionListener(e -> goForward()); - upLevelButton = new EmptyBorderButton(upIcon); + upLevelButton = new EmptyBorderButton(ICON_UP); upLevelButton.setName(UP_BUTTON_NAME); upLevelButton.setToolTipText("Up one level"); upLevelButton.addActionListener(e -> goUpOneDirectoryLevel()); @@ -523,17 +499,17 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi private JButton[] buildNonNavigationButtons() { - newFolderButton = new EmptyBorderButton(newFolderIcon); + newFolderButton = new EmptyBorderButton(ICON_NEW_FOLDER); newFolderButton.setName("NEW_BUTTON"); newFolderButton.setToolTipText("Create new folder"); newFolderButton.addActionListener(e -> createNewFolder()); - refreshButton = new EmptyBorderButton(refreshIcon); + refreshButton = new EmptyBorderButton(Icons.REFRESH_ICON); refreshButton.setName("REFRESH_BUTTON"); refreshButton.setToolTipText("Rescan current directory"); refreshButton.addActionListener(e -> rescanCurrentDirectory()); - detailsButton = new EmptyBorderToggleButton(detailsIcon); + detailsButton = new EmptyBorderToggleButton(ICON_DETAILS); detailsButton.setName("DETAILS_BUTTON"); detailsButton.setToolTipText("Show details"); detailsButton.addActionListener(e -> { @@ -541,7 +517,7 @@ public class GhidraFileChooser extends DialogComponentProvider implements FileFi doSetShowDetails(!showDetails); }); - optionsButton = new EmptyBorderButton(optionsIcon); + optionsButton = new EmptyBorderButton(ICON_OPTIONS); optionsButton.setName("OPTIONS_BUTTON"); optionsButton.setToolTipText("File Chooser Options"); optionsButton.addActionListener(e -> { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/LocalFileChooserModel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/LocalFileChooserModel.java index 7399a6c139..aca78d5940 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/LocalFileChooserModel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/LocalFileChooserModel.java @@ -15,19 +15,18 @@ */ package docking.widgets.filechooser; +import java.io.File; +import java.io.FileFilter; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; -import java.io.File; -import java.io.FileFilter; - import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.filechooser.FileSystemView; +import generic.theme.GIcon; import ghidra.util.filechooser.GhidraFileChooserModel; -import resources.ResourceManager; +import resources.Icons; import utility.function.Callback; /** @@ -35,10 +34,8 @@ import utility.function.Callback; * */ public class LocalFileChooserModel implements GhidraFileChooserModel { - private static final ImageIcon PROBLEM_FILE_ICON = - ResourceManager.loadImage("images/unknown.gif"); - private static final ImageIcon PENDING_ROOT_ICON = - ResourceManager.loadImage("images/famfamfam_silk_icons_v013/drive.png"); + private static final Icon PROBLEM_FILE_ICON = Icons.WARNING_ICON; + private static final Icon PENDING_ROOT_ICON = new GIcon("icon.drive"); private static final FileSystemRootInfo FS_ROOT_INFO = new FileSystemRootInfo(); private static final FileSystemView FS_VIEW = FileSystemView.getFileSystemView(); @@ -160,8 +157,9 @@ public class LocalFileChooserModel implements GhidraFileChooserModel { return src.renameTo(dest); } - //--------------------------------------------------------------------------------------------- - +//================================================================================================= +// Inner Classes +//================================================================================================= /** * Handles querying / caching information about file system root locations. *

diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptions.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptions.java index ac2bf6a943..20191a8af7 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptions.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/FilterOptions.java @@ -23,16 +23,16 @@ import javax.swing.Icon; import org.jdom.Element; +import generic.theme.GIcon; import resources.MultiIcon; -import resources.ResourceManager; import resources.icons.TranslateIcon; public class FilterOptions { - private static final Icon CONTAINS_ICON = ResourceManager.loadImage("images/page_code.png"); - private static final Icon STARTS_WITH_ICON = ResourceManager.loadImage("images/page_go.png"); - private static final Icon EXACT_MATCH_ICON = ResourceManager.loadImage("images/page_green.png"); - private static final Icon REG_EX_ICON = ResourceManager.loadImage("images/page_excel.png"); - private static final Icon NOT_ICON = ResourceManager.loadImage("images/bullet_delete.png"); + private static final Icon CONTAINS_ICON = new GIcon("icon.filter.options.contains"); + private static final Icon STARTS_WITH_ICON = new GIcon("icon.filter.options.starts.with"); + private static final Icon EXACT_MATCH_ICON = new GIcon("icon.filter.options.exact"); + private static final Icon REG_EX_ICON = new GIcon("icon.filter.options.regex"); + private static final Icon NOT_ICON = new GIcon("icon.filter.options.not"); final static Map DELIMITER_NAME_MAP = new HashMap<>(20); @@ -325,8 +325,13 @@ public class FilterOptions { char delim = getDelimitingCharacter(); String delimName = DELIMITER_NAME_MAP.get(delim); - buf.append("'").append(delim).append("'").append("  (").append( - delimName).append(")"); + buf.append("'") + .append(delim) + .append("'") + .append("  (") + .append( + delimName) + .append(")"); buf.append(""); buf.append(""); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ResetTranslationAction.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ResetTranslationAction.java index beaf8911e9..a2627efdd5 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ResetTranslationAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ResetTranslationAction.java @@ -15,20 +15,20 @@ */ package docking.widgets.imagepanel.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.MenuData; import docking.action.ToolBarData; import docking.widgets.imagepanel.ImagePanel; -import resources.ResourceManager; +import generic.theme.GIcon; /** * An action to re-center the image on a NavigableImagePanel. */ public class ResetTranslationAction extends ImagePanelDockingAction { - private static final ImageIcon RECENTER_ICON = ResourceManager.loadImage("images/tag.png"); + private static final Icon RECENTER_ICON = new GIcon("icon.widget.imagepanel.reset"); public ResetTranslationAction(String owner, ImagePanel imagePanel) { super("Recenter", owner, imagePanel); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/SaveImageAction.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/SaveImageAction.java index 0dbd110bc1..1dd5f15769 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/SaveImageAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/SaveImageAction.java @@ -30,7 +30,7 @@ import docking.widgets.filechooser.GhidraFileChooserMode; import docking.widgets.imagepanel.ImagePanel; import generic.util.image.ImageUtils; import ghidra.util.Msg; -import resources.ResourceManager; +import resources.Icons; /** * An action to save the image from a NavigableImagePanel to a file. @@ -51,7 +51,7 @@ public class SaveImageAction extends ImagePanelDockingAction { super("Export Image", owner, imagePanel); setPopupMenuData(new MenuData(new String[] { "Export Image As..." }, "io")); - setToolBarData(new ToolBarData(ResourceManager.loadImage("images/disk_save_as.png"))); + setToolBarData(new ToolBarData(Icons.SAVE_AS_ICON)); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomInAction.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomInAction.java index 3b6cc11014..17a0f0e16c 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomInAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomInAction.java @@ -15,27 +15,27 @@ */ package docking.widgets.imagepanel.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.MenuData; import docking.action.ToolBarData; import docking.widgets.imagepanel.ImagePanel; -import resources.ResourceManager; +import generic.theme.GIcon; /** * An action to zoom the image on a NavigableImagePanel. */ public class ZoomInAction extends ImagePanelDockingAction { - private static final ImageIcon ZOOM_IN_ICON = ResourceManager.loadImage("images/zoom_in.png"); + private static final Icon ICON = new GIcon("icon.widget.imagepanel.zoom.in"); public ZoomInAction(String owner, ImagePanel imagePanel) { super("Zoom In", owner, imagePanel); setPopupMenuData(new MenuData(new String[] { "Zoom in" }, "view")); - setToolBarData(new ToolBarData(ZOOM_IN_ICON)); + setToolBarData(new ToolBarData(ICON)); } @Override diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomOutAction.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomOutAction.java index 3a1d7194c7..303648a033 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomOutAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomOutAction.java @@ -15,20 +15,20 @@ */ package docking.widgets.imagepanel.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.MenuData; import docking.action.ToolBarData; import docking.widgets.imagepanel.ImagePanel; -import resources.ResourceManager; +import generic.theme.GIcon; /** * An action to de-zoom the image on a NavigableImagePanel. */ public class ZoomOutAction extends ImagePanelDockingAction { - private static final ImageIcon ZOOM_OUT_ICON = ResourceManager.loadImage("images/zoom_out.png"); + private static final Icon ZOOM_OUT_ICON = new GIcon("icon.widget.imagepanel.zoom.out"); public ZoomOutAction(String owner, ImagePanel imagePanel) { super("Zoom Out", owner, imagePanel); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomResetAction.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomResetAction.java index 69c6675788..9996e49c24 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomResetAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/ZoomResetAction.java @@ -15,19 +15,19 @@ */ package docking.widgets.imagepanel.actions; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.ActionContext; import docking.action.ToolBarData; import docking.widgets.imagepanel.ImagePanel; -import resources.ResourceManager; +import generic.theme.GIcon; /** * An action to reset the zoom of a NavigableImagePanel. */ public class ZoomResetAction extends ImagePanelDockingAction { - private static final ImageIcon ZOOM_ICON = ResourceManager.loadImage("images/zoom.png"); + private static final Icon ZOOM_ICON = new GIcon("icon.widget.imagepanel.reset"); public ZoomResetAction(String owner, ImagePanel imagePanel) { super("Reset Zoom", owner, imagePanel); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathManager.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathManager.java index 046e21c105..609e234a28 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathManager.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathManager.java @@ -35,7 +35,7 @@ import ghidra.framework.options.SaveState; import ghidra.framework.preferences.Preferences; import ghidra.util.filechooser.GhidraFileChooserModel; import ghidra.util.filechooser.GhidraFileFilter; -import resources.ResourceManager; +import resources.Icons; /** * Component that has a table to show pathnames; the panel includes buttons to control @@ -162,26 +162,26 @@ public class PathManager { panel = new JPanel(new BorderLayout(5, 5)); if (allowOrdering) { - upButton = new JButton(ResourceManager.loadImage("images/up.png")); + upButton = new JButton(Icons.UP_ICON); upButton.setName("UpArrow"); upButton.setToolTipText("Move the selected path up in list"); upButton.addActionListener(e -> up()); upButton.setFocusable(false); - downButton = new JButton(ResourceManager.loadImage("images/down.png")); + downButton = new JButton(Icons.DOWN_ICON); downButton.setName("DownArrow"); downButton.setToolTipText("Move the selected path down in list"); downButton.addActionListener(e -> down()); downButton.setFocusable(false); } - addButton = new JButton(ResourceManager.loadImage("images/Plus.png")); + addButton = new JButton(Icons.ADD_ICON); addButton.setName("AddPath"); addButton.setToolTipText("Display file chooser to select files to add"); addButton.addActionListener(e -> add()); addButton.setFocusable(false); - removeButton = new JButton(ResourceManager.loadImage("images/edit-delete.png")); + removeButton = new JButton(Icons.DELETE_ICON); removeButton.setName("RemovePath"); removeButton.setToolTipText("Remove selected path(s) from list"); removeButton.addActionListener(e -> remove()); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathnameTablePanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathnameTablePanel.java index e05b76a055..f2702d5f91 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathnameTablePanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/pathmanager/PathnameTablePanel.java @@ -27,11 +27,12 @@ import docking.widgets.OptionDialog; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.filechooser.GhidraFileChooserMode; import docking.widgets.table.*; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Tables; import ghidra.framework.preferences.Preferences; import ghidra.util.filechooser.GhidraFileChooserModel; import ghidra.util.filechooser.GhidraFileFilter; -import resources.ResourceManager; +import resources.Icons; import utility.function.Callback; /** @@ -39,14 +40,10 @@ import utility.function.Callback; * the order of the paths, and to add and remove paths. The add button brings up a * file chooser. Call the setFileChooser() method to control how the file chooser should * behave. If the table entries should not be edited, call setEditingEnabled(false). - * - * - * */ public class PathnameTablePanel extends JPanel { - private static final long serialVersionUID = 1L; - private static final Icon RESET_ICON = ResourceManager.loadImage("images/trash-empty.png"); + private static final Icon RESET_ICON = new GIcon("icon.widget.pathmanager.reset"); private JTable pathnameTable; private PathnameTableModel tableModel; @@ -160,19 +157,19 @@ public class PathnameTablePanel extends JPanel { private void create() { - upButton = new JButton(ResourceManager.loadImage("images/up.png")); + upButton = new JButton(Icons.UP_ICON); upButton.setName("UpArrow"); upButton.setToolTipText("Move the selected path up in list"); upButton.addActionListener(e -> up()); - downButton = new JButton(ResourceManager.loadImage("images/down.png")); + downButton = new JButton(Icons.DOWN_ICON); downButton.setName("DownArrow"); downButton.setToolTipText("Move the selected path down in list"); downButton.addActionListener(e -> down()); - addButton = new JButton(ResourceManager.loadImage("images/Plus.png")); + addButton = new JButton(Icons.ADD_ICON); addButton.setName("AddPath"); addButton.setToolTipText("Display file chooser to select files to add"); addButton.addActionListener(e -> add()); - removeButton = new JButton(ResourceManager.loadImage("images/edit-delete.png")); + removeButton = new JButton(Icons.DELETE_ICON); removeButton.setName("RemovePath"); removeButton.setToolTipText("Remove selected path(s) from list"); removeButton.addActionListener(e -> remove()); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTable.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTable.java index 5f30524cb5..904735753a 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTable.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTable.java @@ -38,11 +38,12 @@ import docking.widgets.AutoLookup; import docking.widgets.OptionDialog; import docking.widgets.dialogs.SettingsDialog; import docking.widgets.filechooser.GhidraFileChooser; +import generic.theme.GIcon; import ghidra.docking.settings.*; import ghidra.framework.preferences.Preferences; import ghidra.util.*; import ghidra.util.exception.AssertException; -import resources.ResourceManager; +import resources.Icons; /** * A sub-class of JTable that provides navigation and auto-lookup. @@ -74,6 +75,7 @@ import resources.ResourceManager; */ public class GTable extends JTable { + private static final GIcon ICON_SPREADSHEET = new GIcon("icon.spreadsheet"); private static final KeyStroke COPY_KEY_STROKE = KeyStroke.getKeyStroke(KeyEvent.VK_C, CONTROL_KEY_MODIFIER_MASK); private static final KeyStroke COPY_COLUMN_KEY_STROKE = @@ -1279,7 +1281,7 @@ public class GTable extends JTable { //@formatter:off copyAction.setPopupMenuData(new MenuData( new String[] { "Copy", "Copy" }, - ResourceManager.loadImage("images/page_white_copy.png"), + Icons.COPY_ICON, actionMenuGroup, NO_MNEMONIC, Integer.toString(subGroupIndex++) ) @@ -1300,7 +1302,7 @@ public class GTable extends JTable { copyCurrentColumnAction.setPopupMenuData(new MenuData( new String[] { "Copy", "Copy Current Column" }, - ResourceManager.loadImage("images/page_white_copy.png"), + Icons.COPY_ICON, actionMenuGroup, NO_MNEMONIC, Integer.toString(subGroupIndex++) @@ -1320,7 +1322,7 @@ public class GTable extends JTable { //@formatter:off copyColumnsAction.setPopupMenuData(new MenuData( new String[] { "Copy", "Copy Columns..." }, - ResourceManager.loadImage("images/page_white_copy.png"), + Icons.COPY_ICON, actionMenuGroup, NO_MNEMONIC, Integer.toString(subGroupIndex++) @@ -1339,7 +1341,7 @@ public class GTable extends JTable { //@formatter:off exportAction.setPopupMenuData(new MenuData( new String[] { "Export", GTableToCSV.TITLE + "..." }, - ResourceManager.loadImage("images/application-vnd.oasis.opendocument.spreadsheet-template.png"), + ICON_SPREADSHEET, actionMenuGroup, NO_MNEMONIC, Integer.toString(subGroupIndex++) @@ -1359,7 +1361,7 @@ public class GTable extends JTable { //@formatter:off exportColumnsAction.setPopupMenuData(new MenuData( new String[] { "Export", "Export Columns to CSV..." }, - ResourceManager.loadImage("images/application-vnd.oasis.opendocument.spreadsheet-template.png"), + ICON_SPREADSHEET, actionMenuGroup, NO_MNEMONIC, Integer.toString(subGroupIndex++) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableFilterPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableFilterPanel.java index 6839eaa01f..a230b8f752 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableFilterPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableFilterPanel.java @@ -37,6 +37,7 @@ import docking.widgets.label.GDLabel; import docking.widgets.table.columnfilter.ColumnBasedTableFilter; import docking.widgets.table.columnfilter.ColumnFilterSaveManager; import docking.widgets.table.constraint.dialog.ColumnFilterDialog; +import generic.theme.GIcon; import ghidra.framework.options.PreferenceState; import ghidra.util.HelpLocation; import ghidra.util.Msg; @@ -46,7 +47,6 @@ import ghidra.util.exception.AssertException; import ghidra.util.task.SwingUpdateManager; import help.HelpService; import resources.Icons; -import resources.ResourceManager; import utilities.util.reflection.ReflectionUtilities; import utility.function.Callback; @@ -112,8 +112,8 @@ public class GTableFilterPanel extends JPanel { public static final String FILTER_TEXTFIELD_NAME = "filter.panel.textfield"; private static final String FILTER_STATE = "FILTER_STATE"; private static final String FILTER_EXTENSION = ".FilterExtension"; - private static final Icon FILTER_ON_ICON = ResourceManager.loadImage("images/filter_on.png"); - private static final Icon FILTER_OFF_ICON = ResourceManager.loadImage("images/filter_off.png"); + private static final Icon FILTER_ON_ICON = new GIcon("icon.widget.filterpanel.filter.on"); + private static final Icon FILTER_OFF_ICON = new GIcon("icon.widget.filterpanel.filter.off"); private static final Icon APPLY_FILTER_ICON = Icons.OPEN_FOLDER_ICON; private static final Icon CLEAR_FILTER_ICON = Icons.DELETE_ICON; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeader.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeader.java index f9e689ba51..ef68cfe6f2 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeader.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeader.java @@ -23,6 +23,7 @@ import javax.swing.table.*; import docking.DockingWindowManager; import docking.widgets.table.columnfilter.ColumnBasedTableFilter; +import generic.theme.GIcon; import ghidra.util.HTMLUtilities; import ghidra.util.HelpLocation; import help.HelpService; @@ -40,9 +41,9 @@ public class GTableHeader extends JTableHeader { public static final int HELP_ICON_HEIGHT = 8; private static final Icon HELP_ICON = ResourceManager.getScaledIcon( - ResourceManager.loadImage("images/info_small.png"), HELP_ICON_HEIGHT, HELP_ICON_HEIGHT); + new GIcon("icon.widget.table.header.help"), HELP_ICON_HEIGHT, HELP_ICON_HEIGHT); private static final Icon HELP_HOVERED_ICON = - ResourceManager.getScaledIcon(ResourceManager.loadImage("images/info_small_hover.png"), + ResourceManager.getScaledIcon(new GIcon("icon.widget.table.header.help.hovered"), HELP_ICON_HEIGHT, HELP_ICON_HEIGHT); private final GTable gTable; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java index 1e8ecfa6a8..3f83921acd 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableHeaderRenderer.java @@ -24,6 +24,7 @@ import javax.swing.border.Border; import javax.swing.table.*; import generic.theme.GColor; +import generic.theme.GIcon; import resources.*; import resources.icons.EmptyIcon; import resources.icons.TranslateIcon; @@ -41,7 +42,9 @@ public class GTableHeaderRenderer extends DefaultTableCellRenderer { private static final Icon EMPTY_ICON = new EmptyIcon(0, 0); private static final Icon FILTER_ICON = - ResourceManager.getScaledIcon(ResourceManager.loadImage("images/filter_off.png"), 12, 12); + ResourceManager.getScaledIcon(new GIcon("icon.widget.filterpanel.filter.off"), 12, 12); + + private static final Icon PENDING_ICON = new GIcon("icon.widget.table.header.pending"); private Icon primaryIcon = EMPTY_ICON; private Icon helpIcon = EMPTY_ICON; @@ -290,7 +293,7 @@ public class GTableHeaderRenderer extends DefaultTableCellRenderer { } if (isPendingSort) { - icon = ResourceManager.loadImage("images/hourglass.png"); + icon = PENDING_ICON; } return icon; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java index 224b4408f8..82e9ad055b 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterDialog.java @@ -39,7 +39,7 @@ import generic.util.WindowUtilities; import ghidra.util.HelpLocation; import ghidra.util.Msg; import ghidra.util.layout.VerticalLayout; -import resources.ResourceManager; +import resources.Icons; import utility.function.Callback; /** @@ -129,7 +129,7 @@ public class ColumnFilterDialog extends DialogComponentProvider }; saveAction.setHelpLocation(new HelpLocation("Trees", "Save_Filter")); saveAction.setDescription("Save Filter"); - saveAction.setToolBarData(new ToolBarData(ResourceManager.loadImage("images/disk.png"))); + saveAction.setToolBarData(new ToolBarData(Icons.SAVE_ICON)); addAction(saveAction); DockingAction loadAction = new DockingAction("Load", "Filter") { @@ -141,7 +141,7 @@ public class ColumnFilterDialog extends DialogComponentProvider loadAction.setDescription("Load Filter"); loadAction.setHelpLocation(new HelpLocation("Trees", "Load_Filter")); loadAction.setToolBarData( - new ToolBarData(ResourceManager.loadImage("images/openSmallFolder.png"))); + new ToolBarData(Icons.OPEN_FOLDER_ICON)); addAction(loadAction); } @@ -224,13 +224,13 @@ public class ColumnFilterDialog extends DialogComponentProvider JPanel innerPanel = new JPanel(new VerticalLayout(3)); JButton addAndConditionButton = - new JButton("Add AND condition", ResourceManager.loadImage("images/Plus.png")); + new JButton("Add AND condition", Icons.ADD_ICON); addAndConditionButton.addActionListener(e -> addFilterCondition(LogicOperation.AND)); addAndConditionButton.setEnabled(true); JButton addOrConditionButton = - new JButton("Add OR condition", ResourceManager.loadImage("images/Plus.png")); + new JButton("Add OR condition", Icons.ADD_ICON); addOrConditionButton.setHorizontalAlignment(SwingConstants.LEFT); addOrConditionButton.addActionListener(e -> addFilterCondition(LogicOperation.OR)); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterPanel.java index feb4ad39f5..d3c1d067dc 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constraint/dialog/ColumnFilterPanel.java @@ -28,6 +28,7 @@ import docking.widgets.label.GDLabel; import docking.widgets.list.GListCellRenderer; import generic.theme.GThemeDefaults.Colors.Messages; import ghidra.util.layout.VerticalLayout; +import resources.Icons; import resources.ResourceManager; /** @@ -55,7 +56,7 @@ class ColumnFilterPanel extends JPanel { private Component buildButtonPanel() { JPanel panel = new JPanel(new BorderLayout()); - Icon icon = ResourceManager.loadImage("images/Plus.png"); + Icon icon = Icons.ADD_ICON; icon = ResourceManager.getScaledIcon(icon, BUTTON_ICON_SIZE, BUTTON_ICON_SIZE); JButton button = new EmptyBorderButton(icon); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeNode.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeNode.java index dca009522b..72d94fa2d9 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeNode.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeNode.java @@ -18,11 +18,10 @@ package docking.widgets.tree.internal; import javax.swing.Icon; import docking.widgets.tree.GTreeNode; -import docking.widgets.tree.GTreeNode; -import resources.ResourceManager; +import generic.theme.GIcon; public class InProgressGTreeNode extends GTreeNode { - private static final Icon ICON = ResourceManager.loadImage("images/magnifier.png"); + private static final Icon ICON = new GIcon("icon.search"); public InProgressGTreeNode() { } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeRootNode.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeRootNode.java index b71f3d0331..0bf6197737 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeRootNode.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/internal/InProgressGTreeRootNode.java @@ -18,11 +18,11 @@ package docking.widgets.tree.internal; import javax.swing.Icon; import docking.widgets.tree.GTreeNode; -import resources.ResourceManager; +import generic.theme.GIcon; public class InProgressGTreeRootNode extends GTreeNode { - private static final Icon ICON = ResourceManager.loadImage("images/magnifier.png"); + private static final Icon ICON = new GIcon("icon.search"); @Override public String getName() { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/wizard/WizardManager.java b/Ghidra/Framework/Docking/src/main/java/docking/wizard/WizardManager.java index dae4a1e9ce..7024d97153 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/wizard/WizardManager.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/wizard/WizardManager.java @@ -31,7 +31,7 @@ import generic.theme.GThemeDefaults.Colors.Messages; import ghidra.util.*; import help.Help; import help.HelpService; -import resources.ResourceManager; +import resources.Icons; /** * A dialog that controls the panels for going to "Next" and "Previous" in some @@ -221,7 +221,7 @@ public class WizardManager extends DialogComponentProvider implements WizardPane : new GDLabel(INIT_TITLE, wizardIcon, SwingConstants.TRAILING)); EmptyBorderButton helpButton = - new EmptyBorderButton(ResourceManager.loadImage("images/information.png")); + new EmptyBorderButton(Icons.INFO_ICON); helpButton.setToolTipText("Help (F1)"); helpButton.addActionListener( e -> DockingWindowManager.getHelpService().showHelp(rootPanel, false, rootPanel)); diff --git a/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/ChompingBitsAnimationPanel.java b/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/ChompingBitsAnimationPanel.java index e37b9af018..c06ee2a9af 100644 --- a/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/ChompingBitsAnimationPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/ChompingBitsAnimationPanel.java @@ -17,31 +17,34 @@ package ghidra.util.task; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.ArrayList; import java.util.List; import javax.swing.*; import docking.util.AnimatedIcon; -import resources.ResourceManager; +import generic.theme.GIcon; /** - * Panel that displays an animation of the Ghidra dragon chomping bits. + * Panel that displays an animation of the Ghidra dragon eating bits. */ public class ChompingBitsAnimationPanel extends JPanel { + //@formatter:off + private static final List ICONS = List.of( + new GIcon("icon.task.progress.1"), + new GIcon("icon.task.progress.2"), + new GIcon("icon.task.progress.3"), + new GIcon("icon.task.progress.4"), + new GIcon("icon.task.progress.5"), + new GIcon("icon.task.progress.6"), + new GIcon("icon.task.progress.7") + ); + //@formatter:on + public ChompingBitsAnimationPanel() { setLayout(new BorderLayout()); - - List iconList = new ArrayList<>(); - iconList.add(ResourceManager.loadImage("images/eatbits1.png")); - iconList.add(ResourceManager.loadImage("images/eatbits2.png")); - iconList.add(ResourceManager.loadImage("images/eatbits3.png")); - iconList.add(ResourceManager.loadImage("images/eatbits4.png")); - iconList.add(ResourceManager.loadImage("images/eatbits5.png")); - iconList.add(ResourceManager.loadImage("images/eatbits6.png")); - iconList.add(ResourceManager.loadImage("images/eatbits7.png")); - AnimatedIcon icon = new AnimatedIcon(iconList, 200, 0); + + AnimatedIcon icon = new AnimatedIcon(ICONS, 200, 0); setSize(new Dimension(200, 100)); add(new JLabel(icon)); } diff --git a/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/HourglassAnimationPanel.java b/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/HourglassAnimationPanel.java index e0f0666c1f..3567663ba4 100644 --- a/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/HourglassAnimationPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/HourglassAnimationPanel.java @@ -16,44 +16,44 @@ package ghidra.util.task; import java.awt.BorderLayout; -import java.util.ArrayList; import java.util.List; import javax.swing.*; import docking.util.AnimatedIcon; -import resources.ResourceManager; +import generic.theme.GIcon; /** * Panel that displays an animation of a spinning hourglass */ public class HourglassAnimationPanel extends JPanel { + //@formatter:off + private static final List ICONS = List.of( + new GIcon("icon.task.progress.hourglass.1"), + new GIcon("icon.task.progress.hourglass.2"), + new GIcon("icon.task.progress.hourglass.2"), + new GIcon("icon.task.progress.hourglass.3"), + new GIcon("icon.task.progress.hourglass.3"), + new GIcon("icon.task.progress.hourglass.4"), + new GIcon("icon.task.progress.hourglass.4"), + new GIcon("icon.task.progress.hourglass.5"), + new GIcon("icon.task.progress.hourglass.5"), + new GIcon("icon.task.progress.hourglass.6"), + new GIcon("icon.task.progress.hourglass.6"), + new GIcon("icon.task.progress.hourglass.7"), + new GIcon("icon.task.progress.hourglass.7"), + new GIcon("icon.task.progress.hourglass.8"), + new GIcon("icon.task.progress.hourglass.8"), + new GIcon("icon.task.progress.hourglass.9"), + new GIcon("icon.task.progress.hourglass.10"), + new GIcon("icon.task.progress.hourglass.11") + ); + //@formatter:on + public HourglassAnimationPanel() { - setLayout(new BorderLayout()); - - List iconList = new ArrayList<>(); - iconList.add(ResourceManager.loadImage("images/hourglass24_01.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_02.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_02.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_03.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_03.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_04.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_04.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_05.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_05.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_06.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_06.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_07.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_07.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_08.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_08.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_09.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_10.png")); - iconList.add(ResourceManager.loadImage("images/hourglass24_11.png")); - AnimatedIcon progressIcon = new AnimatedIcon(iconList, 150, 0); - + AnimatedIcon progressIcon = new AnimatedIcon(ICONS, 150, 0); add(new JLabel(progressIcon), BorderLayout.NORTH); } } diff --git a/Ghidra/Features/Base/src/main/resources/images/collapse.gif b/Ghidra/Framework/Docking/src/main/resources/images/collapse.gif similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/collapse.gif rename to Ghidra/Framework/Docking/src/main/resources/images/collapse.gif diff --git a/Ghidra/Features/Base/src/main/resources/images/famfamfam_silk_icons_v013/drive.png b/Ghidra/Framework/Docking/src/main/resources/images/drive.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/famfamfam_silk_icons_v013/drive.png rename to Ghidra/Framework/Docking/src/main/resources/images/drive.png diff --git a/Ghidra/Framework/Project/src/main/resources/images/edit-cut.png b/Ghidra/Framework/Docking/src/main/resources/images/edit-cut.png similarity index 100% rename from Ghidra/Framework/Project/src/main/resources/images/edit-cut.png rename to Ghidra/Framework/Docking/src/main/resources/images/edit-cut.png diff --git a/Ghidra/Features/Base/src/main/resources/images/expand.gif b/Ghidra/Framework/Docking/src/main/resources/images/expand.gif similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/expand.gif rename to Ghidra/Framework/Docking/src/main/resources/images/expand.gif diff --git a/Ghidra/Framework/Docking/src/main/resources/images/go-home.png b/Ghidra/Framework/Docking/src/main/resources/images/go-home.png new file mode 100644 index 0000000000..a46fb22206 Binary files /dev/null and b/Ghidra/Framework/Docking/src/main/resources/images/go-home.png differ diff --git a/Ghidra/Features/Base/src/main/resources/images/list-remove.png b/Ghidra/Framework/Docking/src/main/resources/images/list-remove.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/list-remove.png rename to Ghidra/Framework/Docking/src/main/resources/images/list-remove.png diff --git a/Ghidra/Features/Base/src/main/resources/images/play.png b/Ghidra/Framework/Docking/src/main/resources/images/play.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/play.png rename to Ghidra/Framework/Docking/src/main/resources/images/play.png diff --git a/Ghidra/Framework/Docking/src/main/resources/images/tag.png b/Ghidra/Framework/Docking/src/main/resources/images/tag.png new file mode 100644 index 0000000000..e093032a77 Binary files /dev/null and b/Ghidra/Framework/Docking/src/main/resources/images/tag.png differ diff --git a/Ghidra/Features/Base/src/main/resources/images/zoom.png b/Ghidra/Framework/Docking/src/main/resources/images/zoom.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/zoom.png rename to Ghidra/Framework/Docking/src/main/resources/images/zoom.png diff --git a/Ghidra/Features/Base/src/main/resources/images/zoom_in.png b/Ghidra/Framework/Docking/src/main/resources/images/zoom_in.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/zoom_in.png rename to Ghidra/Framework/Docking/src/main/resources/images/zoom_in.png diff --git a/Ghidra/Features/Base/src/main/resources/images/zoom_out.png b/Ghidra/Framework/Docking/src/main/resources/images/zoom_out.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/zoom_out.png rename to Ghidra/Framework/Docking/src/main/resources/images/zoom_out.png diff --git a/Ghidra/Framework/Generic/src/main/java/resources/Icons.java b/Ghidra/Framework/Generic/src/main/java/resources/Icons.java index f7be54e0f6..d16b78199e 100644 --- a/Ghidra/Framework/Generic/src/main/java/resources/Icons.java +++ b/Ghidra/Framework/Generic/src/main/java/resources/Icons.java @@ -15,8 +15,6 @@ */ package resources; -import java.awt.Component; -import java.awt.Graphics; import java.lang.reflect.Field; import java.net.URL; @@ -24,7 +22,6 @@ import javax.swing.Icon; import javax.swing.ImageIcon; import generic.theme.GIcon; -import generic.theme.GThemeDefaults.Colors; import ghidra.util.Msg; /** @@ -69,6 +66,8 @@ public class Icons { public static final Icon LEFT_ICON = new GIcon("icon.left"); public static final Icon RIGHT_ICON = new GIcon("icon.right"); + public static final Icon UP_ICON = new GIcon("icon.up"); + public static final Icon DOWN_ICON = new GIcon("icon.down"); /** An version of the LEFT_ICON with a different color */ public static final Icon LEFT_ALTERNATE_ICON = new GIcon("icon.left.alt"); @@ -191,36 +190,6 @@ public class Icons { return null; } - // Creates a 16x16 icon with a scaled base icon and puts 3 dots below it. - private static class DotDotDotIcon implements Icon { - private Icon base; - - public DotDotDotIcon(Icon base) { - this.base = ResourceManager.getScaledIcon(base, 12, 12); - } - - @Override - public void paintIcon(Component c, Graphics g, int x, int y) { - base.paintIcon(c, g, x, y); - g.setColor(Colors.BACKGROUND); - g.fillRect(x + 6, y + 14, 2, 2); - g.fillRect(x + 9, y + 14, 2, 2); - g.fillRect(x + 12, y + 14, 2, 2); - - } - - @Override - public int getIconWidth() { - return 16; - } - - @Override - public int getIconHeight() { - return 16; - } - - } - private Icons() { // utility class } diff --git a/Ghidra/Framework/Graph/data/graph.theme.properties b/Ghidra/Framework/Graph/data/graph.theme.properties index 51f39570e8..c80585c98d 100644 --- a/Ghidra/Framework/Graph/data/graph.theme.properties +++ b/Ghidra/Framework/Graph/data/graph.theme.properties @@ -27,13 +27,16 @@ color.visualgraph.view.satellite.edge.hovered = color.palette.lime - # graph display color.graphdisplay.vertex = green color.graphdisplay.edge = green color.graphdisplay.vertex.selected = blue color.graphdisplay.edge.selected = blue +icon.graph.satellite = network-wireless-16.png +icon.graph.satellite.large = network-wireless.png +icon.graph.layout.default = color_swatch.png + [Dark Defaults] diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/featurette/VgSatelliteFeaturette.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/featurette/VgSatelliteFeaturette.java index 8b404bb0f9..8ad2748914 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/featurette/VgSatelliteFeaturette.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/featurette/VgSatelliteFeaturette.java @@ -24,13 +24,13 @@ import javax.swing.JComponent; import docking.*; import docking.action.MenuData; import docking.action.ToggleDockingAction; +import generic.theme.GIcon; import ghidra.framework.options.SaveState; import ghidra.graph.VisualGraph; import ghidra.graph.VisualGraphComponentProvider; import ghidra.graph.viewer.*; import ghidra.graph.viewer.actions.*; import ghidra.util.HelpLocation; -import resources.ResourceManager; /** * A sub-feature that provides a satellite viewer to {@link VisualGraphComponentProvider}s @@ -52,7 +52,7 @@ public class VgSatelliteFeaturette { //@formatter:on - private static final Icon ICON = ResourceManager.loadImage("images/network-wireless-16.png"); + private static final Icon ICON = new GIcon("icon.graph.satellite"); private static final String DISPLAY_SATELLITE = "DISPLAY_SATELLITE"; private static final String DOCK_SATELLITE = "DOCK_SATELLITE"; diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphComponent.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphComponent.java index 169c2e6656..80c2e91b7a 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphComponent.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphComponent.java @@ -44,6 +44,7 @@ import edu.uci.ics.jung.visualization.renderers.Renderer; import edu.uci.ics.jung.visualization.renderers.Renderer.Vertex; import edu.uci.ics.jung.visualization.util.Caching; import generic.theme.GColor; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors; import generic.theme.GThemeDefaults.Colors.Palette; import ghidra.graph.VisualGraph; @@ -64,7 +65,6 @@ import ghidra.util.HelpLocation; import ghidra.util.exception.AssertException; import help.HelpService; import resources.Icons; -import resources.ResourceManager; import util.CollectionUtils; /** @@ -96,6 +96,7 @@ public class GraphComponent, G e private static final Integer SATELLITE_PROVIDER_BUTTON_LAYER = Integer.valueOf(199); private static final Integer SATELLITE_VIEWER_LAYER = Integer.valueOf(200); private static final Integer STALE_GRAPH_VIEW_LAYER = Integer.valueOf(300); + private static final Icon LARGE_SATELLITE_ICON = new GIcon("icon.graph.satellite.large"); private JPanel staleGraphViewPanel; private MessagePaintable messagePaintable = new MessagePaintable(); @@ -453,7 +454,7 @@ public class GraphComponent, G e private EmptyBorderButton buildShowUndockedProviderButton() { String tooltip = "Bring satellite view to the front"; - Icon icon = ResourceManager.loadImage("images/network-wireless.png"); + Icon icon = LARGE_SATELLITE_ICON; JLabel iconLabel = new GIconLabel(icon); iconLabel.setOpaque(false); iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); @@ -1049,9 +1050,6 @@ public class GraphComponent, G e startX + (isGraphViewStale() ? staleGraphViewPanel.getBounds().width + 5 : 0); g2.drawString(message, textX, startY); -// ImageIcon icon = ResourceManager.loadImage("images/dragon_head.png"); -// g2.drawImage(icon.getImage(), backgroundX, upperY, null); - g2.setComposite(originalComposite); } diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/JungLayoutProvider.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/JungLayoutProvider.java index cf10d0f30d..8f7c95992a 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/JungLayoutProvider.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/JungLayoutProvider.java @@ -20,13 +20,13 @@ import java.util.Objects; import javax.swing.Icon; import edu.uci.ics.jung.algorithms.layout.Layout; +import generic.theme.GIcon; import ghidra.graph.VisualGraph; import ghidra.graph.graphs.JungDirectedVisualGraph; import ghidra.graph.viewer.VisualEdge; import ghidra.graph.viewer.VisualVertex; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * A layout provider that works on {@link JungDirectedVisualGraph}s. This class allows the @@ -43,7 +43,7 @@ public abstract class JungLayoutProvider { //@formatter:on - private static final Icon DEFAULT_ICON = ResourceManager.loadImage("images/color_swatch.png"); + private static final Icon DEFAULT_ICON = new GIcon("icon.graph.layout.default"); protected abstract Layout createLayout(G g); diff --git a/Ghidra/Framework/Help/src/main/java/help/GHelpBroker.java b/Ghidra/Framework/Help/src/main/java/help/GHelpBroker.java index a6e8c49000..1923fa2d7d 100644 --- a/Ghidra/Framework/Help/src/main/java/help/GHelpBroker.java +++ b/Ghidra/Framework/Help/src/main/java/help/GHelpBroker.java @@ -24,8 +24,10 @@ import javax.help.*; import javax.swing.*; import javax.swing.text.Document; +import generic.theme.GIcon; import ghidra.util.Msg; import ghidra.util.bean.GGlassPane; +import resources.Icons; import resources.ResourceManager; // NOTE: for JH 2.0, this class has been rewritten to not @@ -38,9 +40,8 @@ import resources.ResourceManager; public class GHelpBroker extends DefaultHelpBroker { // Create the zoom in/out icons that will be added to the default jHelp toolbar. - private static final ImageIcon ZOOM_OUT_ICON = - ResourceManager.loadImage("images/list-remove.png"); - private static final ImageIcon ZOOM_IN_ICON = ResourceManager.loadImage("images/list-add.png"); + private static final Icon ZOOM_OUT_ICON = new GIcon("icon.subtract"); + private static final Icon ZOOM_IN_ICON = Icons.ADD_ICON; private Dimension windowSize = new Dimension(1100, 700); diff --git a/Ghidra/Framework/Project/certification.manifest b/Ghidra/Framework/Project/certification.manifest index 5f90e7b553..045c9ea18f 100644 --- a/Ghidra/Framework/Project/certification.manifest +++ b/Ghidra/Framework/Project/certification.manifest @@ -37,9 +37,9 @@ src/main/resources/images/dialog-cancel.png||Oxygen Icons - LGPL 3.0||||END| src/main/resources/images/disconnected.gif||GHIDRA||reviewed||END| src/main/resources/images/disk.png||FAMFAMFAM Icons - CC 2.5||||END| src/main/resources/images/disk_save_as.png||FAMFAMFAM Icons - CC 2.5|||modified silk icon disk_multiple.png|END| -src/main/resources/images/edit-cut.png||Tango Icons - Public Domain|||tango icon set|END| src/main/resources/images/face-glasses.png||Tango Icons - Public Domain|||tango icon set|END| src/main/resources/images/folder_add.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| +src/main/resources/images/lock.png||FAMFAMFAM Icons - CC 2.5|||famfamfam silk icon set|END| src/main/resources/images/monitor.png||FAMFAMFAM Icons - CC 2.5|||silk|END| src/main/resources/images/noneInTool.gif||GHIDRA||reviewed||END| src/main/resources/images/page_add.png||FAMFAMFAM Icons - CC 2.5||||END| @@ -47,6 +47,7 @@ src/main/resources/images/page_copy.png||FAMFAMFAM Icons - CC 2.5||||END| src/main/resources/images/page_delete.png||FAMFAMFAM Icons - CC 2.5||||END| src/main/resources/images/page_edit.png||FAMFAMFAM Icons - CC 2.5||||END| src/main/resources/images/page_paste.png||FAMFAMFAM Icons - CC 2.5||||END| +src/main/resources/images/plasma.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END| src/main/resources/images/plugin.png||GHIDRA||reviewed||END| src/main/resources/images/small_hijack.gif||GHIDRA||reviewed||END| src/main/resources/images/someInTool.gif||GHIDRA||reviewed||END| diff --git a/Ghidra/Framework/Project/data/project.theme.properties b/Ghidra/Framework/Project/data/project.theme.properties index 1c511e709c..9c26ee46f6 100644 --- a/Ghidra/Framework/Project/data/project.theme.properties +++ b/Ghidra/Framework/Project/data/project.theme.properties @@ -43,6 +43,45 @@ color.fg.logviewer.table.selected = black color.bg.project.access.panel.table.selection = lavender color.fg.project.access.panel.table.selection = black +icon.version.control.add = vcAdd.png +icon.version.control.check.in = vcCheckIn.png +icon.version.control.check.out = vcCheckOut.png +icon.version.control.check.out.undo = vcUndoCheckOut.png +icon.version.control.hijack.undo = undo_hijack.png + +icon.folder.new = folder_add.png +icon.console = monitor.png + +icon.datatree.node.domain.file = unknownFile.gif +icon.datatree.node.domain.folder.closed = icon.folder.closed +icon.datatree.node.domain.folder.open = icon.folder.open + +icon.version.control.dialog.add = icon.version.control.add +icon.version.control.dialog.check.in = icon.version.control.check.in + +icon.logviewer.toolbar.scroll.lock = lock.png +icon.logviewer.toolbar.file.open = icon.folder.open + +icon.projectdata.find.checkouts.search = icon.search {icon.check} +icon.projectdata.copy = icon.copy +icon.projectdata.cut = icon.cut +icon.projectdata.delete = page_delete.png +icon.projectdata.new.folder = icon.folder.new +icon.projectdata.paste = icon.paste +icon.projectdata.rename = page_edit.png +icon.projectdata.version.control.update = vcMerge.png + +icon.menu.file.new.project = icon.folder.new + +icon.frontend.project.connected = connected.gif +icon.frontend.project.disconnected = disconnected.gif + +icon.project.users.in.project = user.png +icon.project.info.convert = wand.png + +icon.extension.configure = plugin.png +icon.plugin.manager.default = plasma.png + [Dark Defaults] diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FileActionManager.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FileActionManager.java index 093a7c9f41..97f3b40eb4 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FileActionManager.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FileActionManager.java @@ -29,6 +29,7 @@ import docking.tool.ToolConstants; import docking.widgets.OptionDialog; import docking.widgets.filechooser.GhidraFileChooser; import docking.wizard.WizardManager; +import generic.theme.GIcon; import ghidra.framework.client.ClientUtil; import ghidra.framework.client.RepositoryAdapter; import ghidra.framework.model.*; @@ -38,7 +39,6 @@ import ghidra.framework.store.LockException; import ghidra.util.*; import ghidra.util.exception.NotFoundException; import ghidra.util.task.TaskLauncher; -import resources.ResourceManager; /** * Helper class to manage actions on the File menu. @@ -49,9 +49,10 @@ class FileActionManager { private final static int OPEN_ACCELERATOR = KeyEvent.VK_O; private final static int CLOSE_ACCELERATOR = KeyEvent.VK_W; private final static int SAVE_ACCELERATOR = KeyEvent.VK_S; - private final static Icon NEW_PROJECT_ICON = ResourceManager.loadImage("images/folder_add.png"); - private final static String LAST_SELECTED_PROJECT_DIRECTORY = "LastSelectedProjectDirectory"; + private final static Icon NEW_PROJECT_ICON = new GIcon("icon.menu.file.new.project"); + + private final static String LAST_SELECTED_PROJECT_DIRECTORY = "LastSelectedProjectDirectory"; private static final String DISPLAY_DATA = "DISPLAY_DATA"; private FrontEndTool tool; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java index b792bafbba..1d4617c933 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndPlugin.java @@ -36,12 +36,12 @@ import docking.widgets.dialogs.InputDialog; import docking.widgets.filechooser.GhidraFileChooser; import docking.widgets.filechooser.GhidraFileChooserMode; import docking.widgets.label.*; +import generic.theme.GIcon; import ghidra.app.plugin.PluginCategoryNames; import ghidra.framework.GenericRunInfo; import ghidra.framework.client.*; import ghidra.framework.main.datatable.ProjectDataTablePanel; -import ghidra.framework.main.datatree.ClearCutAction; -import ghidra.framework.main.datatree.ProjectDataTreePanel; +import ghidra.framework.main.datatree.*; import ghidra.framework.main.projectdata.actions.*; import ghidra.framework.model.*; import ghidra.framework.options.SaveState; @@ -52,7 +52,6 @@ import ghidra.framework.remote.User; import ghidra.util.*; import ghidra.util.filechooser.GhidraFileChooserModel; import ghidra.util.filechooser.GhidraFileFilter; -import resources.ResourceManager; /** * Main plugin component for the Ghidra Project Window, which is @@ -119,9 +118,9 @@ public class FrontEndPlugin extends Plugin private JPanel connectionIconPanel; private JButton connectionButton; - static final Icon CONNECTED_ICON = ResourceManager.loadImage("images/connected.gif"); - static final Icon DISCONNECTED_ICON = ResourceManager.loadImage("images/disconnected.gif"); - private Icon emptyIcon = ResourceManager.loadImage("images/EmptyIcon.gif"); + static final Icon CONNECTED_ICON = new GIcon("icon.frontend.project.connected"); + static final Icon DISCONNECTED_ICON = new GIcon("icon.frontend.project.disconnected"); + private static final Icon EMPTY_ICON = new GIcon("icon.empty.20"); private FrontEndProvider frontEndProvider; @@ -131,12 +130,12 @@ public class FrontEndPlugin extends Plugin private ProjectDataPasteAction pasteAction; private ProjectDataRenameAction renameAction; private ProjectDataOpenDefaultToolAction openAction; - private ProjectDataExpandAction expandAction; - private ProjectDataCollapseAction collapseAction; + private ProjectDataExpandAction expandAction; + private ProjectDataCollapseAction collapseAction; private ProjectDataSelectAction selectAction; private ProjectDataReadOnlyAction readOnlyAction; private ProjectDataRefreshAction refreshAction; - private ProjectDataNewFolderAction newFolderAction; + private ProjectDataNewFolderAction newFolderAction; private ProjectDataDeleteAction deleteAction; protected List openActions = new ArrayList<>(); @@ -671,7 +670,7 @@ public class FrontEndPlugin extends Plugin connectionIconPanel.remove(connectionButton); } if (project == null || project.getRepository() == null) { - connectionLabel = new GIconLabel(emptyIcon); + connectionLabel = new GIconLabel(EMPTY_ICON); connectionIconPanel.add(connectionLabel); return; } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/LogPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/LogPanel.java index 599fee01b6..bb1891bc3f 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/LogPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/LogPanel.java @@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.config.Configuration; import docking.StatusBarSpacer; import docking.widgets.EmptyBorderButton; import docking.widgets.label.GDLabel; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Messages; import ghidra.util.HelpLocation; import ghidra.util.Msg; @@ -36,7 +37,6 @@ import help.Help; import help.HelpService; import log.LogListener; import log.LogPanelAppender; -import resources.ResourceManager; /** * A JPanel that contains a label to show the last message displayed. It also has a button to @@ -54,7 +54,7 @@ public class LogPanel extends JPanel implements LogListener { super(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(8, 4, 4, 2)); - button = new EmptyBorderButton(ResourceManager.loadImage("images/monitor.png")); + button = new EmptyBorderButton(new GIcon("icon.console")); label = new GDLabel(); label.setName("Details"); defaultColor = label.getForeground(); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java index 9da9ad9943..355fcca2d7 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectAccessPanel.java @@ -29,6 +29,7 @@ import docking.widgets.list.GListCellRenderer; import docking.widgets.table.GTable; import docking.wizard.AbstractWizardJPanel; import generic.theme.GColor; +import generic.theme.GIcon; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.client.RepositoryAdapter; import ghidra.framework.plugintool.PluginTool; @@ -566,8 +567,8 @@ public class ProjectAccessPanel extends AbstractWizardJPanel { private Icon inProjectIcon; UserListCellRenderer() { - icon = ResourceManager.loadImage("images/EmptyIcon.gif"); - inProjectIcon = ResourceManager.loadImage("images/user.png"); + icon = new GIcon("icon.empty.20"); + inProjectIcon = new GIcon("icon.project.users.in.project"); icon = ResourceManager.getScaledIcon(icon, inProjectIcon.getIconWidth(), inProjectIcon.getIconHeight()); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java index 87e0cf7a16..1bd4dda4f3 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java @@ -30,6 +30,7 @@ import docking.widgets.OptionDialog; import docking.widgets.label.GDLabel; import docking.widgets.label.GLabel; import docking.wizard.WizardManager; +import generic.theme.GIcon; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.client.*; import ghidra.framework.data.ConvertFileSystem; @@ -45,7 +46,6 @@ import ghidra.util.layout.VerticalLayout; import ghidra.util.task.*; import help.Help; import help.HelpService; -import resources.ResourceManager; /** * Dialog to show project information. Allows the user to convert a local project to a shared project, @@ -54,7 +54,7 @@ import resources.ResourceManager; */ public class ProjectInfoDialog extends DialogComponentProvider { - private final static Icon CONVERT_ICON = ResourceManager.loadImage("images/wand.png"); + private final static Icon CONVERT_ICON = new GIcon("icon.project.info.convert"); public final static String CHANGE = "Change Shared Project Info..."; final static String CONVERT = "Convert to Shared..."; @@ -405,7 +405,7 @@ public class ProjectInfoDialog extends DialogComponentProvider { Msg.showInfo(getClass(), getComponent(), "Cannot Convert/Upgrade Project Storage with Open Files", "Found " + openCount + " open project file(s).\n" + - "Before your project can be converted, you must close\n" + + "Before your project can be converted, you must close\n" + "all open project files and tools."); return; } @@ -450,7 +450,7 @@ public class ProjectInfoDialog extends DialogComponentProvider { Msg.showInfo(getClass(), getComponent(), "Cannot Convert Project with Open Files", "Found " + openCount + " open project file(s).\n" + - "Before your project can be converted, you must close\n" + + "Before your project can be converted, you must close\n" + "all open project files and tools."); return; } @@ -599,7 +599,8 @@ public class ProjectInfoDialog extends DialogComponentProvider { } } - private boolean useForcedCheckoutTransition(TaskMonitor monitor) throws CancelledException, IOException { + private boolean useForcedCheckoutTransition(TaskMonitor monitor) + throws CancelledException, IOException { if (repository == null) { return false; } @@ -610,7 +611,7 @@ public class ProjectInfoDialog extends DialogComponentProvider { !projectData.hasInvalidCheckouts(checkoutFiles, newRepository, monitor)) { return false; } - + if (OptionDialog.showOptionDialog(getComponent(), "Terminate Unrecognized Checkouts", "One or more project file checkouts are not recognized by the selected repository.\n" + "These checkouts will be terminated and a local .keep file created." + @@ -624,7 +625,7 @@ public class ProjectInfoDialog extends DialogComponentProvider { throw new CancelledException(); } - + // Must force termination if not connected to current repository return !repository.isConnected(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java index e7a4ff3088..a447919b64 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/RepositoryChooser.java @@ -38,11 +38,11 @@ import ghidra.util.MessageType; import ghidra.util.Msg; import ghidra.util.layout.MiddleLayout; import ghidra.util.layout.PairLayout; -import resources.ResourceManager; +import resources.Icons; class RepositoryChooser extends DialogComponentProvider { - static final Icon REFRESH_ICON = ResourceManager.loadImage("images/view-refresh.png"); + static final Icon REFRESH_ICON = Icons.REFRESH_ICON; private static final String SERVER_INFO = "ServerInfo"; private static final String GHIDRA_URL = "GhidraURL"; @@ -75,23 +75,13 @@ class RepositoryChooser extends DialogComponentProvider { serverInfoComponent = new ServerInfoComponent(); serverInfoComponent.setStatusListener(this); - serverInfoComponent.setChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - serverInfoChanged(); - } - }); + serverInfoComponent.setChangeListener(e -> serverInfoChanged()); topPanel.add(serverInfoComponent, BorderLayout.CENTER); queryButton = new JButton(REFRESH_ICON); queryButton.setToolTipText("Refresh Repository Names List"); setDefaultButton(queryButton); - queryButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - queryServer(); - } - }); + queryButton.addActionListener(e -> queryServer()); JPanel buttonPanel = new JPanel(new MiddleLayout()); buttonPanel.add(queryButton); topPanel.add(buttonPanel, BorderLayout.EAST); @@ -106,12 +96,7 @@ class RepositoryChooser extends DialogComponentProvider { listModel = new DefaultListModel<>(); nameList = new GList<>(listModel); nameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - nameList.addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - selectionChanged(); - } - }); + nameList.addListSelectionListener(e -> selectionChanged()); nameList.addMouseListener(new MouseInputAdapter() { @Override @@ -177,15 +162,12 @@ class RepositoryChooser extends DialogComponentProvider { JPanel radioButtonPanel = new JPanel(new PairLayout(5, 5)); radioButtonPanel.setBorder(BorderFactory.createTitledBorder("Repository Specification")); - ChangeListener choiceListener = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - Object src = e.getSource(); - if (src instanceof JRadioButton) { - JRadioButton choiceButton = (JRadioButton) src; - if (choiceButton.isSelected()) { - choiceActivated(choiceButton); - } + ChangeListener choiceListener = e -> { + Object src = e.getSource(); + if (src instanceof JRadioButton) { + JRadioButton choiceButton = (JRadioButton) src; + if (choiceButton.isSelected()) { + choiceActivated(choiceButton); } } }; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SetToolAssociationsDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SetToolAssociationsDialog.java index 0ffa03142a..0e2ccea7ab 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SetToolAssociationsDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SetToolAssociationsDialog.java @@ -24,6 +24,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.tool.ToolConstants; import docking.widgets.table.*; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors.Palette; import ghidra.framework.data.ContentHandler; import ghidra.framework.model.*; @@ -309,7 +310,7 @@ class SetToolAssociationsDialog extends DialogComponentProvider { } else { icon = ResourceManager.getDisabledIcon(ResourceManager.getScaledIcon( - ResourceManager.loadImage("images/EmptyIcon.gif"), 24, 24)); + new GIcon("icon.empty.20"), 24, 24)); } renderer.setText(info.getAssociatedToolName()); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/ChangedFilesDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/ChangedFilesDialog.java index 761c4a1e64..d30fb4c402 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/ChangedFilesDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/ChangedFilesDialog.java @@ -16,10 +16,8 @@ package ghidra.framework.main.datatree; import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.IOException; -import java.util.ArrayList; +import java.util.List; import javax.swing.*; @@ -27,6 +25,7 @@ import docking.DialogComponentProvider; import ghidra.framework.model.DomainFile; import ghidra.framework.plugintool.PluginTool; import ghidra.util.Msg; +import ghidra.util.Swing; import ghidra.util.exception.CancelledException; import ghidra.util.task.Task; import ghidra.util.task.TaskMonitor; @@ -37,32 +36,29 @@ import ghidra.util.task.TaskMonitor; */ public class ChangedFilesDialog extends DialogComponentProvider { - private ArrayList fileList; - private DomainFilesPanel filePanel; - private PluginTool tool; - private boolean saveSelected; - + private List fileList; + private DomainFilesPanel filePanel; + private PluginTool tool; + private boolean saveSelected; + /** * Constructor * @param tool tool to execute task and log messages in status window * @param list list of domain files that have changes */ - public ChangedFilesDialog(PluginTool tool, ArrayList list) { + public ChangedFilesDialog(PluginTool tool, List list) { super("Save Changed Files?", true); this.tool = tool; this.fileList = list; addWorkPanel(buildMainPanel()); JButton saveButton = new JButton("Save"); - saveButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - save(); - } - }); - saveButton.setToolTipText("Save files that have selected check boxes"); - addButton(saveButton); - addCancelButton(); - } + saveButton.addActionListener(e -> save()); + saveButton.setToolTipText("Save files that have selected check boxes"); + addButton(saveButton); + addCancelButton(); + } + /** * Set the tool tip on the cancel button. * @param toolTip tool tip to set on the cancel button @@ -70,7 +66,7 @@ public class ChangedFilesDialog extends DialogComponentProvider { public void setCancelToolTipText(String toolTip) { setCancelToolTip(toolTip); } - + /** * Show ChangedFilesDialog. * @return whether the save button was selected; return false if the user @@ -78,21 +74,22 @@ public class ChangedFilesDialog extends DialogComponentProvider { */ public boolean showDialog() { saveSelected = false; - tool.showDialog(this); + tool.showDialog(this); return saveSelected; } + private JPanel buildMainPanel() { - JPanel outerPanel = new JPanel(new BorderLayout()); - outerPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); + JPanel outerPanel = new JPanel(new BorderLayout()); + outerPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); filePanel = new DomainFilesPanel(fileList, "Changed Files"); outerPanel.add(filePanel, BorderLayout.CENTER); - return outerPanel; + return outerPanel; } private void save() { - saveSelected=true; + saveSelected = true; DomainFile[] files = filePanel.getSelectedDomainFiles(); if (files.length > 0) { SaveTask task = new SaveTask(files); @@ -104,36 +101,34 @@ public class ChangedFilesDialog extends DialogComponentProvider { } @Override - protected void cancelCallback() { + protected void cancelCallback() { close(); } - /** - * Task to save files. - */ + private class SaveTask extends Task { private DomainFile[] files; - + SaveTask(DomainFile[] files) { - super(files.length>1?"Saving Files..." : "Saving File", + super(files.length > 1 ? "Saving Files..." : "Saving File", true, true, true); this.files = files; } - + @Override - public void run(TaskMonitor monitor) { + public void run(TaskMonitor monitor) { for (DomainFile file : files) { if (monitor.isCancelled()) { - break; - } - String name = file.getName(); - monitor.setProgress(0); + break; + } + String name = file.getName(); + monitor.setProgress(0); monitor.setMessage("Saving " + name); Msg.info(this, "Successfully saved file: " + name); try { file.save(monitor); } catch (CancelledException e) { - // Move on (TODO: should we break?) + return; } catch (IOException e) { Msg.showError(this, tool.getToolFrame(), "Error Saving File", @@ -141,15 +136,10 @@ public class ChangedFilesDialog extends DialogComponentProvider { } } if (monitor.isCancelled()) { - saveSelected=false; + saveSelected = false; } - SwingUtilities.invokeLater(new Runnable() { - public void run() { - ChangedFilesDialog.this.close(); - } - }); + Swing.runLater(() -> ChangedFilesDialog.this.close()); } } - } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFileNode.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFileNode.java index c655a5d954..400be85269 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFileNode.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFileNode.java @@ -23,6 +23,7 @@ import javax.swing.Icon; import javax.swing.SwingWorker; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.model.DomainFile; import ghidra.framework.store.ItemCheckoutStatus; import ghidra.util.*; @@ -34,8 +35,7 @@ import resources.ResourceManager; */ public class DomainFileNode extends GTreeNode implements Cuttable { - private static final Icon UNKNOWN_FILE_ICON = - ResourceManager.loadImage("images/unknownFile.gif"); + private static final Icon UNKNOWN_FILE_ICON = new GIcon("icon.datatree.node.domain.file"); private final DomainFile domainFile; @@ -48,9 +48,6 @@ public class DomainFileNode extends GTreeNode implements Cuttable { private final SimpleDateFormat formatter = new SimpleDateFormat("yyyy MMM dd hh:mm aaa"); - /** - * Construct a node for a domain file. - */ DomainFileNode(DomainFile domainFile) { this.domainFile = domainFile; displayName = domainFile.getName(); @@ -67,9 +64,6 @@ public class DomainFileNode extends GTreeNode implements Cuttable { return domainFile; } - /** - * Returns true if this node has no children. - */ @Override public boolean isLeaf() { return true; @@ -134,9 +128,6 @@ public class DomainFileNode extends GTreeNode implements Cuttable { return domainFile.getName(); } - /** - * Set the name of this node; update the associated file or folder. - */ void setName(String newName) { try { domainFile.setName(newName); @@ -165,8 +156,6 @@ public class DomainFileNode extends GTreeNode implements Cuttable { /** * Update the display name. - * - * @return true if the node should be reloaded because the display name has changed */ void refresh() { DomainFileNodeSwingWorker worker = new DomainFileNodeSwingWorker(); @@ -280,9 +269,6 @@ public class DomainFileNode extends GTreeNode implements Cuttable { } } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return getName(); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderNode.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderNode.java index 352c86f160..1b027ed0b3 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderNode.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderNode.java @@ -22,6 +22,7 @@ import javax.swing.Icon; import docking.widgets.tree.GTreeLazyNode; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.model.*; import ghidra.util.InvalidNameException; import ghidra.util.Msg; @@ -32,9 +33,9 @@ import resources.ResourceManager; */ public class DomainFolderNode extends GTreeLazyNode implements Cuttable { private static final Icon ENABLED_OPEN_FOLDER = - ResourceManager.loadImage("images/openSmallFolder.png"); + new GIcon("icon.datatree.node.domain.folder.open"); private static final Icon ENABLED_CLOSED_FOLDER = - ResourceManager.loadImage("images/closedSmallFolder.png"); + new GIcon("icon.datatree.node.domain.folder.closed"); private static final Icon DISABLED_OPEN_FOLDER = ResourceManager.getDisabledIcon(ENABLED_OPEN_FOLDER); private static final Icon DISABLED_CLOSED_FOLDER = @@ -48,9 +49,6 @@ public class DomainFolderNode extends GTreeLazyNode implements Cuttable { private String toolTipText; private boolean isEditable; - /** - * Construct a node for a domain folder. - */ DomainFolderNode(DomainFolder domainFolder, DomainFileFilter filter) { this.domainFolder = domainFolder; this.filter = filter; @@ -121,7 +119,7 @@ public class DomainFolderNode extends GTreeLazyNode implements Cuttable { @Override protected List generateChildren() { - List children = new ArrayList(); + List children = new ArrayList<>(); if (domainFolder != null) { DomainFolder[] folders = domainFolder.getFolders(); for (DomainFolder folder : folders) { diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderRootNode.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderRootNode.java index d47579cbe6..1a855660fe 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderRootNode.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFolderRootNode.java @@ -18,18 +18,15 @@ package ghidra.framework.main.datatree; import java.io.File; import javax.swing.Icon; -import javax.swing.ImageIcon; import docking.tool.ToolConstants; +import generic.theme.GIcon; import ghidra.framework.client.RepositoryAdapter; import ghidra.framework.model.*; -import resources.ResourceManager; public class DomainFolderRootNode extends DomainFolderNode { - private static final ImageIcon CLOSED_PROJECT = - ResourceManager.loadImage("images/closedSmallFolder.png"); - private static final ImageIcon OPEN_PROJECT = - ResourceManager.loadImage("images/openSmallFolder.png"); + private static final Icon CLOSED_PROJECT = new GIcon("icon.datatree.node.domain.folder.closed"); + private static final Icon OPEN_PROJECT = new GIcon("icon.datatree.node.domain.folder.open"); private String projectName; private String toolTipText; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java index d14c3f3281..4a10a953fb 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/VersionControlDialog.java @@ -23,6 +23,7 @@ import javax.swing.*; import docking.DialogComponentProvider; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.*; +import generic.theme.GIcon; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.plugintool.PluginTool; import ghidra.util.HelpLocation; @@ -34,6 +35,9 @@ import ghidra.util.HelpLocation; */ public class VersionControlDialog extends DialogComponentProvider { + private static final Icon ADD_ICON = new GIcon("icon.version.control.dialog.add"); + private static final Icon CHECK_IN_ICON = new GIcon("icon.version.control.dialog.check.in"); + static final int OK = 0; public static final int APPLY_TO_ALL = 1; public static final int CANCEL = 2; @@ -85,6 +89,7 @@ public class VersionControlDialog extends DialogComponentProvider { /** * Show the dialog; return an ID for the action that the user chose. + * @param tool the tool * @param parent parent to this dialog * @return OK, APPLY_TO_ALL, or CANCEL */ @@ -97,10 +102,6 @@ public class VersionControlDialog extends DialogComponentProvider { allButton.setEnabled(multi); } - /** - * Return - * @return - */ boolean keepCheckedOut() { return keepCB.isSelected(); } @@ -130,9 +131,8 @@ public class VersionControlDialog extends DialogComponentProvider { return commentsTextArea.getText(); } - /** - * Disable the check box for "keep checked out" because some files - * are still in use. + /* + * Disable the check box for "keep checked out" because some files are still in use. */ public void setKeepCheckboxEnabled(boolean enabled) { keepCB.setEnabled(enabled); @@ -143,8 +143,7 @@ public class VersionControlDialog extends DialogComponentProvider { JPanel innerPanel = new JPanel(); innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS)); - ImageIcon icon = resources.ResourceManager.loadImage( - addToVersionControl ? "images/vcAdd.png" : "images/vcCheckIn.png"); + Icon icon = addToVersionControl ? ADD_ICON : CHECK_IN_ICON; descriptionLabel = new GDLabel(addToVersionControl ? "Add comments to describe the file." : "Add comments to describe changes", diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/FVToolBar.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/FVToolBar.java index 9e7b7f0a1b..2730b6f429 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/FVToolBar.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/ui/FVToolBar.java @@ -21,10 +21,10 @@ import javax.swing.*; import docking.EmptyBorderToggleButton; import docking.widgets.EmptyBorderButton; +import generic.theme.GIcon; import ghidra.framework.main.logviewer.event.FVEvent; import ghidra.framework.main.logviewer.event.FVEvent.EventType; import ghidra.framework.main.logviewer.event.FVEventListener; -import resources.ResourceManager; /** * Toolbar that contains widgets for controlling the {@link FileViewer}. @@ -78,7 +78,7 @@ public class FVToolBar extends JToolBar { private class ScrollLockAction extends AbstractAction { public ScrollLockAction() { - super("FVScrollLockAction", ResourceManager.loadImage("images/lock.png")); + super("FVScrollLockAction", new GIcon("icon.version.control.dialog.add")); putValue(SHORT_DESCRIPTION, "Scroll Lock"); } @@ -98,7 +98,7 @@ public class FVToolBar extends JToolBar { private class FileOpenAction extends AbstractAction { public FileOpenAction() { - super("FVFileOpenAction", ResourceManager.loadImage("images/openSmallFolder.png")); + super("FVFileOpenAction", new GIcon("icon.logviewer.toolbar.file.open")); putValue(SHORT_DESCRIPTION, "Opens the log file folder"); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/FindCheckoutsAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/FindCheckoutsAction.java index 813a5c68a8..467aeec546 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/FindCheckoutsAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/FindCheckoutsAction.java @@ -23,6 +23,7 @@ import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; import docking.widgets.OptionDialog; +import generic.theme.GIcon; import ghidra.framework.client.*; import ghidra.framework.main.datatable.ProjectTreeAction; import ghidra.framework.main.datatree.FindCheckoutsDialog; @@ -31,23 +32,21 @@ import ghidra.framework.model.DomainFolder; import ghidra.framework.model.ProjectData; import ghidra.framework.plugintool.Plugin; import ghidra.util.HelpLocation; -import resources.MultiIcon; -import resources.ResourceManager; public class FindCheckoutsAction extends ProjectTreeAction { + private static final Icon FIND_ICON = new GIcon("icon.projectdata.find.checkouts.search"); + private Plugin plugin; public FindCheckoutsAction(String owner, Plugin plugin) { super("Find Checkouts", owner); this.plugin = plugin; String group = "Repository"; - Icon searchIcon = ResourceManager.loadImage("images/magnifier.png"); - Icon smallCheckIcon = ResourceManager.loadImage("images/check.png"); - MultiIcon icon = new MultiIcon(searchIcon); - icon.addIcon(smallCheckIcon); - setToolBarData(new ToolBarData(icon, group)); - setPopupMenuData(new MenuData(new String[] { "Find Checkouts..." }, icon, "Repository")); + + setToolBarData(new ToolBarData(FIND_ICON, group)); + setPopupMenuData( + new MenuData(new String[] { "Find Checkouts..." }, FIND_ICON, "Repository")); setDescription("Find my checkouts recursively"); setHelpLocation(new HelpLocation("VersionControl", "Find_Checkouts")); setEnabled(false); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCopyAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCopyAction.java index 317e1a6ded..486cfa50d0 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCopyAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCopyAction.java @@ -22,12 +22,12 @@ import javax.swing.tree.TreePath; import docking.action.KeyBindingData; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.framework.main.datatree.DataTreeClipboardUtils; import ghidra.framework.main.datatree.FrontEndProjectTreeContext; -import resources.ResourceManager; public class ProjectDataCopyAction extends ProjectDataCopyCutBaseAction { - private static Icon icon = ResourceManager.loadImage("images/page_copy.png"); + private static final Icon icon = new GIcon("icon.projectdata.copy"); public ProjectDataCopyAction(String owner, String group) { super("Copy", owner); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCutAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCutAction.java index bf3dffbcc3..9feb22e8cf 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCutAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataCutAction.java @@ -23,15 +23,15 @@ import javax.swing.tree.TreePath; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.main.datatree.*; -import resources.ResourceManager; public class ProjectDataCutAction extends ProjectDataCopyCutBaseAction { - private static Icon icon = ResourceManager.loadImage("images/edit-cut22.png"); + private static final Icon ICON = new GIcon("icon.projectdata.cut"); public ProjectDataCutAction(String owner, String group) { super("Cut", owner); - setPopupMenuData(new MenuData(new String[] { "Cut" }, icon, group)); + setPopupMenuData(new MenuData(new String[] { "Cut" }, ICON, group)); setKeyBindingData(new KeyBindingData('X', InputEvent.CTRL_DOWN_MASK)); markHelpUnnecessary(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java index cf90b7eddc..3988d92982 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java @@ -25,21 +25,21 @@ import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.OptionDialog; import docking.widgets.OptionDialogBuilder; -import ghidra.framework.main.datatable.ProjectDataContext; +import generic.theme.GIcon; import ghidra.framework.main.datatable.FrontendProjectTreeAction; +import ghidra.framework.main.datatable.ProjectDataContext; import ghidra.framework.model.DomainFile; import ghidra.framework.model.DomainFolder; import ghidra.util.HTMLUtilities; import ghidra.util.task.TaskLauncher; -import resources.ResourceManager; import util.CollectionUtils; public class ProjectDataDeleteAction extends FrontendProjectTreeAction { - private static Icon icon = ResourceManager.loadImage("images/page_delete.png"); + private static final Icon ICON = new GIcon("icon.projectdata.delete"); public ProjectDataDeleteAction(String owner, String group) { super("Delete", owner); - setPopupMenuData(new MenuData(new String[] { "Delete" }, icon, group)); + setPopupMenuData(new MenuData(new String[] { "Delete" }, ICON, group)); setKeyBindingData(new KeyBindingData(KeyEvent.VK_DELETE, 0)); markHelpUnnecessary(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataNewFolderAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataNewFolderAction.java index 657e4ea745..0b79f2e174 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataNewFolderAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataNewFolderAction.java @@ -22,6 +22,7 @@ import javax.swing.Icon; import docking.action.ContextSpecificAction; import docking.action.MenuData; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.main.datatable.ProjectTreeContext; import ghidra.framework.main.datatree.DataTree; import ghidra.framework.main.datatree.DomainFileNode; @@ -29,16 +30,15 @@ import ghidra.framework.model.DomainFile; import ghidra.framework.model.DomainFolder; import ghidra.util.InvalidNameException; import ghidra.util.exception.AssertException; -import resources.ResourceManager; public class ProjectDataNewFolderAction extends ContextSpecificAction { - private static Icon icon = ResourceManager.loadImage("images/folder_add.png"); + private static final Icon ICON = new GIcon("icon.projectdata.new.folder"); public ProjectDataNewFolderAction(String owner, String group, Class contextClass) { super("New Folder", owner, contextClass); - setPopupMenuData(new MenuData(new String[] { "New Folder" }, icon, group)); + setPopupMenuData(new MenuData(new String[] { "New Folder" }, ICON, group)); markHelpUnnecessary(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataPasteAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataPasteAction.java index baba075365..8230c2448c 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataPasteAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataPasteAction.java @@ -24,17 +24,17 @@ import javax.swing.Icon; import docking.action.KeyBindingData; import docking.action.MenuData; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.main.datatree.*; import ghidra.util.Msg; import ghidra.util.task.TaskLauncher; -import resources.ResourceManager; public class ProjectDataPasteAction extends ProjectDataCopyCutBaseAction { - private static Icon icon = ResourceManager.loadImage("images/page_paste.png"); + private static Icon ICON = new GIcon("icon.projectdata.paste"); public ProjectDataPasteAction(String owner, String group) { super("Paste", owner); - setPopupMenuData(new MenuData(new String[] { "Paste" }, icon, group)); + setPopupMenuData(new MenuData(new String[] { "Paste" }, ICON, group)); setKeyBindingData(new KeyBindingData('V', InputEvent.CTRL_DOWN_MASK)); markHelpUnnecessary(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataRenameAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataRenameAction.java index df7382e344..9e52d65d42 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataRenameAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataRenameAction.java @@ -25,19 +25,19 @@ import javax.swing.table.TableColumnModel; import docking.action.MenuData; import docking.widgets.table.GTable; import docking.widgets.tree.GTreeNode; +import generic.theme.GIcon; import ghidra.framework.main.datatable.*; import ghidra.framework.main.datatree.DataTree; import ghidra.framework.model.DomainFile; import ghidra.framework.model.DomainFolder; import ghidra.util.Msg; -import resources.ResourceManager; public class ProjectDataRenameAction extends FrontendProjectTreeAction { - private static Icon icon = ResourceManager.loadImage("images/page_edit.png"); + private static final Icon ICON = new GIcon("icon.projectdata.rename"); public ProjectDataRenameAction(String owner, String group) { super("Rename", owner); - setPopupMenuData(new MenuData(new String[] { "Rename" }, icon, group)); + setPopupMenuData(new MenuData(new String[] { "Rename" }, ICON, group)); markHelpUnnecessary(); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlAddAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlAddAction.java index 363e8a6675..3352d4480d 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlAddAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlAddAction.java @@ -19,10 +19,11 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.framework.client.ClientUtil; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.main.datatree.*; @@ -33,7 +34,6 @@ import ghidra.util.Msg; import ghidra.util.Swing; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * Action to add a domain file to version control in the repository. @@ -42,7 +42,7 @@ public class VersionControlAddAction extends VersionControlAction { public VersionControlAddAction(Plugin plugin) { super("Add to Version Control", plugin.getName(), plugin.getTool()); - ImageIcon icon = ResourceManager.loadImage("images/vcAdd.png"); + Icon icon = new GIcon("icon.version.control.add"); setToolBarData(new ToolBarData(icon, GROUP)); setPopupMenuData(new MenuData(new String[] { "Add to Version Control..." }, icon, GROUP)); @@ -86,8 +86,9 @@ public class VersionControlAddAction extends VersionControlAction { if (unversioned.isEmpty()) { return; } - ArrayList list = new ArrayList<>(); - ArrayList changedList = new ArrayList<>(); + + List list = new ArrayList<>(); + List changedList = new ArrayList<>(); for (DomainFile domainFile : unversioned) { if (domainFile.isBusy()) { Msg.showWarn(getClass(), null, "Add To Version Control Failed!", diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckInAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckInAction.java index 6f19d215ea..d4d64548c0 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckInAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckInAction.java @@ -19,17 +19,17 @@ import java.awt.Component; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.main.datatree.ChangedFilesDialog; import ghidra.framework.main.datatree.CheckInTask; import ghidra.framework.model.DomainFile; import ghidra.framework.plugintool.Plugin; import ghidra.util.Msg; -import resources.ResourceManager; /** * Action to check-in domain files to the repository. @@ -46,7 +46,7 @@ public class VersionControlCheckInAction extends VersionControlAction { public VersionControlCheckInAction(Plugin plugin, Component parent) { super("CheckIn", plugin.getName(), plugin.getTool()); this.parent = parent; - ImageIcon icon = ResourceManager.loadImage("images/vcCheckIn.png"); + Icon icon = new GIcon("icon.version.control.check.in"); setPopupMenuData(new MenuData(new String[] { "Check In..." }, icon, GROUP)); setToolBarData(new ToolBarData(icon, GROUP)); @@ -114,8 +114,7 @@ public class VersionControlCheckInAction extends VersionControlAction { ArrayList changedList = new ArrayList<>(); ArrayList list = new ArrayList<>(); - for (int i = 0; i < fileList.size(); i++) { - DomainFile df = fileList.get(i); + for (DomainFile df : fileList) { if (df != null && df.canCheckin()) { if (!canCloseDomainFile(df)) { continue; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckOutAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckOutAction.java index 1cf08efe1c..ae8aad2cbd 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckOutAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckOutAction.java @@ -18,11 +18,12 @@ package ghidra.framework.main.projectdata.actions; import java.io.IOException; import java.util.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; import docking.widgets.OptionDialog; +import generic.theme.GIcon; import ghidra.framework.client.ClientUtil; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.main.datatree.CheckoutDialog; @@ -34,7 +35,6 @@ import ghidra.util.Msg; import ghidra.util.Swing; import ghidra.util.exception.CancelledException; import ghidra.util.task.*; -import resources.ResourceManager; /** * Action to checkout domain files from the repository. @@ -52,7 +52,7 @@ public class VersionControlCheckOutAction extends VersionControlAction { /*package*/ VersionControlCheckOutAction(String owner, PluginTool tool) { super("CheckOut", owner, tool); - ImageIcon icon = ResourceManager.loadImage("images/vcCheckOut.png"); + Icon icon = new GIcon("icon.version.control.check.out"); setPopupMenuData(new MenuData(new String[] { "Check Out" }, icon, GROUP)); setToolBarData(new ToolBarData(icon, GROUP)); setDescription("Check out file"); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoCheckOutAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoCheckOutAction.java index 84a411a5da..5047fa86f0 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoCheckOutAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoCheckOutAction.java @@ -19,10 +19,11 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.framework.client.ClientUtil; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.main.datatree.UndoActionDialog; @@ -33,24 +34,22 @@ import ghidra.util.exception.CancelledException; import ghidra.util.exception.FileInUseException; import ghidra.util.task.Task; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * Action to undo checkouts for domain files in the repository. */ public class VersionControlUndoCheckOutAction extends VersionControlAction { + private static final Icon ICON = new GIcon("icon.version.control.check.out.undo"); + /** * Creates an action to undo checkouts for domain files in the repository. * @param plugin the plug-in that owns this action. */ public VersionControlUndoCheckOutAction(Plugin plugin) { super("UndoCheckOut", plugin.getName(), plugin.getTool()); - ImageIcon icon = ResourceManager.loadImage("images/vcUndoCheckOut.png"); - setPopupMenuData(new MenuData(new String[] { "Undo Checkout" }, icon, GROUP)); - - setToolBarData(new ToolBarData(icon, GROUP)); - + setPopupMenuData(new MenuData(new String[] { "Undo Checkout" }, ICON, GROUP)); + setToolBarData(new ToolBarData(ICON, GROUP)); setDescription("Undo checkout"); setEnabled(false); @@ -116,8 +115,7 @@ public class VersionControlUndoCheckOutAction extends VersionControlAction { // Now confirm the modified ones and undo checkout for the ones the user indicates. if (modifiedCheckOutsList.size() > 0) { UndoActionDialog dialog = new UndoActionDialog("Confirm Undo Checkout", - resources.ResourceManager.loadImage("images/vcUndoCheckOut.png"), "UndoCheckOut", - "checkout", modifiedCheckOutsList); + ICON, "UndoCheckOut", "checkout", modifiedCheckOutsList); int actionID = dialog.showDialog(tool); if (actionID != UndoActionDialog.CANCEL) { saveCopy = dialog.saveCopy(); @@ -161,8 +159,7 @@ public class VersionControlUndoCheckOutAction extends VersionControlAction { @Override public void run(TaskMonitor monitor) { try { - for (int i = 0; i < unmodifiedCheckOutsList.size(); i++) { - DomainFile df = unmodifiedCheckOutsList.get(i); + for (DomainFile df : unmodifiedCheckOutsList) { if (df.isCheckedOut()) { df.undoCheckout(false); } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoHijackAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoHijackAction.java index c356876f12..c056be4ebf 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoHijackAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUndoHijackAction.java @@ -19,9 +19,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; +import generic.theme.GIcon; import ghidra.framework.client.ClientUtil; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.main.datatree.UndoActionDialog; @@ -32,21 +33,21 @@ import ghidra.util.InvalidNameException; import ghidra.util.exception.CancelledException; import ghidra.util.task.Task; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * Action to undo hijacked domain files in the project. */ public class VersionControlUndoHijackAction extends VersionControlAction { + private static final Icon ICON = new GIcon("icon.version.control.hijack.undo"); + /** * Creates an action to undo hijacked domain files in the project. * @param plugin the plug-in that owns this action. */ public VersionControlUndoHijackAction(Plugin plugin) { super("Undo Hijack", plugin.getName(), plugin.getTool()); - ImageIcon icon = ResourceManager.loadImage("images/undo_hijack.png"); - setPopupMenuData(new MenuData(new String[] { "Undo Hijack" }, icon, GROUP)); + setPopupMenuData(new MenuData(new String[] { "Undo Hijack" }, ICON, GROUP)); setEnabled(false); } @@ -98,8 +99,7 @@ public class VersionControlUndoHijackAction extends VersionControlAction { } if (hijackList.size() > 0) { UndoActionDialog dialog = new UndoActionDialog("Confirm Undo Hijack", - ResourceManager.loadImage("images/undo_hijack.png"), "Undo_Hijack", "hijack", - hijackList); + ICON, "Undo_Hijack", "hijack", hijackList); int actionID = dialog.showDialog(tool); if (actionID != UndoActionDialog.CANCEL) { diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUpdateAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUpdateAction.java index 5ff1b71427..e3bbc2cd77 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUpdateAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlUpdateAction.java @@ -18,17 +18,17 @@ package ghidra.framework.main.projectdata.actions; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; +import javax.swing.Icon; import docking.action.MenuData; import docking.action.ToolBarData; +import generic.theme.GIcon; import ghidra.framework.main.AppInfo; import ghidra.framework.main.datatable.DomainFileContext; import ghidra.framework.model.DomainFile; import ghidra.framework.plugintool.Plugin; import ghidra.util.task.Task; import ghidra.util.task.TaskListener; -import resources.ResourceManager; /** * Action to update the current checked out domain file to contain the changes @@ -44,11 +44,9 @@ public class VersionControlUpdateAction extends VersionControlAction { */ public VersionControlUpdateAction(Plugin plugin) { super("Update", plugin.getName(), plugin.getTool()); - ImageIcon icon = ResourceManager.loadImage("images/vcMerge.png"); + Icon icon = new GIcon("icon.projectdata.version.control.update"); setPopupMenuData(new MenuData(new String[] { "Update..." }, icon, GROUP)); - setToolBarData(new ToolBarData(icon, GROUP)); - setDescription("Update checked out file with latest version"); setEnabled(false); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/SettableApplicationInformationDisplayFactory.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/SettableApplicationInformationDisplayFactory.java index 3cf2dae80c..6a09bd1721 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/SettableApplicationInformationDisplayFactory.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/SettableApplicationInformationDisplayFactory.java @@ -18,6 +18,7 @@ package ghidra.framework.plugintool; import java.awt.Image; import java.util.List; +import javax.swing.Icon; import javax.swing.ImageIcon; import docking.framework.ApplicationInformationDisplayFactory; @@ -31,7 +32,7 @@ public class SettableApplicationInformationDisplayFactory extends private Runnable homeCallback; @Override - protected ImageIcon getSplashScreenIcon128() { + protected Icon getSplashScreenIcon128() { if (splashIcon != null) { return splashIcon; } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ExtensionTableProvider.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ExtensionTableProvider.java index dc065876f3..1c051f07d4 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ExtensionTableProvider.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ExtensionTableProvider.java @@ -36,7 +36,6 @@ import ghidra.util.*; import ghidra.util.filechooser.GhidraFileChooserModel; import ghidra.util.filechooser.GhidraFileFilter; import resources.Icons; -import resources.ResourceManager; /** * Component Provider that shows the known extensions in Ghidra in a {@link GTable}. Users may @@ -114,7 +113,7 @@ public class ExtensionTableProvider extends DialogComponentProvider { * @param panel The extensions table panel. */ private void createAddAction(ExtensionTablePanel panel) { - Icon addIcon = ResourceManager.loadImage("images/Plus.png"); + Icon addIcon = Icons.ADD_ICON; DockingAction addAction = new DockingAction("ExtensionTools", "AddExtension") { @Override diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/KeyBindingsPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/KeyBindingsPanel.java index 072af3b2e8..cf7c282814 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/KeyBindingsPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/KeyBindingsPanel.java @@ -40,14 +40,14 @@ import generic.util.action.ReservedKeyBindings; import ghidra.framework.options.Options; import ghidra.framework.options.ToolOptions; import ghidra.framework.plugintool.PluginTool; -import ghidra.util.*; +import ghidra.util.HTMLUtilities; +import ghidra.util.Swing; import ghidra.util.exception.AssertException; import ghidra.util.layout.PairLayout; import ghidra.util.layout.VerticalLayout; import help.Help; import help.HelpService; import resources.Icons; -import resources.ResourceManager; /** * Panel to show the key bindings for the plugin actions. @@ -286,7 +286,7 @@ public class KeyBindingsPanel extends JPanel { BoxLayout bl = new BoxLayout(labelPanel, BoxLayout.X_AXIS); labelPanel.setLayout(bl); labelPanel.add(Box.createHorizontalStrut(5)); - labelPanel.add(new GIconLabel(ResourceManager.loadImage("images/information.png"))); + labelPanel.add(new GIconLabel(Icons.INFO_ICON)); labelPanel.add(Box.createHorizontalStrut(5)); labelPanel.add(mlabel); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ManagePluginsDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ManagePluginsDialog.java index ffaf186e7b..95d3cca9c8 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ManagePluginsDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/ManagePluginsDialog.java @@ -24,6 +24,7 @@ import docking.DialogComponentProvider; import docking.action.*; import docking.tool.ToolConstants; import docking.widgets.OptionDialog; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors; import ghidra.app.util.GenericHelpTopics; import ghidra.framework.main.AppInfo; @@ -31,7 +32,7 @@ import ghidra.framework.plugintool.PluginConfigurationModel; import ghidra.framework.plugintool.PluginTool; import ghidra.framework.plugintool.util.PluginPackage; import ghidra.util.HelpLocation; -import resources.ResourceManager; +import resources.Icons; public class ManagePluginsDialog extends DialogComponentProvider { @@ -106,7 +107,7 @@ public class ManagePluginsDialog extends DialogComponentProvider { pluginComponent.manageAllPlugins(); } }; - ImageIcon icon = ResourceManager.loadImage("images/plugin.png"); + Icon icon = new GIcon("icon.extension.configure"); configureAllPluginsAction.setToolBarData(new ToolBarData(icon, "aaa")); configureAllPluginsAction.setDescription("Configure All Plugins"); configureAllPluginsAction @@ -121,7 +122,7 @@ public class ManagePluginsDialog extends DialogComponentProvider { } }; saveAction.setEnabled(tool.hasConfigChanged()); - icon = ResourceManager.loadImage("images/disk.png"); + icon = Icons.SAVE_ICON; String saveGroup = "save"; saveAction.setMenuBarData(new MenuData(new String[] { "Save" }, icon, saveGroup)); saveAction.setToolBarData(new ToolBarData(icon, saveGroup)); @@ -136,7 +137,7 @@ public class ManagePluginsDialog extends DialogComponentProvider { } }; saveAsAction.setEnabled(true); - icon = ResourceManager.loadImage("images/disk_save_as.png"); + icon = Icons.SAVE_AS_ICON; saveAsAction .setMenuBarData(new MenuData(new String[] { "Save As..." }, icon, saveGroup)); saveAsAction.setToolBarData(new ToolBarData(icon, saveGroup)); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginInstallerTableModel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginInstallerTableModel.java index 4da854761f..d0915fe688 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginInstallerTableModel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginInstallerTableModel.java @@ -35,7 +35,6 @@ import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskLauncher; import ghidra.util.task.TaskMonitor; import resources.Icons; -import resources.ResourceManager; /** * Table model for the {@link PluginInstallerDialog} dialog. This defines the table columns and @@ -48,7 +47,7 @@ class PluginInstallerTableModel final static int STATUS_COL = 1; final static int NAME_COL = 2; - public static final Icon EXPERIMENTAL_ICON = ResourceManager.loadImage("images/warning.png"); + public static final Icon EXPERIMENTAL_ICON = Icons.WARNING_ICON; public static final Icon DEV_ICON = Icons.STRONG_WARNING_ICON; private static Map statusIconMap = new HashMap<>(); @@ -136,8 +135,11 @@ class PluginInstallerTableModel List pluginsThatUseTarget = model.getDependencies(targetPluginDescription); String dependenciesToUnloadHtmlList = - pluginsThatUseTarget.stream().map(PluginDescription::getName).sorted().collect( - Collectors.joining("

  • ", "
    • ", "
    ")); + pluginsThatUseTarget.stream() + .map(PluginDescription::getName) + .sorted() + .collect( + Collectors.joining("
  • ", "
    • ", "
    ")); if (pluginsThatUseTarget.isEmpty() || OptionDialog.showYesNoDialog(parentComponent, "Confirm plugin removal", diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java index 838cf06cf0..185b8e1db5 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginManagerComponent.java @@ -26,8 +26,7 @@ import docking.EmptyBorderToggleButton; import docking.widgets.HyperlinkComponent; import docking.widgets.checkbox.GCheckBox; import docking.widgets.label.*; -import generic.theme.GColor; -import generic.theme.GThemeDefaults; +import generic.theme.*; import ghidra.framework.plugintool.PluginConfigurationModel; import ghidra.framework.plugintool.PluginTool; import ghidra.framework.plugintool.util.*; @@ -38,7 +37,7 @@ import ghidra.util.layout.VerticalLayout; import resources.ResourceManager; public class PluginManagerComponent extends JPanel implements Scrollable { - private static final Icon DEFAULT_ICON = ResourceManager.loadImage("images/plasma.png"); + private static final Icon DEFAULT_ICON = new GIcon("icon.plugin.manager.default"); private final PluginTool tool; private PluginConfigurationModel model; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java index ab58f71e03..9393f5679b 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/task/gui/GTaskResultPanel.java @@ -21,11 +21,11 @@ import java.awt.Component; import javax.swing.*; import docking.widgets.list.GListCellRenderer; +import generic.theme.GIcon; import generic.theme.GThemeDefaults.Colors; import ghidra.framework.task.GTaskManager; import ghidra.framework.task.GTaskResult; import resources.Icons; -import resources.ResourceManager; public class GTaskResultPanel extends JPanel { private JList jList; @@ -42,11 +42,9 @@ public class GTaskResultPanel extends JPanel { } static class GTaskResultCellRenderer extends GListCellRenderer { - private static final Icon CANCELLED_ICON = - ResourceManager.loadImage("images/dialog-cancel.png"); + private static final Icon CANCELLED_ICON = new GIcon("icon.not.allowed"); private static final Icon EXCEPTION_ICON = Icons.ERROR_ICON; - private static final Icon COMPLETED_ICON = - ResourceManager.loadImage("images/checkmark_green.gif"); + private static final Icon COMPLETED_ICON = new GIcon("icon.checkmark.green"); @Override protected String getItemText(GTaskResultInfo value) { diff --git a/Ghidra/Features/Base/src/main/resources/images/lock.png b/Ghidra/Framework/Project/src/main/resources/images/lock.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/lock.png rename to Ghidra/Framework/Project/src/main/resources/images/lock.png diff --git a/Ghidra/Features/Base/src/main/resources/images/plasma.png b/Ghidra/Framework/Project/src/main/resources/images/plasma.png similarity index 100% rename from Ghidra/Features/Base/src/main/resources/images/plasma.png rename to Ghidra/Framework/Project/src/main/resources/images/plasma.png diff --git a/Ghidra/Framework/SoftwareModeling/certification.manifest b/Ghidra/Framework/SoftwareModeling/certification.manifest index f6aae4a01e..ada6acd606 100644 --- a/Ghidra/Framework/SoftwareModeling/certification.manifest +++ b/Ghidra/Framework/SoftwareModeling/certification.manifest @@ -12,6 +12,7 @@ data/languages/format_opinions.rxg||GHIDRA||||END| data/languages/language_common.rxg||GHIDRA||||END| data/languages/language_definitions.rxg||GHIDRA||||END| data/languages/processor_spec.rxg||GHIDRA||||END| +data/softwaremodeling.theme.properties||GHIDRA||||END| src/main/antlr/ghidra/sleigh/grammar/BaseLexer.g||GHIDRA||||END| src/main/antlr/ghidra/sleigh/grammar/BooleanExpression.g||GHIDRA||||END| src/main/antlr/ghidra/sleigh/grammar/DisplayLexer.g||GHIDRA||||END| @@ -37,6 +38,7 @@ src/main/java/ghidra/program/model/scalar/package.html||GHIDRA||||END| src/main/java/ghidra/program/model/symbol/package.html||GHIDRA||||END| src/main/java/ghidra/program/model/util/package.html||GHIDRA||||END| src/main/resources/images/audio-volume-medium.png||Tango Icons - Public Domain|||tango icon set|END| +src/main/resources/images/closedBookBlue.png||GHIDRA||||END| src/test.slow/java/log4j.xml||GHIDRA||reviewed||END| src/test/resources/a_nestedif2.input||GHIDRA||reviewed||END| src/test/resources/a_nestedif2.output||GHIDRA||reviewed||END| diff --git a/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties b/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties new file mode 100644 index 0000000000..be5955e97d --- /dev/null +++ b/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties @@ -0,0 +1,12 @@ + +[Defaults] + +icon.content.handler.archive.dt = closedBookBlue.png +icon.content.handler.program = program_obj.png + +icon.data.type.aiff = audio-volume-medium.png +icon.data.type.au = audio-volume-medium.png +icon.data.type.wave = audio-volume-medium.png + +[Dark Defaults] + diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/DataTypeArchiveContentHandler.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/DataTypeArchiveContentHandler.java index 74b208bb25..623a2e421e 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/DataTypeArchiveContentHandler.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/DataTypeArchiveContentHandler.java @@ -18,12 +18,12 @@ package ghidra.program.database; import java.io.IOException; import javax.swing.Icon; -import javax.swing.ImageIcon; import db.DBConstants; import db.DBHandle; import db.buffers.BufferFile; import db.buffers.ManagedBufferFile; +import generic.theme.GIcon; import ghidra.framework.data.*; import ghidra.framework.model.ChangeSet; import ghidra.framework.model.DomainObject; @@ -33,7 +33,6 @@ import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.exception.VersionException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * DataTypeArchiveContentHandler converts between DataTypeArchive instantiations @@ -42,9 +41,9 @@ import resources.ResourceManager; */ public class DataTypeArchiveContentHandler extends DBContentHandler { - private static ImageIcon DATA_TYPE_ARCHIVE_ICON; + private static Icon DATA_TYPE_ARCHIVE_ICON; - private final static String PROGRAM_ICON_PATH = "images/closedBookBlue.png"; + private final static String PROGRAM_ICON_ID = "icon.content.handler.archive.dt"; public final static String DATA_TYPE_ARCHIVE_CONTENT_TYPE = "Archive"; @Override @@ -347,7 +346,7 @@ public class DataTypeArchiveContentHandler extends DBContentHandler { public Icon getIcon() { synchronized (DataTypeArchiveContentHandler.class) { if (DATA_TYPE_ARCHIVE_ICON == null) { - DATA_TYPE_ARCHIVE_ICON = ResourceManager.loadImage(PROGRAM_ICON_PATH); + DATA_TYPE_ARCHIVE_ICON = new GIcon(PROGRAM_ICON_ID); } } return DATA_TYPE_ARCHIVE_ICON; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramContentHandler.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramContentHandler.java index 95d1389ee6..7f124b27d9 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramContentHandler.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramContentHandler.java @@ -18,11 +18,11 @@ package ghidra.program.database; import java.io.IOException; import javax.swing.Icon; -import javax.swing.ImageIcon; import db.*; import db.buffers.BufferFile; import db.buffers.ManagedBufferFile; +import generic.theme.GIcon; import ghidra.framework.data.*; import ghidra.framework.model.ChangeSet; import ghidra.framework.model.DomainObject; @@ -32,7 +32,6 @@ import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.exception.VersionException; import ghidra.util.task.TaskMonitor; -import resources.ResourceManager; /** * ProgramContentHandler converts between Program instantiations @@ -41,8 +40,7 @@ import resources.ResourceManager; */ public class ProgramContentHandler extends DBContentHandler { - // scale just a bit to make a nice, slender document - public static ImageIcon PROGRAM_ICON = ResourceManager.loadImage("images/program_obj.png"); + public static Icon PROGRAM_ICON = new GIcon("icon.content.handler.program"); public static final String PROGRAM_CONTENT_TYPE = "Program"; @@ -82,13 +80,7 @@ public class ProgramContentHandler extends DBContentHandler { catch (Field.UnsupportedFieldException e) { throw new VersionException(false); } - catch (VersionException e) { - throw e; - } - catch (IOException e) { - throw e; - } - catch (CancelledException e) { + catch (VersionException | IOException | CancelledException e) { throw e; } catch (Throwable t) { @@ -141,13 +133,7 @@ public class ProgramContentHandler extends DBContentHandler { catch (Field.UnsupportedFieldException e) { throw new VersionException(false); } - catch (VersionException e) { - throw e; - } - catch (IOException e) { - throw e; - } - catch (CancelledException e) { + catch (VersionException | IOException | CancelledException e) { throw e; } catch (Throwable t) { @@ -207,13 +193,7 @@ public class ProgramContentHandler extends DBContentHandler { catch (Field.UnsupportedFieldException e) { throw new VersionException(false); } - catch (VersionException e) { - throw e; - } - catch (IOException e) { - throw e; - } - catch (CancelledException e) { + catch (VersionException | IOException | CancelledException e) { throw e; } catch (Throwable t) { @@ -311,10 +291,7 @@ public class ProgramContentHandler extends DBContentHandler { program = new ProgramDB(dbh, openMode, null, this); return getProgramChangeSet(program, bf); } - catch (VersionException e) { - throw e; - } - catch (IOException e) { + catch (VersionException | IOException e) { throw e; } catch (Throwable t) { diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AIFFDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AIFFDataType.java index 7e80ac5180..38db4e5796 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AIFFDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AIFFDataType.java @@ -20,13 +20,13 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import javax.sound.sampled.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; +import generic.theme.GIcon; import ghidra.docking.settings.Settings; import ghidra.program.model.mem.MemBuffer; import ghidra.program.model.mem.MemoryAccessException; import ghidra.util.Msg; -import resources.ResourceManager; public class AIFFDataType extends BuiltIn implements Dynamic { @@ -106,8 +106,7 @@ public class AIFFDataType extends BuiltIn implements Dynamic { private static class AIFFData implements Playable { - private static final ImageIcon AUDIO_ICON = - ResourceManager.loadImage("images/audio-volume-medium.png"); + private static final Icon AUDIO_ICON = new GIcon("icon.data.type.aiff"); private byte[] bytes; public AIFFData(byte[] bytes) { @@ -130,7 +129,7 @@ public class AIFFDataType extends BuiltIn implements Dynamic { } @Override - public ImageIcon getImageIcon() { + public Icon getImageIcon() { return AUDIO_ICON; } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java index 666af6b26c..7ba4b6c5b1 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java @@ -20,14 +20,14 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import javax.sound.sampled.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; +import generic.theme.GIcon; import ghidra.docking.settings.Settings; import ghidra.program.model.mem.MemBuffer; import ghidra.program.model.mem.MemoryAccessException; import ghidra.util.GhidraBigEndianDataConverter; import ghidra.util.Msg; -import resources.ResourceManager; public class AUDataType extends BuiltIn implements Dynamic { public static byte[] MAGIC = new byte[] { (byte) '.', (byte) 's', (byte) 'n', (byte) 'd' }; @@ -110,8 +110,7 @@ public class AUDataType extends BuiltIn implements Dynamic { private static class AUData implements Playable { - private static final ImageIcon AUDIO_ICON = - ResourceManager.loadImage("images/audio-volume-medium.png"); + private static final Icon AUDIO_ICON = new GIcon("icon.data.type.au"); private byte[] bytes; public AUData(byte[] bytes) { @@ -134,7 +133,7 @@ public class AUDataType extends BuiltIn implements Dynamic { } @Override - public ImageIcon getImageIcon() { + public Icon getImageIcon() { return AUDIO_ICON; } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Playable.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Playable.java index c3bfcf8146..15ba060c51 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Playable.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Playable.java @@ -17,12 +17,12 @@ package ghidra.program.model.data; import java.awt.event.MouseEvent; -import javax.swing.ImageIcon; +import javax.swing.Icon; public interface Playable { - public ImageIcon getImageIcon(); - + public Icon getImageIcon(); + public void clicked(MouseEvent e); - + } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/WAVEDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/WAVEDataType.java index c18a89a856..4a6197f9fd 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/WAVEDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/WAVEDataType.java @@ -20,13 +20,13 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import javax.sound.sampled.*; -import javax.swing.ImageIcon; +import javax.swing.Icon; +import generic.theme.GIcon; import ghidra.docking.settings.Settings; import ghidra.program.model.mem.MemBuffer; import ghidra.program.model.mem.MemoryAccessException; import ghidra.util.Msg; -import resources.ResourceManager; public class WAVEDataType extends BuiltIn implements Dynamic { public static byte[] MAGIC = new byte[] { (byte) 'R', (byte) 'I', (byte) 'F', (byte) 'F', @@ -103,8 +103,7 @@ public class WAVEDataType extends BuiltIn implements Dynamic { private static class WAVEData implements Playable { - private static final ImageIcon AUDIO_ICON = - ResourceManager.loadImage("images/audio-volume-medium.png"); + private static final Icon AUDIO_ICON = new GIcon("icon.data.type.wave"); private byte[] bytes; public WAVEData(byte[] bytes) { @@ -127,7 +126,7 @@ public class WAVEDataType extends BuiltIn implements Dynamic { } @Override - public ImageIcon getImageIcon() { + public Icon getImageIcon() { return AUDIO_ICON; } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/resources/images/closedBookBlue.png b/Ghidra/Framework/SoftwareModeling/src/main/resources/images/closedBookBlue.png new file mode 100644 index 0000000000..0ae9b62e59 Binary files /dev/null and b/Ghidra/Framework/SoftwareModeling/src/main/resources/images/closedBookBlue.png differ