Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
300 additions
and
9 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/com/ardublock/translator/block/Esplora/Middle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Middle extends TranslatorBlock { | ||
|
||
public Middle (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
|
||
|
||
|
||
String ret = "MIDDLE"; | ||
|
||
return codePrefix + ret + codeSuffix; | ||
|
||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ardublock/translator/block/Esplora/Mouse_Click.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Mouse_Click extends TranslatorBlock { | ||
|
||
public Mouse_Click (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
String Click; | ||
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); | ||
Click = translatorBlock.toCode(); | ||
|
||
translator.addSetupCommand("Mouse.begin();"); | ||
String ret = "Mouse.click(MOUSE_"+Click+");\n"; | ||
|
||
return ret; | ||
|
||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ardublock/translator/block/Esplora/Mouse_Press.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Mouse_Press extends TranslatorBlock { | ||
|
||
public Mouse_Press (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
String Click; | ||
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); | ||
Click = translatorBlock.toCode(); | ||
|
||
translator.addSetupCommand("Mouse.begin();"); | ||
String ret = "Mouse.press(MOUSE_"+Click+");\n"; | ||
|
||
return ret; | ||
|
||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ardublock/translator/block/Esplora/Mouse_Release.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Mouse_Release extends TranslatorBlock { | ||
|
||
public Mouse_Release (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
String Click; | ||
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); | ||
Click = translatorBlock.toCode(); | ||
|
||
translator.addSetupCommand("Mouse.begin();"); | ||
String ret = "Mouse.release(MOUSE_"+Click+");\n"; | ||
|
||
return ret; | ||
|
||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ardublock/translator/block/Esplora/Mouse_isPressed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Mouse_isPressed extends TranslatorBlock { | ||
|
||
public Mouse_isPressed (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
String Click; | ||
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); | ||
Click = translatorBlock.toCode(); | ||
|
||
translator.addSetupCommand("Mouse.begin();"); | ||
String ret = "Mouse.isPressed(MOUSE_"+Click+");\n"; | ||
|
||
return codePrefix + ret + codeSuffix; | ||
|
||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/ardublock/translator/block/Esplora/Mouse_move.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.ardublock.translator.block.Esplora; | ||
|
||
import com.ardublock.translator.Translator; | ||
import com.ardublock.translator.block.TranslatorBlock; | ||
import com.ardublock.translator.block.exception.SocketNullException; | ||
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException; | ||
|
||
|
||
public class Mouse_move extends TranslatorBlock { | ||
|
||
public Mouse_move (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) | ||
{ | ||
super(blockId, translator, codePrefix, codeSuffix, label); | ||
} | ||
//@Override | ||
public String toCode() throws SocketNullException, SubroutineNotDeclaredException | ||
{ | ||
String Xaxis; | ||
String Yaxis; | ||
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); | ||
Xaxis = translatorBlock.toCode(); | ||
translatorBlock = this.getRequiredTranslatorBlockAtSocket(1); | ||
Yaxis = translatorBlock.toCode(); | ||
|
||
translator.addSetupCommand("Mouse.begin();"); | ||
String ret = "Mouse.move("+Xaxis+","+Yaxis+",O);\n"; | ||
|
||
return ret; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters