Class LineLockedFieldPanelCoordinator

java.lang.Object
docking.widgets.fieldpanel.internal.FieldPanelCoordinator
docking.widgets.fieldpanel.internal.LineLockedFieldPanelCoordinator
All Implemented Interfaces:
ViewListener
Direct Known Subclasses:
LayoutLockedFieldPanelCoordinator

public class LineLockedFieldPanelCoordinator extends FieldPanelCoordinator
A LineLockedFieldPanelCoordinator coordinates the scrolling of a set of field panels by sharing bound scroll models that are locked together by a set of line numbers. All the field panels are locked together at the line numbers specified in the locked line array. In other words this coordinator tries to keep the indicated line for each field panel side by side with the indicated line for each other field panel.
  • Field Details

    • lockedLineNumbers

      protected BigInteger[] lockedLineNumbers
  • Constructor Details

    • LineLockedFieldPanelCoordinator

      public LineLockedFieldPanelCoordinator(FieldPanel[] panels)
  • Method Details

    • resetLockedLines

      public void resetLockedLines()
      Resets the locked line numbers for this field panel coordinator to their default of each being zero.
    • lockLines

      public void lockLines(BigInteger... newLockedLines)
      Call this method whenever you want to change the line numbers that are locked together for the associated field panels.
      Parameters:
      newLockedLines - the array of locked line numbers that are directly associated with the array of field panels.
      Important: Make sure the line numbers are in the order that matches the field panels in the array.
    • add

      public void add(FieldPanel fp)
      Adds the given field panel to the list of panels to coordinate.
      Overrides:
      add in class FieldPanelCoordinator
      Parameters:
      fp - the field panel to add.
    • remove

      public void remove(FieldPanel fp)
      Removes the given field panel from the list of those to be coordinated.
      Overrides:
      remove in class FieldPanelCoordinator
    • viewChanged

      public void viewChanged(FieldPanel fp, BigInteger index, int xPos, int yPos)
      Description copied from interface: ViewListener
      Notifies the listener that the top of the screen has changed position.
      Specified by:
      viewChanged in interface ViewListener
      Overrides:
      viewChanged in class FieldPanelCoordinator
      Parameters:
      fp - the field panel whose view changed.
      index - the index of the layout at the top of the screen.
      xPos - the x coordinate of the layout displayed at the left of the screen.
      yPos - the y coordinate of the layout displayed at the top of the screen.
    • getLockedLineForPanel

      protected BigInteger getLockedLineForPanel(FieldPanel fp)
      Gets the locked line value for the indicated panel.
      Parameters:
      fp - the field panel whose locked line value is wanted.
      Returns:
      the locked line value or null if the panel isn't found.