Exemplo 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();
    }
  }
Exemplo 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);
 }
Exemplo n.º 3
0
 public String getSelectedVariable() {
   return (String) (mList.getSelectedValue());
 }
Exemplo n.º 4
0
 public void setSelectedLine(int line) {
   mList.setSelectedIndex(line);
 }