use of com.willwinder.ugs.nbp.designer.actions.AddAction in project Universal-G-Code-Sender by winder.
the class CreateRectangleControl method createEntity.
private void createEntity() {
double startX = Math.min(startPosition.getX(), endPosition.getX());
double endX = Math.max(startPosition.getX(), endPosition.getX());
double startY = Math.min(startPosition.getY(), endPosition.getY());
double endY = Math.max(startPosition.getY(), endPosition.getY());
Rectangle rectangle = new Rectangle(startX, startY);
rectangle.setWidth(endX - startX);
rectangle.setHeight(endY - startY);
AddAction addAction = new AddAction(controller, rectangle);
addAction.actionPerformed(new ActionEvent(this, 0, ""));
controller.addEntity(rectangle);
}
use of com.willwinder.ugs.nbp.designer.actions.AddAction in project Universal-G-Code-Sender by winder.
the class CreateEllipseControl method createEntity.
private void createEntity() {
double startX = Math.min(startPosition.getX(), endPosition.getX());
double endX = Math.max(startPosition.getX(), endPosition.getX());
double startY = Math.min(startPosition.getY(), endPosition.getY());
double endY = Math.max(startPosition.getY(), endPosition.getY());
Ellipse ellipse = new Ellipse(startX, startY);
ellipse.setSize(new Size(endX - startX, endY - startY));
AddAction addAction = new AddAction(controller, ellipse);
addAction.actionPerformed(new ActionEvent(this, 0, ""));
controller.addEntity(ellipse);
}
use of com.willwinder.ugs.nbp.designer.actions.AddAction in project Universal-G-Code-Sender by winder.
the class CreateTextControl method createEntity.
private void createEntity() {
double startX = Math.min(startPosition.getX(), endPosition.getX());
double startY = Math.min(startPosition.getY(), endPosition.getY());
Text text = new Text(startX, startY);
AddAction addAction = new AddAction(controller, text);
addAction.actionPerformed(new ActionEvent(this, 0, ""));
controller.addEntity(text);
controller.setTool(Tool.SELECT);
controller.getSelectionManager().addSelection(text);
}
use of com.willwinder.ugs.nbp.designer.actions.AddAction in project Universal-G-Code-Sender by winder.
the class Controller method addEntity.
public void addEntity(Entity s) {
AddAction add = new AddAction(this, s);
add.execute();
undoManager.addAction(add);
}
use of com.willwinder.ugs.nbp.designer.actions.AddAction in project Universal-G-Code-Sender by winder.
the class Controller method addEntities.
public void addEntities(List<Entity> s) {
AddAction add = new AddAction(this, s);
add.execute();
undoManager.addAction(add);
}
Aggregations