org.eclipse.graphiti.pattern
Class AbstractConnectionPattern

java.lang.Object
  extended by org.eclipse.graphiti.pattern.AbstractBasePattern
      extended by org.eclipse.graphiti.pattern.AbstractConnectionPattern
All Implemented Interfaces:
IFeatureProviderHolder, IAdd, ICreateConnection, ICreateInfo, IConnectionPattern

public abstract class AbstractConnectionPattern
extends AbstractBasePattern
implements IConnectionPattern

The Class AbstractConnectionPattern.


Constructor Summary
AbstractConnectionPattern()
          Creates a new AbstractConnectionPattern.
 
Method Summary
protected  Connection addGraphicalRepresentation(IConnectionContext context, Object newObject)
          Adds the graphical representation.
 void attachedToSource(ICreateConnectionContext context)
          Will called after a connection was successfully attached to an anchor of a source object.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction.
 void canceledAttaching(ICreateConnectionContext context)
          Will called if the connection creation process was canceled after the successful attachment of the connection to an anchor of a source object.
 boolean canCreate(ICreateConnectionContext context)
          Can create.
 boolean canStartConnection(ICreateConnectionContext context)
          Can start connection.
 Connection create(ICreateConnectionContext context)
          Creates the.
 void endConnecting()
          Will called after a connection creation tool from the palette was deselected.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction.
protected static AddConnectionContext getAddConnectionContext(ICreateConnectionContext context)
          Gets the adds the connection context.
 String getCreateDescription()
          Gets the create description.
 String getCreateImageId()
          Gets the create image id.
 String getCreateLargeImageId()
          Gets the create large image id.
 String getCreateName()
          Gets the create name.
protected  String getText(IStructureMapping structureMapping, PictogramLink link)
          Gets the text.
protected  void layoutPictogramElement(PictogramElement pe)
          Layout pictogram element.
 void startConnecting()
          Will called after a connection creation tool from the palette was selected.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction.
protected  void updatePictogramElement(PictogramElement pe)
          Update pictogram element.
 
Methods inherited from class org.eclipse.graphiti.pattern.AbstractBasePattern
add, canAdd, getBusinessObjectForPictogramElement, getDiagram, getDiagramEditor, getFeatureProvider, getMappingProvider, link, link, manageColor, manageColor, manageFont, manageFont, setFeatureProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.graphiti.pattern.IConnectionPattern
setFeatureProvider
 
Methods inherited from interface org.eclipse.graphiti.func.IAdd
add, canAdd
 

Constructor Detail

AbstractConnectionPattern

public AbstractConnectionPattern()
Creates a new AbstractConnectionPattern.

Method Detail

getAddConnectionContext

protected static AddConnectionContext getAddConnectionContext(ICreateConnectionContext context)
Gets the adds the connection context.

Parameters:
context - the create connection context
Returns:
the adds the connection context

canCreate

public boolean canCreate(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Can create.

Specified by:
canCreate in interface ICreateConnection
Parameters:
context - the context
Returns:
true, if successful

canStartConnection

public boolean canStartConnection(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Can start connection.

Specified by:
canStartConnection in interface ICreateConnection
Parameters:
context - the context
Returns:
true, if successful

create

public Connection create(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Creates the.

Specified by:
create in interface ICreateConnection
Parameters:
context - the context
Returns:
the connection

addGraphicalRepresentation

protected Connection addGraphicalRepresentation(IConnectionContext context,
                                                Object newObject)
Adds the graphical representation.

Parameters:
context - the connection context
newObject - the new object
Returns:
the connection

getText

protected String getText(IStructureMapping structureMapping,
                         PictogramLink link)
Gets the text.

Parameters:
structureMapping - the structure mapping
link - the pictogram link
Returns:
the text

layoutPictogramElement

protected void layoutPictogramElement(PictogramElement pe)
Layout pictogram element.

Parameters:
pe - the pictogram element

updatePictogramElement

protected void updatePictogramElement(PictogramElement pe)
Update pictogram element.

Parameters:
pe - the pictogram element

getCreateDescription

public String getCreateDescription()
Description copied from interface: ICreateInfo
Gets the create description.

Specified by:
getCreateDescription in interface ICreateInfo
Returns:
description for UI representation

getCreateImageId

public String getCreateImageId()
Description copied from interface: ICreateInfo
Gets the create image id.

Specified by:
getCreateImageId in interface ICreateInfo
Returns:
image for UI representation

getCreateLargeImageId

public String getCreateLargeImageId()
Description copied from interface: ICreateInfo
Gets the create large image id.

Specified by:
getCreateLargeImageId in interface ICreateInfo
Returns:
large image for UI representation

getCreateName

public String getCreateName()
Description copied from interface: ICreateInfo
Gets the create name.

Specified by:
getCreateName in interface ICreateInfo
Returns:
name for UI representation

startConnecting

public void startConnecting()
Description copied from interface: ICreateConnection
Will called after a connection creation tool from the palette was selected.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.

Specified by:
startConnecting in interface ICreateConnection
Since:
0.9

endConnecting

public void endConnecting()
Description copied from interface: ICreateConnection
Will called after a connection creation tool from the palette was deselected.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.

Specified by:
endConnecting in interface ICreateConnection
Since:
0.9

attachedToSource

public void attachedToSource(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Will called after a connection was successfully attached to an anchor of a source object.
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.

Specified by:
attachedToSource in interface ICreateConnection
Parameters:
context - the context
Since:
0.9

canceledAttaching

public void canceledAttaching(ICreateConnectionContext context)
Description copied from interface: ICreateConnection
Will called if the connection creation process was canceled after the successful attachment of the connection to an anchor of a source object. E.g. user pressed ESC, user clicked on an invalid target, focus was lost, ...
Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.

Specified by:
canceledAttaching in interface ICreateConnection
Parameters:
context - the context
Since:
0.9


Copyright (c) SAP AG 2005, 2010.