@ -2,7 +2,7 @@
* 12 / 21 / 2004
* 12 / 21 / 2004
*
*
* ConfigurableCaret . java - The caret used by RTextArea .
* ConfigurableCaret . java - The caret used by RTextArea .
*
*
* This library is distributed under a modified BSD license . See the included
* This library is distributed under a modified BSD license . See the included
* RSyntaxTextArea . License . txt file for details .
* RSyntaxTextArea . License . txt file for details .
* /
* /
@ -159,7 +159,7 @@ public class ConfigurableCaret extends DefaultCaret {
textArea . isRequestFocusEnabled ( ) ) {
textArea . isRequestFocusEnabled ( ) ) {
if ( inWindow )
if ( inWindow )
textArea . requestFocusInWindow ( ) ;
textArea . requestFocusInWindow ( ) ;
else
else
textArea . requestFocus ( ) ;
textArea . requestFocus ( ) ;
}
}
}
}
@ -458,7 +458,8 @@ public class ConfigurableCaret extends DefaultCaret {
Graphics2D g2 = ( Graphics2D ) g ;
Graphics2D g2 = ( Graphics2D ) g ;
g2 . setStroke ( new BasicStroke ( 2 ) ) ;
g2 . setStroke ( new BasicStroke ( 2 ) ) ;
// 向右再移动一个位置 避免光标太接近文字内容
// 向右再移动一个位置 避免光标太接近文字内容
g2 . draw ( new Line2D . Float ( r . x + 1 , r . y , r . x + 1 , r . y + r . height ) ) ;
// REPORT-41895 光标上方超出背景高亮的部分不会闪烁,会形成一个停留的小点,因此将光标的超出部分截去
g2 . draw ( new Line2D . Float ( r . x + 1 , r . y + 1 , r . x + 1 , r . y + r . height ) ) ;
break ;
break ;
} // End of switch (style).
} // End of switch (style).
@ -676,7 +677,7 @@ public class ConfigurableCaret extends DefaultCaret {
if ( line < lineCount ) {
if ( line < lineCount ) {
dot = textArea . getLineStartOffset ( line ) ;
dot = textArea . getLineStartOffset ( line ) ;
}
}
else { // No lower lines visible
else { // No lower lines visible
UIManager . getLookAndFeel ( ) .
UIManager . getLookAndFeel ( ) .
provideErrorFeedback ( textArea ) ;
provideErrorFeedback ( textArea ) ;
return ;
return ;
@ -711,4 +712,4 @@ public class ConfigurableCaret extends DefaultCaret {
}
}
}
}