Class ListingModelAdapter
- java.lang.Object
-
- ghidra.app.util.viewer.listingpanel.ListingModelAdapter
-
- All Implemented Interfaces:
LayoutModel,ListingModelListener
public class ListingModelAdapter extends java.lang.Object implements LayoutModel, ListingModelListener
-
-
Constructor Summary
Constructors Constructor Description ListingModelAdapter(ListingModel bigListingModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutModelListener(LayoutModelListener listener)Adds a LayoutModelListener to be notified when changes occur.voiddataChanged(boolean updateImmediately)Called when the data at an index or range of indexes changes.voiddispose()voidflushChanges()Returns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.AddressIndexMapgetAddressIndexMap()ProgramSelectiongetAllProgramSelection()FieldLocationgetFieldLocation(ProgramLocation location)Translates the given ProgramLocation into a FieldLocation.FieldSelectiongetFieldSelection(ProgramSelection selection)java.math.BigIntegergetIndexAfter(java.math.BigInteger index)Returns the closest larger index in the model that has a non-null layout.java.math.BigIntegergetIndexBefore(java.math.BigInteger index)Returns the closest smaller index in the model that has a non-null layout.LayoutgetLayout(Address addr)LayoutgetLayout(java.math.BigInteger index)Returns a layout for the given index.java.math.BigIntegergetNumIndexes()Returns the total number of indexes.java.awt.DimensiongetPreferredViewSize()Returns the width of the largest possible layout.ProgramLocationgetProgramLocation(FieldLocation floc)ProgramLocationgetProgramLocation(FieldLocation location, Field field)ProgramSelectiongetProgramSelection(FieldSelection selection)booleanisUniform()Returns true if every index returns a non-null layout and all the layouts are the same height.voidmodelSizeChanged()Called whenever the number of indexes changedvoidremoveLayoutModelListener(LayoutModelListener listener)Removes a LayoutModelListener to be notified when changes occur.protected voidresetIndexMap()voidsetAddressSet(AddressSetView view)Sets the addresses displayed by this model's listing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface docking.widgets.fieldpanel.LayoutModel
iterator, iterator
-
-
-
-
Constructor Detail
-
ListingModelAdapter
public ListingModelAdapter(ListingModel bigListingModel)
-
-
Method Detail
-
flushChanges
public void flushChanges()
Description copied from interface:LayoutModelReturns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.- Specified by:
flushChangesin interfaceLayoutModel
-
addLayoutModelListener
public void addLayoutModelListener(LayoutModelListener listener)
Description copied from interface:LayoutModelAdds a LayoutModelListener to be notified when changes occur.- Specified by:
addLayoutModelListenerin interfaceLayoutModel- Parameters:
listener- the LayoutModelListener to add.
-
getIndexAfter
public java.math.BigInteger getIndexAfter(java.math.BigInteger index)
Description copied from interface:LayoutModelReturns the closest larger index in the model that has a non-null layout.- Specified by:
getIndexAfterin interfaceLayoutModel- Parameters:
index- for which to find the next index with a non-null layout.- Returns:
- returns the closest larger index in the model that has a non-null layout.
-
getIndexBefore
public java.math.BigInteger getIndexBefore(java.math.BigInteger index)
Description copied from interface:LayoutModelReturns the closest smaller index in the model that has a non-null layout.- Specified by:
getIndexBeforein interfaceLayoutModel- Parameters:
index- for which to find the previous index with a non-null layout.- Returns:
- returns the closest smaller index in the model that has a non-null layout.
-
getLayout
public Layout getLayout(java.math.BigInteger index)
Description copied from interface:LayoutModelReturns a layout for the given index.- Specified by:
getLayoutin interfaceLayoutModel- Parameters:
index- the index of the layout to retrieve.
-
getPreferredViewSize
public java.awt.Dimension getPreferredViewSize()
Description copied from interface:LayoutModelReturns the width of the largest possible layout.- Specified by:
getPreferredViewSizein interfaceLayoutModel
-
getNumIndexes
public java.math.BigInteger getNumIndexes()
Description copied from interface:LayoutModelReturns the total number of indexes.- Specified by:
getNumIndexesin interfaceLayoutModel
-
isUniform
public boolean isUniform()
Description copied from interface:LayoutModelReturns true if every index returns a non-null layout and all the layouts are the same height.- Specified by:
isUniformin interfaceLayoutModel
-
removeLayoutModelListener
public void removeLayoutModelListener(LayoutModelListener listener)
Description copied from interface:LayoutModelRemoves a LayoutModelListener to be notified when changes occur.- Specified by:
removeLayoutModelListenerin interfaceLayoutModel- Parameters:
listener- the LayoutModelListener to remove.
-
dispose
public void dispose()
-
dataChanged
public void dataChanged(boolean updateImmediately)
Description copied from interface:ListingModelListenerCalled when the data at an index or range of indexes changes.- Specified by:
dataChangedin interfaceListingModelListener
-
modelSizeChanged
public void modelSizeChanged()
Description copied from interface:ListingModelListenerCalled whenever the number of indexes changed- Specified by:
modelSizeChangedin interfaceListingModelListener
-
getFieldLocation
public FieldLocation getFieldLocation(ProgramLocation location)
Translates the given ProgramLocation into a FieldLocation. Attempts to find a field that can exactly find a match for the program location. Otherwise, it will return a fieldLocation to the default field or beginning of the line.- Parameters:
location- the ProgramLocation to translate.- Returns:
- a FieldLocation for the ProgramLocation or null if none can be found.
-
getProgramLocation
public ProgramLocation getProgramLocation(FieldLocation floc)
-
getProgramLocation
public ProgramLocation getProgramLocation(FieldLocation location, Field field)
-
getAllProgramSelection
public ProgramSelection getAllProgramSelection()
-
getProgramSelection
public ProgramSelection getProgramSelection(FieldSelection selection)
-
resetIndexMap
protected void resetIndexMap()
-
getAddressIndexMap
public AddressIndexMap getAddressIndexMap()
-
getFieldSelection
public FieldSelection getFieldSelection(ProgramSelection selection)
-
setAddressSet
public void setAddressSet(AddressSetView view)
Sets the addresses displayed by this model's listing.- Parameters:
view- the addresses. These must already be compatible with the program associated with this model.
-
-