mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GT-2698 refactor JLabel -> GLabel, JComboBox -> GComboBox, renderers.
This commit is contained in:
parent
e0c25b0590
commit
6448f0da8f
280 changed files with 2277 additions and 1531 deletions
|
@ -24,12 +24,12 @@ import javax.swing.*;
|
|||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.ToolTipManager;
|
||||
import docking.help.HelpService;
|
||||
import docking.widgets.EmptyBorderButton;
|
||||
import docking.widgets.PopupWindow;
|
||||
import docking.widgets.label.GIconLabel;
|
||||
import edu.uci.ics.jung.algorithms.layout.GraphElementAccessor;
|
||||
import edu.uci.ics.jung.algorithms.layout.Layout;
|
||||
import edu.uci.ics.jung.visualization.*;
|
||||
|
@ -418,7 +418,7 @@ public class GraphComponent<V extends VisualVertex, E extends VisualEdge<V>, G e
|
|||
String tooltip = "Bring satellite view to the front";
|
||||
|
||||
Icon icon = ResourceManager.loadImage("images/network-wireless.png");
|
||||
JLabel iconLabel = DockingUtils.createNonHtmlLabel(icon);
|
||||
JLabel iconLabel = new GIconLabel(icon);
|
||||
iconLabel.setOpaque(false);
|
||||
iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||
iconLabel.setToolTipText(tooltip);
|
||||
|
@ -458,7 +458,7 @@ public class GraphComponent<V extends VisualVertex, E extends VisualEdge<V>, G e
|
|||
"options to have the graph update automatically.";
|
||||
|
||||
Icon icon = Icons.REFRESH_ICON;
|
||||
JLabel iconLabel = DockingUtils.createNonHtmlLabel(icon);
|
||||
JLabel iconLabel = new GIconLabel(icon);
|
||||
iconLabel.setOpaque(false);
|
||||
iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||
iconLabel.setToolTipText(tooltip);
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.function.Supplier;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.widgets.label.GDLabel;
|
||||
import edu.uci.ics.jung.visualization.RenderContext;
|
||||
import edu.uci.ics.jung.visualization.VisualizationViewer;
|
||||
import edu.uci.ics.jung.visualization.control.ScalingControl;
|
||||
|
@ -342,7 +342,7 @@ public class VisualGraphView<V extends VisualVertex,
|
|||
|
||||
viewContentPanel.removeAll();
|
||||
viewContentPanel.paintImmediately(viewContentPanel.getBounds());
|
||||
JLabel messageLabel = DockingUtils.createNonHtmlLabel(errorMessage);
|
||||
JLabel messageLabel = new GDLabel(errorMessage);
|
||||
Font font = messageLabel.getFont();
|
||||
messageLabel.setFont(font.deriveFont(22f)); // make a bit bigger for readability
|
||||
messageLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
|
|
@ -22,16 +22,17 @@ import java.util.*;
|
|||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import org.apache.commons.collections4.Factory;
|
||||
import org.apache.commons.collections4.map.LazyMap;
|
||||
|
||||
import ghidra.graph.graphs.TestEdge;
|
||||
import docking.widgets.label.GDHtmlLabel;
|
||||
import ghidra.graph.graphs.AbstractTestVertex;
|
||||
import ghidra.graph.graphs.TestEdge;
|
||||
import ghidra.graph.viewer.event.mouse.VertexTooltipProvider;
|
||||
|
||||
public class TestVertexTooltipProvider implements VertexTooltipProvider<AbstractTestVertex, TestEdge> {
|
||||
public class TestVertexTooltipProvider
|
||||
implements VertexTooltipProvider<AbstractTestVertex, TestEdge> {
|
||||
|
||||
private AtomicBoolean tooltipTriggered = new AtomicBoolean();
|
||||
private Map<AbstractTestVertex, List<SpyTooltip>> shownTooltipsByVertex =
|
||||
|
@ -104,7 +105,7 @@ public class TestVertexTooltipProvider implements VertexTooltipProvider<Abstract
|
|||
|
||||
}
|
||||
|
||||
public class SpyTooltipLabel extends JLabel implements SpyTooltip {
|
||||
public class SpyTooltipLabel extends GDHtmlLabel implements SpyTooltip {
|
||||
|
||||
SpyTooltipLabel(String text) {
|
||||
setText(text);
|
||||
|
|
|
@ -20,14 +20,14 @@ import java.awt.Dimension;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.DockingUtils;
|
||||
import docking.widgets.label.GDLabel;
|
||||
|
||||
/**
|
||||
* A test vertex that renders using a {@link JLabel}.
|
||||
*/
|
||||
public class LabelTestVertex extends AbstractTestVertex {
|
||||
|
||||
private JLabel label = DockingUtils.createNonHtmlLabel();
|
||||
private JLabel label = new GDLabel();
|
||||
|
||||
public LabelTestVertex(String name) {
|
||||
super(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue