Skip to content

Commit

Permalink
typos , refactoring
Browse files Browse the repository at this point in the history
Issue imixs#227
  • Loading branch information
rsoika committed Apr 5, 2023
1 parent e3c2370 commit 783b35f
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ protected void executeOperation(final CreateNodeOperation operation) {
elementX = elementX - (DataObject.DEFAULT_WIDTH / 2);
elementY = elementY - (DataObject.DEFAULT_HEIGHT / 2);

dataObject.getBounds().setPosition(elementX, elementY);
dataObject.getBounds().setDimension(DataObject.DEFAULT_WIDTH, DataObject.DEFAULT_HEIGHT);
dataObject.setPosition(elementX, elementY);
dataObject.setDimension(DataObject.DEFAULT_WIDTH, DataObject.DEFAULT_HEIGHT);
// set label bounds

// set label bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ protected void executeOperation(final CreateNodeOperation operation) {
elementX = elementX - (Message.DEFAULT_WIDTH / 2);
elementY = elementY - (Message.DEFAULT_HEIGHT / 2);

message.getBounds().setPosition(elementX, elementY);
message.getBounds().setDimension(Message.DEFAULT_WIDTH, Message.DEFAULT_HEIGHT);
message.setPosition(elementX, elementY);
message.setDimension(Message.DEFAULT_WIDTH, Message.DEFAULT_HEIGHT);
// set label bounds

// set label bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ protected void executeOperation(final CreateNodeOperation operation) {
// compute relative center position...
elementX = elementX - (TextAnnotation.DEFAULT_WIDTH / 2);
elementY = elementY - (TextAnnotation.DEFAULT_HEIGHT / 2);
textAnnotation.getBounds().setPosition(elementX, elementY);
textAnnotation.getBounds().setDimension(TextAnnotation.DEFAULT_WIDTH, TextAnnotation.DEFAULT_HEIGHT);
textAnnotation.setPosition(elementX, elementY);
textAnnotation.setDimension(TextAnnotation.DEFAULT_WIDTH, TextAnnotation.DEFAULT_HEIGHT);
}
} catch (BPMNModelException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public void executeOperation(final CreateNodeOperation operation) {
}
}
// set event bounds
event.getBounds().setPosition(elementX, elementY);
event.getBounds().setDimension(Event.DEFAULT_WIDTH, Event.DEFAULT_HEIGHT);
event.setPosition(elementX, elementY);
event.setDimension(Event.DEFAULT_WIDTH, Event.DEFAULT_HEIGHT);
// set label bounds
event.getLabel().updateLocation(labelX, labelY);
event.getLabel().updateDimension(BPMNLabel.DEFAULT_WIDTH, BPMNLabel.DEFAULT_HEIGHT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public void executeOperation(final CreateNodeOperation operation) {
elementX = elementX - (Gateway.DEFAULT_WIDTH / 2);
elementY = elementY - (Gateway.DEFAULT_HEIGHT / 2);

gateway.getBounds().setPosition(elementX, elementY);
gateway.getBounds().setDimension(Gateway.DEFAULT_WIDTH, Gateway.DEFAULT_HEIGHT);
gateway.setPosition(elementX, elementY);
gateway.setDimension(Gateway.DEFAULT_WIDTH, Gateway.DEFAULT_HEIGHT);
// set label bounds
double labelX = elementX + (Gateway.DEFAULT_WIDTH / 2) - (BPMNLabel.DEFAULT_WIDTH / 2);
double labelY = elementY + Gateway.DEFAULT_HEIGHT + Gateway.LABEL_OFFSET;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public void executeOperation(final CreateNodeOperation operation) {
Optional<GPoint> point = operation.getLocation();
if (point.isPresent()) {
// set the bounds
participant.getBounds().setPosition(point.get().getX(), point.get().getY());
participant.getBounds().setDimension(Participant.DEFAULT_WIDTH, Participant.DEFAULT_HEIGHT);
participant.setPosition(point.get().getX(), point.get().getY());
participant.setDimension(Participant.DEFAULT_WIDTH, Participant.DEFAULT_HEIGHT);
}
} catch (BPMNModelException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ protected void executeOperation(final CreateNodeOperation operation) {
elementX = elementX - (Activity.DEFAULT_WIDTH / 2);
elementY = elementY - (Activity.DEFAULT_HEIGHT / 2);

task.getBounds().setPosition(elementX, elementY);
task.getBounds().setDimension(Activity.DEFAULT_WIDTH, Activity.DEFAULT_HEIGHT);
task.setPosition(elementX, elementY);
task.setDimension(Activity.DEFAULT_WIDTH, Activity.DEFAULT_HEIGHT);

logger.debug("new BPMNActivity Position = " + elementX + "," + elementY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public Lane addLane(String name) throws BPMNMissingElementException {
if (currentLaneCount > 0) {
// increase height...
expansion = currentHeight / currentLaneCount;
bpmnParticipant.getBounds().setDimension(currentWidth, currentHeight + expansion);
bpmnParticipant.setDimension(currentWidth, currentHeight + expansion);
}

Element laneBpmnShape = model.createElement(BPMNNS.BPMNDI, "BPMNShape");
Expand All @@ -632,8 +632,8 @@ public Lane addLane(String name) throws BPMNMissingElementException {
// laneHeight++;
}

bpmnLane.getBounds().setDimension(laneWidth, laneHeight);
bpmnLane.getBounds().setPosition(laneX, laneY);
bpmnLane.setDimension(laneWidth, laneHeight);
bpmnLane.setPosition(laneX, laneY);

}

Expand All @@ -642,7 +642,10 @@ public Lane addLane(String name) throws BPMNMissingElementException {
}

/**
* Return true if the process is the public default process
* Return true if the process is the public default process of the diagram.
*
* The method returns false in case the process is a private process assigned to
* a bpmn2:participant.
*/
public boolean isPublicProcess() {
return BPMNTypes.PROCESS_TYPE_PUBLIC.equals(getProcessType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public boolean hasPool() {

/**
* Returns the initialized BPMNProcess of this participant or returns null if no
* proces exists
* process exists
*
* @return BPMNProcess
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import org.openbpmn.bpmn.BPMNModel;
import org.openbpmn.bpmn.BPMNTypes;
import org.openbpmn.bpmn.elements.Activity;
import org.openbpmn.bpmn.elements.BPMNProcess;
import org.openbpmn.bpmn.elements.Lane;
import org.openbpmn.bpmn.elements.Participant;
import org.openbpmn.bpmn.elements.BPMNProcess;
import org.openbpmn.bpmn.exceptions.BPMNModelException;
import org.openbpmn.bpmn.util.BPMNModelFactory;

Expand Down Expand Up @@ -172,8 +172,8 @@ public void testCreateModelWithProcessAndElementsLayout() {
processContext.addEvent("start_1", "Start", BPMNTypes.START_EVENT);
processContext.addEvent("end_1", "End", BPMNTypes.END_EVENT);
Activity task = processContext.addTask("task_1", "Task", BPMNTypes.TASK);
task.getBounds().setPosition(10.0, 10.0);
task.getBounds().setDimension(140.0, 60.0);
task.setPosition(10.0, 10.0);
task.setDimension(140.0, 60.0);
processContext.addSequenceFlow("SequenceFlow_1", "start_1", "task_1");
processContext.addSequenceFlow("SequenceFlow_2", "task_1", "end_1");
} catch (BPMNModelException e) {
Expand Down Expand Up @@ -203,7 +203,7 @@ public void testCreateCollaborationModel() {
try {
// create two participants
Participant participantSales = model.addParticipant("Sales Team");

// add a task
Activity task = participantSales.openProcess().addTask("task_1", "Task", BPMNTypes.TASK);
task.setPosition(60, 40);
Expand All @@ -217,8 +217,6 @@ public void testCreateCollaborationModel() {
logger.info("...model created sucessful: " + out);
}



/**
* This test shows how creating a Collaboration model with Lanes
*/
Expand All @@ -237,13 +235,13 @@ public void testCreateCollaborationModelWithLanes() {
try {
// create two participants
Participant participantSales = model.addParticipant("Sales Team");
participantSales.setBounds(10,10,500,100);
BPMNProcess salesProcess=participantSales.openProcess();
participantSales.setBounds(10, 10, 500, 100);

BPMNProcess salesProcess = participantSales.openProcess();
// add a BPMNLane
Lane lane1=salesProcess.addLane("Europe");
Lane lane2=salesProcess.addLane("United States");
Lane lane1 = salesProcess.addLane("Europe");
Lane lane2 = salesProcess.addLane("United States");

// add a task
Activity task = participantSales.openProcess().addTask("task_1", "Task", BPMNTypes.TASK);
task.setPosition(100, 40);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public void testCreateModelWithProcessAndElementsLayout() {
String targetNameSpace = "http://org.openbpmn";
BPMNModel model = BPMNModelFactory.createInstance(exporter, version, targetNameSpace);
try {
BPMNProcess processContext= model.openDefaultProcess();
BPMNProcess processContext = model.openDefaultProcess();
assertNotNull(processContext);
// add a start and end event
processContext.addEvent("start_1", "Start", BPMNTypes.START_EVENT);
processContext.addEvent("end_1", "End", BPMNTypes.END_EVENT);
Activity task = processContext.addTask("task_1", "Task", BPMNTypes.TASK);
task.getBounds().setPosition(10.0, 10.0);
task.getBounds().setDimension(140.0, 60.0);
task.setPosition(10.0, 10.0);
task.setDimension(140.0, 60.0);

processContext.addSequenceFlow("SequenceFlow_1", "start_1", "task_1");
processContext.addSequenceFlow("SequenceFlow_2", "task_1", "end_1");
Expand All @@ -60,10 +60,9 @@ public void testCreateModelWithProcessAndElementsLayout() {
// remove elements from origin
processContext.deleteEvent("start_1");


// one Process expected
assertEquals(1,model.getProcesses().size());
assertEquals(1, model.getProcesses().size());

model.save(out);

// test structure of clone....
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void testBuildAndDelete() {
processContext.addEvent("start_1", "Start", BPMNTypes.START_EVENT);
processContext.addEvent("end_1", "End", BPMNTypes.END_EVENT);
Activity task = processContext.addTask("task_1", "Task", BPMNTypes.TASK);
task.getBounds().setPosition(10.0, 10.0);
task.getBounds().setDimension(140.0, 60.0);
task.setPosition(10.0, 10.0);
task.setDimension(140.0, 60.0);

processContext.addSequenceFlow("SequenceFlow_1", "start_1", "task_1");
processContext.addSequenceFlow("SequenceFlow_2", "task_1", "end_1");
Expand Down

0 comments on commit 783b35f

Please sign in to comment.