Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.editor.plugins
Class DragDropPlugin.DragCaret

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by javax.swing.text.DefaultCaret
                  extended by oracle.javatools.editor.BasicCaret
                      extended by oracle.javatools.editor.plugins.DragDropPlugin.DragCaret
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.Shape, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.text.Caret, 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/interfaces 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_EDITOR_SELECTION_COLUMNS, CARET_EDITOR_SELECTION_TYPE, CARET_EDITOR_SELECTION_WRAP, CARET_ENABLE_BLINK, CARET_OUTLINE_BOX, CARET_QUAD_UNDER_BAR, CARET_QUAD_VERTICAL_BAR, CARET_RIGHT_CLICK_SELECTION, 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
ALWAYS_UPDATE, changeEvent, listenerList, NEVER_UPDATE, UPDATE_WHEN_ON_EDT
 
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
adjustCaretPosition, adjustVisibility, attributeUpdate, damage, deinstall, fireStateChanged, getActionInvoker, getCaretInsets, getEditorSelection, getInsertMode, getOffsetForMouseEvent, insertUpdate, install, isPressInSelection, moveCaret, moveDot, paint, positionCaret, propertyChange, removeUpdate, setDot, setEditorSelection, setInsertMode, toggleInsertMode, updateHighlight
 
Methods inherited from class javax.swing.text.DefaultCaret
addChangeListener, equals, focusLost, getBlinkRate, getChangeListeners, getComponent, getDot, getDotBias, getListeners, getMagicCaretPosition, getMark, getMarkBias, getSelectionPainter, getUpdatePolicy, isActive, isSelectionVisible, mouseEntered, mouseExited, mouseMoved, moveDot, removeChangeListener, repaint, setBlinkRate, setDot, setMagicCaretPosition, setSelectionVisible, setUpdatePolicy, 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:
e - 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.

Specified by:
isVisible in interface javax.swing.text.Caret
Overrides:
isVisible in class javax.swing.text.DefaultCaret
Returns:
true if visible else false

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

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