示例#1
0
 /** 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;
   }
 }
示例#2
0
 /** Returns the color of the outline of the selection overlay. */
 public Color getSelectionOverlayStrokeColor() {
   if (textSelectionManager != null) {
     return textSelectionManager.getSelectionOverlayStrokeColor();
   } else {
     return null;
   }
 }
示例#3
0
 /** Initializes the event handling classes. */
 protected void initializeEventHandling() {
   if (eventsEnabled) {
     eventDispatcher = new AWTEventDispatcher();
     if (selectableText) {
       textSelectionManager = new TextSelectionManager(this, eventDispatcher);
       textSelectionManager.addSelectionListener(new UnixTextSelectionListener());
     }
   }
 }
示例#4
0
 /** 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;
 }
示例#5
0
 /** Deselects all. */
 public void deselectAll() {
   if (textSelectionManager != null) {
     textSelectionManager.clearSelection();
   }
 }
示例#6
0
 /**
  * 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);
   }
 }
示例#7
0
 /**
  * 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);
   }
 }
示例#8
0
 /**
  * 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);
   }
 }