GP-1981 - Theming - Color conversion for Debugger modules

This commit is contained in:
dragonmacher 2022-09-20 18:11:23 -04:00 committed by ghidragon
parent 9a0d7892da
commit abe31c5a95
21 changed files with 287 additions and 196 deletions

View file

@ -6,6 +6,7 @@
##MODULE IP: Tango Icons - Public Domain
Module.manifest||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
data/debugger.theme.properties||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/shared/arrow.gif||GHIDRA||||END|
src/main/help/help/shared/close16.gif||GHIDRA||||END|

View file

@ -0,0 +1,68 @@
[Defaults]
color.bg.debugger.diff.marker = moccasin
color.bg.debugger.listing.blended = color.bg
color.bg.debugger.memory.state = color.bg
color.debugger.plugin.plugin.memview.arrow = red
color.debugger.plugin.memview.box = blue
color.debugger.plugin.memview.box.type.instructions = rgb(128, 000, 000)
color.debugger.plugin.memview.box.type.process = rgb(200, 200, 255)
color.debugger.plugin.memview.box.type.thread = rgb(200, 255, 255)
color.debugger.plugin.memview.box.type.module = lime
color.debugger.plugin.memview.box.type.region = yellow
color.debugger.plugin.memview.box.type.image = magenta
color.debugger.plugin.memview.box.type.virtual.alloc = lightgray
color.debugger.plugin.memview.box.type.heap.create = blue
color.debugger.plugin.memview.box.type.heap.alloc = rgb(000, 100, 050)
color.debugger.plugin.memview.box.type.pool = rgb(100, 000, 150)
color.debugger.plugin.memview.box.type.stack = cyan
color.debugger.plugin.memview.box.type.perfinfo = lightgray
color.debugger.plugin.memview.box.type.read.memory = darkgray
color.debugger.plugin.memview.box.type.write.memory = blue
color.debugger.plugin.memview.box.type.breakpoint = red
color.bg.debugger.plugin.objects.default = color.bg
color.fg.debugger.plugin.objects.default = color.fg
color.fg.debugger.plugin.objects.invisible = lightgray
color.fg.debugger.plugin.objects.invalidated = lightgray
color.fg.debugger.plugin.objects.modified = red
color.fg.debugger.plugin.objects.subscribed = black
color.fg.debugger.plugin.objects.error = color.fg.error
color.fg.debugger.plugin.objects.intrinsic = blue
color.fg.debugger.plugin.objects.target = magenta
color.fg.debugger.plugin.objects.accessor = lightgray
color.fg.debugger.plugin.objects.link = green
color.bg.debugger.plugin.resources.stale = lightgray
color.bg.debugger.plugin.resources.error = lightpink
color.debugger.plugin.resources.register.marker = lightcoral
color.debugger.plugin.resources.register.stale = gray
color.debugger.plugin.resources.register.stale.selected = lightgray
color.debugger.plugin.resources.register.changed = red
color.debugger.plugin.resources.register.changed.selected = lightcoral
color.debugger.plugin.resources.watch.stale = gray
color.debugger.plugin.resources.watch.stale.selected = lightgray
color.debugger.plugin.resources.watch.changed = red
color.debugger.plugin.resources.watch.changed.selected = lightcoral
color.debugger.plugin.resources.value.changed = red
color.debugger.plugin.resources.value.changed.selected = lightcoral
color.debugger.plugin.resources.pcode.counter = lightgreen
color.debugger.plugin.resources.breakpoint.marker.enabled = lightsteelblue
color.debugger.plugin.resources.breakpoint.marker.disabled = color.debugger.plugin.resources.breakpoint.marker.enabled
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
[Dark Defaults]

View file

@ -30,6 +30,7 @@ import docking.action.ToggleDockingAction;
import docking.action.builder.*;
import docking.widgets.table.*;
import docking.widgets.tree.GTreeNode;
import generic.theme.GColor;
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;
@ -54,7 +55,8 @@ import ghidra.framework.plugintool.Plugin;
import ghidra.framework.plugintool.util.PluginUtils;
import ghidra.program.database.ProgramContentHandler;
import ghidra.trace.model.Trace;
import ghidra.util.*;
import ghidra.util.HelpLocation;
import ghidra.util.Msg;
import ghidra.util.exception.CancelledException;
import resources.MultiIcon;
import resources.ResourceManager;
@ -274,44 +276,51 @@ public interface DebuggerResources {
String BOOKMARK_CATEGORY_MEMORY_READ_ERROR = "Debugger Memory Read Error";
String OPTION_NAME_COLORS_STALE_MEMORY = "Colors.Stale Memory";
Color DEFAULT_COLOR_BACKGROUND_STALE = Color.LIGHT_GRAY;
Color DEFAULT_COLOR_BACKGROUND_STALE = new GColor("color.bg.debugger.plugin.resources.stale");
String OPTION_NAME_COLORS_ERROR_MEMORY = "Colors.Error Memory";
Color DEFAULT_COLOR_BACKGROUND_ERROR = new Color(1.0f, 0.75f, 0.75f);
Color DEFAULT_COLOR_BACKGROUND_ERROR = new GColor("color.bg.debugger.plugin.resources.error");
int PRIORITY_REGISTER_MARKER = 10;
String OPTION_NAME_COLORS_TRACKING_MARKERS = "Colors.Tracking Markers";
Color DEFAULT_COLOR_REGISTER_MARKERS = new Color(0.75f, 0.875f, 0.75f);
Color DEFAULT_COLOR_REGISTER_MARKERS =
new GColor("color.debugger.plugin.resources.register.marker");
ImageIcon ICON_REGISTER_MARKER = ResourceManager.loadImage("images/register-marker.png");
ImageIcon ICON_EVENT_MARKER = ICON_REGISTER_MARKER; // TODO: Another icon?
// At least rename to "marker-arrow", and then have both ref it.
//@formatter:off
String OPTION_NAME_COLORS_REGISTER_STALE = "Colors.Stale Registers";
Color DEFAULT_COLOR_REGISTER_STALE = Color.GRAY;
Color DEFAULT_COLOR_REGISTER_STALE = new GColor("color.debugger.plugin.resources.register.stale");
String OPTION_NAME_COLORS_REGISTER_STALE_SEL = "Colors.Stale Registers (selected)";
Color DEFAULT_COLOR_REGISTER_STALE_SEL = Color.LIGHT_GRAY;
Color DEFAULT_COLOR_REGISTER_STALE_SEL = new GColor("color.debugger.plugin.resources.register.stale.selected");
String OPTION_NAME_COLORS_REGISTER_CHANGED = "Colors.Changed Registers";
Color DEFAULT_COLOR_REGISTER_CHANGED = Color.RED;
Color DEFAULT_COLOR_REGISTER_CHANGED = new GColor("color.debugger.plugin.resources.register.changed");
String OPTION_NAME_COLORS_REGISTER_CHANGED_SEL = "Colors.Changed Registers (selected)";
Color DEFAULT_COLOR_REGISTER_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
Color DEFAULT_COLOR_REGISTER_CHANGED_SEL = new GColor("color.debugger.plugin.resources.register.changed.selected");
//@formatter:on
//@formatter:off
String OPTION_NAME_COLORS_WATCH_STALE = "Colors.Stale Watches";
Color DEFAULT_COLOR_WATCH_STALE = Color.GRAY;
Color DEFAULT_COLOR_WATCH_STALE = new GColor("color.debugger.plugin.resources.watch.stale");
String OPTION_NAME_COLORS_WATCH_STALE_SEL = "Colors.Stale Watches (selected)";
Color DEFAULT_COLOR_WATCH_STALE_SEL = Color.LIGHT_GRAY;
Color DEFAULT_COLOR_WATCH_STALE_SEL = new GColor("color.debugger.plugin.resources.watch.stale.selected");
String OPTION_NAME_COLORS_WATCH_CHANGED = "Colors.Changed Watches";
Color DEFAULT_COLOR_WATCH_CHANGED = Color.RED;
Color DEFAULT_COLOR_WATCH_CHANGED = new GColor("color.debugger.plugin.resources.watch.changed");
String OPTION_NAME_COLORS_WATCH_CHANGED_SEL = "Colors.Changed Watches (selected)";
Color DEFAULT_COLOR_WATCH_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
Color DEFAULT_COLOR_WATCH_CHANGED_SEL = new GColor("color.debugger.plugin.resources.watch.changed.selected");
//@formatter:on
//@formatter:off
String OPTION_NAME_COLORS_VALUE_CHANGED = "Colors.Changed Values";
Color DEFAULT_COLOR_VALUE_CHANGED = Color.RED;
Color DEFAULT_COLOR_VALUE_CHANGED = new GColor("color.debugger.plugin.resources.value.changed");
String OPTION_NAME_COLORS_VALUE_CHANGED_SEL = "Colors.Changed Values (selected)";
Color DEFAULT_COLOR_VALUE_CHANGED_SEL = ColorUtils.blend(Color.RED, Color.WHITE, 0.5f);
Color DEFAULT_COLOR_VALUE_CHANGED_SEL = new GColor("color.debugger.plugin.resources.value.changed.selected");
//@formatter:on
String OPTION_NAME_COLORS_PCODE_COUNTER = "Colors.Pcode Counter";
Color DEFAULT_COLOR_PCODE_COUNTER = new Color(0.75f, 0.875f, 0.75f);
Color DEFAULT_COLOR_PCODE_COUNTER = new GColor("color.debugger.plugin.resources.pcode.counter");
String NAME_BREAKPOINT_MARKER_ENABLED = "Enabled Breakpoint";
String NAME_BREAKPOINT_MARKER_DISABLED = "Disabled Breakpoint";
@ -349,17 +358,16 @@ public interface DebuggerResources {
ImageIcon ICON_UNIQUE_REF_WRITE = ResourceManager.loadImage("images/cursor_arrow.gif"); // TODO
Icon ICON_UNIQUE_REF_RW = new MultiIcon(ICON_UNIQUE_REF_READ, ICON_UNIQUE_REF_WRITE); // TODO
//@formatter:off
String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_MARKERS = "Colors.Enabled Breakpoint Markers";
Color DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS = new Color(0.75f, 0.75f, 0.875f);
Color DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled");
String OPTION_NAME_COLORS_DISABLED_BREAKPOINT_MARKERS = "Colors.Disabled Breakpoint Markers";
Color DEFAULT_COLOR_DISABLED_BREAKPOINT_MARKERS = DEFAULT_COLOR_ENABLED_BREAKPOINT_MARKERS;
String OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS =
"Colors.Ineffective Enabled Breakpoint Markers";
Color DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS = new Color(0.75f, 0.75f, 0.75f);
String OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS =
"Colors.Ineffective Disabled Breakpoint Markers";
Color DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS =
DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS;
Color DEFAULT_COLOR_DISABLED_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled");
String OPTION_NAME_COLORS_INEFF_EN_BREAKPOINT_MARKERS = "Colors.Ineffective Enabled Breakpoint Markers";
Color DEFAULT_COLOR_INEFF_EN_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.enabled.ineffective");
String OPTION_NAME_COLORS_INEFF_DIS_BREAKPOINT_MARKERS = "Colors.Ineffective Disabled Breakpoint Markers";
Color DEFAULT_COLOR_INEFF_DIS_BREAKPOINT_MARKERS = new GColor("color.debugger.plugin.resources.breakpoint.marker.disabled.ineffective");
//@formatter:on
String OPTION_NAME_COLORS_ENABLED_BREAKPOINT_COLORING_BACKGROUND =
"Colors.Enabled Breakpoint Markers Have Background";

View file

@ -28,6 +28,7 @@ import javax.swing.event.ChangeListener;
import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.ToggleDockingAction;
import generic.theme.GColor;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.plugin.core.codebrowser.MarkerServiceBackgroundColorModel;
import ghidra.app.plugin.core.debug.*;
@ -57,28 +58,19 @@ import ghidra.trace.model.program.TraceProgramView;
import ghidra.trace.model.time.schedule.TraceSchedule;
import ghidra.util.Msg;
@PluginInfo(
shortDescription = "Compare memory state between times in a trace",
description = "Provides a side-by-side diff view between snapshots (points in time) in a " +
"trace. The comparison is limited to raw bytes.",
category = PluginCategoryNames.DEBUGGER,
packageName = DebuggerPluginPackage.NAME,
status = PluginStatus.RELEASED,
eventsConsumed = {
@PluginInfo(shortDescription = "Compare memory state between times in a trace", description = "Provides a side-by-side diff view between snapshots (points in time) in a " +
"trace. The comparison is limited to raw bytes.", category = PluginCategoryNames.DEBUGGER, packageName = DebuggerPluginPackage.NAME, status = PluginStatus.RELEASED, eventsConsumed = {
TraceClosedPluginEvent.class,
},
eventsProduced = {},
servicesRequired = {
}, eventsProduced = {}, servicesRequired = {
DebuggerListingService.class,
},
servicesProvided = {})
}, servicesProvided = {})
public class DebuggerTraceViewDiffPlugin extends AbstractDebuggerPlugin {
protected static final String MARKER_NAME = "Trace Diff";
protected static final String MARKER_DESCRIPTION = "Difference between snapshots in this trace";
public static final String DIFF_COLOR_CATEGORY = "Listing Fields";
public static final String DIFF_COLOR_NAME = "Selection Colors.Difference Color";
public static final Color DEFAULT_DIFF_COLOR = new Color(255, 230, 180); // light orange
public static final Color DEFAULT_DIFF_COLOR = new GColor("color.bg.debugger.diff.marker");
protected class ListingCoordinationListener implements CoordinatedListingPanelListener {
@Override

View file

@ -19,6 +19,7 @@ import java.awt.Color;
import java.math.BigInteger;
import java.util.Map.Entry;
import generic.theme.GColor;
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
import ghidra.app.util.viewer.listingpanel.ListingPanel;
@ -34,7 +35,7 @@ import ghidra.trace.model.program.TraceProgramView;
import ghidra.util.ColorUtils;
public class MemoryStateListingBackgroundColorModel implements ListingBackgroundColorModel {
private Color defaultBackgroundColor = Color.WHITE;
private Color defaultBackgroundColor = new GColor("color.bg.debugger.memory.state");
private AddressIndexMap addressIndexMap;
private TraceProgramView view;

View file

@ -21,11 +21,14 @@ import java.util.ArrayList;
import java.util.List;
import docking.widgets.fieldpanel.support.BackgroundColorModel;
import generic.theme.GColor;
import ghidra.app.util.viewer.listingpanel.ListingBackgroundColorModel;
import ghidra.app.util.viewer.listingpanel.ListingPanel;
import ghidra.util.ColorUtils.ColorBlender;
public class MultiBlendedListingBackgroundColorModel implements ListingBackgroundColorModel {
private static final Color BG_COLOR_EMPTY = new GColor("color.bg.debugger.listing.blended");
private final List<BackgroundColorModel> models = new ArrayList<>();
private final ColorBlender blender = new ColorBlender();
@ -60,7 +63,7 @@ public class MultiBlendedListingBackgroundColorModel implements ListingBackgroun
@Override
public Color getDefaultBackgroundColor() {
if (models.isEmpty()) {
return Color.WHITE;
return BG_COLOR_EMPTY;
}
return models.get(0).getDefaultBackgroundColor();
}

View file

@ -20,6 +20,8 @@ import java.awt.Graphics;
import java.util.HashMap;
import java.util.Map;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors.Java;
import ghidra.program.model.address.AddressRange;
import ghidra.trace.model.Lifespan;
@ -34,7 +36,7 @@ public class MemoryBox {
protected long stopAddr = -1;
protected long startTime;
protected long stopTime = -1;
protected Color color = Color.BLUE;
protected Color color = new GColor("color.bg.debugger.memview.box");
protected int pixAstart;
protected int pixAend;
@ -108,8 +110,9 @@ public class MemoryBox {
}
public int getAddressPixelWidth() {
if (pixAend - pixAstart <= 0)
if (pixAend - pixAstart <= 0) {
return 1;
}
return pixAend - pixAstart;
}
@ -121,8 +124,9 @@ public class MemoryBox {
if (pixTend < pixTstart) {
pixTend = boundT;
}
if (pixTend - pixTstart == 0)
if (pixTend - pixTstart == 0) {
return 1;
}
return pixTend - pixTstart;
}
@ -147,7 +151,7 @@ public class MemoryBox {
int w = vertical ? getTimePixelWidth() : getAddressPixelWidth();
int y = vertical ? getAddressPixelStart() : getTimePixelStart();
int h = vertical ? getAddressPixelWidth() : getTimePixelWidth();
g.setColor(Color.BLACK);
g.setColor(Java.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
@ -158,7 +162,7 @@ public class MemoryBox {
int w = vertical ? sz : getAddressPixelWidth();
int y = vertical ? getAddressPixelStart() : 0;
int h = vertical ? getAddressPixelWidth() : sz;
g.setColor(Color.BLACK);
g.setColor(Java.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
@ -169,7 +173,7 @@ public class MemoryBox {
int w = vertical ? 1 : sz;
int y = vertical ? 0 : getTimePixelStart();
int h = vertical ? sz : 1;
g.setColor(Color.BLACK);
g.setColor(Java.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
@ -227,10 +231,12 @@ public class MemoryBox {
}
public boolean inPixelRange(long pos) {
if (pos < pixTstart)
if (pos < pixTstart) {
return false;
if (pixTend <= 0)
}
if (pixTend <= 0) {
return true;
}
return pos <= pixTend;
}

View file

@ -17,6 +17,8 @@ package ghidra.app.plugin.core.debug.gui.memview;
import java.awt.Color;
import generic.theme.GColor;
public enum MemviewBoxType {
INSTRUCTIONS,
PROCESS,
@ -35,21 +37,21 @@ public enum MemviewBoxType {
BREAKPOINT;
Color[] colors = { //
new Color(128, 000, 000), // INSTRUCTIONS
new Color(200, 200, 255), // PROCESS
new Color(200, 255, 255), // THREAD
Color.GREEN, //new Color(000, 150, 200), // MODULE
Color.YELLOW, //new Color(000, 150, 200), // REGION
Color.MAGENTA, //new Color(050, 100, 255), // IMAGE
Color.LIGHT_GRAY, // VIRTUAL_ALLOC
Color.BLUE, // HEAP_CREATE
new Color(000, 100, 050), // HEAP_ALLOC
new Color(100, 000, 150), // POOL
Color.CYAN, // STACK
Color.LIGHT_GRAY, // PERFINFO
Color.DARK_GRAY, // READ_MEMORY
Color.BLUE, // WRITE_MEMORY
Color.RED, // WRITE_MEMORY
new GColor("color.debugger.plugin.memview.box.type.instructions"),
new GColor("color.debugger.plugin.memview.box.type.process"),
new GColor("color.debugger.plugin.memview.box.type.thread"),
new GColor("color.debugger.plugin.memview.box.type.module"),
new GColor("color.debugger.plugin.memview.box.type.region"),
new GColor("color.debugger.plugin.memview.box.type.image"),
new GColor("color.debugger.plugin.memview.box.type.virtual.alloc"),
new GColor("color.debugger.plugin.memview.box.type.heap.create"),
new GColor("color.debugger.plugin.memview.box.type.heap.alloc"),
new GColor("color.debugger.plugin.memview.box.type.pool"),
new GColor("color.debugger.plugin.memview.box.type.stack"),
new GColor("color.debugger.plugin.memview.box.type.perfinfo"),
new GColor("color.debugger.plugin.memview.box.type.read.memory"),
new GColor("color.debugger.plugin.memview.box.type.write.memory"),
new GColor("color.debugger.plugin.memview.box.type.breakpoint"),
};
public Color getColor() {

View file

@ -22,16 +22,20 @@ import java.util.List;
import javax.swing.*;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors.Java;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressRange;
public class MemviewPanel extends JPanel implements MouseListener, MouseMotionListener {
private static final long serialVersionUID = 1L;
private Color ARROW_COLOR = new GColor("color.debugger.memview.arrow");
private MemviewProvider provider;
private MemviewMap amap;
private MemviewMap tmap;
private List<MemoryBox> boxList = new ArrayList<MemoryBox>();
private List<MemoryBox> boxList = new ArrayList<>();
private int pressedX;
private int pressedY;
@ -60,7 +64,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
this.provider = provider;
setPreferredSize(new Dimension(barWidth, barHeight));
setSize(getPreferredSize());
setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
setBorder(BorderFactory.createLineBorder(Java.BORDER, 1));
setFocusable(true);
addMouseListener(this);
@ -129,7 +133,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
g.translate(currentPixelAddr, currentPixelTime);
}
g.setColor(Color.RED);
g.setColor(ARROW_COLOR);
g.fillPolygon(locXs, locYs, locXs.length);
if (vertical) {
@ -149,7 +153,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
int y = currentRectangle.y;
int w = currentRectangle.width;
int h = currentRectangle.height;
g.setColor(Color.RED);
g.setColor(ARROW_COLOR);
g.fillRect(x - 1, y - 1, 1, h + 2);
g.fillRect(x - 1, y - 1, w + 2, 1);
g.fillRect(x + w + 1, y - 1, 1, h + 2);
@ -180,17 +184,19 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
}
void updateBoxes() {
if (!this.isShowing())
if (!this.isShowing()) {
return;
}
boxList = new ArrayList<MemoryBox>();
boxList = new ArrayList<>();
Collection<MemoryBox> boxes = getBoxes();
if (boxes == null) {
return;
}
for (MemoryBox box : boxes) {
if (box == null)
if (box == null) {
continue;
}
int bound = vertical ? getHeight() - 1 : getWidth() - 1;
box.setAddressBounds(amap, bound);
@ -374,26 +380,26 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
Set<MemoryBox> mboxes = addr2box.get(box.getStartAddress());
if (mboxes == null) {
mboxes = new HashSet<MemoryBox>();
mboxes = new HashSet<>();
}
mboxes.add(box);
addr2box.put(box.getStartAddress(), mboxes);
mboxes = addr2box.get(box.getStopAddress());
if (mboxes == null) {
mboxes = new HashSet<MemoryBox>();
mboxes = new HashSet<>();
}
mboxes.add(box);
addr2box.put(box.getStopAddress(), mboxes);
mboxes = time2box.get(box.getStartTime());
if (mboxes == null) {
mboxes = new HashSet<MemoryBox>();
mboxes = new HashSet<>();
}
mboxes.add(box);
time2box.put(box.getStartTime(), mboxes);
mboxes = time2box.get(box.getStopTime());
if (mboxes == null) {
mboxes = new HashSet<MemoryBox>();
mboxes = new HashSet<>();
}
mboxes.add(box);
time2box.put(box.getStopTime(), mboxes);
@ -415,7 +421,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
public void addBoxes(List<MemoryBox> boxes) {
if (blist == null) {
blist = new ArrayList<MemoryBox>();
blist = new ArrayList<>();
}
for (MemoryBox b : boxes) {
if (bmap.containsKey(b.getId())) {
@ -429,7 +435,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
}
public void reset() {
blist = new ArrayList<MemoryBox>();
blist = new ArrayList<>();
bmap.clear();
parseBoxes(blist);
}
@ -451,14 +457,16 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
}
public long getAddr(int x, int y) {
if (amap == null)
if (amap == null) {
return 0;
}
return vertical ? amap.getOffset(y) : amap.getOffset(x);
}
public long getTick(int x, int y) {
if (tmap == null)
if (tmap == null) {
return 0;
}
return vertical ? tmap.getOffset(x) : tmap.getOffset(y);
}

View file

@ -29,6 +29,7 @@ import docking.action.DockingAction;
import docking.action.ToggleDockingAction;
import docking.widgets.table.RangeCursorTableHeaderRenderer.SeekListener;
import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin;
import generic.theme.GColor;
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
@ -77,16 +78,10 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveable
@SuppressWarnings("unused")
private final AutoService.Wiring autoServiceWiring;
@AutoOptionDefined(
description = "Text color for values that have just changed",
name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED,
help = @HelpInfo(anchor = "colors"))
@AutoOptionDefined(description = "Text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED, help = @HelpInfo(anchor = "colors"))
private Color diffColor = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED;
@AutoOptionDefined(
description = "Select text color for values that have just changed",
name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED_SEL,
help = @HelpInfo(anchor = "colors"))
@AutoOptionDefined(description = "Select text color for values that have just changed", name = DebuggerResources.OPTION_NAME_COLORS_VALUE_CHANGED_SEL, help = @HelpInfo(anchor = "colors"))
private Color diffColorSel = DebuggerResources.DEFAULT_COLOR_VALUE_CHANGED_SEL;
@SuppressWarnings("unused")
@ -143,7 +138,8 @@ public class DebuggerModelProvider extends ComponentProvider implements Saveable
setTitle("[" + DebuggerResources.TITLE_PROVIDER_MODEL + "]");
setWindowGroup("Debugger.Core.disconnected");
setIntraGroupPosition(WindowPosition.STACK);
mainPanel.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
mainPanel.setBorder(BorderFactory
.createLineBorder(new GColor("color.border.provider.disconnected"), 2));
setTransient();
}
else {

View file

@ -43,6 +43,8 @@ import docking.widgets.OptionDialog;
import docking.widgets.table.DefaultEnumeratedColumnTableModel;
import docking.widgets.tree.GTree;
import generic.jar.ResourceFile;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors;
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
@ -127,68 +129,68 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
description = "The default foreground color of items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color defaultForegroundColor = Color.BLACK;
Color defaultForegroundColor = new GColor("color.fg.debugger.plugin.objects.default");
@AutoOptionDefined( //
name = OPTION_NAME_DEFAULT_BACKGROUND_COLOR, //
description = "The default background color of items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color defaultBackgroundColor = Color.WHITE;
Color defaultBackgroundColor = new GColor("color.bg.debugger.plugin.objects.default");
@AutoOptionDefined( //
name = OPTION_NAME_INVISIBLE_FOREGROUND_COLOR, //
description = "The foreground color for items normally not visible (toggleable)", //
help = @HelpInfo(anchor = "colors") //
)
Color invisibleForegroundColor = Color.LIGHT_GRAY;
Color invisibleForegroundColor = new GColor("color.fg.debugger.plugin.objects.invisible");
@AutoOptionDefined( //
name = OPTION_NAME_INVALIDATED_FOREGROUND_COLOR, //
description = "The foreground color for items no longer valid", //
help = @HelpInfo(anchor = "colors") //
)
Color invalidatedForegroundColor = Color.LIGHT_GRAY;
Color invalidatedForegroundColor = new GColor("color.fg.debugger.plugin.objects.invalidated");
@AutoOptionDefined( //
name = OPTION_NAME_MODIFIED_FOREGROUND_COLOR, //
description = "The foreground color for modified items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color modifiedForegroundColor = Color.RED;
Color modifiedForegroundColor = new GColor("color.fg.debugger.plugin.objects.modified");
@AutoOptionDefined( //
name = OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR, //
description = "The foreground color for subscribed items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color subscribedForegroundColor = Color.BLACK;
Color subscribedForegroundColor = new GColor("color.fg.debugger.plugin.objects.subscribed");
@AutoOptionDefined( //
name = OPTION_NAME_ERROR_FOREGROUND_COLOR, //
description = "The foreground color for items in error", //
help = @HelpInfo(anchor = "colors") //
)
Color errorForegroundColor = Color.RED;
Color errorForegroundColor = new GColor("color.fg.debugger.plugin.objects.error");
@AutoOptionDefined( //
name = OPTION_NAME_INTRINSIC_FOREGROUND_COLOR, //
description = "The foreground color for intrinsic items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color intrinsicForegroundColor = Color.BLUE;
Color intrinsicForegroundColor = new GColor("color.fg.debugger.plugin.objects.intrinsic");
@AutoOptionDefined( //
name = OPTION_NAME_TARGET_FOREGROUND_COLOR, //
description = "The foreground color for target object items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color targetForegroundColor = Color.MAGENTA;
Color targetForegroundColor = new GColor("color.fg.debugger.plugin.objects.target");
@AutoOptionDefined( //
name = OPTION_NAME_ACCESSOR_FOREGROUND_COLOR, //
description = "The foreground color for property accessor items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color accessorForegroundColor = Color.LIGHT_GRAY;
Color accessorForegroundColor = new GColor("color.fg.debugger.plugin.objects.accessor");
@AutoOptionDefined( //
name = OPTION_NAME_LINK_FOREGROUND_COLOR, //
description = "The foreground color for links to items in the objects tree", //
help = @HelpInfo(anchor = "colors") //
)
Color linkForegroundColor = Color.GREEN.darker();
Color linkForegroundColor = new GColor("color.fg.debugger.plugin.objects.link");
@AutoOptionDefined( //
name = "Default Extended Step", //
@ -281,7 +283,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
this.asTree = asTree;
setIcon(asTree ? ObjectTree.ICON_TREE : ObjectTable.ICON_TABLE);
targetMap = new LinkedMap<String, ObjectContainer>();
targetMap = new LinkedMap<>();
refSet = new HashSet<>();
getRoot().propagateProvider(this);
@ -658,7 +660,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
}
}
model.addAll(list);
return new ObjectTable<ObjectAttributeRow>(container, ObjectAttributeRow.class, model);
return new ObjectTable<>(container, ObjectAttributeRow.class, model);
}
private ObjectTable<ObjectElementRow> buildTableFromElements(ObjectContainer container) {
@ -678,7 +680,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
new ObjectEnumeratedColumnTableModel<>(name, cols);
model.addAll(list);
ObjectTable<ObjectElementRow> table =
new ObjectTable<ObjectElementRow>(container, ObjectElementRow.class, model);
new ObjectTable<>(container, ObjectElementRow.class, model);
for (Object obj : map.values()) {
if (obj instanceof TargetObject) {
TargetObject ref = (TargetObject) obj;
@ -744,7 +746,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
static List<ObjectContainer> getContainersFromObjects(Map<String, ?> objectMap,
TargetObject parent, boolean usingAttributes) {
List<ObjectContainer> result = new ArrayList<ObjectContainer>();
List<ObjectContainer> result = new ArrayList<>();
if (parent == null || parent instanceof DummyTargetObject) {
return result;
}
@ -826,7 +828,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
public ObjectContainer getParent(ObjectContainer container) {
List<String> path = container.getTargetObject().getPath();
List<String> ppath = new ArrayList<String>();
List<String> ppath = new ArrayList<>();
for (String link : path) {
ppath.add(link);
}
@ -2028,7 +2030,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
case OPTION_NAME_TARGET_FOREGROUND_COLOR:
return targetForegroundColor;
default:
return Color.BLACK;
return Colors.FOREGROUND;
}
}

View file

@ -15,15 +15,14 @@
*/
package ghidra.app.plugin.core.debug.gui.objects.components;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.*;
import java.util.Map;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
import docking.widgets.tree.support.GTreeRenderer;
import generic.theme.GThemeDefaults.Colors.Tables;
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider;
import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer;
import ghidra.dbg.target.TargetExecutionStateful;
@ -35,12 +34,11 @@ import ghidra.util.SystemUtilities;
class ObjectTreeCellRenderer extends GTreeRenderer {
private final DebuggerObjectsProvider provider;
private Font defaultFont = SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.PLAIN, 11));
private Font unsubscribedFont = SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.ITALIC, 11));
private Font defaultFont =
SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.PLAIN, 11));
private Font unsubscribedFont =
SystemUtilities.adjustForFontSizeOverride(new Font("Tahoma", Font.ITALIC, 11));
/**
* @param provider
*/
public ObjectTreeCellRenderer(DebuggerObjectsProvider provider) {
this.provider = provider;
}
@ -90,7 +88,7 @@ class ObjectTreeCellRenderer extends GTreeRenderer {
if (container.isSubscribed()) {
Color color = provider
.getColor(DebuggerObjectsProvider.OPTION_NAME_SUBSCRIBED_FOREGROUND_COLOR);
if (!color.equals(Color.BLACK)) {
if (!color.equals(Tables.FG_UNSELECTED)) {
component.setForeground(color);
}
}
@ -100,7 +98,7 @@ class ObjectTreeCellRenderer extends GTreeRenderer {
if (last instanceof ObjectNode) {
ObjectContainer selection = ((ObjectNode) last).getContainer();
if (container.equals(selection)) {
component.setForeground(Color.WHITE);
component.setForeground(Tables.FG_SELECTED);
}
}
}

View file

@ -38,6 +38,7 @@ import docking.actions.PopupActionProvider;
import docking.widgets.table.*;
import docking.widgets.table.ColumnSortState.SortDirection;
import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn;
import generic.theme.GColor;
import ghidra.app.plugin.core.data.DataSettingsDialog;
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
@ -472,23 +473,19 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
@SuppressWarnings("unused")
private final AutoService.Wiring autoServiceWiring;
@AutoOptionDefined(
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE, //
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE, //
description = "Text color for registers whose value is not known", //
help = @HelpInfo(anchor = "colors"))
protected Color registerStaleColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE;
@AutoOptionDefined(
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL, //
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_STALE_SEL, //
description = "Selected text color for registers whose value is not known", //
help = @HelpInfo(anchor = "colors"))
protected Color registerStaleSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_STALE_SEL;
@AutoOptionDefined(
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED, //
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED, //
description = "Text color for registers whose value just changed", //
help = @HelpInfo(anchor = "colors"))
protected Color registerChangesColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED;
@AutoOptionDefined(
name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL, //
@AutoOptionDefined(name = DebuggerResources.OPTION_NAME_COLORS_REGISTER_CHANGED_SEL, //
description = "Selected text color for registers whose value just changed", //
help = @HelpInfo(anchor = "colors"))
protected Color registerChangesSelColor = DebuggerResources.DEFAULT_COLOR_REGISTER_CHANGED_SEL;
@ -550,7 +547,8 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter
setTitle("[" + DebuggerResources.TITLE_PROVIDER_REGISTERS + "]");
setWindowGroup("Debugger.Core.disconnected");
setIntraGroupPosition(WindowPosition.STACK);
mainPanel.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
mainPanel.setBorder(BorderFactory
.createLineBorder(new GColor("color.border.provider.disconnected"), 2));
setTransient();
}
else {

View file

@ -441,7 +441,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
assertNotNull("Cannot get cursor bounds", cursor);
Color actual = new Color(image.getRGB(locFP.x + cursor.x - 1,
locFP.y + cursor.y + cursor.height * 3 / 2 + yAdjust));
assertEquals(expected, actual);
assertEquals(expected.getRGB(), actual.getRGB());
});
}

View file

@ -17,7 +17,6 @@ package ghidra.app.plugin.core.debug.gui.copying;
import static org.junit.Assert.*;
import java.awt.Color;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.*;
@ -26,6 +25,7 @@ import javax.swing.JCheckBox;
import org.junit.Test;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.plugin.assembler.Assembler;
import ghidra.app.plugin.assembler.Assemblers;
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
@ -615,7 +615,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE);
BookmarkManager bookmarks = view.getBookmarkManager();
bookmarks.defineType("TestType", DebuggerResources.ICON_DEBUGGER, Color.BLUE, 1);
bookmarks.defineType("TestType", DebuggerResources.ICON_DEBUGGER, Palette.BLUE, 1);
bookmarks.setBookmark(tb.addr(0x55550123), "TestType", "TestCategory", "Test Comment");
}
@ -644,7 +644,7 @@ public class DebuggerCopyPlanTests extends AbstractGhidraHeadedDebuggerGUITest {
assertEquals("Test Comment", bm.getComment());
assertEquals(DebuggerResources.ICON_DEBUGGER, type.getIcon());
assertEquals(Color.BLUE, type.getMarkerColor());
assertEquals(Palette.BLUE, type.getMarkerColor());
assertEquals(1, type.getMarkerPriority());
}

View file

@ -17,7 +17,6 @@ package ghidra.app.plugin.core.debug.gui.listing;
import static org.junit.Assert.*;
import java.awt.Color;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.ByteBuffer;
@ -31,6 +30,7 @@ import docking.menu.ActionState;
import docking.menu.MultiStateDockingAction;
import docking.widgets.EventTrigger;
import generic.test.category.NightlyCategory;
import generic.theme.GThemeDefaults.Colors;
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
@ -637,7 +637,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
// While we're here, ensure static view didn't track anywhere
assertEquals(cur, codePlugin.getCurrentLocation().getAddress());
assertListingBackgroundAt(Color.WHITE, codePlugin.getListingPanel(),
assertListingBackgroundAt(Colors.BACKGROUND, codePlugin.getListingPanel(),
ss.getAddress(0x00601234), 0);
}
@ -774,7 +774,7 @@ public class DebuggerListingProviderTest extends AbstractGhidraHeadedDebuggerGUI
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_STALE,
listingProvider.getListingPanel(), tb.addr(0x00401233), 0);
assertListingBackgroundAt(Color.WHITE, listingProvider.getListingPanel(),
assertListingBackgroundAt(Colors.BACKGROUND, listingProvider.getListingPanel(),
tb.addr(0x00401234), 0);
assertListingBackgroundAt(DebuggerResources.DEFAULT_COLOR_BACKGROUND_ERROR,
listingProvider.getListingPanel(), tb.addr(0x00401235), 0);

View file

@ -15,7 +15,7 @@
*/
package ghidra.app.plugin.core.debug.gui.memory;
import static ghidra.lifecycle.Unfinished.TODO;
import static ghidra.lifecycle.Unfinished.*;
import static org.junit.Assert.*;
import java.awt.*;
@ -434,7 +434,7 @@ public class DebuggerMemoryBytesProviderTest extends AbstractGhidraHeadedDebugge
}
Rectangle cursor = component.getCursorBounds();
Color actual = new Color(image.getRGB(cursor.x + 8, cursor.y));
assertEquals(expected, actual);
assertEquals(expected.getRGB(), actual.getRGB());
});
}

View file

@ -28,6 +28,7 @@ import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import generic.theme.GThemeDefaults.Colors.Messages;
import ghidra.framework.LoggingInitialization;
import ghidra.util.Msg;
import ghidra.util.Swing;
@ -73,6 +74,11 @@ public class AgentWindow extends JFrame implements WindowListener, LogListener {
@Override
public void messageLogged(String message, boolean isError) {
<<<<<<< Upstream, based on origin/master
=======
String fMessage =
isError ? "<font color=\"" + Messages.ERROR + "\">" + message + "</font>" : message;
>>>>>>> 1e5309a GP-1981 - Theming - Color conversion for Debugger modules
Swing.runIfSwingOrRunLater(() -> {
MutableAttributeSet attributes = new SimpleAttributeSet();
if (isError) {

View file

@ -17,7 +17,6 @@ package ghidra.trace.database;
import static org.junit.Assert.*;
import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
@ -29,6 +28,7 @@ import java.nio.file.Path;
import java.util.Collection;
import db.DBHandle;
import generic.theme.GThemeDefaults.Colors.Messages;
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
import ghidra.pcode.exec.*;
import ghidra.pcode.exec.trace.TraceSleighUtils;
@ -168,7 +168,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
/**
* Get the named register
*
* @param the platform
* @param platform the platform
* @param name the name
* @return the register or null if it doesn't exist
*/
@ -190,7 +190,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
/**
* Create an address in the given language's default space
*
* @param lang the langauge
* @param lang the language
* @param offset the offset
* @return the address
*/
@ -252,7 +252,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
}
/**
* Create an address range: shortcut for {@link new AddressRangeImpl(start, end)}
* Create an address range: shortcut for {@link AddressRangeImpl}
*
* @param start the start address
* @param end the end address
@ -444,7 +444,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
*/
public DBTraceBookmarkType getOrAddBookmarkType(String name) {
DBTraceBookmarkManager manager = trace.getBookmarkManager();
return manager.defineBookmarkType(name, null, Color.red, 1);
return manager.defineBookmarkType(name, null, Messages.ERROR, 1);
}
/**
@ -477,7 +477,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
*
* @param snap the starting snap
* @param threadName the name of the thread
* @param registerName the name of the regsiter
* @param registerName the name of the register
* @param typeName the name of its type
* @param category the category
* @param comment an optional comment
@ -549,11 +549,12 @@ public class ToyDBTraceBuilder implements AutoCloseable {
public DBTraceInstruction addInstruction(long snap, Address start,
TracePlatform platform) throws CodeUnitInsertionException {
DBTraceCodeManager code = trace.getCodeManager();
Language language = platform.getLanguage();
Disassembler dis = Disassembler.getDisassembler(language, language.getAddressFactory(),
Language platformLanguage = platform.getLanguage();
Disassembler dis =
Disassembler.getDisassembler(platformLanguage, platformLanguage.getAddressFactory(),
new ConsoleTaskMonitor(), msg -> Msg.info(this, "Listener: " + msg));
RegisterValue defaultContextValue = trace.getRegisterContextManager()
.getDefaultContext(language)
.getDefaultContext(platformLanguage)
.getDefaultDisassemblyContext();
MemBuffer memBuf = platform.getMappedMemBuffer(snap, platform.mapHostToGuest(start));
@ -725,10 +726,10 @@ public class ToyDBTraceBuilder implements AutoCloseable {
}
/**
* Get the language with the given ID, as in {@link LangaugeID}
* Get the language with the given ID, as in {@link LanguageID}
*
* @param id the ID
* @return the langauge
* @return the language
* @throws LanguageNotFoundException if the language does not exist
*/
public Language getLanguage(String id) throws LanguageNotFoundException {
@ -742,7 +743,7 @@ public class ToyDBTraceBuilder implements AutoCloseable {
* @param compID the compiler ID as in {@link CompilerSpecID}
* @return the compiler spec
* @throws CompilerSpecNotFoundException if the compiler spec does not exist
* @throws LanguageNotFoundException if the langauge does not exist
* @throws LanguageNotFoundException if the language does not exist
*/
public CompilerSpec getCompiler(String langID, String compID)
throws CompilerSpecNotFoundException, LanguageNotFoundException {

View file

@ -17,7 +17,6 @@ package ghidra.util.database.spatial;
import static org.junit.Assert.*;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@ -41,6 +40,8 @@ import com.google.common.collect.Iterators;
import db.DBHandle;
import db.DBRecord;
import generic.theme.GThemeDefaults.Colors.Palette;
import generic.theme.TempColorUtils;
import ghidra.util.LockHold;
import ghidra.util.database.*;
import ghidra.util.database.annot.*;
@ -565,13 +566,13 @@ public class RStarTreeMapTest {
public void selectColor(Graphics g, NodeType type) {
if (type.isLeaf()) {
g.setColor(new Color(1, 0, 0, 0.5f).darker());
g.setColor(TempColorUtils.fromRgba(179, 0, 0, 128));
}
else if (type.isLeafParent()) {
g.setColor(new Color(0, 1, 0, 0.5f).darker());
g.setColor(TempColorUtils.fromRgba(0, 179, 0, 128));
}
else {
g.setColor(new Color(0, 0, 1, 0.5f).darker());
g.setColor(TempColorUtils.fromRgba(0, 0, 179, 128));
}
}
@ -581,14 +582,14 @@ public class RStarTreeMapTest {
return;
}
drawPath(g, getParentOf(nr));
g.setColor(Color.BLACK);
g.setColor(Palette.BLACK);
drawRect(g, nr.getShape(), false);
}
public void drawPath(Graphics g, DBIntRectStringDataRecord dr) {
System.out.println("Selected: " + dr);
drawPath(g, getParentOf(dr));
g.setColor(Color.BLACK);
g.setColor(Palette.BLACK);
drawRect(g, dr.getBounds(), false);
}
@ -609,7 +610,7 @@ public class RStarTreeMapTest {
@Override
protected VisitResult visitData(DBIntRectNodeRecord parent,
DBIntRectStringDataRecord d, boolean included) {
g.setColor(new Color(0, 0, 0, 0.5f));
g.setColor(TempColorUtils.fromRgba(0, 0, 0, 128));
drawRect(g, d.getShape(), true);
return VisitResult.NEXT;
}

View file

@ -10,7 +10,7 @@ color.fg.plugin.python.syntax.method = teal
color.fg.plugin.python.syntax.null = red
color.fg.plugin.python.syntax.number = darkgray
color.fg.plugin.python.syntax.package = darkred
color.fg.plugin.python.syntax.sequence = rbg(128, 96, 64)
color.fg.plugin.python.syntax.sequence = rgb(128, 96, 64)
color.fg.plugin.python.syntax.special = darkgreen