mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-13 08:42:19 +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();
|
||||
GTreeNode root = (GTreeNode) model.getRoot();
|
||||
assertEquals(expectedFilteredNames.size(), root.getChildCount());
|
||||
for (int i = 0; i < expectedFilteredNames.size(); i++) {
|
||||
GTreeNode child = root.getChild(i);
|
||||
assertEquals(expectedFilteredNames.get(i), child.toString());
|
||||
if (child instanceof DomainFolderNode) {
|
||||
continue;
|
||||
}
|
||||
assertTrue(child.toString().startsWith("tN"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-7
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
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.graph.Graph;
|
||||
@@ -241,10 +241,7 @@ class ArticulatedEdgeRouter<V extends VisualVertex, E extends VisualEdge<V>>
|
||||
Layout<V, E> layout = viewer.getGraphLayout();
|
||||
Graph<V, E> graph = layout.getGraph();
|
||||
|
||||
Set<V> prototype = new HashSet<>();
|
||||
Factory<Set<V>> factory = FactoryUtils.prototypeFactory(prototype);
|
||||
Map<E, Set<V>> map = MapUtils.lazyMap(new HashMap<E, Set<V>>(), factory);
|
||||
|
||||
LazyMap<E, Set<V>> map = LazyMap.lazyMap(new HashMap<E, Set<V>>(), () -> new HashSet<>());
|
||||
Map<V, Rectangle> vertexBoundsMap = getVertexBounds();
|
||||
Set<Entry<V, Rectangle>> entrySet = vertexBoundsMap.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.util.*;
|
||||
|
||||
import org.apache.commons.collections4.TransformerUtils;
|
||||
import org.apache.commons.collections4.map.TransformedMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import edu.uci.ics.jung.algorithms.layout.Layout;
|
||||
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) {
|
||||
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) {
|
||||
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() {
|
||||
|
||||
+1
-2
@@ -863,8 +863,7 @@ public interface Listing {
|
||||
public void renameTree(String oldName, String newName) throws DuplicateNameException;
|
||||
|
||||
/**
|
||||
* gets the total number of CodeUnits (Instructions, defined Data, and
|
||||
* undefined Data)
|
||||
* gets the total number of CodeUnits (Instructions and defined Data)
|
||||
*
|
||||
* @return the total number of CodeUnits in the listing.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user