|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--canvas.ShapeComponent
|
+--canvas.DropDragShapeComponent
Provides a set of methods that allow ShapeComponents to listen for mouse, keyboard,
and drag-and-drop events using a DefaultListener
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class canvas.ShapeComponent |
debug, name |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
DropDragShapeComponent(Shape shape,
boolean filled,
Color color)
|
|
| Method Summary | |
boolean |
acceptDrop(Object dropped)
You should override this method in subclass to get drag/drop to work with your shapes. |
void |
addDragListener()
Allows this Shape to listen for Drag & Drop |
void |
addKeyboardListener()
Allows this Shape to Listen for Arrow Keys Note: Only one shape will listen for key strokes at a time to obtain the focus for this shape, you need to call the Shape's getFocus() method. |
void |
addMouseListener()
Allows this Shape to listen for Mouse Events. |
void |
dragDropEnd(DragSourceDropEvent dsde)
You should not need to use this method |
void |
dragEnter(DragSourceDragEvent dsde)
You should not need to use this method |
void |
dragExit(DragSourceEvent dse)
You should not need to use this method |
void |
dragOver(DragSourceDragEvent dsde)
You should not need to use this method |
void |
dropActionChanged(DragSourceDragEvent dsde)
You should not need to use this method |
Object |
getTransferData(DataFlavor flavor)
You should not need to use this method |
DataFlavor[] |
getTransferDataFlavors()
You should not need to use this method |
boolean |
isDataFlavorSupported(DataFlavor flavor)
You should not need to use this method |
Object |
manufactureDroppable()
You should override this method in subclass to get drag/drop to work with your shapes. |
boolean |
okToDrag()
Returns whether it's OK to drag this object |
void |
removeDragListener()
Removes this Shape's ability to listen for Drag & Drop |
void |
removeKeyboardListener()
Removes this Shape's ability to Listen for Arrow Keys |
void |
removeMouseListener()
Removes Shape's ability to listen for Mouse Events. |
void |
resetBorder()
You should not need to use this method |
void |
setInvolvedInDrop(canvas.DragComponent drop)
|
void |
setListener(canvas.DefaultListener newListener)
Will set the listener from the default to your subclass of a DefaultListener so you can obtain function from the listeners |
| Methods inherited from class canvas.ShapeComponent |
displace, displace, getDrawingPane, getFilled, getPreferredSize, getShape, getShapeHeight, getShapeWidth, getShapeX, getShapeY, moveTo, moveTo, paint, redraw, resizeTo, resizeTo, rotate, rotateAbout, rotateAbout, setDebug, setFeedbackText, setFilled, smoothDisplace, smoothDisplace, smoothMove, smoothMove, smoothResize, smoothResize, smoothRotate, smoothRotateAbout, smoothRotateAbout, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface canvas.DragComponent |
setBorder |
| Methods inherited from interface canvas.CanvasComponent |
getHeight, getWidth |
| Constructor Detail |
public DropDragShapeComponent(Shape shape,
boolean filled,
Color color)
| Method Detail |
public Object manufactureDroppable()
manufactureDroppable in interface DragComponentpublic boolean acceptDrop(Object dropped)
acceptDrop in interface DragComponentpublic boolean okToDrag()
DragComponent
okToDrag in interface DragComponentpublic void setInvolvedInDrop(canvas.DragComponent drop)
public void addMouseListener()
public void removeMouseListener()
public void addDragListener()
public void removeDragListener()
public void addKeyboardListener()
public void removeKeyboardListener()
public void setListener(canvas.DefaultListener newListener)
public Object getTransferData(DataFlavor flavor)
getTransferData in interface Transferablepublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface Transferablepublic boolean isDataFlavorSupported(DataFlavor flavor)
isDataFlavorSupported in interface Transferablepublic void dragDropEnd(DragSourceDropEvent dsde)
dragDropEnd in interface DragSourceListenerpublic void dragEnter(DragSourceDragEvent dsde)
dragEnter in interface DragSourceListenerpublic void dragExit(DragSourceEvent dse)
dragExit in interface DragSourceListenerpublic void dragOver(DragSourceDragEvent dsde)
dragOver in interface DragSourceListenerpublic void dropActionChanged(DragSourceDragEvent dsde)
dropActionChanged in interface DragSourceListenerpublic void resetBorder()
resetBorder in interface DragComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||