/** * Clears the selection. */ public void clearSelection() { textSelector.clearSelection(); }
/** * Add a selection listener to be notified when the * text selection changes in the document. */ public void addSelectionListener(SelectionListener sl) { textSelector.addSelectionListener(sl); }
public void mouseEntered(GraphicsNodeMouseEvent evt) { checkSelectGesture(evt); }
if (isDeselectGesture(evt)) { if (selectionNode != null) { selectionNodeRoot.removeTreeGraphicsNodeChangeListener(this); clearSelection(); } else if (mevt != null) { (isSelectStartGesture(evt))) { if (selectionNode != source) { if (selectionNode != null) { dispatchSelectionEvent( new SelectionEvent(null, SelectionEvent.SELECTION_STARTED, null)); } else if (isSelectEndGesture(evt)) { if (selectionNode == source) { ((Selectable) source).selectTo(p.getX(), p.getY()); Object oldSelection = getSelection(); if (selectionNode != null) { Shape newShape; newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(oldSelection, SelectionEvent.SELECTION_DONE, newShape));
public void changeCompleted (GraphicsNodeChangeEvent gnce) { if (selectionNode == null) { return; } Shape newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(getSelection(), SelectionEvent.SELECTION_CHANGED, newShape)); }
public void mousePressed(GraphicsNodeMouseEvent evt) { if (evt.getSource() instanceof Selectable) { textSelector.mousePressed(evt); } else if (selectionHighlight != null) { textSelector.clearSelection(); } }
/** * Creates a new TextSelectionManager. */ public TextSelectionManager(JGVTComponent comp, EventDispatcher ed) { textSelector = new ConcreteTextSelector(); textSelectionListener = new TextSelectionListener(); textSelector.addSelectionListener(textSelectionListener); mouseListener = new MouseListener(); component = comp; component.getOverlays().add(selectionOverlay); ed.addGraphicsNodeMouseListener(mouseListener); }
/** * Reports whether the current selection contains any objects. */ public boolean isEmpty() { return (getSelection() == null); }
public void clearSelection() { if (selectionNode == null) { return; } dispatchSelectionEvent(new SelectionEvent (null, SelectionEvent.SELECTION_CLEARED, null)); selectionNode = null; selectionNodeRoot = null; }
if (isDeselectGesture(evt)) { if (selectionNode != null) { selectionNodeRoot.removeTreeGraphicsNodeChangeListener(this); clearSelection(); } else if (mevt != null) { (isSelectStartGesture(evt))) { if (selectionNode != source) { if (selectionNode != null) { dispatchSelectionEvent( new SelectionEvent(null, SelectionEvent.SELECTION_STARTED, null)); } else if (isSelectEndGesture(evt)) { if (selectionNode == source) { ((Selectable) source).selectTo(p.getX(), p.getY()); Object oldSelection = getSelection(); if (selectionNode != null) { Shape newShape; newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(oldSelection, SelectionEvent.SELECTION_DONE, newShape));
public void changeCompleted (GraphicsNodeChangeEvent gnce) { if (selectionNode == null) { return; } Shape newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(getSelection(), SelectionEvent.SELECTION_CHANGED, newShape)); }
public void mousePressed(GraphicsNodeMouseEvent evt) { if (evt.getSource() instanceof Selectable) { textSelector.mousePressed(evt); } else if (selectionHighlight != null) { textSelector.clearSelection(); } }
/** * Creates a new TextSelectionManager. */ public TextSelectionManager(JGVTComponent comp, EventDispatcher ed) { textSelector = new ConcreteTextSelector(); textSelectionListener = new TextSelectionListener(); textSelector.addSelectionListener(textSelectionListener); mouseListener = new MouseListener(); component = comp; component.getOverlays().add(selectionOverlay); ed.addGraphicsNodeMouseListener(mouseListener); }
/** * Reports whether the current selection contains any objects. */ public boolean isEmpty() { return (getSelection() == null); }
public void clearSelection() { if (selectionNode == null) { return; } dispatchSelectionEvent(new SelectionEvent (null, SelectionEvent.SELECTION_CLEARED, null)); selectionNode = null; selectionNodeRoot = null; }
if (isDeselectGesture(evt)) { if (selectionNode != null) { selectionNodeRoot.removeTreeGraphicsNodeChangeListener(this); clearSelection(); } else if (mevt != null) { (isSelectStartGesture(evt))) { if (selectionNode != source) { if (selectionNode != null) { dispatchSelectionEvent( new SelectionEvent(null, SelectionEvent.SELECTION_STARTED, null)); } else if (isSelectEndGesture(evt)) { if (selectionNode == source) { ((Selectable) source).selectTo(p.getX(), p.getY()); Object oldSelection = getSelection(); if (selectionNode != null) { Shape newShape; newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(oldSelection, SelectionEvent.SELECTION_DONE, newShape));
public void changeCompleted (GraphicsNodeChangeEvent gnce) { if (selectionNode == null) { return; } Shape newShape = ((Selectable)selectionNode).getHighlightShape(); dispatchSelectionEvent (new SelectionEvent(getSelection(), SelectionEvent.SELECTION_CHANGED, newShape)); }
public void mousePressed(GraphicsNodeMouseEvent evt) { if (evt.getSource() instanceof Selectable) { textSelector.mousePressed(evt); } else if (selectionHighlight != null) { textSelector.clearSelection(); } }
public void mouseClicked(GraphicsNodeMouseEvent evt) { checkSelectGesture(evt); }
/** * Creates a new TextSelectionManager. */ public TextSelectionManager(JGVTComponent comp, EventDispatcher ed) { textSelector = new ConcreteTextSelector(); textSelectionListener = new TextSelectionListener(); textSelector.addSelectionListener(textSelectionListener); mouseListener = new MouseListener(); component = comp; component.getOverlays().add(selectionOverlay); ed.addGraphicsNodeMouseListener(mouseListener); }