Package org.jbpm.ui.common.figure

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

package org.jbpm.ui.common.figure;

import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;

public abstract class StateFigure extends NodeFigure {

    @Override
    public void init(boolean bpmnNotation) {
        super.init(bpmnNotation);
        connectionAnchor = new StateAnchor(this);
    }

    @Override
    public Dimension getDefaultSize() {
        return DIM_RECTANGLE.getCopy();
    }

    @Override
    protected void paintBPMNFigure(Graphics g, Rectangle r) {
        g.drawRoundRectangle(r, 20, 20);
        g.translate(getBounds().getLocation());
    }
       
    @Override
    protected void paintUMLFigure(Graphics g, Rectangle r) {
        Rectangle rect = r.getResized(-1, -1);
        g.drawRoundRectangle(rect, 20, 10);
        g.translate(getBounds().getLocation());
    }
   
    @Override
    public Rectangle getClientArea(Rectangle rect) {
        if (bpmnNotation) {
            return super.getClientArea(rect).getExpanded(-GRID_SIZE / 2, -GRID_SIZE / 2);
        }
        return super.getClientArea(rect);
    }
   
    protected Rectangle getBox() {
        return getBounds();
    }

}
TOP

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

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.