|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool
org.eclipse.gef.tools.TargetingTool
org.eclipse.gef.tools.AbstractConnectionCreationTool
public class AbstractConnectionCreationTool
The base implementation for tools which create a connection. A connection is a link between two existing GraphicalEditParts.
A connection creation tool uses a CreateConnectionRequest to perform
the creation. This request is sent to both graphical editparts which serve as
the "nodes" at each end of the connection. The first node clicked on is the
source. The source is asked for a Command that represents
creating the first half of the connection. This command is then passed to the
target editpart, which is reponsible for creating the final Command that is
executed.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.gef.tools.AbstractTool |
|---|
AbstractTool.Input |
| Field Summary | |
|---|---|
protected static int |
MAX_FLAG
The max flag. |
protected static int |
MAX_STATE
The max state. |
protected static int |
STATE_CONNECTION_STARTED
The state which indicates that the connection creation has begun. |
| Fields inherited from class org.eclipse.gef.tools.AbstractTool |
|---|
MOUSE_BUTTON_ANY, MOUSE_BUTTON1, MOUSE_BUTTON2, MOUSE_BUTTON3, PROPERTY_UNLOAD_WHEN_FINISHED, STATE_ACCESSIBLE_DRAG, STATE_ACCESSIBLE_DRAG_IN_PROGRESS, STATE_DRAG, STATE_DRAG_IN_PROGRESS, STATE_INITIAL, STATE_INVALID, STATE_TERMINAL |
| Fields inherited from interface org.eclipse.gef.RequestConstants |
|---|
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER |
| Constructor Summary | |
|---|---|
AbstractConnectionCreationTool()
The default constructor |
|
AbstractConnectionCreationTool(CreationFactory factory)
Constructs a new abstract creation tool with the given creation factory. |
|
| Method Summary | |
|---|---|
protected Cursor |
calculateCursor()
Returns the appropriate cursor for the tools current state. |
protected Request |
createTargetRequest()
Creates the target request that will be used with the target editpart. |
void |
deactivate()
Erases feedback and sets fields to null. |
protected void |
eraseSourceFeedback()
Asks the source editpart to erase connection creation feedback. |
protected java.lang.String |
getCommandName()
Returns the identifier of the command that is being sought. |
protected java.lang.String |
getDebugName()
Returns the debug name for this tool. |
protected java.lang.String |
getDebugNameForState(int s)
Returns a String representation of the given state for debug purposes. |
protected CreationFactory |
getFactory()
Returns the creation factory that will be used with the create connection request. |
protected Request |
getSourceRequest()
Returns the request sent to the source node. |
protected boolean |
handleButtonDown(int button)
When the button is first pressed, the source node and its command contribution are determined and locked in. |
protected boolean |
handleButtonUp(int button)
Unloads or resets the tool if the state is in the terminal or invalid state. |
protected boolean |
handleCommandStackChanged()
Called when the command stack has changed, for instance, when a delete or undo command has been executed. |
protected boolean |
handleCreateConnection()
Method that is called when the gesture to create the connection has been received. |
protected boolean |
handleDrag()
Called whenever the mouse is being dragged. |
protected boolean |
handleDragInProgress()
Called whenever a mouse is being dragged and the drag threshold has been exceeded. |
protected boolean |
handleFocusLost()
Handles high-level processing of a focus lost event. |
protected boolean |
handleHover()
Handles high-level processing of a mouse hover event. |
protected boolean |
handleInvalidInput()
Called when invalid input is encountered. |
protected boolean |
handleMove()
Handles high-level processing of a mouse move. |
protected void |
handleSourceDeactivated()
Called if the source editpart is deactivated for some reason during the creation process. |
protected boolean |
isShowingSourceFeedback()
Returns true if feedback is being shown. |
protected void |
setConnectionSource(EditPart source)
Sets the source editpart for the creation |
void |
setFactory(CreationFactory factory)
Sets the creation factory used in the request. |
protected void |
showSourceFeedback()
Sends a show feedback request to the source editpart and sets the feedback flag. |
protected void |
updateTargetRequest()
Subclasses should override to update the target request. |
| Methods inherited from class org.eclipse.gef.util.FlagSupport |
|---|
getFlag, setFlag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int STATE_CONNECTION_STARTED
protected static final int MAX_STATE
protected static final int MAX_FLAG
| Constructor Detail |
|---|
public AbstractConnectionCreationTool()
public AbstractConnectionCreationTool(CreationFactory factory)
factory - the creation factory| Method Detail |
|---|
protected Cursor calculateCursor()
AbstractToolnull is returned. Otherwise,
either the default or disabled cursor is returned, based on the existence
of a current command, and whether that current command is executable.
Subclasses may override or extend this method to calculate the appropriate cursor based on other conditions.
calculateCursor in class AbstractToolnull or a cursor to be displayed.AbstractTool.calculateCursor()protected Request createTargetRequest()
TargetingTool
createTargetRequest in class TargetingToolTargetingTool.createTargetRequest()public void deactivate()
null.
deactivate in interface Tooldeactivate in class TargetingToolTool.deactivate()protected void eraseSourceFeedback()
protected java.lang.String getCommandName()
AbstractTool
getCommandName in class AbstractToolAbstractTool.getCommandName()protected java.lang.String getDebugName()
AbstractTool
getDebugName in class AbstractToolAbstractTool.getDebugName()protected java.lang.String getDebugNameForState(int s)
AbstractTool
getDebugNameForState in class AbstractTools - the state
AbstractTool.getDebugNameForState(int)protected CreationFactory getFactory()
protected Request getSourceRequest()
RequestConstants.REQ_CONNECTION_START.
protected boolean handleButtonDown(int button)
handleButtonDown in class AbstractToolbutton - which button is pressed
true if the button down was processedAbstractTool.handleButtonDown(int)protected boolean handleButtonUp(int button)
handleButtonUp in class AbstractToolbutton - the button being released
true if the button up was handledAbstractTool.handleButtonUp(int)protected boolean handleCommandStackChanged()
AbstractToolSTATE_INVALID and handleInvalidInput is called. Subclasses
may override this method to change what happens when the command stack
changes. Returning true indicates that the change was
handled in some way.
handleCommandStackChanged in class AbstractTooltrue if the change was handled in some wayAbstractTool.handleCommandStackChanged()protected boolean handleCreateConnection()
true to indicate that the
connection creation succeeded.
true if the connection creation was performedprotected boolean handleDrag()
AbstractToolAbstractTool.handleDragInProgress() starts getting called.
By default, nothing happens, and false is returned.
Subclasses may override this method to interpret a drag. Returning
true indicates that the drag was handled in some way.
handleDrag in class AbstractTooltrue if the drag is handledAbstractTool.handleDrag()protected boolean handleDragInProgress()
AbstractToolAbstractTool.handleDrag() is called. This method gets called repeatedly for
every mouse move during the drag. By default, nothing happens and
false is returned. Subclasses may override this method to
interpret the drag. Returning true indicates that the drag
was handled.
handleDragInProgress in class AbstractTooltrue if the drag was handledAbstractTool.handleDragInProgress()protected boolean handleFocusLost()
AbstractToolfalse is returned. Subclasses may override this
method to interpret the focus lost event. Return true to
indicate that the event was processed.
handleFocusLost in class AbstractTooltrue if the event was handledAbstractTool.handleFocusLost()protected boolean handleHover()
AbstractToolfalse is returned. Subclasses may override this
method to interpret the hover. Return true to indicate that
the hover was handled.
handleHover in class AbstractTooltrue if the hover was handledAbstractTool.handleHover()protected boolean handleInvalidInput()
TargetingToolAbstractTool.STATE_INVALID.
handleInvalidInput in class TargetingTooltrueTargetingTool.handleInvalidInput()protected boolean handleMove()
AbstractToolfalse. Subclasses may extend this method to
process mouse moves. Returns true if the mouse move was
processed.
handleMove in class AbstractTooltrue if the mouse move was handledAbstractTool.handleMove()protected void handleSourceDeactivated()
protected boolean isShowingSourceFeedback()
true if feedback is being shown.
true if showing source feedbackprotected void setConnectionSource(EditPart source)
source - the source editpart nodepublic void setFactory(CreationFactory factory)
factory - the factoryprotected void showSourceFeedback()
protected void updateTargetRequest()
TargetingTool
updateTargetRequest in class TargetingToolTargetingTool.updateTargetRequest()
|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||