Class FieldLocation

java.lang.Object
docking.widgets.fieldpanel.support.FieldLocation
All Implemented Interfaces:
Comparable<FieldLocation>

public class FieldLocation extends Object implements Comparable<FieldLocation>
Class to represent Field locations within the field viewer.

A field location represents a place within a Field. Fields live within a concept we call a layout. A layout represents an 'item', for example an address, along with a grouping of related information. Each layout will contain one or more Field objects. Further, each layout's fields may have varying shapes, such as single or multiple rows within the layout. Thusly, a layout could conceptually represent a single line of text or multiple groupings of text and images, similar to how a newspaper or web page is laid out.

A layout lives in a larger collection of layouts, which are laid out vertically. The index of a layout is its position within that larger list. This class contains the index of the layout within which it lives.

A FieldSelection may be within a single layout or may cross multiple layouts. To determine if a selection crosses multiple layouts, you can get the range of the selection. You can then use the range's start and end locations to determine if the selection spans multiple layouts. If the start and end indexes of the range are the same, then the selection is within a single layout; otherwise, the selection spans multiple layouts.

This location also contains row and column values. These values refer to the row and column of text within a single Field. Lastly, this class contains a field number, which represents the relative field number inside of the over layout, which may contain multiple fields.

See Also:
  • Field Details

    • MAX

      public static final FieldLocation MAX
    • fieldNum

      public int fieldNum
    • row

      public int row
    • col

      public int col
  • Constructor Details

    • FieldLocation

      public FieldLocation()
    • FieldLocation

      public FieldLocation(int index)
    • FieldLocation

      public FieldLocation(int index, int fieldNum)
    • FieldLocation

      public FieldLocation(BigInteger index)
    • FieldLocation

      public FieldLocation(BigInteger index, int fieldNum)
    • FieldLocation

      public FieldLocation(int index, int fieldNum, int row, int col)
      Construct a new FieldLocation with the given index,fieldNum,row, and col.
      Parameters:
      index - the index of the layout containing the location
      fieldNum - the index of the field in the layout containing the location
      row - the text row in the field containing the location.
      col - the character position the row containing the location.
    • FieldLocation

      public FieldLocation(BigInteger index, int fieldNum, int row, int col)
    • FieldLocation

      public FieldLocation(org.jdom.Element child)
    • FieldLocation

      public FieldLocation(FieldLocation loc)
      Construct a new FieldLocation by copying from another FieldLocation.
      Parameters:
      loc - the FieldLocation to be copied.
  • Method Details

    • getIndex

      public BigInteger getIndex()
      Returns the index for this location. The index corresponds to the layout that contains the field represented by this location. See the javadoc header for more details.
      Returns:
      the index for this location.
    • getFieldNum

      public int getFieldNum()
      Returns the number of the field for this location. This is the number of the field within a given layout. See the javadoc header for more details.
      Returns:
      the number of the field for this location.
    • getRow

      public int getRow()
      Returns the row within the Field for this location.
      Returns:
      the row within the Field for this location.
    • getCol

      public int getCol()
      Returns the column within the Field for this location.
      Returns:
      the column within the Field for this location.
    • equals

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

      public int compareTo(FieldLocation o)
      Specified by:
      compareTo in interface Comparable<FieldLocation>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getElement

      public org.jdom.Element getElement(String name)
    • set

      public void set(FieldLocation loc)
    • setIndex

      public void setIndex(BigInteger index)