/** * Sets the style used when painting the caret. * * @param style The style to use. This should not be <code>null</code>. * @see #getStyle() */ public void setStyle(CaretStyle style) { if (style==null) { style = CaretStyle.THICK_VERTICAL_LINE_STYLE; } if (style!=this.style) { this.style = style; repaint(); } }
/** * Overridden to damage the correct width of the caret, since this caret * can be different sizes. * * @param r The current location of the caret. */ @Override protected synchronized void damage(Rectangle r) { if (r != null) { validateWidth(r); // Check for "0" or "1" caret width x = r.x - 1; y = r.y; width = r.width + 4; height = r.height; repaint(); } }
/** * Toggles whether this caret should always be visible (as opposed to * blinking, or not visible when the editor's window is not focused). * This can be used by popup windows that want the caret's location * to still be visible for contextual purposes while they are displayed. * * @param alwaysVisible Whether this caret should always be visible. * @see #isAlwaysVisible() */ public void setAlwaysVisible(boolean alwaysVisible) { if (alwaysVisible != this.alwaysVisible) { this.alwaysVisible = alwaysVisible; if (!isVisible()) { // Force painting of caret since super class's "flasher" timer // won't fire when the window doesn't have focus repaint(); } } }
/** * Sets the style used when painting the caret. * * @param style The style to use. If this isn't one of * <code>VERTICAL_LINE_STYLE</code>, <code>UNDERLINE_STYLE</code>, * or <code>BLOCK_STYLE</code>, then * <code>VERTICAL_LINE_STYLE</code> is used. * @see #getStyle() */ public void setStyle(int style) { if (style<MIN_STYLE || style>MAX_STYLE) style = VERTICAL_LINE_STYLE; this.style = style; repaint(); }
/** * Sets the style used when painting the caret. * * @param style The style to use. This should not be <code>null</code>. * @see #getStyle() */ public void setStyle(CaretStyle style) { if (style==null) { style = CaretStyle.THICK_VERTICAL_LINE_STYLE; } if (style!=this.style) { this.style = style; repaint(); } }
/** * Sets the style used when painting the caret. * * @param style The style to use. If this isn't one of * <code>VERTICAL_LINE_STYLE</code>, <code>UNDERLINE_STYLE</code>, * or <code>BLOCK_STYLE</code>, then * <code>VERTICAL_LINE_STYLE</code> is used. * @see #getStyle() */ public void setStyle(int style) { if (style<MIN_STYLE || style>MAX_STYLE) style = VERTICAL_LINE_STYLE; this.style = style; repaint(); }
/** * Overridden to damage the correct width of the caret, since this caret * can be different sizes. * * @param r The current location of the caret. */ protected synchronized void damage(Rectangle r) { if (r != null) { validateWidth(r); // Check for "0" or "1" caret width x = r.x - 1; y = r.y; width = r.width + 4; height = r.height; repaint(); } }
/** * Overridden to damage the correct width of the caret, since this caret * can be different sizes. * * @param r The current location of the caret. */ protected synchronized void damage(Rectangle r) { if (r != null) { validateWidth(r); // Check for "0" or "1" caret width x = r.x - 1; y = r.y; width = r.width + 4; height = r.height; repaint(); } }
/** * Overridden to damage the correct width of the caret, since this caret * can be different sizes. * * @param r The current location of the caret. */ @Override protected synchronized void damage(Rectangle r) { if (r != null) { validateWidth(r); // Check for "0" or "1" caret width x = r.x - 1; y = r.y; width = r.width + 4; height = r.height; repaint(); } }
/** * Toggles whether this caret should always be visible (as opposed to * blinking, or not visible when the editor's window is not focused). * This can be used by popup windows that want the caret's location * to still be visible for contextual purposes while they are displayed. * * @param alwaysVisible Whether this caret should always be visible. * @see #isAlwaysVisible() */ public void setAlwaysVisible(boolean alwaysVisible) { if (alwaysVisible != this.alwaysVisible) { this.alwaysVisible = alwaysVisible; if (!isVisible()) { // Force painting of caret since super class's "flasher" timer // won't fire when the window doesn't have focus repaint(); } } }