|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.pogamut.posh.widget.accept.AbstractAcceptAction<DROPPED,TARGET>
DROPPED - We are dragging PoshElement of DROPPED type. This is
the source.TARGET - Type of PoshElement this action drops to, it is
destination element.public abstract class AbstractAcceptAction<DROPPED extends PoshElement,TARGET extends PoshElement>
Ancestor for accept providers of widgets. Action can take the element of type DROPPED and drop it to the element of type TARGET.
| Field Summary | |
|---|---|
protected DataFlavor |
dataFlavor
|
protected TARGET |
dataNode
|
protected static Logger |
log
|
protected ShedWidget |
widget
|
| Constructor Summary | |
|---|---|
protected |
AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode)
same as other constructor, but we don't require widget. |
protected |
AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode,
ShedWidget widget)
Create an abstract action in the widget widget that will do something to data node dataNode when transferable of same data flavor as dataFlavor is dropped onto widget. |
| Method Summary | |
|---|---|
void |
accept(org.netbeans.api.visual.widget.Widget widget,
Point point,
Transferable transferable)
Basically take the data from @transferable (use our getDataFlavor()) and perform the action (performAction(cz.cuni.amis.pogamut.sposh.elements.PoshElement)). |
protected void |
displayMessage(String message,
int messageType)
Display message using NotifyDescriptor. |
DataFlavor |
getDataFlavor()
Get data flavor this accept provider accepts. |
protected int |
getIndexInList(List list,
Object o)
Get index of object in the list. |
org.netbeans.api.visual.action.ConnectorState |
isAcceptable(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
Transferable transferable)
|
abstract void |
performAction(DROPPED droppedData)
When deriving from this widget, implement what should actually be done in this function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DataFlavor dataFlavor
protected TARGET extends PoshElement dataNode
protected ShedWidget widget
protected static final Logger log
| Constructor Detail |
|---|
protected AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode,
ShedWidget widget)
dataFlavor - data flavor we are accepting, no multiple flavors accepteddataNode - data node that will be used somehow when accept action happens.widget - widget transferable is dropped onto for this accept provider to work.
protected AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode)
dataFlavor - Data flavor we are accepting.dataNode - target lap element.| Method Detail |
|---|
public final org.netbeans.api.visual.action.ConnectorState isAcceptable(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
Transferable transferable)
isAcceptable in interface org.netbeans.api.visual.action.AcceptProvider
public final void accept(org.netbeans.api.visual.widget.Widget widget,
Point point,
Transferable transferable)
getDataFlavor()) and perform the action (performAction(cz.cuni.amis.pogamut.sposh.elements.PoshElement)). If @transferable is empty (its dataflavored data is null), don't
perform the action, only log it.
accept in interface org.netbeans.api.visual.action.AcceptProviderwidget - Not used, widget at which was the transferable droppedpoint - Not used, location at which was the transferable dropped,
local coordinatin system of the @widget.transferable - Transferable used to get the data.public final DataFlavor getDataFlavor()
public abstract void performAction(DROPPED droppedData)
droppedData - Object that was dropped to the accepting element (in
case of drag and drop, data that was stored in the Transferable).
protected final int getIndexInList(List list,
Object o)
list - list of object where this function will look for object o.o - object whos index we are looking for
protected final void displayMessage(String message,
int messageType)
NotifyDescriptor.
messgae - messageType - Type of message, from NotifyDescriptor.*_MESSAGE
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||