GT-2698 refactor JLabel -> GLabel, JComboBox -> GComboBox, renderers.

This commit is contained in:
dev747368
2019-04-15 15:29:00 -04:00
parent e0c25b0590
commit 6448f0da8f
280 changed files with 2277 additions and 1531 deletions

View File

@@ -22,7 +22,7 @@ import java.util.List;
import javax.swing.*;
import docking.DockingUtils;
import docking.widgets.label.GLabel;
import docking.widgets.table.GTable;
import docking.widgets.textfield.IntegerTextField;
import ghidra.bitpatterns.info.FileBitPatternInfoReader;
@@ -69,7 +69,7 @@ public class AlignmentPanelBuilder extends ContextRegisterFilterablePanelBuilder
JPanel modulusPanel = new JPanel();
PairLayout modulusLayout = new PairLayout();
modulusPanel.setLayout(modulusLayout);
modulusPanel.add(DockingUtils.createNonHtmlLabel(MODULUS_FIELD_TEXT));
modulusPanel.add(new GLabel(MODULUS_FIELD_TEXT));
modulusField = new IntegerTextField();
modulusField.setValue(DEFAULT_MODULUS);
modulusPanel.add(modulusField.getComponent());

View File

@@ -17,8 +17,8 @@ package ghidra.bitpatterns.gui;
import javax.swing.JPanel;
import docking.DockingUtils;
import docking.DockingWindowManager;
import docking.widgets.label.GLabel;
import docking.widgets.textfield.IntegerTextField;
import ghidra.util.HelpLocation;
import ghidra.util.layout.PairLayout;
@@ -60,12 +60,12 @@ public class BitsInputDialogComponentProvider extends InputDialogComponentProvid
PairLayout pairLayout = new PairLayout();
mainPanel.setLayout(pairLayout);
mainPanel.add(DockingUtils.createNonHtmlLabel(TOTAL_BITS_LABEL));
mainPanel.add(new GLabel(TOTAL_BITS_LABEL));
totalBitsBox = new IntegerTextField();
totalBitsBox.setValue(DEFAULT_TOTAL_BITS);
mainPanel.add(totalBitsBox.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(POST_BITS_LABEL));
mainPanel.add(new GLabel(POST_BITS_LABEL));
preBitsBox = new IntegerTextField();
preBitsBox.setValue(DEFAULT_POST_BITS);
mainPanel.add(preBitsBox.getComponent());

View File

@@ -19,8 +19,8 @@ import java.awt.Component;
import javax.swing.JPanel;
import docking.DockingUtils;
import docking.DockingWindowManager;
import docking.widgets.label.GLabel;
import docking.widgets.textfield.IntegerTextField;
import ghidra.bitpatterns.info.ByteSequenceLengthFilter;
import ghidra.util.HelpLocation;
@@ -65,10 +65,10 @@ public class ByteSequenceLengthFilterInputDialog extends InputDialogComponentPro
JPanel mainPanel = new JPanel();
PairLayout pairLayout = new PairLayout();
mainPanel.setLayout(pairLayout);
mainPanel.add(DockingUtils.createNonHtmlLabel(INDEX_BOX_TITLE_TEXT));
mainPanel.add(new GLabel(INDEX_BOX_TITLE_TEXT));
indexBox = new IntegerTextField();
mainPanel.add(indexBox.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(LENGTH_BOX_TITLE_TEXT));
mainPanel.add(new GLabel(LENGTH_BOX_TITLE_TEXT));
minLengthBox = new IntegerTextField();
mainPanel.add(minLengthBox.getComponent());
return mainPanel;

View File

@@ -22,7 +22,7 @@ import java.util.List;
import javax.swing.*;
import docking.DockingUtils;
import docking.widgets.label.GLabel;
import docking.widgets.table.GFilterTable;
import ghidra.bitpatterns.info.*;
import ghidra.util.layout.PairLayout;
@@ -113,7 +113,7 @@ public class ByteSequencePanelBuilder extends ContextRegisterFilterablePanelBuil
JPanel numSeqsPanel = new JPanel();
PairLayout numSeqsLayout = new PairLayout();
numSeqsPanel.setLayout(numSeqsLayout);
numSeqsPanel.add(DockingUtils.createNonHtmlLabel(NUM_SEQS_LABEL_TEXT));
numSeqsPanel.add(new GLabel(NUM_SEQS_LABEL_TEXT));
numSeqsField = new JTextField(25);
numSeqsField.setEditable(false);
numSeqsPanel.add(numSeqsField);

View File

@@ -20,8 +20,8 @@ import java.awt.Component;
import javax.swing.JPanel;
import javax.swing.JTextField;
import docking.DockingUtils;
import docking.DockingWindowManager;
import docking.widgets.label.GLabel;
import docking.widgets.textfield.IntegerTextField;
import ghidra.bitpatterns.info.DataGatheringParams;
import ghidra.util.HelpLocation;
@@ -84,37 +84,37 @@ public class DataGatheringParamsDialog extends InputDialogComponentProvider {
PairLayout pairLayout = new PairLayout();
mainPanel.setLayout(pairLayout);
mainPanel.add(DockingUtils.createNonHtmlLabel(FIRST_BYTES_TEXT));
mainPanel.add(new GLabel(FIRST_BYTES_TEXT));
firstBytesField = new IntegerTextField();
firstBytesField.setValue(DEFAULT_FIRST_BYTES);
mainPanel.add(firstBytesField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(PRE_BYTES_TEXT));
mainPanel.add(new GLabel(PRE_BYTES_TEXT));
preBytesField = new IntegerTextField();
preBytesField.setValue(DEFAULT_PRE_BYTES);
mainPanel.add(preBytesField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(RETURN_BYTES_TEXT));
mainPanel.add(new GLabel(RETURN_BYTES_TEXT));
returnBytesField = new IntegerTextField();
returnBytesField.setValue(DEFAULT_RETURN_BYTES);
mainPanel.add(returnBytesField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(FIRST_INSTRUCTIONS_TEXT));
mainPanel.add(new GLabel(FIRST_INSTRUCTIONS_TEXT));
firstInstructionsField = new IntegerTextField();
firstInstructionsField.setValue(DEFAULT_FIRST_INSTRUCTIONS);
mainPanel.add(firstInstructionsField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(PRE_INSTRUCTIONS_TEXT));
mainPanel.add(new GLabel(PRE_INSTRUCTIONS_TEXT));
preInstructionsField = new IntegerTextField();
preInstructionsField.setValue(DEFAULT_PRE_INSTRUCTIONS);
mainPanel.add(preInstructionsField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(RETURN_INSTRUCTIONS_TEXT));
mainPanel.add(new GLabel(RETURN_INSTRUCTIONS_TEXT));
returnInstructionsField = new IntegerTextField();
returnInstructionsField.setValue(DEFAULT_RETURN_INSTRUCTIONS);
mainPanel.add(returnInstructionsField.getComponent());
mainPanel.add(DockingUtils.createNonHtmlLabel(CONTEXT_REGISTER_TEXT));
mainPanel.add(new GLabel(CONTEXT_REGISTER_TEXT));
contextRegistersField = new JTextField(DEFAULT_CONTEXT_REGISTERS);
mainPanel.add(contextRegistersField);

View File

@@ -24,10 +24,10 @@ import javax.swing.*;
import javax.swing.tree.TreePath;
import docking.ActionContext;
import docking.DockingUtils;
import docking.action.DockingAction;
import docking.action.MenuData;
import docking.widgets.filechooser.GhidraFileChooser;
import docking.widgets.label.GLabel;
import ghidra.bitpatterns.info.*;
import ghidra.framework.options.OptionsChangeListener;
import ghidra.framework.options.ToolOptions;
@@ -282,17 +282,17 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
PairLayout pairLayout = new PairLayout();
dataInfoPanel.setLayout(pairLayout);
dataInfoPanel.add(DockingUtils.createNonHtmlLabel(DATA_SOURCE_FIELD_LABEL));
dataInfoPanel.add(new GLabel(DATA_SOURCE_FIELD_LABEL));
dataSourceField = new JTextField(70);
dataSourceField.setEditable(false);
dataInfoPanel.add(dataSourceField);
dataInfoPanel.add(DockingUtils.createNonHtmlLabel(NUM_FUNCS_FIELD_LABEL));
dataInfoPanel.add(new GLabel(NUM_FUNCS_FIELD_LABEL));
numFunctionsField = new JTextField(10);
numFunctionsField.setEditable(false);
dataInfoPanel.add(numFunctionsField);
dataInfoPanel.add(DockingUtils.createNonHtmlLabel(NUM_FILES_FIELD_LABEL));
dataInfoPanel.add(new GLabel(NUM_FILES_FIELD_LABEL));
numFilesField = new JTextField(10);
numFilesField.setEditable(false);
dataInfoPanel.add(numFilesField);
@@ -301,17 +301,17 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
PairLayout instructionLayout = new PairLayout();
instructionInfoPanel.setLayout(instructionLayout);
instructionInfoPanel.add(DockingUtils.createNonHtmlLabel(FIRST_INSTRUCTIONS_LABEL));
instructionInfoPanel.add(new GLabel(FIRST_INSTRUCTIONS_LABEL));
firstInstructionsField = new JTextField(10);
firstInstructionsField.setEditable(false);
instructionInfoPanel.add(firstInstructionsField);
instructionInfoPanel.add(DockingUtils.createNonHtmlLabel(PRE_INSTRUCTIONS_LABEL));
instructionInfoPanel.add(new GLabel(PRE_INSTRUCTIONS_LABEL));
preInstructionsField = new JTextField(10);
preInstructionsField.setEditable(false);
instructionInfoPanel.add(preInstructionsField);
instructionInfoPanel.add(DockingUtils.createNonHtmlLabel(RETURN_INSTRUCTIONS_LABEL));
instructionInfoPanel.add(new GLabel(RETURN_INSTRUCTIONS_LABEL));
returnInstructionsField = new JTextField(10);
returnInstructionsField.setEditable(false);
instructionInfoPanel.add(returnInstructionsField);
@@ -320,17 +320,17 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
PairLayout bytesLayout = new PairLayout();
bytesInfoPanel.setLayout(bytesLayout);
bytesInfoPanel.add(DockingUtils.createNonHtmlLabel(FIRST_BYTES_LABEL));
bytesInfoPanel.add(new GLabel(FIRST_BYTES_LABEL));
firstBytesField = new JTextField(10);
firstBytesField.setEditable(false);
bytesInfoPanel.add(firstBytesField);
bytesInfoPanel.add(DockingUtils.createNonHtmlLabel(PRE_BYTES_LABEL));
bytesInfoPanel.add(new GLabel(PRE_BYTES_LABEL));
preBytesField = new JTextField(10);
preBytesField.setEditable(false);
bytesInfoPanel.add(preBytesField);
bytesInfoPanel.add(DockingUtils.createNonHtmlLabel(RETURN_BYTES_LABEL));
bytesInfoPanel.add(new GLabel(RETURN_BYTES_LABEL));
returnBytesField = new JTextField(10);
returnBytesField.setEditable(false);
bytesInfoPanel.add(returnBytesField);

View File

@@ -24,8 +24,8 @@ import javax.swing.*;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import docking.DockingUtils;
import docking.widgets.dialogs.NumberInputDialog;
import docking.widgets.label.GDLabel;
import docking.widgets.tree.GTree;
import ghidra.bitpatterns.info.*;
import ghidra.util.layout.PairLayout;
@@ -120,7 +120,7 @@ public class InstructionSequenceTreePanelBuilder extends ContextRegisterFilterab
countPanel = new JPanel();
PairLayout countLayout = new PairLayout();
countPanel.setLayout(countLayout);
JLabel countLabel = DockingUtils.createNonHtmlLabel(COUNT_FIELD_LABEL);
JLabel countLabel = new GDLabel(COUNT_FIELD_LABEL);
countPanel.add(countLabel);
countField = new JTextField(25);
countField.setEditable(false);

View File

@@ -19,8 +19,8 @@ import java.awt.*;
import javax.swing.*;
import docking.DockingUtils;
import docking.WindowPosition;
import docking.widgets.label.GLabel;
import ghidra.app.services.GoToService;
import ghidra.bitpatterns.info.*;
import ghidra.framework.plugintool.ComponentProviderAdapter;
@@ -110,17 +110,16 @@ public class PatternEvalTableProvider extends ComponentProviderAdapter {
private JPanel buildInfoPanel(PatternEvaluationStats stats) {
JPanel evalPanel = new JPanel(new GridLayout(2, 8));
evalPanel.add(DockingUtils.createNonHtmlLabel("Match Type"));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.TRUE_POSITIVE.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.FP_WRONG_FLOW.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.FP_MISALIGNED.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.FP_DATA.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.POSSIBLE_START_CODE.name()));
evalPanel.add(
DockingUtils.createNonHtmlLabel(PatternMatchType.POSSIBLE_START_UNDEFINED.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.CONTEXT_CONFLICT.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel(PatternMatchType.PRE_PATTERN_HIT.name()));
evalPanel.add(DockingUtils.createNonHtmlLabel("Number"));
evalPanel.add(new GLabel("Match Type"));
evalPanel.add(new GLabel(PatternMatchType.TRUE_POSITIVE.name()));
evalPanel.add(new GLabel(PatternMatchType.FP_WRONG_FLOW.name()));
evalPanel.add(new GLabel(PatternMatchType.FP_MISALIGNED.name()));
evalPanel.add(new GLabel(PatternMatchType.FP_DATA.name()));
evalPanel.add(new GLabel(PatternMatchType.POSSIBLE_START_CODE.name()));
evalPanel.add(new GLabel(PatternMatchType.POSSIBLE_START_UNDEFINED.name()));
evalPanel.add(new GLabel(PatternMatchType.CONTEXT_CONFLICT.name()));
evalPanel.add(new GLabel(PatternMatchType.PRE_PATTERN_HIT.name()));
evalPanel.add(new GLabel("Number"));
JTextField truePositivesField = new JTextField(8);
truePositivesField.setEditable(false);
truePositivesField.setText(Integer.toString(stats.getNumTruePositives()));

View File

@@ -19,8 +19,8 @@ import java.awt.Component;
import javax.swing.*;
import docking.DockingUtils;
import docking.DockingWindowManager;
import docking.widgets.label.GLabel;
import docking.widgets.textfield.IntegerTextField;
import ghidra.closedpatternmining.SequenceMiningParams;
import ghidra.framework.preferences.Preferences;
@@ -80,7 +80,7 @@ public class SequenceMiningParamsInputDialog extends InputDialogComponentProvide
PairLayout mainLayout = new PairLayout();
mainPanel.setLayout(mainLayout);
mainPanel.add(DockingUtils.createNonHtmlLabel(PERCENTAGE_BOX_TEXT));
mainPanel.add(new GLabel(PERCENTAGE_BOX_TEXT));
percentageBox = new JTextField(16);
double percentage =
Double.parseDouble(Preferences.getProperty(PERCENTAGE_PROPERTY, DEFAULT_PERCENTAGE));
@@ -88,7 +88,7 @@ public class SequenceMiningParamsInputDialog extends InputDialogComponentProvide
percentageBox.setEditable(true);
mainPanel.add(percentageBox);
mainPanel.add(DockingUtils.createNonHtmlLabel(MIN_FIXED_BITS_BOX_TEXT));
mainPanel.add(new GLabel(MIN_FIXED_BITS_BOX_TEXT));
minFixedBitsBox = new IntegerTextField();
int minFixBits = Integer.parseInt(
Preferences.getProperty(MIN_FIXED_BITS_PROPERTY, DEFAULT_MIN_FIXED_BITS));