Esempio n. 1
0
  private void buildList() {
    Vector<String> params = new Vector<String>();
    OpenDataFile of = (OpenDataFile) mFileViewer.mOpenFiles.currElement();
    Section sech = (Section) of.mSections.currElement();
    for (int i = 0; i < sech.getNumStnVars(); i++) {
      params.addElement(sech.getStnVar(i));
    }

    if (mList == null) {
      mList = new JOAJList(params);
    } else {
      mList.setListData(params);
      mList.invalidate();
    }
  }
Esempio n. 2
0
 public void init() {
   this.setLayout(new BorderLayout(5, 5));
   l1 = new JOAJLabel(mTitle, JOAJLabel.LEFT);
   this.add(l1, BorderLayout.NORTH);
   buildList();
   mList.setVisibleRowCount(mVisibleRows - 1);
   if (mAllowMultipleSelection) {
     mList.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   } else {
     mList.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
   }
   if (mProtoCell != null) {
     mList.setPrototypeCellValue(mProtoCell);
   } else {
     mList.setPrototypeCellValue("SALT                          ");
   }
   JScrollPane listScroller = new JScrollPane(mList);
   this.add(listScroller, BorderLayout.CENTER);
   mList.addListSelectionListener((ListSelectionListener) mComp);
 }
Esempio n. 3
0
 public String getSelectedVariable() {
   return (String) (mList.getSelectedValue());
 }
Esempio n. 4
0
 public void setSelectedLine(int line) {
   mList.setSelectedIndex(line);
 }