Package org.jbpm.ui.common.figure

Source Code of org.jbpm.ui.common.figure.StartStateFigure

package org.jbpm.ui.common.figure;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.GridData;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jbpm.ui.SharedImages;

public class StartStateFigure extends TerminalFigure {

    @Override
    public void init(boolean bpmnNotation) {
        super.init(bpmnNotation);
        if (!bpmnNotation) {
            addSwimlaneLabel();
            addLabel();
            addEllipse();
        }
    }

    @Override
    protected void addEllipse() {
        ellipse.setBounds(new Rectangle(3, 3, 16, 16));
        ellipse.setBackgroundColor(ColorConstants.black);
       
        Ellipse outer = new Ellipse();
        outer.setSize(22, 22);
        outer.setOutline(false);
        outer.add(ellipse);

        add(outer, new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
    }

    @Override
    protected void paintBPMNFigure(Graphics g, Rectangle r) {
        g.drawImage(SharedImages.getImage("icons/bpmn/graph/start.png"), r.getLocation());
    }

    @Override
    public ConnectionAnchor getArrivingConnectionAnchor() {
        return null;
    }

}
TOP

Related Classes of org.jbpm.ui.common.figure.StartStateFigure

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.