mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Merge remote-tracking branch 'origin/GP-2848-dragonmacher-theme-fixups'
This commit is contained in:
commit
b252544c15
16 changed files with 219 additions and 250 deletions
|
@ -1,79 +1,65 @@
|
|||
[Defaults]
|
||||
|
||||
|
||||
color.bg.functiongraph = color.bg
|
||||
color.bg.plugin.functiongraph = color.bg
|
||||
|
||||
color.fg.label.picked = color.fg
|
||||
color.fg.label.non.picked = color.fg.disabled
|
||||
color.fg.plugin.functiongraph.label.picked = color.fg
|
||||
color.fg.plugin.functiongraph.label.non.picked = color.fg.disabled
|
||||
|
||||
color.bg.functiongraph.vertex.group = rgb(226, 255, 155)
|
||||
color.bg.functiongraph.vertex.entry = color.palette.lightgreen
|
||||
color.bg.functiongraph.vertex.exit = color.palette.lightred
|
||||
color.bg.functiongraph.vertex.picked = color.palette.yellow
|
||||
color.bg.plugin.functiongraph.vertex.group = rgb(226, 255, 155)
|
||||
color.bg.plugin.functiongraph.vertex.entry = color.palette.lightgreen
|
||||
color.bg.plugin.functiongraph.vertex.exit = color.palette.lightred
|
||||
color.bg.plugin.functiongraph.vertex.picked = color.palette.yellow
|
||||
|
||||
color.bg.functiongraph.edge.fall.through = color.flowtype.fall.through
|
||||
color.bg.functiongraph.edge.fall.through.highlight = rgb(255, 127, 127)
|
||||
color.bg.functiongraph.edge.jump.conditional = color.flowtype.jump.conditional
|
||||
color.bg.functiongraph.edge.jump.conditional.highlight = lime
|
||||
color.bg.functiongraph.edge.jump.unconditional = color.flowtype.jump.unconditional
|
||||
color.bg.functiongraph.edge.jump.unconditional.highlight = rgb(127, 127, 255)
|
||||
color.bg.plugin.functiongraph.edge.fall.through = color.flowtype.fall.through
|
||||
color.bg.plugin.functiongraph.edge.fall.through.highlight = rgb(255, 127, 127)
|
||||
color.bg.plugin.functiongraph.edge.jump.conditional = color.flowtype.jump.conditional
|
||||
color.bg.plugin.functiongraph.edge.jump.conditional.highlight = lime
|
||||
color.bg.plugin.functiongraph.edge.jump.unconditional = color.flowtype.jump.unconditional
|
||||
color.bg.plugin.functiongraph.edge.jump.unconditional.highlight = rgb(127, 127, 255)
|
||||
|
||||
color.bg.functiongraph.paint.icon = rgb(189, 221, 252) // gentle pale blue
|
||||
color.bg.plugin.functiongraph.paint.icon = rgb(189, 221, 252) // gentle pale blue
|
||||
|
||||
|
||||
icon.functiongraph.layout.experimental = package_development.png
|
||||
icon.functiongraph.action.vertex.xrefs = brick_link.png
|
||||
icon.functiongraph.action.vertex.maximize = fullscreen_view.png
|
||||
icon.functiongraph.action.vertex.minimize = graph_view.png
|
||||
icon.functiongraph.action.vertex.group = shape_handles.png
|
||||
icon.functiongraph.action.vertex.group.add = shape_square_add.png
|
||||
icon.functiongraph.action.vertex.regroup = edit-redo.png
|
||||
icon.functiongraph.action.vertex.ungroup = shape_ungroup.png
|
||||
icon.functiongraph.action.vertex.choose.color = paintbrush.png
|
||||
icon.functiongraph.action.vertex.choose.color.palette = palette.png
|
||||
icon.functiongraph.action.vertex.edit.label = id.png
|
||||
icon.functiongraph.action.vertex.full.screen = fullscreen_view.png
|
||||
icon.functiongraph.action.vertex.edit.format = field.header.png
|
||||
icon.plugin.functiongraph.layout.experimental = package_development.png
|
||||
icon.plugin.functiongraph.action.vertex.xrefs = brick_link.png
|
||||
icon.plugin.functiongraph.action.vertex.maximize = fullscreen_view.png
|
||||
icon.plugin.functiongraph.action.vertex.minimize = graph_view.png
|
||||
icon.plugin.functiongraph.action.vertex.group = shape_handles.png
|
||||
icon.plugin.functiongraph.action.vertex.group.add = shape_square_add.png
|
||||
icon.plugin.functiongraph.action.vertex.regroup = edit-redo.png
|
||||
icon.plugin.functiongraph.action.vertex.ungroup = shape_ungroup.png
|
||||
icon.plugin.functiongraph.action.vertex.choose.color = paintbrush.png
|
||||
icon.plugin.functiongraph.action.vertex.choose.color.palette = palette.png
|
||||
icon.plugin.functiongraph.action.vertex.edit.label = id.png
|
||||
icon.plugin.functiongraph.action.vertex.full.screen = fullscreen_view.png
|
||||
icon.plugin.functiongraph.action.vertex.edit.format = field.header.png
|
||||
|
||||
icon.functiongraph.action.viewer.clone = icon.provider.clone
|
||||
icon.functiongraph.action.viewer.layout = preferences-system.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.paths.to.vertex = fgin.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.paths.from.vertex = fgout.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex = fginout.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.paths.all = fgpaths.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.cycles = fgloop.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.cycles.all = fgloopall.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.scoped.flow.forward = fgblock.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse = fgrevblock.png
|
||||
icon.functiongraph.action.viewer.vertex.hover.off = hoverOff.gif
|
||||
icon.plugin.functiongraph.action.viewer.clone = icon.provider.clone
|
||||
icon.plugin.functiongraph.action.viewer.layout = preferences-system.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.paths.to.vertex = fgin.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.vertex = fgout.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex = fginout.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.paths.all = fgpaths.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.cycles = fgloop.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.cycles.all = fgloopall.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.forward = fgblock.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse = fgrevblock.png
|
||||
icon.plugin.functiongraph.action.viewer.vertex.hover.off = hoverOff.gif
|
||||
|
||||
icon.functiongraph.action.viewer.home = house.png
|
||||
icon.functiongraph.action.viewer.reset = icon.refresh
|
||||
icon.plugin.functiongraph.action.viewer.home = house.png
|
||||
icon.plugin.functiongraph.action.viewer.reset = icon.refresh
|
||||
|
||||
icon.functiongraph.action.provider = function_graph.png
|
||||
icon.functiongraph.action.provider.satellite = network-wireless-16.png
|
||||
icon.plugin.functiongraph.action.provider = function_graph.png
|
||||
icon.plugin.functiongraph.action.provider.satellite = network-wireless-16.png
|
||||
|
||||
|
||||
[Dark Defaults]
|
||||
|
||||
|
||||
// color.bg.functiongraph = color.bg
|
||||
color.bg.plugin.functiongraph.vertex.group = rgb(226, 222, 179) // TODO confirm value
|
||||
|
||||
// color.fg.label.picked = color.fg
|
||||
// color.fg.label.non.picked = color.fg.disabled
|
||||
|
||||
color.bg.functiongraph.vertex.group = rgb(226, 222, 179) // TODO confirm value
|
||||
// color.bg.functiongraph.vertex.entry = color.palette.lightgreen
|
||||
// color.bg.functiongraph.vertex.exit = color.palette.lightred
|
||||
// color.bg.functiongraph.vertex.picked = color.palette.yellow
|
||||
|
||||
// color.bg.functiongraph.edge.fall.through = color.flowtype.fall.through
|
||||
color.bg.functiongraph.edge.fall.through.highlight = rgb(165, 76, 80)
|
||||
// color.bg.functiongraph.edge.jump.conditional = color.flowtype.jump.conditional
|
||||
color.bg.functiongraph.edge.jump.conditional.highlight = rgb(95, 160, 196)
|
||||
// color.bg.functiongraph.edge.jump.unconditional = color.flowtype.jump.unconditional
|
||||
color.bg.functiongraph.edge.jump.unconditional.highlight = rgb(140, 162, 88)
|
||||
|
||||
|
||||
// TODO dark version color.bg.functiongraph.paint.icon = // TODO
|
||||
color.bg.plugin.functiongraph.edge.fall.through.highlight = rgb(165, 76, 80)
|
||||
color.bg.plugin.functiongraph.edge.jump.conditional.highlight = rgb(95, 160, 196)
|
||||
color.bg.plugin.functiongraph.edge.jump.unconditional.highlight = rgb(140, 162, 88)
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@ class FGActionManager {
|
|||
private static final String LAYOUT_CLASS_NAME = "LAYOUT_CLASS_NAME";
|
||||
|
||||
//@formatter:off
|
||||
private static final Icon GROUP_ICON = new GIcon("icon.functiongraph.action.vertex.group");
|
||||
private static final Icon GROUP_ADD_ICON = new GIcon("icon.functiongraph.action.vertex.group.add");
|
||||
private static final Icon UNGROUP_ICON = new GIcon("icon.functiongraph.action.vertex.ungroup");
|
||||
private static final Icon GROUP_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.group");
|
||||
private static final Icon GROUP_ADD_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.group.add");
|
||||
private static final Icon UNGROUP_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.ungroup");
|
||||
|
||||
private static final Icon EDIT_ICON = new GIcon("icon.functiongraph.action.vertex.edit.label");
|
||||
private static final Icon FULL_SCREEN_ICON = new GIcon("icon.functiongraph.action.vertex.full.screen");
|
||||
private static final Icon XREFS_ICON = new GIcon("icon.functiongraph.action.vertex.full.screen");
|
||||
private static final Icon EDIT_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.edit.label");
|
||||
private static final Icon FULL_SCREEN_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.full.screen");
|
||||
private static final Icon XREFS_ICON = new GIcon("icon.plugin.functiongraph.action.vertex.full.screen");
|
||||
//@formatter:off
|
||||
|
||||
private PluginTool tool;
|
||||
|
@ -127,7 +127,7 @@ class FGActionManager {
|
|||
|
||||
// subgroup 3, after the refresh and layout actions
|
||||
chooseFormatsAction.setToolBarData(new ToolBarData(
|
||||
new GIcon("icon.functiongraph.action.vertex.edit.format"), layoutGroup, "3"));
|
||||
new GIcon("icon.plugin.functiongraph.action.vertex.edit.format"), layoutGroup, "3"));
|
||||
chooseFormatsAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Function_Graph_Action_Format"));
|
||||
|
||||
|
@ -144,7 +144,7 @@ class FGActionManager {
|
|||
}
|
||||
};
|
||||
homeAction.setToolBarData(
|
||||
new ToolBarData(new GIcon("icon.functiongraph.action.viewer.home"), toolBarGroup1));
|
||||
new ToolBarData(new GIcon("icon.plugin.functiongraph.action.viewer.home"), toolBarGroup1));
|
||||
homeAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Function_Graph_Action_Home"));
|
||||
|
||||
|
@ -166,7 +166,7 @@ class FGActionManager {
|
|||
}
|
||||
};
|
||||
resetGraphAction.setToolBarData(
|
||||
new ToolBarData(new GIcon("icon.functiongraph.action.viewer.reset"), layoutGroup, "1"));
|
||||
new ToolBarData(new GIcon("icon.plugin.functiongraph.action.viewer.reset"), layoutGroup, "1"));
|
||||
resetGraphAction.setDescription("<html>Reloads the graph--All positioning and grouping " +
|
||||
"information is <b>lost</b>");
|
||||
resetGraphAction.setHelpLocation(
|
||||
|
@ -659,7 +659,7 @@ class FGActionManager {
|
|||
return controller.getGraphedFunction() != null;
|
||||
}
|
||||
};
|
||||
Icon image = new GIcon("icon.functiongraph.action.viewer.clone");
|
||||
Icon image = new GIcon("icon.plugin.functiongraph.action.viewer.clone");
|
||||
cloneAction.setToolBarData(new ToolBarData(image, toolbarEndGroup));
|
||||
cloneAction.setDescription(
|
||||
"Create a snapshot (disconnected) copy of this Function Graph window ");
|
||||
|
@ -889,7 +889,7 @@ class FGActionManager {
|
|||
|
||||
// This icon will display when the action has no icon. This allows actions with no good
|
||||
// icon to be blank in the menu, but to use this icon on the toolbar.
|
||||
layoutAction.setDefaultIcon(new GIcon("icon.functiongraph.action.viewer.layout"));
|
||||
layoutAction.setDefaultIcon(new GIcon("icon.plugin.functiongraph.action.viewer.layout"));
|
||||
|
||||
List<ActionState<FGLayoutProvider>> actionStates = loadActionStatesForLayoutProviders();
|
||||
for (ActionState<FGLayoutProvider> actionState : actionStates) {
|
||||
|
@ -944,14 +944,14 @@ class FGActionManager {
|
|||
private void addVertexHoverModeAction(String group) {
|
||||
|
||||
//@formatter:off
|
||||
Icon pathsToVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.to.vertex");
|
||||
Icon pathsFromVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.from.vertex");
|
||||
Icon pathsFromToVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex");
|
||||
Icon pathsIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.all");
|
||||
Icon cyclesIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.cycles");
|
||||
Icon forwardScopedIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.scoped.flow.forward");
|
||||
Icon reverseScopedIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse");
|
||||
Icon nothingIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.off");
|
||||
Icon pathsToVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.to.vertex");
|
||||
Icon pathsFromVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.vertex");
|
||||
Icon pathsFromToVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex");
|
||||
Icon pathsIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.all");
|
||||
Icon cyclesIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.cycles");
|
||||
Icon forwardScopedIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.forward");
|
||||
Icon reverseScopedIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse");
|
||||
Icon nothingIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.off");
|
||||
//@formatter:off
|
||||
|
||||
HelpLocation pathHelpLocation =
|
||||
|
@ -1020,16 +1020,16 @@ class FGActionManager {
|
|||
}
|
||||
|
||||
private void addVertexSelectedModeAction(String group) {
|
||||
|
||||
|
||||
//@formatter:off
|
||||
Icon pathsToVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.to.vertex");
|
||||
Icon pathsFromVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.from.vertex");
|
||||
Icon pathsFromToVertexIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex");
|
||||
Icon cyclesIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.cycles");
|
||||
Icon allCyclesIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.cycles.all");
|
||||
Icon forwardScopedIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.scoped.flow.forward");
|
||||
Icon reverseScopedIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse");
|
||||
Icon nothingIcon = new GIcon("icon.functiongraph.action.viewer.vertex.hover.off");
|
||||
Icon pathsToVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.to.vertex");
|
||||
Icon pathsFromVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.vertex");
|
||||
Icon pathsFromToVertexIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.paths.from.to.vertex");
|
||||
Icon cyclesIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.cycles");
|
||||
Icon allCyclesIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.cycles.all");
|
||||
Icon forwardScopedIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.forward");
|
||||
Icon reverseScopedIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.scoped.flow.reverse");
|
||||
Icon nothingIcon = new GIcon("icon.plugin.functiongraph.action.viewer.vertex.hover.off");
|
||||
//@formatter:off
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@ import ghidra.util.HelpLocation;
|
|||
public class FGSatelliteUndockedProvider extends ComponentProviderAdapter {
|
||||
|
||||
static final String NAME = "Function Graph Satellite";
|
||||
private static final Icon ICON = new GIcon("icon.functiongraph.action.provider.satellite");
|
||||
private static final Icon ICON =
|
||||
new GIcon("icon.plugin.functiongraph.action.provider.satellite");
|
||||
|
||||
private FGController controller;
|
||||
private JComponent satelliteComponent;
|
||||
|
|
|
@ -61,7 +61,7 @@ public class FunctionGraphPlugin extends ProgramPlugin implements OptionsChangeL
|
|||
static final String OPTIONS_NAME_PATH =
|
||||
ToolConstants.GRAPH_OPTIONS + Options.DELIMITER + FUNCTION_GRAPH_NAME;
|
||||
|
||||
static final Icon ICON = new GIcon("icon.functiongraph.action.provider");
|
||||
static final Icon ICON = new GIcon("icon.plugin.functiongraph.action.provider");
|
||||
|
||||
private static final String USER_DEFINED_FORMAT_CONFIG_NAME = "USER_DEFINED_FORMAT_MANAGER";
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ import ghidra.util.UndefinedFunction;
|
|||
public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph> {
|
||||
|
||||
//@formatter:off
|
||||
private static final Color PICKED_COLOR = new GColor("color.bg.functiongraph.vertex.picked");
|
||||
private static final Color START_COLOR = new GColor("color.bg.functiongraph.vertex.entry");
|
||||
private static final Color END_COLOR = new GColor("color.bg.functiongraph.vertex.exit");
|
||||
private static final Color PICKED_COLOR = new GColor("color.bg.plugin.functiongraph.vertex.picked");
|
||||
private static final Color START_COLOR = new GColor("color.bg.plugin.functiongraph.vertex.entry");
|
||||
private static final Color END_COLOR = new GColor("color.bg.plugin.functiongraph.vertex.exit");
|
||||
private static final Color UNDEFINED_FUNCTION_COLOR = new GColor("color.bg.undefined");
|
||||
//@formatter:on
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
public FGComponent(FGView functionGraphView, FGData data,
|
||||
LayoutProvider<FGVertex, FGEdge, FunctionGraph> layoutProvider) {
|
||||
|
||||
// Note: we cannot call super here, as we need to set our variables below before
|
||||
// Note: we cannot call super here, as we need to set our variables below before
|
||||
// the base class builds.
|
||||
// super(data.getFunctionGraph());
|
||||
|
||||
|
@ -84,8 +84,8 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
setStatusMessage(message);
|
||||
}
|
||||
|
||||
// Note: can't do this here due to timing...restoring the groups may trigger
|
||||
// callbacks into the view code, which at the point of this constructor has
|
||||
// Note: can't do this here due to timing...restoring the groups may trigger
|
||||
// callbacks into the view code, which at the point of this constructor has
|
||||
// not yet been initialized
|
||||
//
|
||||
// restoreSettings();
|
||||
|
@ -217,11 +217,12 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
com.google.common.base.Function<FGEdge, String> edgeLabelTransformer = e -> e.getLabel();
|
||||
renderContext.setEdgeLabelTransformer(edgeLabelTransformer);
|
||||
|
||||
// note: this label renderer is the stamp for the label; we use another edge label
|
||||
// note: this label renderer is the stamp for the label; we use another edge label
|
||||
// renderer inside of the VisualGraphRenderer
|
||||
VisualGraphEdgeLabelRenderer edgeLabelRenderer =
|
||||
new VisualGraphEdgeLabelRenderer(new GColor("color.fg.label.picked"));
|
||||
edgeLabelRenderer.setNonPickedForegroundColor(new GColor("color.fg.label.non.picked"));
|
||||
VisualGraphEdgeLabelRenderer edgeLabelRenderer = new VisualGraphEdgeLabelRenderer(
|
||||
new GColor("color.fg.plugin.functiongraph.label.picked"));
|
||||
edgeLabelRenderer.setNonPickedForegroundColor(
|
||||
new GColor("color.fg.plugin.functiongraph.label.non.picked"));
|
||||
edgeLabelRenderer.setRotateEdgeLabels(false);
|
||||
renderContext.setEdgeLabelRenderer(edgeLabelRenderer);
|
||||
|
||||
|
@ -229,16 +230,16 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
Color bgColor = vgOptions.getGraphBackgroundColor();
|
||||
if (vgOptions.isDefaultBackgroundColor(bgColor)) {
|
||||
|
||||
// Give user notice when seeing the graph for a non-function (such as an undefined
|
||||
// function), as this is typical for Ghidra UI widgets.
|
||||
// Don't do this if the user has manually set the background color (this would require
|
||||
// Give user notice when seeing the graph for a non-function (such as an undefined
|
||||
// function), as this is typical for Ghidra UI widgets.
|
||||
// Don't do this if the user has manually set the background color (this would require
|
||||
// another option).
|
||||
Function function = functionGraphData.getFunction();
|
||||
if (function instanceof UndefinedFunction) {
|
||||
viewer.setBackground(UNDEFINED_FUNCTION_COLOR);
|
||||
}
|
||||
else {
|
||||
viewer.setBackground(new GColor("color.bg.functiongraph"));
|
||||
viewer.setBackground(new GColor("color.bg.plugin.functiongraph"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,11 +275,11 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
|
||||
//==================================================================================================
|
||||
// Accessor Methods
|
||||
//==================================================================================================
|
||||
//==================================================================================================
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
// big assumption - the components below will be disposed by the controller, so we don't
|
||||
// big assumption - the components below will be disposed by the controller, so we don't
|
||||
// dispose them, as they may be cached
|
||||
functionGraph = null;
|
||||
functionGraphData = null;
|
||||
|
@ -314,17 +315,17 @@ public class FGComponent extends GraphComponent<FGVertex, FGEdge, FunctionGraph>
|
|||
public void setVertexFocused(FGVertex v, ProgramLocation location) {
|
||||
|
||||
//
|
||||
// NOTE: we must focus the vertex before we set the program location, as focusing the
|
||||
// NOTE: we must focus the vertex before we set the program location, as focusing the
|
||||
// vertex will turn on the cursor, which allows the cursor to be properly set when we
|
||||
// set the location. Reversing these two calls will not allow the cursor to be set
|
||||
// set the location. Reversing these two calls will not allow the cursor to be set
|
||||
// properly.
|
||||
//
|
||||
//
|
||||
|
||||
boolean wasFocused = v.isFocused();
|
||||
|
||||
// As per the note above, the vertex must think it is focused to update its cursor, so
|
||||
// focus it, but DO NOT send out the event. The 'pick to sync' will not trigger an
|
||||
// API-wide notification of the focused vertex.
|
||||
// focus it, but DO NOT send out the event. The 'pick to sync' will not trigger an
|
||||
// API-wide notification of the focused vertex.
|
||||
gPickedState.pickToSync(v);
|
||||
v.setProgramLocation(location);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import generic.theme.GIcon;
|
|||
|
||||
public abstract class ExperimentalLayoutProvider extends FGLayoutProviderExtensionPoint {
|
||||
|
||||
private static final Icon ICON = new GIcon("icon.functiongraph.layout.experimental");
|
||||
private static final Icon ICON = new GIcon("icon.plugin.functiongraph.layout.experimental");
|
||||
|
||||
@Override
|
||||
public Icon getActionIcon() {
|
||||
|
|
|
@ -44,7 +44,7 @@ import ghidra.util.layout.VerticalLayout;
|
|||
import util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* This panel looks similar in appearance to the LisGraphComponentPanel, with a header, actions
|
||||
* This panel looks similar in appearance to the LisGraphComponentPanel, with a header, actions
|
||||
* and a body.
|
||||
*/
|
||||
public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPanel {
|
||||
|
@ -139,10 +139,8 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
add(genericHeader, BorderLayout.NORTH);
|
||||
add(contentPanel, BorderLayout.CENTER);
|
||||
|
||||
Border beveledBorder =
|
||||
BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
||||
new GColor("color.border.bevel.highlight"),
|
||||
new GColor("color.border.bevel.shadow"));
|
||||
Border beveledBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
||||
new GColor("color.border.bevel.highlight"), new GColor("color.border.bevel.shadow"));
|
||||
|
||||
setBorder(beveledBorder);
|
||||
|
||||
|
@ -156,7 +154,7 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
}
|
||||
|
||||
/**
|
||||
* A bit of a hack that triggers the text area to update its preferred height now before we
|
||||
* A bit of a hack that triggers the text area to update its preferred height now before we
|
||||
* render so that it doesn't change later.
|
||||
*/
|
||||
private void updateTextAreaSizeToForceTextLayout() {
|
||||
|
@ -189,7 +187,7 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
}
|
||||
};
|
||||
groupAction.setDescription("Combine selected vertices into one vertex");
|
||||
Icon imageIcon = new GIcon("icon.functiongraph.action.vertex.group");
|
||||
Icon imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.group");
|
||||
groupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
groupAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Group_Vertex_Action_Group"));
|
||||
|
@ -202,10 +200,10 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
}
|
||||
};
|
||||
regroupAction.setDescription("Restore vertex and siblings back to group form");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.regroup");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.regroup");
|
||||
regroupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
regroupAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Regroup"));
|
||||
regroupAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Regroup"));
|
||||
|
||||
// ungroup
|
||||
ungroupAction = new DockingAction("Ungroup Vertices", FunctionGraphPlugin.class.getName()) {
|
||||
|
@ -215,10 +213,10 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
}
|
||||
};
|
||||
ungroupAction.setDescription("Ungroup selected vertices into individual vertex");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.ungroup");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.ungroup");
|
||||
ungroupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
ungroupAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Ungroup"));
|
||||
ungroupAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Ungroup"));
|
||||
|
||||
// add to group
|
||||
addToGroupAction = new DockingAction("Add to Group", FunctionGraphPlugin.class.getName()) {
|
||||
|
@ -243,12 +241,12 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
}
|
||||
};
|
||||
addToGroupAction.setDescription("Add the selected vertices to this group");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.group.add");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.group.add");
|
||||
addToGroupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
addToGroupAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Group_Add"));
|
||||
|
||||
// color
|
||||
// color
|
||||
setVertexMostRecentAction = new SetVertexMostRecentColorAction(controller, vertex);
|
||||
setVertexMostRecentAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Group_Vertex_Action_Color"));
|
||||
|
@ -614,7 +612,7 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
|||
@Override
|
||||
Component getMaximizedViewComponent() {
|
||||
// 7937:3 - this will need to change if we want to support showing only the vertices inside of
|
||||
// this group vertex. To make this happen we probably need to be able to have the
|
||||
// this group vertex. To make this happen we probably need to be able to have the
|
||||
// group vertex contain its own graph that we can set on the viewer if the user hits
|
||||
// the full display button.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package ghidra.app.plugin.core.functiongraph.graph.vertex;
|
||||
|
||||
|
@ -115,10 +115,10 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
setLayout(new BorderLayout());
|
||||
listingPanel = new FGVertexListingPanel(controller, controller.getMinimalFormatManager(),
|
||||
program, addressSet);
|
||||
listingPanel.addButtonPressedListener(
|
||||
new FieldNavigator(tool, controller.getNavigatable()));
|
||||
listingPanel.addButtonPressedListener(
|
||||
controller.getSharedHighlighterButtonPressedListener());
|
||||
listingPanel
|
||||
.addButtonPressedListener(new FieldNavigator(tool, controller.getNavigatable()));
|
||||
listingPanel
|
||||
.addButtonPressedListener(controller.getSharedHighlighterButtonPressedListener());
|
||||
listingPanel.setStringSelectionListener(controller.getSharedStringSelectionListener());
|
||||
|
||||
fieldPanel = listingPanel.getFieldPanel();
|
||||
|
@ -135,10 +135,8 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
|
||||
add(listingPanel, BorderLayout.CENTER);
|
||||
|
||||
Border beveledBorder =
|
||||
BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
||||
new GColor("color.border.bevel.highlight"),
|
||||
new GColor("color.border.bevel.shadow"));
|
||||
Border beveledBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
||||
new GColor("color.border.bevel.highlight"), new GColor("color.border.bevel.shadow"));
|
||||
setBorder(beveledBorder);
|
||||
|
||||
addKeyListener(new FieldPanelKeyListener());
|
||||
|
@ -168,7 +166,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
|
||||
createActions();
|
||||
|
||||
// Sets the initial view of the graph to NOT be full-screen, and show
|
||||
// Sets the initial view of the graph to NOT be full-screen, and show
|
||||
// the full function graph.
|
||||
setFormat(false);
|
||||
|
||||
|
@ -234,7 +232,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
|
||||
/**
|
||||
* Signals to rebuild this component's data model. This call should not do any real work
|
||||
* Signals to rebuild this component's data model. This call should not do any real work
|
||||
* if the model is not 'dirty'.
|
||||
*/
|
||||
@Override
|
||||
|
@ -298,11 +296,11 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
String secondGroup = "group2";
|
||||
|
||||
setVertexMostRecentAction = new SetVertexMostRecentColorAction(controller, vertex);
|
||||
setVertexMostRecentAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
setVertexMostRecentAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
ToolBarData toolBarData = setVertexMostRecentAction.getToolBarData();
|
||||
setVertexMostRecentAction.setToolBarData(
|
||||
new ToolBarData(toolBarData.getIcon(), firstGroup));
|
||||
setVertexMostRecentAction
|
||||
.setToolBarData(new ToolBarData(toolBarData.getIcon(), firstGroup));
|
||||
|
||||
xrefsAction = new DockingAction("Jump To XRef", FunctionGraphPlugin.class.getName()) {
|
||||
@Override
|
||||
|
@ -311,7 +309,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
};
|
||||
xrefsAction.setDescription("Jump to a XRef");
|
||||
Icon imageIcon = new GIcon("icon.functiongraph.action.vertex.xrefs");
|
||||
Icon imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.xrefs");
|
||||
xrefsAction.setToolBarData(new ToolBarData(imageIcon, firstGroup));
|
||||
xrefsAction.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_XRefs"));
|
||||
|
||||
|
@ -325,7 +323,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
};
|
||||
maximizeViewModeAction.setDescription("Reverts view from graph to fullscreen");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.maximize");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.maximize");
|
||||
maximizeViewModeAction.setToolBarData(new ToolBarData(imageIcon, firstGroup));
|
||||
maximizeViewModeAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Full_View"));
|
||||
|
@ -340,7 +338,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
};
|
||||
minimizeViewModeAction.setDescription("Reverts view from fullscreen to graph");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.minimize");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.minimize");
|
||||
minimizeViewModeAction.setToolBarData(new ToolBarData(imageIcon, firstGroup));
|
||||
minimizeViewModeAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Full_View"));
|
||||
|
@ -352,7 +350,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
};
|
||||
groupAction.setDescription("Combine selected vertices into one vertex");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.group");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.group");
|
||||
groupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
groupAction.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Group"));
|
||||
|
||||
|
@ -363,11 +361,11 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
}
|
||||
};
|
||||
regroupAction.setDescription("Restore vertex and siblings back to group form");
|
||||
imageIcon = new GIcon("icon.functiongraph.action.vertex.regroup");
|
||||
imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.regroup");
|
||||
regroupAction.setToolBarData(new ToolBarData(imageIcon, secondGroup));
|
||||
|
||||
regroupAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Regroup"));
|
||||
regroupAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Regroup"));
|
||||
|
||||
genericHeader.actionAdded(setVertexMostRecentAction);
|
||||
|
||||
|
@ -673,7 +671,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
void dispose() {
|
||||
|
||||
//
|
||||
// Let's go a bit overboard and help the garbage collector cleanup by nulling out
|
||||
// Let's go a bit overboard and help the garbage collector cleanup by nulling out
|
||||
// references and removing the data from Jung's graph
|
||||
//
|
||||
|
||||
|
@ -709,11 +707,10 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
|||
|
||||
//==================================================================================================
|
||||
// Inner-inner classes
|
||||
//==================================================================================================
|
||||
//==================================================================================================
|
||||
|
||||
private class ListingHoverAdapter extends ListingHoverProvider {
|
||||
public ListingHoverAdapter() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,17 +49,18 @@ public class SetVertexMostRecentColorAction extends MultiActionDockingAction {
|
|||
this.controller = controller;
|
||||
this.vertex = vertex;
|
||||
setDescription("Set this block's background color");
|
||||
colorIcon = new ColorIcon3D(new GColor("color.bg.functiongraph.paint.icon"), 12, 12) {
|
||||
@Override
|
||||
public Color getColor() {
|
||||
return controller.getMostRecentColor();
|
||||
}
|
||||
};
|
||||
colorIcon =
|
||||
new ColorIcon3D(new GColor("color.bg.plugin.functiongraph.paint.icon"), 12, 12) {
|
||||
@Override
|
||||
public Color getColor() {
|
||||
return controller.getMostRecentColor();
|
||||
}
|
||||
};
|
||||
|
||||
Icon blankIcon = new EmptyIcon(16, 16);
|
||||
|
||||
MultiIcon multiIcon = new MultiIcon(blankIcon);
|
||||
Icon paintBrushImage = new GIcon("icon.functiongraph.action.vertex.choose.color");
|
||||
Icon paintBrushImage = new GIcon("icon.plugin.functiongraph.action.vertex.choose.color");
|
||||
Icon scaledBrush = ResourceManager.getScaledIcon(paintBrushImage, 16, 16);
|
||||
|
||||
Point point = getLowerLeftIconOffset(blankIcon, colorIcon);
|
||||
|
@ -100,11 +101,11 @@ public class SetVertexMostRecentColorAction extends MultiActionDockingAction {
|
|||
colorProvider.setVertexColor(vertex, newColor);
|
||||
}
|
||||
};
|
||||
Icon imageIcon = new GIcon("icon.functiongraph.action.vertex.choose.color.palette");
|
||||
chooseColorAction.setMenuBarData(
|
||||
new MenuData(new String[] { "Choose New Color" }, imageIcon));
|
||||
chooseColorAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
Icon imageIcon = new GIcon("icon.plugin.functiongraph.action.vertex.choose.color.palette");
|
||||
chooseColorAction
|
||||
.setMenuBarData(new MenuData(new String[] { "Choose New Color" }, imageIcon));
|
||||
chooseColorAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
|
||||
clearColorAction =
|
||||
new DockingAction("Clear Vertex Color", FunctionGraphPlugin.class.getName()) {
|
||||
|
@ -115,8 +116,8 @@ public class SetVertexMostRecentColorAction extends MultiActionDockingAction {
|
|||
}
|
||||
};
|
||||
clearColorAction.setMenuBarData(new MenuData(new String[] { "Clear Background Color" }));
|
||||
clearColorAction.setHelpLocation(
|
||||
new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
clearColorAction
|
||||
.setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Vertex_Action_Color"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -174,7 +175,7 @@ public class SetVertexMostRecentColorAction extends MultiActionDockingAction {
|
|||
@Override
|
||||
/**
|
||||
* This is used by our button above to show a popup. We need to override the
|
||||
* value here, since
|
||||
* value here, since
|
||||
*/
|
||||
public Point getLocationOnScreen() {
|
||||
if (vertex.isFullScreenMode()) {
|
||||
|
@ -210,7 +211,7 @@ public class SetVertexMostRecentColorAction extends MultiActionDockingAction {
|
|||
JComponent vertexComponentPanel = vertex.getComponent();
|
||||
|
||||
// Start with our (this button) coordinates and add those to our container's
|
||||
// value recursively until we reach our vertex panel. We have to stop there,
|
||||
// value recursively until we reach our vertex panel. We have to stop there,
|
||||
// since the vertex panel
|
||||
int x = getX();
|
||||
int y = getY();
|
||||
|
|
|
@ -90,17 +90,17 @@ public class FunctionGraphOptions extends VisualGraphOptions {
|
|||
private boolean updateGroupColorsAutomatically = true;
|
||||
|
||||
//@formatter:off
|
||||
public static final Color DEFAULT_GROUP_BACKGROUND_COLOR = new GColor("color.bg.functiongraph.vertex.group");
|
||||
private GColor defaultVertexBackgroundColor = new GColor("color.bg.functiongraph");
|
||||
private GColor defaultGroupBackgroundColor = new GColor("color.bg.functiongraph.vertex.group");
|
||||
public static final Color DEFAULT_GROUP_BACKGROUND_COLOR = new GColor("color.bg.plugin.functiongraph.vertex.group");
|
||||
private GColor defaultVertexBackgroundColor = new GColor("color.bg.plugin.functiongraph");
|
||||
private GColor defaultGroupBackgroundColor = new GColor("color.bg.plugin.functiongraph.vertex.group");
|
||||
|
||||
private GColor fallthroughEdgeColor = new GColor("color.bg.functiongraph.edge.fall.through");
|
||||
private GColor conditionalJumpEdgeColor = new GColor("color.bg.functiongraph.edge.jump.conditional");
|
||||
private GColor unconditionalJumpEdgeColor = new GColor("color.bg.functiongraph.edge.jump.unconditional");
|
||||
private GColor fallthroughEdgeColor = new GColor("color.bg.plugin.functiongraph.edge.fall.through");
|
||||
private GColor conditionalJumpEdgeColor = new GColor("color.bg.plugin.functiongraph.edge.jump.conditional");
|
||||
private GColor unconditionalJumpEdgeColor = new GColor("color.bg.plugin.functiongraph.edge.jump.unconditional");
|
||||
|
||||
private GColor fallthroughEdgeHighlightColor = new GColor("color.bg.functiongraph.edge.fall.through.highlight");
|
||||
private GColor conditionalJumpEdgeHighlightColor = new GColor("color.bg.functiongraph.edge.jump.conditional.highlight");
|
||||
private GColor unconditionalJumpEdgeHighlightColor = new GColor("color.bg.functiongraph.edge.jump.unconditional.highlight");
|
||||
private GColor fallthroughEdgeHighlightColor = new GColor("color.bg.plugin.functiongraph.edge.fall.through.highlight");
|
||||
private GColor conditionalJumpEdgeHighlightColor = new GColor("color.bg.plugin.functiongraph.edge.jump.conditional.highlight");
|
||||
private GColor unconditionalJumpEdgeHighlightColor = new GColor("color.bg.plugin.functiongraph.edge.jump.unconditional.highlight");
|
||||
//@formatter:on
|
||||
|
||||
private boolean useFullSizeTooltip = false;
|
||||
|
@ -174,12 +174,10 @@ public class FunctionGraphOptions extends VisualGraphOptions {
|
|||
new HelpLocation(OWNER, "Layout_Compressing"), USE_CONDENSED_LAYOUT_DESCRIPTION);
|
||||
|
||||
options.registerThemeColorBinding(DEFAULT_VERTEX_BACKGROUND_COLOR_KEY,
|
||||
defaultVertexBackgroundColor.getId(),
|
||||
help, DEFAULT_VERTEX_BACKGROUND_COLOR_DESCRPTION);
|
||||
defaultVertexBackgroundColor.getId(), help, DEFAULT_VERTEX_BACKGROUND_COLOR_DESCRPTION);
|
||||
|
||||
options.registerThemeColorBinding(DEFAULT_GROUP_BACKGROUND_COLOR_KEY,
|
||||
defaultGroupBackgroundColor.getId(),
|
||||
help, DEFAULT_GROUP_BACKGROUND_COLOR_DESCRPTION);
|
||||
defaultGroupBackgroundColor.getId(), help, DEFAULT_GROUP_BACKGROUND_COLOR_DESCRPTION);
|
||||
|
||||
options.registerOption(UPDATE_GROUP_AND_UNGROUP_COLORS, updateGroupColorsAutomatically,
|
||||
help, UPDATE_GROUP_AND_UNGROUP_COLORS_DESCRIPTION);
|
||||
|
@ -191,12 +189,10 @@ public class FunctionGraphOptions extends VisualGraphOptions {
|
|||
conditionalJumpEdgeColor.getId(), help, "Conditional jump edge color");
|
||||
|
||||
options.registerThemeColorBinding(EDGE_UNCONDITIONAL_JUMP_COLOR_KEY,
|
||||
unconditionalJumpEdgeColor.getId(), help,
|
||||
"Unconditional jump edge color");
|
||||
unconditionalJumpEdgeColor.getId(), help, "Unconditional jump edge color");
|
||||
|
||||
options.registerThemeColorBinding(EDGE_FALLTHROUGH_COLOR_KEY, fallthroughEdgeColor.getId(),
|
||||
help,
|
||||
"Fallthrough edge color");
|
||||
help, "Fallthrough edge color");
|
||||
|
||||
options.registerThemeColorBinding(EDGE_CONDITIONAL_JUMP_HIGHLIGHT_COLOR_KEY,
|
||||
conditionalJumpEdgeHighlightColor.getId(), help,
|
||||
|
@ -207,8 +203,8 @@ public class FunctionGraphOptions extends VisualGraphOptions {
|
|||
"Unconditional jump edge color when highlighting the reachablity of a vertex");
|
||||
|
||||
options.registerThemeColorBinding(EDGE_FALLTHROUGH_HIGHLIGHT_COLOR_KEY,
|
||||
fallthroughEdgeHighlightColor.getId(),
|
||||
help, "Fallthrough edge color when highlighting the reachablity of a vertex");
|
||||
fallthroughEdgeHighlightColor.getId(), help,
|
||||
"Fallthrough edge color when highlighting the reachablity of a vertex");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[Defaults]
|
||||
|
||||
|
||||
icon.functiongraph.layout.nested.code = function_graph_code_flow.png
|
||||
icon.plugin.functiongraph.layout.nested.code = function_graph_code_flow.png
|
||||
|
||||
|
||||
[Dark Defaults]
|
||||
|
|
|
@ -24,7 +24,7 @@ import ghidra.util.task.TaskMonitor;
|
|||
|
||||
public class DecompilerNestedLayoutProvider extends FGLayoutProviderExtensionPoint {
|
||||
|
||||
private static final Icon ICON = new GIcon("icon.functiongraph.layout.nested.code");
|
||||
private static final Icon ICON = new GIcon("icon.plugin.functiongraph.layout.nested.code");
|
||||
static final String LAYOUT_NAME = "Nested Code Layout";
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,29 +1,21 @@
|
|||
[Defaults]
|
||||
|
||||
color.bg.fcg.vertex.default = rgb(110, 197, 174) // chill green
|
||||
color.bg.fcg.vertex.toobig = color.palette.lightgray
|
||||
color.bg.plugin.fcg.vertex.default = rgb(110, 197, 174) // chill green
|
||||
color.bg.plugin.fcg.vertex.toobig = color.palette.lightgray
|
||||
|
||||
color.bg.fcg.edge.primary.direct = rgb(143, 197, 143) // light pale green
|
||||
color.bg.fcg.edge.primary.direct.selected = rgb(68, 171, 96) // lighter green
|
||||
color.bg.fcg.edge.primary.indirect = rgb(233, 233, 233) // lightGray
|
||||
color.bg.fcg.edge.primary.indirect.selected = rgb(201, 195, 195)
|
||||
color.bg.plugin.fcg.edge.primary.direct = rgb(143, 197, 143) // light pale green
|
||||
color.bg.plugin.fcg.edge.primary.direct.selected = rgb(68, 171, 96) // lighter green
|
||||
color.bg.plugin.fcg.edge.primary.indirect = rgb(233, 233, 233) // lightGray
|
||||
color.bg.plugin.fcg.edge.primary.indirect.selected = rgb(201, 195, 195)
|
||||
|
||||
// the satellite gets too cluttered, so wash out the edges
|
||||
color.bg.fcg.edge.satellite.direct = rgba(0,0,0,0.1) // 'washed out black'
|
||||
color.bg.fcg.edge.satellite.indirect = rgba(125, 125, 125, 25) // 'washed out gray'
|
||||
color.bg.plugin.fcg.edge.satellite.direct = rgba(0,0,0,0.1) // 'washed out black'
|
||||
color.bg.plugin.fcg.edge.satellite.indirect = rgba(125, 125, 125, 25) // 'washed out gray'
|
||||
|
||||
icon.fcg.layout.bow.tie = color_swatch.png
|
||||
icon.plugin.fcg.layout.bow.tie = color_swatch.png
|
||||
|
||||
|
||||
[Dark Defaults]
|
||||
|
||||
// TODO dark colors
|
||||
// TODO color.bg.fcg.vertex.default = rgb(110, 197, 174) // chill green
|
||||
// TODO color.bg.fcg.vertex.toobig = color.palette.lightGray
|
||||
|
||||
// TODO color.bg.fcg.edge.primary.direct = rgb(143, 197, 143) // lightGreen
|
||||
// TODO color.bg.fcg.edge.primary.indirect = rgb(233, 233, 233) // lightGray
|
||||
|
||||
// the satellite gets too cluttered, so wash out the edges
|
||||
// TODO color.bg.fcg.edge.satellite.direct = rgba(0,0,0,0.1) // 'washed out black'
|
||||
// TODO color.bg.fcg.edge.satellite.indirect = rgba(125, 125, 125, 25) // 'washed out gray'
|
||||
color.bg.plugin.fcg.edge.satellite.direct = rgba(143, 197, 143, 100) // light pale green
|
||||
color.bg.plugin.fcg.edge.satellite.indirect = rgba(233, 233, 233, 100) // lightGray
|
|
@ -45,8 +45,8 @@ import resources.ResourceManager;
|
|||
public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvider {
|
||||
|
||||
//@formatter:off
|
||||
public static final Color DEFAULT_VERTEX_SHAPE_COLOR = new GColor("color.bg.fcg.vertex.default");
|
||||
private static final Color TOO_BIG_VERTEX_SHAPE_COLOR = new GColor("color.bg.fcg.vertex.toobig");
|
||||
public static final Color DEFAULT_VERTEX_SHAPE_COLOR = new GColor("color.bg.plugin.fcg.vertex.default");
|
||||
private static final Color TOO_BIG_VERTEX_SHAPE_COLOR = new GColor("color.bg.plugin.fcg.vertex.toobig");
|
||||
//@formatter:on
|
||||
|
||||
public static final Icon NOT_ALLOWED_ICON = Icons.ERROR_ICON;
|
||||
|
@ -55,7 +55,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
private static final Icon COLLAPSE_ICON =
|
||||
ResourceManager.getScaledIcon(Icons.COLLAPSE_ALL_ICON, 10, 10);
|
||||
|
||||
// higher numbered layers go on top
|
||||
// higher numbered layers go on top
|
||||
private static final Integer VERTEX_SHAPE_LAYER = 100;
|
||||
private static final Integer TOGGLE_BUTTON_LAYER = 200;
|
||||
private static final Integer LABEL_LAYER = 300;
|
||||
|
@ -64,7 +64,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
private static final int VERTEX_SHAPE_SIZE = 50;
|
||||
|
||||
// TODO to be made an option in an upcoming ticket
|
||||
// based upon the default function name, plus some extra
|
||||
// based upon the default function name, plus some extra
|
||||
private static final int MAX_NAME_LENGTH = 30;
|
||||
|
||||
private Function function;
|
||||
|
@ -97,7 +97,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param function the function represented by this vertex
|
||||
* @param level the level of this vertex
|
||||
* @param expansionListener the listener for expanding connections to this vertex
|
||||
|
@ -139,7 +139,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
int start = 0;
|
||||
int end = half + offset;
|
||||
|
||||
// paint top-down: dark to light for incoming; light to dark for outgoing
|
||||
// paint top-down: dark to light for incoming; light to dark for outgoing
|
||||
inPaint = new LinearGradientPaint(new Point(0, start), new Point(0, end),
|
||||
new float[] { .0f, .2f, 1f }, new Color[] { darkestColor, darkColor, lightColor });
|
||||
|
||||
|
@ -190,7 +190,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
parent.add(v);
|
||||
parent.add(name);
|
||||
|
||||
// for now, the buttons only appear on hover, but if we want to avoid clipping when
|
||||
// for now, the buttons only appear on hover, but if we want to avoid clipping when
|
||||
// painting, we need to account for them in the shape's overall bounds
|
||||
Area in = new Area(toggleInsButton.getBounds());
|
||||
Area out = new Area(toggleOutsButton.getBounds());
|
||||
|
@ -291,8 +291,8 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
vertexImageLabel.setBounds(x, y, size.width, size.height);
|
||||
Dimension shapeSize = vertexShape.getBounds().getSize();
|
||||
|
||||
// setFrame() will make sure the shape's x,y values are where they need to be
|
||||
// for the later 'full shape' creation
|
||||
// setFrame() will make sure the shape's x,y values are where they need to be
|
||||
// for the later 'full shape' creation
|
||||
vertexShape.setFrame(x, y, shapeSize.width, shapeSize.height);
|
||||
layeredPane.add(vertexImageLabel, VERTEX_SHAPE_LAYER);
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Sets to true if this vertex is showing all edges in the incoming direction
|
||||
*
|
||||
*
|
||||
* @param setExpanded true if this vertex is showing all edges in the incoming direction
|
||||
*/
|
||||
public void setIncomingExpanded(boolean setExpanded) {
|
||||
|
@ -414,7 +414,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Returns true if this vertex is showing all edges in the incoming direction
|
||||
*
|
||||
*
|
||||
* @return true if this vertex is showing all edges in the incoming direction
|
||||
*/
|
||||
public boolean isIncomingExpanded() {
|
||||
|
@ -423,7 +423,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Sets to true if this vertex is showing all edges in the outgoing direction
|
||||
*
|
||||
*
|
||||
* @param setExpanded true if this vertex is showing all edges in the outgoing direction
|
||||
*/
|
||||
public void setOutgoingExpanded(boolean setExpanded) {
|
||||
|
@ -438,7 +438,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Returns true if this vertex is showing all edges in the outgoing direction
|
||||
*
|
||||
*
|
||||
* @return true if this vertex is showing all edges in the outgoing direction
|
||||
*/
|
||||
public boolean isOutgoingExpanded() {
|
||||
|
@ -447,7 +447,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Returns whether this vertex is fully expanded in its current direction
|
||||
*
|
||||
*
|
||||
* @return whether this vertex is fully expanded in its current direction
|
||||
*/
|
||||
public boolean isExpanded() {
|
||||
|
@ -462,10 +462,10 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets whether this vertex has too many incoming references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* Sets whether this vertex has too many incoming references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* usability.
|
||||
*
|
||||
*
|
||||
* @param tooMany if there are too many references
|
||||
*/
|
||||
public void setTooManyIncomingReferences(boolean tooMany) {
|
||||
|
@ -476,10 +476,10 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets whether this vertex has too many outgoing references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* Sets whether this vertex has too many outgoing references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* usability.
|
||||
*
|
||||
*
|
||||
* @param tooMany if there are too many references
|
||||
*/
|
||||
public void setTooManyOutgoingReferences(boolean tooMany) {
|
||||
|
@ -490,10 +490,10 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether this vertex has too many incoming references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* Returns whether this vertex has too many incoming references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* usability.
|
||||
*
|
||||
*
|
||||
* @return true if there are too many references
|
||||
*/
|
||||
public boolean hasTooManyIncomingReferences() {
|
||||
|
@ -501,10 +501,10 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether this vertex has too many outgoing references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* Returns whether this vertex has too many outgoing references, where too many is subjectively
|
||||
* defined by this class. Too many nodes in the display would ruin rendering and general
|
||||
* usability.
|
||||
*
|
||||
*
|
||||
* @return true if there are too many references
|
||||
*/
|
||||
public boolean hasTooManyOutgoingReferences() {
|
||||
|
@ -512,9 +512,9 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if this vertex can expand itself in its current direction, or in either
|
||||
* Returns true if this vertex can expand itself in its current direction, or in either
|
||||
* direction if this is a source vertex
|
||||
*
|
||||
*
|
||||
* @return true if this vertex can be expanded
|
||||
*/
|
||||
public boolean canExpand() {
|
||||
|
@ -540,7 +540,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Sets whether this vertex has any incoming references
|
||||
*
|
||||
*
|
||||
* @param hasIncoming true if this vertex has any incoming references
|
||||
*/
|
||||
public void setHasIncomingReferences(boolean hasIncoming) {
|
||||
|
@ -549,7 +549,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
/**
|
||||
* Sets whether this vertex has any outgoing references
|
||||
*
|
||||
*
|
||||
* @param hasOutgoing true if this vertex has any outgoing references
|
||||
*/
|
||||
|
||||
|
@ -597,10 +597,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((function == null) ? 0 : function.hashCode());
|
||||
return result;
|
||||
return Objects.hash(function);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BowTieLayoutProvider
|
|||
|
||||
public static final String NAME = "Bow Tie Layout";
|
||||
|
||||
private static final Icon DEFAULT_ICON = new GIcon("icon.fcg.layout.bow.tie");
|
||||
private static final Icon DEFAULT_ICON = new GIcon("icon.plugin.fcg.layout.bow.tie");
|
||||
|
||||
@Override
|
||||
public VisualGraphLayout<FcgVertex, FcgEdge> getLayout(FunctionCallGraph graph,
|
||||
|
|
|
@ -39,14 +39,14 @@ public class FcgComponent extends GraphComponent<FcgVertex, FcgEdge, FunctionCal
|
|||
new FcgVertexPaintTransformer(FcgVertex.DEFAULT_VERTEX_SHAPE_COLOR);
|
||||
|
||||
private FcgEdgePaintTransformer edgePaintTransformer =
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.fcg.edge.primary.direct"),
|
||||
new GColor("color.bg.fcg.edge.primary.indirect"));
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.plugin.fcg.edge.primary.direct"),
|
||||
new GColor("color.bg.plugin.fcg.edge.primary.indirect"));
|
||||
private FcgEdgePaintTransformer selectedEdgePaintTransformer =
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.fcg.edge.primary.direct.selected"),
|
||||
new GColor("color.bg.fcg.edge.primary.indirect.selected"));
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.plugin.fcg.edge.primary.direct.selected"),
|
||||
new GColor("color.bg.plugin.fcg.edge.primary.indirect.selected"));
|
||||
private FcgEdgePaintTransformer satelliteEdgePaintTransformer =
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.fcg.edge.satellite.direct"),
|
||||
new GColor("color.bg.fcg.edge.satellite.indirect"));
|
||||
new FcgEdgePaintTransformer(new GColor("color.bg.plugin.fcg.edge.satellite.direct"),
|
||||
new GColor("color.bg.plugin.fcg.edge.satellite.indirect"));
|
||||
|
||||
FcgComponent(FunctionCallGraph g) {
|
||||
setGraph(g);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue