| java.lang.Object org.gjt.sp.jedit.textarea.ChunkCache
ChunkCache | class ChunkCache (Code) | | Manages low-level text display tasks - the visible lines in the TextArea.
author: Slava Pestov version: $Id: ChunkCache.java 8271 2006-12-28 08:05:51Z kpouer $ |
Inner Class :static class LineInfo | |
Method Summary | |
int | getAbovePosition(int physicalLine, int offset, int x, boolean ignoreWrap) | int | getBelowPosition(int physicalLine, int offset, int x, boolean ignoreWrap) | LineInfo | getLineInfo(int screenLine) | LineInfo[] | getLineInfosForPhysicalLine(int physicalLine) | int | getLineSubregionCount(int physicalLine) | int | getMaxHorizontalScrollWidth() Returns the max line width of the textarea. | int | getScreenLineOfOffset(int line, int offset) Parameters: line - physical line number of document Parameters: offset - number of characters from the left of the line. | int | getSubregionEndOffset(int line, int offset) Returns the end offset of the specified subregion of the specified
physical line. | static int | getSubregionOfOffset(int offset, LineInfo[] lineInfos) Returns the subregion containing the specified offset. | int | getSubregionStartOffset(int line, int offset) Returns the start offset of the specified subregion of the specified
physical line. | void | invalidateAll() | void | invalidateChunksFrom(int screenLine) | void | invalidateChunksFromPhys(int physicalLine) | boolean | needFullRepaint() The needFullRepaint variable becomes true when the number of screen
lines in a physical line changes. | void | recalculateVisibleLines() Recalculate visible lines. | void | scrollDown(int amount) | void | scrollUp(int amount) | void | setBuffer(JEditBuffer buffer) | int | subregionOffsetToX(int physicalLine, int offset) Converts an offset within a subregion into an x co-ordinate. | static int | subregionOffsetToX(LineInfo info, int offset) Converts an offset within a subregion into an x co-ordinate. | int | xToSubregionOffset(int physicalLine, int subregion, int x, boolean round) Converts an x co-ordinate within a subregion into an offset from the
start of that subregion. | static int | xToSubregionOffset(LineInfo info, int x, boolean round) Converts an x co-ordinate within a subregion into an offset from the
start of that subregion. |
getAbovePosition | int getAbovePosition(int physicalLine, int offset, int x, boolean ignoreWrap)(Code) | | Parameters: physicalLine - The physical line number Parameters: offset - The offset Parameters: x - The location Parameters: ignoreWrap - If true, behave as if soft wrap is off even if itis on |
getBelowPosition | int getBelowPosition(int physicalLine, int offset, int x, boolean ignoreWrap)(Code) | | Parameters: physicalLine - The physical line number Parameters: offset - The offset Parameters: x - The location Parameters: ignoreWrap - If true, behave as if soft wrap is off even if itis on |
getLineInfo | LineInfo getLineInfo(int screenLine)(Code) | | |
getLineInfosForPhysicalLine | LineInfo[] getLineInfosForPhysicalLine(int physicalLine)(Code) | | |
getLineSubregionCount | int getLineSubregionCount(int physicalLine)(Code) | | |
getMaxHorizontalScrollWidth | int getMaxHorizontalScrollWidth()(Code) | | Returns the max line width of the textarea.
It will check all lines the first invalid line.
the max line width |
getScreenLineOfOffset | int getScreenLineOfOffset(int line, int offset)(Code) | | Parameters: line - physical line number of document Parameters: offset - number of characters from the left of the line. number of pixels from the left of the textArea where thecursor should be |
getSubregionEndOffset | int getSubregionEndOffset(int line, int offset)(Code) | | Returns the end offset of the specified subregion of the specified
physical line.
Parameters: line - The physical line number Parameters: offset - An offset |
getSubregionOfOffset | static int getSubregionOfOffset(int offset, LineInfo[] lineInfos)(Code) | | Returns the subregion containing the specified offset. A subregion
is a subset of a physical line. Each screen line corresponds to one
subregion. Unlike the
ChunkCache.getScreenLineOfOffset(int,int) method,
this method works with non-visible lines too.
Parameters: offset - the offset Parameters: lineInfos - a lineInfos array. Usualy the array is the result ofChunkCache.getLineInfosForPhysicalLine(int) call the subregion of the offset, or -1 if the offset was not in one of the given lineInfos |
getSubregionStartOffset | int getSubregionStartOffset(int line, int offset)(Code) | | Returns the start offset of the specified subregion of the specified
physical line.
Parameters: line - The physical line number Parameters: offset - An offset |
invalidateAll | void invalidateAll()(Code) | | |
invalidateChunksFrom | void invalidateChunksFrom(int screenLine)(Code) | | |
invalidateChunksFromPhys | void invalidateChunksFromPhys(int physicalLine)(Code) | | |
needFullRepaint | boolean needFullRepaint()(Code) | | The needFullRepaint variable becomes true when the number of screen
lines in a physical line changes.
|
recalculateVisibleLines | void recalculateVisibleLines()(Code) | | Recalculate visible lines.
This is called when the TextArea geometry is changed or when the font is changed.
|
scrollDown | void scrollDown(int amount)(Code) | | |
scrollUp | void scrollUp(int amount)(Code) | | |
subregionOffsetToX | int subregionOffsetToX(int physicalLine, int offset)(Code) | | Converts an offset within a subregion into an x co-ordinate.
Parameters: physicalLine - The physical line Parameters: offset - The offset |
subregionOffsetToX | static int subregionOffsetToX(LineInfo info, int offset)(Code) | | Converts an offset within a subregion into an x co-ordinate.
Parameters: info - The line info object Parameters: offset - The offset |
xToSubregionOffset | int xToSubregionOffset(int physicalLine, int subregion, int x, boolean round)(Code) | | Converts an x co-ordinate within a subregion into an offset from the
start of that subregion.
Parameters: physicalLine - The physical line number Parameters: subregion - The subregion; if -1, then this is the lastsubregion. Parameters: x - The x co-ordinate Parameters: round - Round up to next character if x is past the middle of acharacter? |
xToSubregionOffset | static int xToSubregionOffset(LineInfo info, int x, boolean round)(Code) | | Converts an x co-ordinate within a subregion into an offset from the
start of that subregion.
Parameters: info - The line info object Parameters: x - The x co-ordinate Parameters: round - Round up to next character if x is past the middle of acharacter? |
|
|