mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 07:04:59 +08:00
Merge remote-tracking branch 'origin/Ghidra_12.1'
This commit is contained in:
+4
-2
@@ -98,10 +98,12 @@ public class DataTreeDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
TreeModel model = tree.getModel();
|
TreeModel model = tree.getModel();
|
||||||
GTreeNode root = (GTreeNode) model.getRoot();
|
GTreeNode root = (GTreeNode) model.getRoot();
|
||||||
assertEquals(expectedFilteredNames.size(), root.getChildCount());
|
|
||||||
for (int i = 0; i < expectedFilteredNames.size(); i++) {
|
for (int i = 0; i < expectedFilteredNames.size(); i++) {
|
||||||
GTreeNode child = root.getChild(i);
|
GTreeNode child = root.getChild(i);
|
||||||
assertEquals(expectedFilteredNames.get(i), child.toString());
|
if (child instanceof DomainFolderNode) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
assertTrue(child.toString().startsWith("tN"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.apache.commons.collections4.*;
|
import org.apache.commons.collections4.map.LazyMap;
|
||||||
|
|
||||||
import edu.uci.ics.jung.algorithms.layout.Layout;
|
import edu.uci.ics.jung.algorithms.layout.Layout;
|
||||||
import edu.uci.ics.jung.graph.Graph;
|
import edu.uci.ics.jung.graph.Graph;
|
||||||
@@ -241,10 +241,7 @@ class ArticulatedEdgeRouter<V extends VisualVertex, E extends VisualEdge<V>>
|
|||||||
Layout<V, E> layout = viewer.getGraphLayout();
|
Layout<V, E> layout = viewer.getGraphLayout();
|
||||||
Graph<V, E> graph = layout.getGraph();
|
Graph<V, E> graph = layout.getGraph();
|
||||||
|
|
||||||
Set<V> prototype = new HashSet<>();
|
LazyMap<E, Set<V>> map = LazyMap.lazyMap(new HashMap<E, Set<V>>(), () -> new HashSet<>());
|
||||||
Factory<Set<V>> factory = FactoryUtils.prototypeFactory(prototype);
|
|
||||||
Map<E, Set<V>> map = MapUtils.lazyMap(new HashMap<E, Set<V>>(), factory);
|
|
||||||
|
|
||||||
Map<V, Rectangle> vertexBoundsMap = getVertexBounds();
|
Map<V, Rectangle> vertexBoundsMap = getVertexBounds();
|
||||||
Set<Entry<V, Rectangle>> entrySet = vertexBoundsMap.entrySet();
|
Set<Entry<V, Rectangle>> entrySet = vertexBoundsMap.entrySet();
|
||||||
for (Entry<V, Rectangle> entry : entrySet) {
|
for (Entry<V, Rectangle> entry : entrySet) {
|
||||||
|
|||||||
+26
-7
@@ -17,9 +17,7 @@ package ghidra.graph.viewer.layout;
|
|||||||
|
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import org.apache.commons.collections4.TransformerUtils;
|
|
||||||
import org.apache.commons.collections4.map.TransformedMap;
|
|
||||||
|
|
||||||
import edu.uci.ics.jung.algorithms.layout.Layout;
|
import edu.uci.ics.jung.algorithms.layout.Layout;
|
||||||
import ghidra.graph.VisualGraph;
|
import ghidra.graph.VisualGraph;
|
||||||
@@ -78,13 +76,34 @@ public class LayoutPositions<V extends VisualVertex, E extends VisualEdge<V>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setVertexLocations(Map<V, Point2D> newVertexLocations) {
|
private void setVertexLocations(Map<V, Point2D> newVertexLocations) {
|
||||||
this.vertexLocations = TransformedMap.transformedMap(newVertexLocations,
|
|
||||||
TransformerUtils.nopTransformer(), TransformerUtils.cloneTransformer());
|
Map<V, Point2D> newMap = new HashMap<>();
|
||||||
|
Set<Entry<V, Point2D>> entries = newVertexLocations.entrySet();
|
||||||
|
for (Entry<V, Point2D> entry : entries) {
|
||||||
|
V key = entry.getKey();
|
||||||
|
Point2D value = entry.getValue();
|
||||||
|
newMap.put(key, (Point2D) value.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.vertexLocations = newMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setEdgeArticulations(Map<E, List<Point2D>> newEdgeArticulations) {
|
private void setEdgeArticulations(Map<E, List<Point2D>> newEdgeArticulations) {
|
||||||
this.edgeArticulations = TransformedMap.transformedMap(newEdgeArticulations,
|
|
||||||
TransformerUtils.nopTransformer(), TransformerUtils.cloneTransformer());
|
Map<E, List<Point2D>> newMap = new HashMap<>();
|
||||||
|
Set<Entry<E, List<Point2D>>> entries = newEdgeArticulations.entrySet();
|
||||||
|
for (Entry<E, List<Point2D>> entry : entries) {
|
||||||
|
E key = entry.getKey();
|
||||||
|
List<Point2D> value = entry.getValue();
|
||||||
|
List<Point2D> newList = new ArrayList<>();
|
||||||
|
for (Point2D p : value) {
|
||||||
|
newList.add(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
newMap.put(key, newList);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.edgeArticulations = newMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<V, Point2D> getVertexLocations() {
|
public Map<V, Point2D> getVertexLocations() {
|
||||||
|
|||||||
+1
-2
@@ -863,8 +863,7 @@ public interface Listing {
|
|||||||
public void renameTree(String oldName, String newName) throws DuplicateNameException;
|
public void renameTree(String oldName, String newName) throws DuplicateNameException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the total number of CodeUnits (Instructions, defined Data, and
|
* gets the total number of CodeUnits (Instructions and defined Data)
|
||||||
* undefined Data)
|
|
||||||
*
|
*
|
||||||
* @return the total number of CodeUnits in the listing.
|
* @return the total number of CodeUnits in the listing.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user