JIDE 3.5.15

com.jidesoft.marker
Class AbstractRowMarkerSupport

java.lang.Object
  extended by com.jidesoft.marker.AbstractMarkerSupport
      extended by com.jidesoft.marker.AbstractRowMarkerSupport
All Implemented Interfaces:
MarkerSupport
Direct Known Subclasses:
CodeEditorMarkerSupport, ListMarkerSupport, TableRowMarkerSupport, TextAreaRowMarkerSupport, TreeMarkerSupport

public abstract class AbstractRowMarkerSupport
extends AbstractMarkerSupport

AbstractRowMarkerSupport provides default implementations for indexToPoint(int, int) and pointToIndexRange(Point, int) methods for components that have rows. In the default implementation, we assume the vertical position in the marker matches with the row index in the component. Most components such as JList, JTree, even JTable fall into this category. For JTable, even though there are cells in each row, you can still show the marker per row.


Constructor Summary
AbstractRowMarkerSupport()
           
 
Method Summary
abstract  int getRowCount()
           
abstract  int getRowHeight()
           
 Point indexToPoint(int index, int height)
          MarkerArea shows information of some elements from a potential large range in a condensed stripe.
 IntegerRange pointToIndexRange(Point p, int height)
          Finds out the index range that represented by the point.
 
Methods inherited from class com.jidesoft.marker.AbstractMarkerSupport
createMarkerModel, getMarkerModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.marker.MarkerSupport
scrollTo
 

Constructor Detail

AbstractRowMarkerSupport

public AbstractRowMarkerSupport()
Method Detail

getRowHeight

public abstract int getRowHeight()

getRowCount

public abstract int getRowCount()

indexToPoint

public Point indexToPoint(int index,
                          int height)
Description copied from interface: MarkerSupport
MarkerArea shows information of some elements from a potential large range in a condensed stripe. Since the space of the stripe is limited, we need a way to convert the position of the element to a point on the stripe. This method is used to find out the point based on the element index. For vertical stripe, what matters if the y of the point while x is usually 0.

Parameters:
index - the element index.
height - the total height of the marker stripe
Returns:
the position on the stripe that represents the element at the index. Null if the index is out of the range.

pointToIndexRange

public IntegerRange pointToIndexRange(Point p,
                                      int height)
Description copied from interface: MarkerSupport
Finds out the index range that represented by the point. The range could be one index or an index range. The reason is there could be more elements than the number of pixels vertically on the stripe. For example, if there are 10000 elements and only 100 vertical pixels, each pixel will represent 100 elements. That's why we need to return a range here.

Parameters:
p - the Point
height - the total height of the marker stripe
Returns:
the range of the indices.

JIDE 3.5.15