/** * method that will be called when mouse releases * @param point , the point mouse release at */ public void onMouseRelease(Location point) { isGrabbed = false; if(!success){ for(Piece p: bp){ //if correctly matched if(p.contains(grabbedPiece.getCenter()) && p.equals(grabbedPiece)){ grabbedPiece.hide(); p.show(); p.showHighlight(Color.GREEN); lockedBP[p.getId()] = true; //check if all pieces are matched boolean check = true; for(boolean b: lockedBP){ check = check && b; } if(check){ success = true; for(Piece piece: bp){ piece.hideHighlight(); } text.show(); } } } } }
/** * method that will be called when mouse enters the boundary * @param point , the point mouse enter at */ public void onMouseEnter(Location point){ instr1.show(); instr2.show(); instr3.show(); }