com.jgraph.example.adapter
Interface JGraphAdapterBackend

All Known Implementing Classes:
JGraphSQLBackend

public interface JGraphAdapterBackend

TODO Support parent child relations and ports, but make it easy to ignore. We do not use an event-model for the backend since the calling of these methods is already based on an event information, and we use the commit / rollback to mimic transactional behaviour.


Method Summary
 void attributesChanged(JGraphAdapterModel sender, java.lang.Object cell, java.util.Map attributes, boolean validate)
           
 void cellRemoved(JGraphAdapterModel sender, java.lang.Object cell, boolean validate)
           
 void commit()
          Invoked after no exception has been thrown during a non-validating calling sequence on the backend.
 void edgeAdded(JGraphAdapterModel sender, java.lang.Object edge, java.lang.Object source, java.lang.Object target, boolean validate)
           
 void parentChanged(JGraphAdapterModel sender, java.lang.Object child, java.lang.Object parent, boolean validate)
           
 void rollback()
          Invoked when an exception has been thrown during a non-validating calling sequence on the backend.
 void sourceChanged(JGraphAdapterModel sender, java.lang.Object edge, java.lang.Object source, boolean validate)
           
 void targetChanged(JGraphAdapterModel sender, java.lang.Object edge, java.lang.Object target, boolean validate)
           
 void vertexAdded(JGraphAdapterModel sender, java.lang.Object vertex, boolean validate)
          Invoked when a vertex has been added to the sender model.
 

Method Detail

commit

void commit()
            throws java.lang.Exception
Invoked after no exception has been thrown during a non-validating calling sequence on the backend.

Throws:
java.lang.Exception

rollback

void rollback()
              throws java.lang.Exception
Invoked when an exception has been thrown during a non-validating calling sequence on the backend.

Throws:
java.lang.Exception

vertexAdded

void vertexAdded(JGraphAdapterModel sender,
                 java.lang.Object vertex,
                 boolean validate)
                 throws java.lang.Exception
Invoked when a vertex has been added to the sender model. If validate is true then the change should not be performed yet. If the validation or the actual change fail on the backend, you should throw an exception.

Throws:
java.lang.Exception

edgeAdded

void edgeAdded(JGraphAdapterModel sender,
               java.lang.Object edge,
               java.lang.Object source,
               java.lang.Object target,
               boolean validate)
               throws java.lang.Exception
Throws:
java.lang.Exception

cellRemoved

void cellRemoved(JGraphAdapterModel sender,
                 java.lang.Object cell,
                 boolean validate)
                 throws java.lang.Exception
Throws:
java.lang.Exception

parentChanged

void parentChanged(JGraphAdapterModel sender,
                   java.lang.Object child,
                   java.lang.Object parent,
                   boolean validate)
                   throws java.lang.Exception
Throws:
java.lang.Exception

sourceChanged

void sourceChanged(JGraphAdapterModel sender,
                   java.lang.Object edge,
                   java.lang.Object source,
                   boolean validate)
                   throws java.lang.Exception
Throws:
java.lang.Exception

targetChanged

void targetChanged(JGraphAdapterModel sender,
                   java.lang.Object edge,
                   java.lang.Object target,
                   boolean validate)
                   throws java.lang.Exception
Throws:
java.lang.Exception

attributesChanged

void attributesChanged(JGraphAdapterModel sender,
                       java.lang.Object cell,
                       java.util.Map attributes,
                       boolean validate)
                       throws java.lang.Exception
Throws:
java.lang.Exception