com.jidesoft.marker
Class TextAreaRowMarkerSupport
java.lang.Object
com.jidesoft.marker.AbstractMarkerSupport
com.jidesoft.marker.AbstractRowMarkerSupport
com.jidesoft.marker.TextAreaRowMarkerSupport
- All Implemented Interfaces:
- MarkerSupport
public class TextAreaRowMarkerSupport
- extends AbstractRowMarkerSupport
TextAreaRowMarkerSupport
provides the marker support for JTextArea at the row level. In the MarkerModel,
you can add marker using the offset. When displaying the marker, if several markers are in the same line, it will be
displayed as one marker on the UI.
Method Summary |
int |
getRowCount()
|
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. |
void |
scrollTo(int start,
int end,
boolean select)
Scrolls the view to show the items from the start index to the end index. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextAreaRowMarkerSupport
public TextAreaRowMarkerSupport(JTextArea textArea)
scrollTo
public void scrollTo(int start,
int end,
boolean select)
- Description copied from interface:
MarkerSupport
- Scrolls the view to show the items from the start index to the end index.
- Parameters:
start
- the index of the start elementend
- the index of the end elementselect
- true to select the elements. Otherwise false.
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.
- Specified by:
indexToPoint
in interface MarkerSupport
- Overrides:
indexToPoint
in class AbstractRowMarkerSupport
- 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.
- Specified by:
pointToIndexRange
in interface MarkerSupport
- Overrides:
pointToIndexRange
in class AbstractRowMarkerSupport
- Parameters:
p
- the Pointheight
- the total height of the marker stripe
- Returns:
- the range of the indices.
getRowHeight
public int getRowHeight()
- Specified by:
getRowHeight
in class AbstractRowMarkerSupport
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in class AbstractRowMarkerSupport