renamed a method

This commit is contained in:
hneemann 2020-06-03 07:22:06 +02:00
parent 5900342508
commit 9b3740643d
5 changed files with 8 additions and 8 deletions

View File

@ -21,15 +21,15 @@ public interface MouseMovable {
* Sets the position by the mouse.
* Is called while dragging.
*
* @param pos the position
* @param pos the intermediate position
*/
void setPosByMouse(VectorFloat pos);
void setPosDragging(VectorFloat pos);
/**
* Sets the position by the mouse.
* Is called if mouse button is released.
*
* @param pos the position
* @param pos the final position
*/
void setPos(VectorFloat pos);
}

View File

@ -42,7 +42,7 @@ public class Movable<A extends Movable<?>> implements MouseMovable {
*
* @param position the position
*/
public void setPosByMouse(VectorFloat position) {
public void setPosDragging(VectorFloat position) {
setPos(position, Property.MOUSEPOS);
}

View File

@ -250,7 +250,7 @@ public class State extends Movable<State> {
}
@Override
public void setPosByMouse(VectorFloat pos) {
public void setPosDragging(VectorFloat pos) {
VectorInterface delta = pos.sub(State.this.getPos());
double angle = Math.atan2(-delta.getYFloat(), delta.getXFloat()) / Math.PI * 16;
if (angle < 0)

View File

@ -86,8 +86,8 @@ public class Transition extends Movable<Transition> {
@Override
public void setPosByMouse(VectorFloat position) {
super.setPosByMouse(posConstrain(position));
public void setPosDragging(VectorFloat position) {
super.setPosDragging(posConstrain(position));
}
@Override

View File

@ -139,7 +139,7 @@ public class FSMComponent extends JComponent {
repaint();
}
if (elementMoved != null) {
elementMoved.setPosByMouse(getPosVector(e).sub(delta).toFloat());
elementMoved.setPosDragging(getPosVector(e).sub(delta).toFloat());
repaint();
}
if (newTransitionFromState != null)