Search in sources :

Example 1 with Next

use of org.cristalise.kernel.lifecycle.instance.Next in project kernel by cristal-ise.

the class WfDirectedEdgeRenderer method draw.

@Override
public void draw(Graphics2D g2d, DirectedEdge directedEdge) {
    Next next = (Next) directedEdge;
    boolean hasError = !next.verify();
    String label = (String) next.getBuiltInProperty(ALIAS);
    String type = (String) next.getBuiltInProperty(TYPE);
    draw(g2d, directedEdge, label, type, hasError);
}
Also used : Next(org.cristalise.kernel.lifecycle.instance.Next)

Example 2 with Next

use of org.cristalise.kernel.lifecycle.instance.Next in project kernel by cristal-ise.

the class CastorXMLTest method testGraphMultiPointEdge.

@Test
public void testGraphMultiPointEdge() throws Exception {
    CastorXMLUtility marshaller = Gateway.getMarshaller();
    GraphableEdge edge = new Next();
    edge.getMultiPoints().put(1, new GraphPoint(0, 0));
    edge.getMultiPoints().put(2, new GraphPoint(100, 100));
    edge.getMultiPoints().put(3, new GraphPoint(200, 100));
    GraphableEdge edgePrime = (GraphableEdge) marshaller.unmarshall(marshaller.marshall(edge));
    assertThat(edge).isEqualToComparingFieldByField(edgePrime);
    Logger.msg(marshaller.marshall(edge));
    Logger.msg(marshaller.marshall(edgePrime));
}
Also used : GraphPoint(org.cristalise.kernel.graph.model.GraphPoint) Next(org.cristalise.kernel.lifecycle.instance.Next) CastorXMLUtility(org.cristalise.kernel.utils.CastorXMLUtility) GraphableEdge(org.cristalise.kernel.graph.model.GraphableEdge) MainTest(org.cristalise.kernel.test.process.MainTest) Test(org.junit.Test)

Example 3 with Next

use of org.cristalise.kernel.lifecycle.instance.Next in project kernel by cristal-ise.

the class CompositeActivityDef method instantiateEdges.

/**
 * Loops through the edges of children graph model and calls their instantiate method
 *
 * @param ca the parent CompositeActivity instance which will be set as a Parent
 * @return the instantiated array of edge instances called Next
 */
public Next[] instantiateEdges(CompositeActivity ca) {
    Next[] nexts = new Next[getChildrenGraphModel().getEdges().length];
    for (int i = 0; i < getChildrenGraphModel().getEdges().length; i++) {
        NextDef nextDef = (NextDef) getChildrenGraphModel().getEdges()[i];
        nexts[i] = nextDef.instantiate();
        nexts[i].setParent(ca);
    }
    return nexts;
}
Also used : Next(org.cristalise.kernel.lifecycle.instance.Next) GraphPoint(org.cristalise.kernel.graph.model.GraphPoint)

Example 4 with Next

use of org.cristalise.kernel.lifecycle.instance.Next in project kernel by cristal-ise.

the class NextDef method instantiate.

public Next instantiate() {
    Next next = new Next();
    next.setID(getID());
    next.setOriginVertexId(getOriginVertexId());
    next.setTerminusVertexId(getTerminusVertexId());
    next.setProperties(getProperties());
    next.setOriginPoint(getOriginPoint());
    next.setTerminusPoint(getTerminusPoint());
    return next;
}
Also used : Next(org.cristalise.kernel.lifecycle.instance.Next)

Aggregations

Next (org.cristalise.kernel.lifecycle.instance.Next)4 GraphPoint (org.cristalise.kernel.graph.model.GraphPoint)2 GraphableEdge (org.cristalise.kernel.graph.model.GraphableEdge)1 MainTest (org.cristalise.kernel.test.process.MainTest)1 CastorXMLUtility (org.cristalise.kernel.utils.CastorXMLUtility)1 Test (org.junit.Test)1