Extension SDK 10.1.2

oracle.javatools.editor.plugins
Class DragDropPlugin.DragCaret

java.lang.Object
  extended byjava.awt.geom.RectangularShape
      extended byjava.awt.geom.Rectangle2D
          extended byjava.awt.Rectangle
              extended byjavax.swing.text.DefaultCaret
                  extended byoracle.javatools.editor.BasicCaret
                      extended byoracle.javatools.editor.plugins.DragDropPlugin.DragCaret
All Implemented Interfaces:
javax.swing.text.Caret, java.lang.Cloneable, java.util.EventListener, java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, java.io.Serializable, java.awt.Shape, TextBufferListener
Enclosing class:
DragDropPlugin

protected class DragDropPlugin.DragCaret
extends BasicCaret

The DragCaret class extends the editor caret implementation to support the initiation of dragging without moving the cursor.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
 
Fields inherited from class oracle.javatools.editor.BasicCaret
CARET_BLINK_RATE, CARET_COLOR, CARET_DOUBLE_UNDER_BAR, CARET_DOUBLE_VERTICAL_BAR, CARET_ENABLE_BLINK, CARET_OUTLINE_BOX, CARET_QUAD_UNDER_BAR, CARET_QUAD_VERTICAL_BAR, CARET_SHAPE_INSERT, CARET_SHAPE_OVERWRITE, CARET_SOLID_BOX, CARET_TRIPLE_UNDER_BAR, CARET_TRIPLE_VERTICAL_BAR, CARET_UNDER_BAR, CARET_VERTICAL_BAR, CARET_XOR_PAINTING, HIGHLIGHT_SELECTION_NAME, lastClickCount, lastClickOffset
 
Fields inherited from class javax.swing.text.DefaultCaret
changeEvent, listenerList
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Fields inherited from interface oracle.javatools.buffer.TextBufferListener
EOL_TYPE_ATTRIBUTE, MODIFIED_ATTRIBUTE, READ_ONLY_ATTRIBUTE, RELOAD_END_ATTRIBUTE, RELOAD_START_ATTRIBUTE
 
Constructor Summary
protected DragDropPlugin.DragCaret()
           
 
Method Summary
 void focusGained(java.awt.event.FocusEvent event)
          Called when the component containing the caret gains focus.
 boolean isVisible()
          Determines if the caret is currently visible.
 void mouseClicked(java.awt.event.MouseEvent event)
          Called when the mouse is clicked.
 void mouseDragged(java.awt.event.MouseEvent event)
          Invoked when the mouse button has been pressed and dragged.
 void mousePressed(java.awt.event.MouseEvent event)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent event)
          Invoked when a mouse button has been released on a component.
protected  boolean offsetInSelection(int offset)
          Utility method to check if the given offset is in the selection.
 
Methods inherited from class oracle.javatools.editor.BasicCaret
adjustVisibility, attributeUpdate, damage, deinstall, fireStateChanged, getActionInvoker, getInsertMode, getOffsetForMouseEvent, insertUpdate, install, moveCaret, moveDot, paint, positionCaret, propertyChange, removeUpdate, setDot, setInsertMode, toggleInsertMode
 
Methods inherited from class javax.swing.text.DefaultCaret
addChangeListener, equals, focusLost, getBlinkRate, getChangeListeners, getComponent, getDot, getListeners, getMagicCaretPosition, getMark, getSelectionPainter, isSelectionVisible, mouseEntered, mouseExited, mouseMoved, removeChangeListener, repaint, setBlinkRate, setMagicCaretPosition, setSelectionVisible, setVisible, toString
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

DragDropPlugin.DragCaret

protected DragDropPlugin.DragCaret()
Method Detail

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Called when the component containing the caret gains focus. This is implemented to set the caret to visible if the component is editable.

Specified by:
focusGained in interface java.awt.event.FocusListener
Overrides:
focusGained in class BasicCaret
Parameters:
event - the focus event
See Also:
FocusListener#focusGained

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Called when the mouse is clicked. Override this to handle drag initiation.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class BasicCaret
Parameters:
event - the mouse event
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Invoked when the mouse button has been pressed and dragged. Override this to handle drag cases.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class BasicCaret
Parameters:
event - the mouse drag event

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Invoked when a mouse button has been pressed on a component. Override this to handle drag initiation.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class BasicCaret
Parameters:
event - the mouse event that occurred

offsetInSelection

protected boolean offsetInSelection(int offset)
Utility method to check if the given offset is in the selection. We will consider starting offsets to be inclusive, and ending offsets to be exclusive.

Parameters:
offset - the offset to check

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Invoked when a mouse button has been released on a component. Override this to handle drag cases.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class BasicCaret
Parameters:
event - the mouse event that occurred

isVisible

public boolean isVisible()
Determines if the caret is currently visible.

Returns:
true if visible else false

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.