Skip to content

Commit

Permalink
fixed some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Aram1997 committed Mar 13, 2020
1 parent 4e8e807 commit 4c72fe5
Show file tree
Hide file tree
Showing 22 changed files with 256 additions and 274 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

422 changes: 197 additions & 225 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified out/production/swop1920/main/GlobalController.class
Binary file not shown.
Binary file modified out/production/swop1920/model/ModelController.class
Binary file not shown.
Binary file modified out/production/swop1920/model/blocks/ModelBlock.class
Binary file not shown.
Binary file modified out/production/swop1920/model/blocks/ModelMoveBlock.class
Binary file not shown.
Binary file modified out/production/swop1920/model/blocks/ModelNotBlock.class
Binary file not shown.
Binary file modified out/production/swop1920/model/blocks/ModelWallInFrontBlock.class
Binary file not shown.
Binary file modified out/production/swop1920/model/blocks/ModelWhileIfBlock.class
Binary file not shown.
9 changes: 7 additions & 2 deletions src/main/CanvasWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ private void handleMouseEvent_(MouseEvent e) {
/**
* Called when the user presses (id == MouseEvent.MOUSE_PRESSED), releases (id == MouseEvent.MOUSE_RELEASED), or drags (id == MouseEvent.MOUSE_DRAGGED) the mouse.
*
* @param e Details about the event
* @param id Details about the event
* @param x x coordinate
* @param y y coordinate
* @param clickCount the clickcount
*/
protected void handleMouseEvent(int id, int x, int y, int clickCount) {
}
Expand All @@ -302,7 +305,9 @@ private void handleKeyEvent_(KeyEvent e) {
/**
* Called when the user presses a key (id == KeyEvent.KEY_PRESSED) or enters a character (id == KeyEvent.KEY_TYPED).
*
* @param e
* @param id
* @param keyCode
* @param keyChar
*/
protected void handleKeyEvent(int id, int keyCode, char keyChar) {
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/GlobalController.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public void handleMouseEvent(int id, int x, int y, int clickCount){
* This function handles key events by telling the model controller
* to either step through the execution or stop running the program
*
* @param {int} id id of the event
* @param {int} keyCode keyCode of the pressed key: - 27 = ESC
* @param id id of the event
* @param keyCode keyCode of the pressed key: - 27 = ESC
* see: http://keycode.info - 65 = A
* - 116 = F5
* @param {char} keyChar character of the pressed key
* @param keyChar character of the pressed key
*/
public void handleKeyEvent(int id, int keyCode, char keyChar){
System.out.println("key pressed");
Expand Down Expand Up @@ -124,7 +124,7 @@ public void step(){
/**
* This function renders the UI
*
* @param {Graphics} g the graphics object which the rendering uses
* @param g the graphics object which the rendering uses
*/
public void render(Graphics g){
uiController.render(g);
Expand Down Expand Up @@ -167,7 +167,7 @@ public ModelBlock getCurrent(){
/**
* Updates the current active modelBlock
*
* @param {ModelBlock} blk the new active modelBlock
* @param blk the new active modelBlock
*/
public void setCurrent(ModelBlock blk){
this.current = blk;
Expand Down
38 changes: 19 additions & 19 deletions src/model/ModelController.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public ModelController(GridInfo gridInfo, int maxBlocks, int cellSize){

/**
*
* @param {ModelBlock} block block to move
* @param {Location} newPos new position the block should be at
* @param {Boolean} inProgramArea signify whether the block is moved into the program area
* @param block block to move
* @param newPos new position the block should be at
* @param inProgramArea signify whether the block is moved into the program area
*/
public void moveBlock(ModelBlock block, Location newPos, boolean inProgramArea){
if (block != null){
Expand All @@ -55,7 +55,7 @@ public void moveBlock(ModelBlock block, Location newPos, boolean inProgramArea){

/**
*
* @param {ModelBlock} block The block of which the neighbour is searched.
* @param block The block of which the neighbour is searched.
* @return the left neighbour of the block if there is one, otherwise null.
*/
public ModelBlock findLeftNeighbour(ModelBlock block){
Expand All @@ -73,7 +73,7 @@ public ModelBlock findLeftNeighbour(ModelBlock block){

/**
*
* @param {ModelBlock} block The block of which the neighbour is searched.
* @param block The block of which the neighbour is searched.
* @return the right neighbour of the block if there is one, otherwise null.
*/
public ModelBlock findRightNeighbour(ModelBlock block){
Expand All @@ -92,7 +92,7 @@ public ModelBlock findRightNeighbour(ModelBlock block){

/**
*
* @param {ModelBlock} block The block of which the neighbour is searched.
* @param block The block of which the neighbour is searched.
* @return the upper neighbour of the block if there is one, otherwise null.
*/
public ModelBlock findUpperNeighbour(ModelBlock block){
Expand All @@ -110,7 +110,7 @@ public ModelBlock findUpperNeighbour(ModelBlock block){

/**
*
* @param {ModelBlock} block The block of which the neighbour is searched.
* @param block The block of which the neighbour is searched.
* @return the bottom neighbour of the block if there is one, otherwise null.
*/
public ModelBlock findBottomNeighbour(ModelBlock block){
Expand All @@ -137,7 +137,7 @@ public ModelPalette getPalette() {
/**
* Set the Model Palette of the controller
*
* @param {ModelPalette} the palette the controller controls
* @param palette the controller controls
*/
public void setPalette(ModelPalette palette) {
this.palette = palette;
Expand All @@ -154,7 +154,7 @@ public ModelProgramWindow getPWindow() {
/**
* Set the Model Program Window of the controller
*
* @param {ModelProgramWindow} the program window the controller controls
* @param pWindow program window the controller controls
*/
public void setPWindow(ModelProgramWindow pWindow) {
this.pWindow = pWindow;
Expand All @@ -172,7 +172,7 @@ public ModelGrid getGrid() {
/**
* Set the Model Grid of the controller
*
* @param {ModelGrid} the grid the controller controls
* @param grid the grid the controller controls
*/
public void setGrid(ModelGrid grid) {
this.grid = grid;
Expand All @@ -184,12 +184,12 @@ public void setGrid(ModelGrid grid) {
*
* TODO: for some reason I can't use the static fields MouseEvent.MOUSE_PRESSED etc
*
* @param {int} id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* @param id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* - 501 = MOUSE_PRESSED: Where you start holding the button down
* - 502 = MOUSE_RELEASED: Where you release the button
* - 506 = MOUSE_DRAGGED: Holding down, gets triggerd after each small move
* @param {Location} eventLocation location where the event happened
* @param {int} clickCount number of clicks
* @param eventLocation location where the event happened
* @param clickCount number of clicks
*/
public void handleMouseEvent(int id, Location eventLocation, int clickCount){
if(eventLocation.getX() > 0 && eventLocation.getX() < MyCanvasWindow.WIDTH/3 ){
Expand All @@ -206,12 +206,12 @@ public void handleMouseEvent(int id, Location eventLocation, int clickCount){
/**
* handle mouse events in the palette
*
* @param {int} id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* @param id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* - 501 = MOUSE_PRESSED: Where you start holding the button down
* - 502 = MOUSE_RELEASED: Where you release the button
* - 506 = MOUSE_DRAGGED: Holding down, gets triggerd after each small move
* @param {Location} eventLocation location where the event happened
* @param {int} clickCount number of clicks
* @param eventLocation location where the event happened
* @param clickCount number of clicks
*/
protected void handlePaletteMouseEvent(int id, Location eventLocation, int clickCount){
switch(id){
Expand Down Expand Up @@ -245,12 +245,12 @@ protected void handlePaletteMouseEvent(int id, Location eventLocation, int click
/**
* handle mouse events in the program area
*
* @param {int} id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* @param id id of the event: - 500 = MOUSE_CLICKED: Press + release (comes after released + pressed), only comes if no dragging happended
* - 501 = MOUSE_PRESSED: Where you start holding the button down
* - 502 = MOUSE_RELEASED: Where you release the button
* - 506 = MOUSE_DRAGGED: Holding down, gets triggerd after each small move
* @param {Location} eventLocation location where the event happened
* @param {int} clickCount number of clicks
* @param eventLocation location where the event happened
* @param clickCount number of clicks
*/
protected void handleProgramAreaMouseEvent(int id, Location eventLocation, int clickCount){
switch(id){
Expand Down
4 changes: 2 additions & 2 deletions src/model/ModelGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public Location getRobotPos() {
/**
* Setter for the robot position
*
* @param {Location} robotPos the new position of the robot
* @param robotPos the new position of the robot
*/
public void setRobotPos(Location robotPos) {
this.robotPos = robotPos;
Expand All @@ -179,7 +179,7 @@ public Direction getRobotDir() {
/**
* Setter for the robot direction
*
* @param {Direction} robotDir the new direction of the robot
* @param robotDir the new direction of the robot
*/
public void setRobotDir(Direction robotDir) {
this.robotDir = robotDir;
Expand Down
10 changes: 5 additions & 5 deletions src/model/ModelProgramWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void setBlocks(ArrayList<ModelBlock> blocks) {
/**
* Remove a block from the Program Area
*
* @param {ModelBlock} toBeRemoved block that should be removed
* @param toBeRemoved block that should be removed
*/
public void removeBlock(ModelBlock toBeRemoved){
this.blocks.remove(toBeRemoved);
Expand All @@ -178,7 +178,7 @@ public void removeBlock(ModelBlock toBeRemoved){
*
* TODO: remove debug print statements
*
* @param {ModelBlock} toBeAdded the block which should be added
* @param toBeAdded the block which should be added
*/
public void addBlock(ModelBlock toBeAdded){
System.out.println("here");
Expand Down Expand Up @@ -240,7 +240,7 @@ else if(current.getPos().getDistance(block.getPos()) < closest.getPos().getDista
* Note that the blocks list has to be traversed in reverse
* order due to rendering (ask Bert if unclear)
*
* @param {Location} eventLocation location of the mouseDown event
* @param eventLocation location of the mouseDown event
* @return block to be returned
*/
public ModelBlock handleMouseDown(Location eventLocation){
Expand All @@ -259,8 +259,8 @@ public ModelBlock handleMouseDown(Location eventLocation){
*
* TODO: remove debug print statements
*
* @param {Location} the location of the mouseUp event
* @param {ModelBlock} activeBlock the current active block
* @param eveLocation the location of the mouseUp event
* @param activeB activeBlock the current active block
*/
public void handleMouseUp(Location eveLocation, ModelBlock activeB){
this.addBlock(activeB);
Expand Down
2 changes: 1 addition & 1 deletion src/model/blocks/LeftPlug.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface LeftPlug {

/**
*
* @param {ModelBlock} blk the block to attach to the left plug
* @param blk the block to attach to the left plug
*/
public void setLeftPlug(ModelBlock blk);

Expand Down
8 changes: 5 additions & 3 deletions src/model/blocks/ModelBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import java.util.ArrayList;

import utilities.*;
import model.*;
import utilities.Blocktype;
import utilities.Location;

/**
* Abstract representation of a block that can be placed from the palette onto the program area.
*/
Expand Down Expand Up @@ -55,8 +57,8 @@ public boolean isHighlighted(){
/**
* Removes duplicate modelblocks from the list
*
* @param {ArrayList<ModelBlock>} list List with duplicates to remove
* @return {ArrayList<ModelBlock>} list without duplicates
* @param list List with duplicates to remove
* @return list without duplicates
*/
public static ArrayList<ModelBlock> removeDuplicates(ArrayList<ModelBlock> list)
{
Expand Down
2 changes: 1 addition & 1 deletion src/model/blocks/ModelMoveBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void disconnect() {
/**
* Method describing how a block will connect to another block.
*
* @param {ModelBlock} block Block
* @param block Block
*/
@Override
public void connect(ModelBlock block) {
Expand Down
2 changes: 1 addition & 1 deletion src/model/blocks/RightSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface RightSocket {

/**
*
* @param {ModelBlock} blk the block to attach to the right socket
* @param blk the block to attach to the right socket
*/
public void setRightSocket(ModelBlock blk);

Expand Down
2 changes: 1 addition & 1 deletion src/model/blocks/TopSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface TopSocket {

/**
*
* @param {ModelBlock} blk the block to attach to the top socket
* @param blk the block to attach to the top socket
*/
public void setTopSocket(ModelBlock blk);

Expand Down
2 changes: 1 addition & 1 deletion src/ui/UIElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Location getPos(){
* at the highest y-coordinate and then the leftmost
* x-coordinate
*
* @param {Location} Pos the new position of the UI Element
* @param Pos the new position of the UI Element
*/
public void setPos(Location Pos) {
this.pos = Pos;
Expand Down
14 changes: 7 additions & 7 deletions src/ui/UIGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public UIGrid(Location position, int width, int height, int cellSize, ArrayList<
/**
* Sets the robot's new location {@link #robotLocation}
*
* @param {Location} newRobotLocation Location the robot should now have
* @param newRobotLocation Location the robot should now have
*/
public void updateRobotLocation(Location newRobotLocation){
System.out.println("moving robot in UI");
Expand All @@ -47,7 +47,7 @@ public void updateRobotLocation(Location newRobotLocation){
/**
* Sets the robot's new direction {@link #robotDirection}
*
* @param {Direction} newRobotDirection Direction the robot should now have
* @param newRobotDirection Direction the robot should now have
*/
public void updateRobotDirection(Direction newRobotDirection){
this.robotDirection = newRobotDirection;
Expand All @@ -73,9 +73,9 @@ public void render(Graphics g) {


/**
* This function renders the grid itself (e.g. the raster lines, given by {@link #dimension})
* This function renders the grid itself (e.g. the raster lines, given by dimension)
*
* @param {Graphics} g The Graphics object on which the rendering happens
* @param g The Graphics object on which the rendering happens
*/
public void renderGrid(Graphics g) {
g.setColor(Color.GRAY);
Expand All @@ -90,7 +90,7 @@ public void renderGrid(Graphics g) {
/**
* This function renders all the walls (stored in {@link #walls}) on the grid
*
* @param {Graphics} g The Graphics object on which the rendering happens
* @param g The Graphics object on which the rendering happens
*/
public void renderWalls(Graphics g) {
g.setColor(Color.BLACK);
Expand All @@ -102,7 +102,7 @@ public void renderWalls(Graphics g) {
/**
* This function renders the goal cell (stored in {@link #goalCell}) on the grid
*
* @param {Graphics} g The Graphics object on which the rendering happens
* @param g The Graphics object on which the rendering happens
*/
public void renderGoalCell(Graphics g) {
g.setColor(Color.YELLOW);
Expand All @@ -114,7 +114,7 @@ public void renderGoalCell(Graphics g) {
* This function renders the robot (with direction stored in {@link #robotDirection}
* and location stored in {@link #robotLocation}) on the grid
*
* @param {Graphics} g The Graphics object on which the rendering happens
* @param g The Graphics object on which the rendering happens
*/
public void renderRobot(Graphics g) {
g.setColor(Color.RED);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/blocks/UIBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void renderInnerBlock(Graphics g){
/**
* This function renders the block
*
* @param {Graphics} g The Graphics object on which the block is rendered
* @param g The Graphics object on which the block is rendered
*/
public void render(Graphics g){

Expand Down

0 comments on commit 4c72fe5

Please sign in to comment.