mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-21 19:42:14 +00:00
Merge remote-tracking branch 'origin/GT-2735-dragonmacher'
This commit is contained in:
commit
4ce178c419
@ -23,6 +23,7 @@ import com.google.common.base.Function;
|
||||
import edu.uci.ics.jung.visualization.picking.PickedInfo;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.FGVertexType;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.vertex.FGVertex;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
|
||||
public class FGVertexPickableBackgroundPaintTransformer implements Function<FGVertex, Paint> {
|
||||
|
||||
@ -55,6 +56,15 @@ public class FGVertexPickableBackgroundPaintTransformer implements Function<FGVe
|
||||
@Override
|
||||
public Paint apply(FGVertex v) {
|
||||
Color backgroundColor = v.getBackgroundColor();
|
||||
|
||||
ProgramSelection selection = v.getProgramSelection();
|
||||
if (!selection.isEmpty()) {
|
||||
// mix the colors so the user can see both the selection and the background color
|
||||
Color selectionColor = v.getSelectionColor();
|
||||
Color mixed = mix(selectionColor, backgroundColor);
|
||||
backgroundColor = mixed;
|
||||
}
|
||||
|
||||
FGVertexType vertexType = v.getVertexType();
|
||||
if (info.isPicked(v)) {
|
||||
if (v.isDefaultBackgroundColor()) {
|
||||
|
@ -289,6 +289,11 @@ public abstract class AbstractFunctionGraphVertex implements FGVertex {
|
||||
return doGetComponent().getBackgroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getSelectionColor() {
|
||||
return doGetComponent().getSelectionColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearColor() {
|
||||
doGetComponent().clearColor();
|
||||
|
@ -90,6 +90,8 @@ public abstract class AbstractGraphComponentPanel extends JPanel {
|
||||
|
||||
abstract Color getBackgroundColor();
|
||||
|
||||
abstract Color getSelectionColor();
|
||||
|
||||
abstract Color getUserDefinedColor();
|
||||
|
||||
abstract Color getDefaultBackgroundColor();
|
||||
|
@ -86,6 +86,8 @@ public interface FGVertex extends VisualVertex {
|
||||
|
||||
public Color getBackgroundColor();
|
||||
|
||||
public Color getSelectionColor();
|
||||
|
||||
public void setBackgroundColor(Color color);
|
||||
|
||||
public void clearColor();
|
||||
@ -205,5 +207,7 @@ public interface FGVertex extends VisualVertex {
|
||||
*/
|
||||
public void setShowing(boolean isShowing);
|
||||
|
||||
@Override
|
||||
public void dispose();
|
||||
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import ghidra.util.*;
|
||||
import ghidra.util.exception.AssertException;
|
||||
import ghidra.util.layout.VerticalLayout;
|
||||
import resources.ResourceManager;
|
||||
import util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* This panel looks similar in appearance to the LisGraphComponentPanel, with a header, actions
|
||||
@ -414,6 +415,13 @@ public class GroupedFunctionGraphComponentPanel extends AbstractGraphComponentPa
|
||||
return defaultBackgroundColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
Color getSelectionColor() {
|
||||
Set<FGVertex> vertices = groupVertex.getVertices();
|
||||
FGVertex v = CollectionUtils.any(vertices);
|
||||
return v.getSelectionColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
JComponent getHeader() {
|
||||
return genericHeader;
|
||||
|
@ -261,6 +261,11 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
|
||||
return listingPanel.getTextBackgroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
Color getSelectionColor() {
|
||||
return fieldPanel.getSelectionColor();
|
||||
}
|
||||
|
||||
private void createActions() {
|
||||
String firstGroup = "group1";
|
||||
String secondGroup = "group2";
|
||||
|
Loading…
Reference in New Issue
Block a user