Package com.neophob.sematrix.core.properties

Examples of com.neophob.sematrix.core.properties.ValidCommands


                System.out.println("Unknown Command: "+ArrayUtils.toString(args));
                System.out.println("Exit now");
                throw new IllegalArgumentException("no ValidCommand specified!");
            }
           
            ValidCommands parsedCommand = ValidCommands.valueOf(pCmd.toUpperCase());
            String[] otherArgs = parser.getRemainingArgs();
           
            if (parsedCommand.getNrOfParams() < otherArgs.length) {
              String err = "Invalid parameter count, expected: "+parsedCommand.getNrOfParams()+", provided: "+otherArgs.length;
              System.out.println(err);
              throw new InvalidParameterException(err);
            }
           
            String param = "";
View Full Code Here


    }
               
    int msgLength = msg.length-1;
    int tmp;   
    try {
      ValidCommands cmd = ValidCommands.valueOf(msg[0]);
      Collector col = Collector.getInstance();
      switch (cmd) {
      case CHANGE_GENERATOR_A:
        try {
          int nr = col.getCurrentVisual();
View Full Code Here

  @Override
  public void updateGuiElements(Map<String, String> diff) {
    for (Map.Entry<String, String> s: diff.entrySet()) {
      try {
        ValidCommands cmd = ValidCommands.valueOf(s.getKey());
        switch (cmd) {
        case CHANGE_GENERATOR_A:         
          generatorListOne.setLabel(generatorListOne.getItem(Integer.parseInt(s.getValue())).getName());         
          break;
View Full Code Here

      return;
    }
   
    String pattern = oscIn.getPattern();
   
    ValidCommands command;   
    try {
      command = ValidCommands.valueOf(pattern);
    } catch (Exception e) {
      LOG.log(Level.WARNING, "Unknown message: "+pattern, e);
      return;     
    }
   
    String[] msg = new String[1+command.getNrOfParams()];
    msg[0] = pattern;
   
    if (oscIn.getBlob()==null && command.getNrOfParams()>0 &&
        command.getNrOfParams()!=oscIn.getArgs().length) {
      String args = oscIn.getArgs()==null ? "null" : ""+oscIn.getArgs().length;
      LOG.log(Level.WARNING, "Parameter cound missmatch, expected: {0} available: {1} ",
          new String[]{""+command.getNrOfParams(), ""+args});
      return;
    }
   
    //ignore nr of parameter for osc generator
    if (command != ValidCommands.OSC_GENERATOR1 && command != ValidCommands.OSC_GENERATOR2) {     
      for (int i=0; i<command.getNrOfParams(); i++) {
        msg[1+i] = oscIn.getArgs()[i];
      }     
    }

    LOG.log(Level.INFO, "Recieved OSC message: {0}", msg);
View Full Code Here

        ValidCommands[] allCommands = ValidCommands.values();
        Random r = new Random();
        System.out.println("Start fuzzing");
       
        for (int i=0; i<100000; i++) {
            ValidCommands cmd = allCommands[r.nextInt(allCommands.length)];
            String[] param = new String[2];
            param[0] = cmd.toString();
           
            if (i%3==0) {
                param[1] = ""+r.nextInt(512);
            } else if (i%3==1) {
                param[1] = ""+r.nextFloat();
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.properties.ValidCommands

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.