package application.editor;

import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.swing.view.mxICellEditor;
import com.mxgraph.util.mxEventSource.mxIEventListener;
import com.mxgraph.view.mxGraph;
import models.dataFlowModel.DataTransferModel;

import java.awt.event.MouseListener;

public abstract class Stage {

    public static final int PORT_DIAMETER = 8;
    public static final int PORT_RADIUS = PORT_DIAMETER / 2;

    protected DataTransferModel model = null;

    protected mxGraphComponent graphComponent;
    protected mxGraph graph;

    public Stage(mxGraphComponent graphComponent) {
        this.graphComponent = graphComponent;
        this.graph = graphComponent.getGraph();
    }

    public abstract void init(Stage prevStage);

    public abstract mxICellEditor createCellEditor(mxGraphComponent graphComponent);

    public abstract mxIEventListener createChangeEventListener(Editor editor);

    public abstract MouseListener createMouseEventListener(Editor editor);

    public abstract boolean canChangeFrom(Stage prevStage);

    public DataTransferModel getModel() {
        return model;
    }
}
