/** Returns true if the selection overlay is painted in XOR mode, false otherwise. */ public boolean isSelectionOverlayXORMode() { if (textSelectionManager != null) { return textSelectionManager.isSelectionOverlayXORMode(); } else { return false; } }
/** Returns the color of the outline of the selection overlay. */ public Color getSelectionOverlayStrokeColor() { if (textSelectionManager != null) { return textSelectionManager.getSelectionOverlayStrokeColor(); } else { return null; } }
/** Initializes the event handling classes. */ protected void initializeEventHandling() { if (eventsEnabled) { eventDispatcher = new AWTEventDispatcher(); if (selectableText) { textSelectionManager = new TextSelectionManager(this, eventDispatcher); textSelectionManager.addSelectionListener(new UnixTextSelectionListener()); } } }
/** Releases the references to the rendering resources, */ protected void releaseRenderingReferences() { eventDispatcher = null; if (textSelectionManager != null) { overlays.remove(textSelectionManager.getSelectionOverlay()); textSelectionManager = null; } renderer = null; image = null; gvtRoot = null; }
/** Deselects all. */ public void deselectAll() { if (textSelectionManager != null) { textSelectionManager.clearSelection(); } }
/** * Sets the selection to the specified start and end mark. * * @param start the mark used to define where the selection starts * @param end the mark used to define where the selection ends */ public void select(Mark start, Mark end) { if (textSelectionManager != null) { textSelectionManager.setSelection(start, end); } }
/** * Sets whether or not the selection overlay will be painted in XOR mode, depending on the * specified parameter. * * @param state true implies the selection overlay will be in XOR mode */ public void setSelectionOverlayXORMode(boolean state) { if (textSelectionManager != null) { textSelectionManager.setSelectionOverlayXORMode(state); } }
/** * Sets the color of the outline of the selection overlay to the specified color. * * @param color the new color of the outline of the selection overlay */ public void setSelectionOverlayStrokeColor(Color color) { if (textSelectionManager != null) { textSelectionManager.setSelectionOverlayStrokeColor(color); } }