Esempio n. 1
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"));
  }
  private void createPresetCombo() {
    JLabel myTimelineLabel = new JLabel("timeline");
    myTimelineLabel.setFont(SwingGuiConstants.ARIAL_11);
    add(myTimelineLabel);
    CCNIOUtil.createDirectories(CCNIOUtil.dataPath("settings"));
    _myPresetList = new JComboBox<String>();
    _myPresetList.setEditable(true);

    _myPresetList.addItemListener(
        new ItemListener() {

          @Override
          public void itemStateChanged(ItemEvent theE) {
            if (_myEventPoint == null) return;
            switch (theE.getStateChange()) {
              case ItemEvent.SELECTED:
                _myEventPoint.content(
                    new TimedEventPointContent(_myPresetList.getSelectedItem().toString()));
                _myController.view().render();
                break;
            }
          }
        });

    CCUIStyler.styleTransportComponent(_myPresetList, 120, 20);
    _myPanel.add(_myPresetList);
  }