Skip to content

Commit

Permalink
Merge pull request #5 from AngelsCheeseBurgerOrg/develop
Browse files Browse the repository at this point in the history
Fix Bug that only place 1px of move always. Set the parameter pixel as set mouse movement.
Create Interface distinction between readonly and writeonly functions interface to maintain application argument correct referencing and use of it on any class.
Fix folder path on pom.xml when copying the .bat file.
Update the READ.md to place my name as primary author
  • Loading branch information
angelsburger90 committed Oct 20, 2020
2 parents 2791267 + 471835b commit 2d0ab06
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 27 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,9 @@ License

CC0-1.0 License

Author
----

by: Ryan Seth Roldan

**Free Angellic Software, Yeah! **
25 changes: 18 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.angelssoftware</groupId>
<artifactId>makeamove-site</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Make a Move</name>
<description>Dont make your computer Idle</description>
Expand All @@ -31,6 +31,19 @@

<plugins>

<!-- Force Author Ship -->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.10.3</version>
<configuration>
<fixTags>author</fixTags>
<force>true</force>
<fixFieldComment>false</fixFieldComment>
<fixMethodComment>false</fixMethodComment>
</configuration>
</plugin>

<!-- Always clean project first -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
Expand Down Expand Up @@ -74,10 +87,8 @@
</executions>
</plugin>

<!--
Try to Auto generate the script batch file to execute
the Runnable Jar
-->
<!-- Try to Auto generate the script batch file to execute the Runnable
Jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -90,10 +101,10 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/classes/</directory>
<directory>${basedir}/target/classes</directory>
<includes>
<include>run_make_a_move.bat</include>
</includes>
Expand Down
11 changes: 6 additions & 5 deletions src/org/angelssoftware/classes/MousePointerMover.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.angelssoftware.interfaces.RobotActionInterface;
import org.angelssoftware.interfaces.RobotMouseInterface;
import org.angelssoftware.interfaces.readonly.RobotMouseInterfaceReadOnly;
import org.angelssoftware.models.RobotProperties;
import org.angelssoftware.structures.ScreenSize;

Expand All @@ -19,7 +20,7 @@ public MousePointerMover() throws AWTException {
commonInitialization();
}

public MousePointerMover(RobotMouseInterface robotProperties) throws AWTException {
public MousePointerMover(RobotMouseInterfaceReadOnly robotProperties) throws AWTException {
commonInitialization();
this.setMouseHopInPx(robotProperties.getMouseHopInPx());
this.setMoveDirection(robotProperties.getMoveDirection());
Expand All @@ -39,22 +40,22 @@ private void MakeTheMousePointerMove() {

switch(getMoveDirection()) {
case UP:
mpY = mpY - 1;
mpY = mpY - getMouseHopInPx();
if(mpY<0) mpY = 1;
if(mpX<0) mpX = 0;
break;
case DOWN:
mpY = mpY + 1;
mpY = mpY + getMouseHopInPx();
if(mpY>getMaxHeight()) mpY = getMaxHeight() - 1;
if(mpX<0) mpX = 0;
break;
case LEFT:
mpX = mpX - 1;
mpX = mpX - getMouseHopInPx();
if(mpX<0) mpX = 1;
if(mpY<0) mpY = 0;
break;
case RIGHT:
mpX = mpX + 1;
mpX = mpX + getMouseHopInPx();
if(mpX>getMaxWidth()) mpX = getMaxWidth() - 1;
if(mpY<0) mpY = 0;
break;
Expand Down
6 changes: 3 additions & 3 deletions src/org/angelssoftware/classes/RobotAutomation.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import java.util.TimerTask;

import org.angelssoftware.interfaces.RobotActionInterface;
import org.angelssoftware.models.ApplicationArgumentModel;
import org.angelssoftware.interfaces.readonly.RobotInterfaceReadOnly;

public class RobotAutomation {
private ApplicationArgumentModel applicationArgumentModel;
private RobotInterfaceReadOnly applicationArgumentModel;
private List<RobotActionInterface> listRobotActions;

public RobotAutomation(ApplicationArgumentModel applicationArgumentModel) {
public RobotAutomation(RobotInterfaceReadOnly applicationArgumentModel) {
this.applicationArgumentModel = applicationArgumentModel;
this.listRobotActions = new ArrayList<RobotActionInterface>();
}
Expand Down
7 changes: 4 additions & 3 deletions src/org/angelssoftware/interfaces/RobotInterface.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.angelssoftware.interfaces;

public interface RobotInterface extends
RobotPropertiesInterface,
RobotMouseInterface {
import org.angelssoftware.interfaces.readonly.RobotInterfaceReadOnly;
import org.angelssoftware.interfaces.writeonly.RobotInterfaceWriteOnly;

public interface RobotInterface extends
RobotInterfaceReadOnly, RobotInterfaceWriteOnly {
}
11 changes: 5 additions & 6 deletions src/org/angelssoftware/interfaces/RobotMouseInterface.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package org.angelssoftware.interfaces;

import org.angelssoftware.structures.MoveDirection;
import org.angelssoftware.interfaces.readonly.RobotMouseInterfaceReadOnly;
import org.angelssoftware.interfaces.writeonly.RobotMouseInterfaceWriteOnly;

public interface RobotMouseInterface extends RobotMouseInterfaceReadOnly, RobotMouseInterfaceWriteOnly {


public interface RobotMouseInterface {
public int getMouseHopInPx();
public void setMouseHopInPx(int mouseHopInPx);
public MoveDirection getMoveDirection();
public void setMoveDirection(MoveDirection moveDirection);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.angelssoftware.interfaces;

public interface RobotPropertiesInterface {
public int getTimeDelayInMillis();
public void setTimeDelayInMillis(int timeDelayInMillis);
import org.angelssoftware.interfaces.readonly.RobotPropertiesInterfaceReadOnly;
import org.angelssoftware.interfaces.writeonly.RobotPropertiesInterfaceWriteOnly;

public interface RobotPropertiesInterface extends RobotPropertiesInterfaceReadOnly, RobotPropertiesInterfaceWriteOnly{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.angelssoftware.interfaces.readonly;


public interface RobotInterfaceReadOnly extends
RobotPropertiesInterfaceReadOnly,
RobotMouseInterfaceReadOnly {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.angelssoftware.interfaces.readonly;

import org.angelssoftware.structures.MoveDirection;

public interface RobotMouseInterfaceReadOnly {
public int getMouseHopInPx();
public MoveDirection getMoveDirection();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.angelssoftware.interfaces.readonly;

public interface RobotPropertiesInterfaceReadOnly {
public int getTimeDelayInMillis();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.angelssoftware.interfaces.writeonly;


public interface RobotInterfaceWriteOnly extends
RobotPropertiesInterfaceWriteOnly,
RobotMouseInterfaceWriteOnly{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.angelssoftware.interfaces.writeonly;

import org.angelssoftware.structures.MoveDirection;

public interface RobotMouseInterfaceWriteOnly {

public void setMouseHopInPx(int mouseHopInPx);

public void setMoveDirection(MoveDirection moveDirection);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.angelssoftware.interfaces.writeonly;

public interface RobotPropertiesInterfaceWriteOnly {
public void setTimeDelayInMillis(int timeDelayInMillis);
}

0 comments on commit 2d0ab06

Please sign in to comment.