Search in sources :

Example 31 with SVGCoordinates

use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.

the class FlowImpl method getStartIconExitArrowCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the arrow which leaves the start Flow Icon
 *
 * @return coordinates of the exit arrow for the start icon
 * After Calculations(Vertical Layout): xLeft= Xleft of Icon + (width of icon)/2 , yTop= Ytop of the Icon +
 * height of the icon
 */
protected SVGCoordinates getStartIconExitArrowCoords() {
    int xLeft = 0;
    int yTop = 0;
    if (layoutManager.isVerticalLayout()) {
        xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
        yTop = getStartIconYTop() + getStartIconHeight();
    } else {
        xLeft = getStartIconXLeft() + getStartIconWidth();
        yTop = getStartIconYTop() + (getStartIconHeight() / 2);
    }
    // Returns the calculated coordinate points of the exit arrow of the startIcon
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Example 32 with SVGCoordinates

use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.

the class FlowImpl method getExitArrowCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the arrow which leaves an activity
 *
 * @return coordinates/exit point of the exit arrow for the activities
 */
@Override
public SVGCoordinates getExitArrowCoords() {
    int xLeft = 0;
    int yTop = 0;
    if (layoutManager.isVerticalLayout()) {
        xLeft = getEndIconXLeft() + (getEndIconWidth() / 2);
        yTop = getEndIconYTop() + getEndIconHeight();
    } else {
        xLeft = getEndIconXLeft() + getEndIconWidth();
        yTop = getEndIconYTop() + (getEndIconHeight() / 2);
    }
    // Returns the calculated coordinate points of the exit arrow
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Example 33 with SVGCoordinates

use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.

the class FlowImpl method getArrows.

/**
 * Get the arrow coordinates of the activities
 *
 * @param doc SVG document which defines the components including shapes, gradients etc. of the activity
 * @return An element which contains the arrow coordinates of the Flow activity and its subActivities
 */
protected Element getArrows(SVGDocument doc) {
    Element subGroup = null;
    subGroup = doc.createElementNS(SVGNamespace.SVG_NAMESPACE, "g");
    // Gets the coordinates of the Flow start icon
    SVGCoordinates myStartCoords = getStartIconExitArrowCoords();
    // Gets the coordinates of the Flow end icon
    SVGCoordinates myExitCoords = getEndIconEntryArrowCoords();
    // Arrow flow/path coordinates of the start and end icons of the flow activity
    // Arrow Flow Coordinates of the Start Flow Icon
    subGroup.appendChild(getArrowDefinition(doc, myStartCoords.getXLeft(), myStartCoords.getYTop(), myStartCoords.getXLeft(), (myStartCoords.getYTop() + 30), "Flow_Top", true));
    subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth() / 2 + getXSpacing()), (myStartCoords.getYTop() + 30), (myStartCoords.getXLeft() + dimensions.getWidth() / 2 - getXSpacing()), (myStartCoords.getYTop() + 30), "Flow_TopH", true));
    // Arrow Flow Coordinates of the End Flow Icon
    subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth() / 2 + getXSpacing()), (myExitCoords.getYTop() - 20), (myStartCoords.getXLeft() + dimensions.getWidth() / 2 - getXSpacing()), (myExitCoords.getYTop() - 20), "Flow_DownH", true));
    subGroup.appendChild(getArrowDefinition(doc, myExitCoords.getXLeft(), myExitCoords.getYTop() - 20, myExitCoords.getXLeft(), myExitCoords.getYTop(), "Flow_Top", false));
    return subGroup;
}
Also used : OMElement(org.apache.axiom.om.OMElement) Element(org.w3c.dom.Element) SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Example 34 with SVGCoordinates

use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.

the class IfImpl method getEndIconEntryArrowCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the arrow which enters the end icon
 *
 * @return coordinates of the entry arrow for the end icon
 * After Calculations(Vertical Layout): xLeft= Xleft of Icon + (width of icon)/2 , yTop= Ytop of the Icon
 */
protected SVGCoordinates getEndIconEntryArrowCoords() {
    int xLeft = 0;
    int yTop = 0;
    if (layoutManager.isVerticalLayout()) {
        xLeft = getEndIconXLeft() + (getEndIconWidth() / 2);
        yTop = getEndIconYTop();
    } else {
        xLeft = getEndIconXLeft();
        yTop = getEndIconYTop() + (getEndIconHeight() / 2);
    }
    // Returns the calculated coordinate points of the entry arrow of the endIcon
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Example 35 with SVGCoordinates

use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.

the class IfImpl method getEntryArrowCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the arrow which enters an activity
 *
 * @return coordinates/entry point of the entry arrow for the activities
 * After Calculations(Vertical Layout): xLeft=Xleft of Icon + (width of icon)/2 , yTop= Ytop of the Icon
 */
@Override
public SVGCoordinates getEntryArrowCoords() {
    int xLeft = 0;
    int yTop = 0;
    xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
    yTop = getStartIconYTop();
    // if (layoutManager.isVerticalLayout()) {
    // xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
    // yTop = getStartIconYTop();
    // } else {
    // xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
    // yTop = getStartIconYTop();
    // 
    // }
    // Returns the calculated coordinate points of the entry arrow
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Aggregations

SVGCoordinates (org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)59 ActivityInterface (org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface)14 OMElement (org.apache.axiom.om.OMElement)10 Element (org.w3c.dom.Element)10