/** * Determines the position in the model that is closest to the given * view location in the row above. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static int getPositionAbove(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineAbove(offs); if (token==null) { return -1; } else if (token.getType()==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be >0 ?? return c.getLineStartOffset(line-1); } else { return token.getListOffset(c, e, c.getMargin().left, x); } }
return token.getListOffset(c, e, c.getMargin().left, x);
Token tokenList = doc.getTokenListForLine(lineIndex); tabBase = alloc.x; int offs = tokenList.getListOffset( (RSyntaxTextArea)getContainer(), this, tabBase, x);
int n = tlist.getListOffset(textArea, WrappedSyntaxView.this, alloc.x, x);
/** * Determines the position in the model that is closest to the given * view location in the row below. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static final int getPositionBelow(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineBelow(offs); if (token==null) return -1; // A line containing only Token.NULL is an empty line. else if (token.type==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be > c.getLineCount()-1 ?? return c.getLineStartOffset(line+1); } else { return token.getListOffset(c, e, 0, x); } }
/** * Determines the position in the model that is closest to the given * view location in the row above. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static final int getPositionAbove(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineAbove(offs); if (token==null) return -1; // A line containing only Token.NULL is an empty line. else if (token.type==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be >0 ?? return c.getLineStartOffset(line-1); } else { return token.getListOffset(c, e, 0, x); } }
/** * Determines the position in the model that is closest to the given * view location in the row above. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static final int getPositionAbove(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineAbove(offs); if (token==null) return -1; // A line containing only Token.NULL is an empty line. else if (token.type==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be >0 ?? return c.getLineStartOffset(line-1); } else { return token.getListOffset(c, e, 0, x); } }
/** * Determines the position in the model that is closest to the given * view location in the row below. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static final int getPositionBelow(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineBelow(offs); if (token==null) return -1; // A line containing only Token.NULL is an empty line. else if (token.type==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be > c.getLineCount()-1 ?? return c.getLineStartOffset(line+1); } else { return token.getListOffset(c, e, 0, x); } }
/** * Determines the position in the model that is closest to the given * view location in the row above. The component given must have a * size to compute the result. If the component doesn't have a size * a value of -1 will be returned. * * @param c the editor * @param offs the offset in the document >= 0 * @param x the X coordinate >= 0 * @return the position >= 0 if the request can be computed, otherwise * a value of -1 will be returned. * @exception BadLocationException if the offset is out of range */ public static int getPositionAbove(RSyntaxTextArea c, int offs, float x, TabExpander e) throws BadLocationException { TokenOrientedView tov = (TokenOrientedView)e; Token token = tov.getTokenListForPhysicalLineAbove(offs); if (token==null) { return -1; } else if (token.getType()==Token.NULL) { int line = c.getLineOfOffset(offs); // Sure to be >0 ?? return c.getLineStartOffset(line-1); } else { return token.getListOffset(c, e, c.getMargin().left, x); } }
return token.getListOffset(c, e, c.getMargin().left, x);
Token tokenList = doc.getTokenListForLine(lineIndex); tabBase = alloc.x; int offs = tokenList.getListOffset( (RSyntaxTextArea)getContainer(), this, tabBase, x);
Token tokenList = doc.getTokenListForLine(lineIndex); tabBase = alloc.x; int offs = tokenList.getListOffset( (RSyntaxTextArea)getContainer(), this, tabBase, x);
Token tokenList = doc.getTokenListForLine(lineIndex); tabBase = alloc.x; int offs = tokenList.getListOffset( (RSyntaxTextArea)getContainer(), this, tabBase, x);
int n = tlist.getListOffset(textArea, WrappedSyntaxView.this, alloc.x, x);
int n = tlist.getListOffset(textArea, WrappedSyntaxView.this, alloc.x, x);
int n = tlist.getListOffset(textArea, WrappedSyntaxView.this, alloc.x, x);