예제 #1
0
  private void loadRestartOptions(CCXMLElement theRestartOptionsXML) {
    if (theRestartOptionsXML == null) return;

    CCXMLElement myMinFrameRateXML = theRestartOptionsXML.child("minFrameRate");
    if (myMinFrameRateXML != null) {
      addCommandHandler(
          "-frameRate", new CCWatchDogFrameRateRestart(myMinFrameRateXML.floatContent()));
    }
    CCXMLElement myMaxOffTimeXML = theRestartOptionsXML.child("maxOffTime");
    if (myMaxOffTimeXML != null) {
      _myMaxOffTime = myMaxOffTimeXML.intContent();
    }
  }
예제 #2
0
  CCColladaSource(CCXMLElement theSourceXML) {
    _myID = theSourceXML.attribute("id");
    CCXMLElement myAccessorXML = theSourceXML.child("technique_common/accessor");
    String myType = myAccessorXML.child("param").attribute("type");

    if (myType.contains("float")) {
      String[] myFloatArray = theSourceXML.child("float_array").content().split("\\s");
      int myCount = myAccessorXML.intAttribute("count");
      _myStride = myAccessorXML.intAttribute("stride", 1);

      _myPointMatrix = new float[myCount][_myStride];

      for (int i = 0, k = 0; i < myCount; i++) {
        for (int j = 0; j < _myStride; j++, k++) {
          _myPointMatrix[i][j] = Float.parseFloat(myFloatArray[k]);
        }
      }
    } else if (myType.equals("name")) {
      _myStringValues = theSourceXML.child("Name_array").content().split("\\s");
    }
  }
예제 #3
0
  private void loadSettings(final String theFile) {
    CCXMLElement myProcessXML = CCXMLIO.createXMLElement(CCNIOUtil.dataPath(theFile));
    System.out.println(CCNIOUtil.dataPath(theFile));
    CCXMLElement myStartTimeXML = myProcessXML.child("starttime");
    if (myStartTimeXML != null) _myStartTime = myStartTimeXML.intContent(0);

    CCXMLElement myRestartTimeXML = myProcessXML.child("restarttime");
    if (myRestartTimeXML != null) _myRestartTime = myRestartTimeXML.intContent(0);

    CCXMLElement myClassNameXML = myProcessXML.child("class");
    if (myClassNameXML == null)
      throw new RuntimeException("You have to define a class to start inside the process.xml!");
    _myClassName = myClassNameXML.content();

    CCXMLElement myClassPathXML = myProcessXML.child("classpath");
    if (myClassPathXML == null)
      throw new RuntimeException("You have to define a classpath inside the process.xml!");

    for (CCXMLElement myLibXML : myClassPathXML) {
      _myLibraries.add(myLibXML.content());
    }

    CCXMLElement myVMParametersXML = myProcessXML.child("vm_options");
    if (myVMParametersXML != null) {
      for (CCXMLElement myVMParameterXML : myVMParametersXML) {
        _myVirtualMachineOptions.add(myVMParameterXML.content());
      }
    }

    loadRestartOptions(myProcessXML.child("restart"));
  }