Search in sources :

Example 1 with PanelPaintDeviceListener

use of net.sf.sdedit.ui.PanelPaintDeviceListener in project abstools by abstools.

the class Tab method renderDiagram.

void renderDiagram() {
    PanelPaintDevice paintDevice = new PanelPaintDevice(true);
    for (PanelPaintDeviceListener listener : ppdListeners) {
        paintDevice.addListener(listener);
    }
    TextHandler textHandler = new TextHandler(getCode());
    Diagram diagram = new Diagram(configuration.getDataObject(), textHandler, paintDevice);
    DiagramError newError = null;
    try {
        diagram.generate();
    } catch (RuntimeException e) {
        newError = new FatalError(textHandler, e);
    } catch (DiagramError e) {
        newError = e;
    }
    synchronized (diagramStack) {
        diagramStack.addLast(diagram);
        synchronized (this) {
            error = newError;
        }
    }
}
Also used : FatalError(net.sf.sdedit.error.FatalError) PanelPaintDeviceListener(net.sf.sdedit.ui.PanelPaintDeviceListener) PanelPaintDevice(net.sf.sdedit.ui.PanelPaintDevice) TextHandler(net.sf.sdedit.text.TextHandler) DiagramError(net.sf.sdedit.error.DiagramError) Diagram(net.sf.sdedit.diagram.Diagram)

Aggregations

Diagram (net.sf.sdedit.diagram.Diagram)1 DiagramError (net.sf.sdedit.error.DiagramError)1 FatalError (net.sf.sdedit.error.FatalError)1 TextHandler (net.sf.sdedit.text.TextHandler)1 PanelPaintDevice (net.sf.sdedit.ui.PanelPaintDevice)1 PanelPaintDeviceListener (net.sf.sdedit.ui.PanelPaintDeviceListener)1