src/tokenclustering/model/ClusteringAreaData.java
/**
     * Puts a token in this area in the given slot.
     * @param token The token to put.
     * @param slot The slot to put the token.
     * @return If its possible to put the token.
     */
Puts a token in this area in the given slot.
@param token The token to put.
@param slot The slot to put the token.
@return If its possible to put the token.
Puts a token in this area in the given slot . @param token The token to put . @param slot The slot to put the token . @return If its possible to put the token .
public boolean canPutToken(Token token, Slot slot) {
        if (this.getTokens().contains(token)) {
            return false;
        }
        for (int i = slot.getX(); i < slot.getX() + token.getWidth(); i++) {
            for (int j = slot.getY(); j < slot.getY() + token.getHeight(); j++) {
                if (this.occupiedSlots.contains(new Slot(i, j))) {
                    return false;
                }
            }
        }
        return true;
    }
public boolean canPutToken ( Token token , Slot slot ) { if ( this . getTokens ( ) . contains ( token ) ) { return false ; } for ( int i = slot . getX ( ) ; i < slot . getX ( ) + token . getWidth ( ) ; i ++ ) { for ( int j = slot . getY ( ) ; j < slot . getY ( ) + token . getHeight ( ) ; j ++ ) { if ( this . occupiedSlots . contains ( new Slot ( i , j ) ) ) { return false ; } } } return true ; }
Puts a token in this area in the given slot.
Puts a token in this area in the given slot .