Class AdjustmentSynchronizer

  • All Implemented Interfaces:
    java.awt.event.AdjustmentListener, java.util.EventListener

    public class AdjustmentSynchronizer
    extends java.lang.Object
    implements java.awt.event.AdjustmentListener
    Synchronizes scrollbar adjustments between a set of Adjustables. Whenever the adjustment of one of the registered Adjustables is updated the adjustment of the other registered Adjustables is adjusted too.
    Since:
    6147
    • Constructor Summary

      Constructors 
      Constructor Description
      AdjustmentSynchronizer()
      Constructs a new AdjustmentSynchronizer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void adapt​(javax.swing.JCheckBox view, java.awt.Adjustable adjustable)
      Wires a JCheckBox to the adjustment synchronizer, in such a way that: state changes in the checkbox control whether the adjustable participates in synchronized adjustment state changes in this AdjustmentSynchronizer are reflected in the JCheckBox
      void adjustmentValueChanged​(java.awt.event.AdjustmentEvent e)
      Event handler for AdjustmentEvents
      protected boolean isParticipatingInSynchronizedScrolling​(java.awt.Adjustable adjustable)
      Returns true if an adjustable is participating in synchronized scrolling
      void participateInSynchronizedScrolling​(java.awt.Adjustable adjustable)
      Registers an Adjustable for participation in synchronized scrolling.
      protected void setParticipatingInSynchronizedScrolling​(java.awt.Adjustable adjustable, boolean isParticipating)
      Sets whether adjustable participates in adjustment synchronization or not
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • participateInSynchronizedScrolling

        public void participateInSynchronizedScrolling​(java.awt.Adjustable adjustable)
        Registers an Adjustable for participation in synchronized scrolling.
        Parameters:
        adjustable - the adjustable
      • adjustmentValueChanged

        public void adjustmentValueChanged​(java.awt.event.AdjustmentEvent e)
        Event handler for AdjustmentEvents
        Specified by:
        adjustmentValueChanged in interface java.awt.event.AdjustmentListener
      • setParticipatingInSynchronizedScrolling

        protected void setParticipatingInSynchronizedScrolling​(java.awt.Adjustable adjustable,
                                                               boolean isParticipating)
        Sets whether adjustable participates in adjustment synchronization or not
        Parameters:
        adjustable - the adjustable
        isParticipating - true if adjustable participates in adjustment synchronization
      • isParticipatingInSynchronizedScrolling

        protected boolean isParticipatingInSynchronizedScrolling​(java.awt.Adjustable adjustable)
        Returns true if an adjustable is participating in synchronized scrolling
        Parameters:
        adjustable - the adjustable
        Returns:
        true, if the adjustable is participating in synchronized scrolling, false otherwise
        Throws:
        java.lang.IllegalStateException - if adjustable is not registered for synchronized scrolling
      • adapt

        public void adapt​(javax.swing.JCheckBox view,
                          java.awt.Adjustable adjustable)
        Wires a JCheckBox to the adjustment synchronizer, in such a way that:
        1. state changes in the checkbox control whether the adjustable participates in synchronized adjustment
        2. state changes in this AdjustmentSynchronizer are reflected in the JCheckBox
        Parameters:
        view - the checkbox to control whether an adjustable participates in synchronized adjustment
        adjustable - the adjustable
        Throws:
        java.lang.IllegalArgumentException - if view is null
        java.lang.IllegalArgumentException - if adjustable is null