public Object next() { return self.getElementAt(index++); }
/** * Returns current templates list. * * @return templates list */ public List<IgnoreSettings.UserTemplate> getList() { ArrayList<IgnoreSettings.UserTemplate> list = ContainerUtil.newArrayList(); for (int i = 0; i < myListModel.size(); i++) { list.add(myListModel.getElementAt(i)); } return list; }
/** * Returns the component at the specified index. * * @param index an index into this list * @return the component at the specified index * @throws ArrayIndexOutOfBoundsException */ @Override public Object getElementAt(int index) { return ((CheckBoxListItem) super.getElementAt(index));//.getContent(); }
/** * sets the checked state of the element at the given index * * @param index the index of the element to set the checked state for * @param checked the new checked state */ public void setChecked(int index, boolean checked) { ((CheckBoxListItem) super.getElementAt(index)).setChecked(checked); } }
/** * returns the checked state of the element at the given index * * @param index the index of the element to return the checked state for * @return the checked state of the specifed element */ public boolean getChecked(int index) { return ((CheckBoxListItem) super.getElementAt(index)).getChecked(); }
item = comboModel.getElementAt(i).toString(); choiceItems.put(item, item); if (comboModel.getElementAt(i).toString().equals(item)) { combo.setSelectedIndex(i);
protected boolean exists(CharSequence nickname) { for (int i = 0; i < model.getSize(); i++) { final JLabel userLabel = (JLabel) model.getElementAt(i); if (userLabel.getText().equals(nickname.toString())) { return true; } } return false; }
/** Obsolete * @deprecated * @see #getCount * @see #getRoisAsArray */ public Hashtable getROIs() { Roi[] rois = getRoisAsArray(); Hashtable ht = new Hashtable(); for (int i=0; i<rois.length; i++) ht.put((String)listModel.getElementAt(i), rois[i]); return ht; }
/** Returns the name of the ROI with the specified index, or null if the index is out of range. */ public String getName(int index) { if (index>=0 && index<getCount()) return (String) listModel.getElementAt(index); else return null; }
public int getIndex(CharSequence name) { for (int i = 0; i < model.getSize(); i++) { JLabel label = (JLabel) model.getElementAt(i); if (label.getText().equals(name.toString())) { return i; } } return -1; }
/** * @param foundModel */ public void setSourceDirecs(DefaultListModel<String> foundModel) { for (int i = 0; i < foundModel.size(); i++) { this.sourceModel.addElement(foundModel.getElementAt(i)); } } }
private int getIndex(DefaultListModel model, String s) { for (int i = 0; i < model.getSize(); i++) { ListValue e = (ListValue) model.getElementAt(i); if(e.value.equals(s)) { return i; } } return -1; }
/** * Get the Selected Column */ public Vector getAvailableColumnNames(){ Vector columnNames = new Vector(); for (int i=0; i< availableColumnListModel.size(); i++){ //String columnName = selectedColumnListModel.getElementAt(i).toString(); columnNames.add(availableColumnListModel.getElementAt(i)); } return columnNames; }
@Override public void mouseClicked(MouseEvent e) { if( ! sendNow.isSelected() && e.getClickCount()==2) { int index = reportList.locationToIndex(e.getPoint()); final Report selected = (Report)reportModel.getElementAt(index); if(selected!=null) { relayStats(selected); } } } });
public Collection<String> getAll() { Collection<String> all = new HashSet<String>(); for (int i = 0; i < model.getSize(); i++) { CheckListItem item = (CheckListItem) model.getElementAt(i); all.add(item.toString()); } return all; } }
public boolean contains(String label) { if (label == null) { return false; } for (int i = 0; i < model.getSize(); i++) { CheckListItem item = (CheckListItem) model.getElementAt(i); if (label.equals(item.toString())) { return true; } } return false; }
public void mouseEntered(MouseEvent e) { int loc = contactItemList.locationToIndex(e.getPoint()); Object o = model.getElementAt(loc); if (!(o instanceof ContactItem)) { return; } contactItemList.setCursor(GraphicUtils.HAND_CURSOR); }
public InternalHandle getSelectedHandle() { synchronized (model) { int select = selectionModel.getMinSelectionIndex(); if (select != -1) { if (select >= 0 && select < model.size()) { return (InternalHandle) model.getElementAt(select); } } } return null; }
public void setChecked(String label, boolean isChecked) { if (label != null) { for (int i = 0; i < model.getSize(); i++) { CheckListItem item = (CheckListItem) model.getElementAt(i); if (label.equals(item.toString())) { item.setSelected(isChecked); break; } } } }
/** Deselect the specified ROI if it is the only one selected. */ public void deselect(Roi roi) { int[] indexes = getSelectedIndexes(); if (indexes.length==1 && listModel.getSize()>0) { String label = (String)listModel.getElementAt(indexes[0]); if (label.equals(roi.getName())) { deselect(); repaint(); } } }