コード例 #1
0
  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);
  }
コード例 #2
0
 public void setPresets(CCObjectPropertyHandle theObjectHandle) {
   _myPresetsPath = theObjectHandle.presetPath();
   CCNIOUtil.createDirectories(_myPresetsPath);
   _myPresetList.removeAllItems();
   for (Path myPath : CCNIOUtil.list(_myPresetsPath, "json")) {
     _myPresetList.addItem(CCNIOUtil.fileName(myPath.getFileName().toString()));
   }
 }