mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 09:54:49 -04:00
renamed a method
This commit is contained in:
parent
5900342508
commit
9b3740643d
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user