Class PlateFieldLocation

All Implemented Interfaces:
Cloneable, Comparable<ProgramLocation>

public class PlateFieldLocation extends CommentFieldLocation
The PlateFieldLocation class contains specific location information within the Plate field of a CodeUnitLocation object.
  • Constructor Details

    • PlateFieldLocation

      public PlateFieldLocation(Program program, Address addr, int[] componentPath, int row, int charOffset, String[] comment, int commentRow)
      Construct a new PlateFieldLocation.
      Parameters:
      program - the program of the location
      addr - the address of the code unit.
      componentPath - the componentPath of the codeUnit
      row - the line of the location
      charOffset - the character position on the row of the location.
      comment - plate comment text
      commentRow - The row index into the comments of this location. This is different than the row due to the fact that the PlateField has fictitious borders that don't exist in the actual comment.
    • PlateFieldLocation

      public PlateFieldLocation()
      Default constructor needed for restoring a plate field location from XML.
  • Method Details

    • toString

      public String toString()
      Description copied from class: CommentFieldLocation
      Returns a String representation of this location.
      Overrides:
      toString in class CommentFieldLocation
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class CommentFieldLocation
    • getCommentRow

      public int getCommentRow()
      Returns the index into the String[] returned by CommentFieldLocation.getComment() that represents the comment row that was clicked. -1 will be returned if the border of the plate field was clicked.

      Note: This value is different than that returned by ProgramLocation.getRow(), as that value represents the screen row clicked. Further, the PlateField adds screen decoration to the comments, which causes the screen row to differ from the comment row.

      Returns:
      the index into the String[] returned by CommentFieldLocation.getComment() that represents the comment row that was clicked. -1 will be returned if the border of the plate field was clicked.
    • restoreState

      public void restoreState(Program p, SaveState obj)
      Description copied from class: ProgramLocation
      Restore this program location using the given program and save state object.
      Overrides:
      restoreState in class CommentFieldLocation
      Parameters:
      p - program to restore from
      obj - the save state to restore from
    • saveState

      public void saveState(SaveState obj)
      Description copied from class: ProgramLocation
      Save this program location to the given save state object.
      Overrides:
      saveState in class CommentFieldLocation
      Parameters:
      obj - the save state object for saving the location