GP-926 - Function Graph - Layouts - Created generic

layout provider to use jung layouts by name
This commit is contained in:
dragonmacher 2021-05-12 14:53:58 -04:00
parent 2da717d56a
commit c8e359ddec
28 changed files with 882 additions and 254 deletions

View file

@ -1,28 +0,0 @@
/* ###
* IP: GHIDRA
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.app.plugin.core.functiongraph.graph.jung.renderer;
import ghidra.app.plugin.core.functiongraph.graph.FGEdge;
public class DNLArticulatedEdgeTransformer extends FGArticulatedEdgeTransformer {
@Override
public int getOverlapOffset(FGEdge edge) {
// we position all locations ourself manually--no need to offset them to avoid overlapping
return 0;
}
}

View file

@ -27,14 +27,11 @@ import org.apache.commons.collections4.BidiMap;
import org.apache.commons.collections4.bidimap.DualHashBidiMap;
import org.apache.commons.collections4.map.LazyMap;
import com.google.common.base.Function;
import edu.uci.ics.jung.visualization.renderers.Renderer.EdgeLabel;
import ghidra.app.decompiler.DecompInterface;
import ghidra.app.decompiler.DecompileOptions;
import ghidra.app.plugin.core.functiongraph.graph.FGEdge;
import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
import ghidra.app.plugin.core.functiongraph.graph.jung.renderer.DNLArticulatedEdgeTransformer;
import ghidra.app.plugin.core.functiongraph.graph.vertex.FGVertex;
import ghidra.app.plugin.core.functiongraph.graph.vertex.GroupedFunctionGraphVertex;
import ghidra.graph.VisualGraph;
@ -102,11 +99,6 @@ public class DecompilerNestedLayout extends AbstractFGLayout {
}
}
@Override
public Function<FGEdge, Shape> getEdgeShapeTransformer() {
return new DNLArticulatedEdgeTransformer();
}
@Override
public EdgeLabel<FGVertex, FGEdge> getEdgeLabelRenderer() {
return new DNLEdgeLabelRenderer<>(getCondenseFactor());

View file

@ -22,7 +22,7 @@ import ghidra.framework.options.Options;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
public class DecompilerNestedLayoutProvider extends FGLayoutProvider {
public class DecompilerNestedLayoutProvider extends FGLayoutProviderExtensionPoint {
private static final Icon ICON =
ResourceManager.loadImage("images/function_graph_code_flow.png");