JIDE 3.5.15

com.jidesoft.margin
Class AbstractMarginSupport

java.lang.Object
  extended by com.jidesoft.margin.AbstractMarginSupport
All Implemented Interfaces:
MarginSupport
Direct Known Subclasses:
AbstractRowMarginSupport

public abstract class AbstractMarginSupport
extends Object
implements MarginSupport

Abstract implementation of MarginSupport assuming the component has a scroll pane.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jidesoft.margin.MarginSupport
MarginSupport.ModelChangedCallback, MarginSupport.RepaintCallback
 
Field Summary
protected  AdjustmentListener _listener
           
protected  JScrollPane _scrollPane
           
 
Constructor Summary
AbstractMarginSupport(JScrollPane scrollPane)
           
 
Method Summary
 int getViewPosition()
          Gets the view position in the corresponding view port.
 int getViewSize()
          Gets the view size in the corresponding view port.
 void installListeners(MarginSupport.RepaintCallback repaintCallback, MarginSupport.ModelChangedCallback modelChangedCallback)
          Installs the listener to the component so that the RepaintCallback will be triggered when a repaint is needed, and the ModelChangedCallback will be triggered when the model is changed.
 void uninstallListeners(MarginSupport.RepaintCallback repaintCallback, MarginSupport.ModelChangedCallback modelChangedCallback)
          Uninstalls all the listeners installed in MarginSupport.installListeners(com.jidesoft.margin.MarginSupport.RepaintCallback, com.jidesoft.margin.MarginSupport.ModelChangedCallback).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_scrollPane

protected JScrollPane _scrollPane

_listener

protected AdjustmentListener _listener
Constructor Detail

AbstractMarginSupport

public AbstractMarginSupport(JScrollPane scrollPane)
Method Detail

getViewPosition

public int getViewPosition()
Description copied from interface: MarginSupport
Gets the view position in the corresponding view port.

Specified by:
getViewPosition in interface MarginSupport
Returns:
the view position.

getViewSize

public int getViewSize()
Description copied from interface: MarginSupport
Gets the view size in the corresponding view port.

Specified by:
getViewSize in interface MarginSupport
Returns:
teh view size.

installListeners

public void installListeners(MarginSupport.RepaintCallback repaintCallback,
                             MarginSupport.ModelChangedCallback modelChangedCallback)
Description copied from interface: MarginSupport
Installs the listener to the component so that the RepaintCallback will be triggered when a repaint is needed, and the ModelChangedCallback will be triggered when the model is changed.

Specified by:
installListeners in interface MarginSupport
Parameters:
repaintCallback - the callback when a repaint is needed.
modelChangedCallback - the callback when the model of the component is changed. By default, the parameter is null unless the MarginComponent overrides the AbstractMargin.createModelChangedCallback() method is overridden to return a valid callback.

uninstallListeners

public void uninstallListeners(MarginSupport.RepaintCallback repaintCallback,
                               MarginSupport.ModelChangedCallback modelChangedCallback)
Description copied from interface: MarginSupport
Uninstalls all the listeners installed in MarginSupport.installListeners(com.jidesoft.margin.MarginSupport.RepaintCallback, com.jidesoft.margin.MarginSupport.ModelChangedCallback).

Specified by:
uninstallListeners in interface MarginSupport
Parameters:
repaintCallback - the callback when a repaint is needed.
modelChangedCallback - the callback when the model of the component is changed. By default, the parameter is null unless the MarginComponent overrides the AbstractMargin.createModelChangedCallback() method is overridden to return a valid callback.

JIDE 3.5.15