use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.
the class ForEachImpl 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;
if (layoutManager.isVerticalLayout()) {
xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
yTop = getStartIconYTop();
} else {
xLeft = getStartIconXLeft();
yTop = getStartIconYTop() + (getStartIconHeight() / 2);
}
// Returns the calculated coordinate points of the entry arrow
SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
return coords;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.
the class ForEachImpl 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;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.
the class ForEachImpl 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 ForEach activity and its subActivities
*/
protected Element getArrows(SVGDocument doc) {
Element subGroup = null;
// Creating an SVG Container "g"
subGroup = doc.createElementNS(SVGNamespace.SVG_NAMESPACE, "g");
// Checks for the subActivities
if (subActivities != null) {
ActivityInterface activity = null;
String id = null;
SVGCoordinates myStartCoords = getStartIconExitArrowCoords();
SVGCoordinates myExitCoords = getEndIconEntryArrowCoords();
SVGCoordinates activityExitCoords = null;
SVGCoordinates activityEntryCoords = null;
Iterator<ActivityInterface> itr = subActivities.iterator();
// Iterates through all the subActivities
while (itr.hasNext()) {
activity = itr.next();
id = activity.getId();
// Gets the entry and exit coordinates of the iterated activity
activityExitCoords = activity.getExitArrowCoords();
activityEntryCoords = activity.getEntryArrowCoords();
// Gives the coordinates of the entry arrow to the first activity from the startIcon
subGroup.appendChild(getArrowDefinition(doc, myStartCoords.getXLeft(), myStartCoords.getYTop(), activityEntryCoords.getXLeft(), activityEntryCoords.getYTop(), id));
// Gives the coordinates of the entry arrow to the endIcon of ForEach
subGroup.appendChild(getArrowDefinition(doc, activityExitCoords.getXLeft(), activityExitCoords.getYTop(), myExitCoords.getXLeft(), myExitCoords.getYTop(), id));
}
}
return subGroup;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.
the class ScopeImpl method getStartFaultCoords.
/**
* At the start: xLeft=0, yTop=0
* Calculates the coordinates of the start arrow of the FaultHandler
*
* @return coordinates of the start arrow of the FaultHandler
*/
protected SVGCoordinates getStartFaultCoords() {
int xLeft = 0;
int yTop = 0;
if (layoutManager.isVerticalLayout()) {
xLeft = getCoreDimensions().getXLeft() + getCoreDimensions().getWidth();
yTop = getCoreDimensions().getYTop() + (getHandlerIconHeight() * 3) + (getHandlerConnectorSpacing() * 4) + (getYSpacing() / 2);
} else {
xLeft = getCoreDimensions().getXLeft() + (getHandlerIconWidth() * 3) + (getHandlerConnectorSpacing() * 4) + (getYSpacing() / 2);
yTop = getCoreDimensions().getYTop() + getCoreDimensions().getHeight();
}
// Returns the calculated coordinate points of the start arrow of the FaultHandler
SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
return coords;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates in project carbon-business-process by wso2.
the class ScopeImpl 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;
}
Aggregations