/** * removes a user from the user list * * @param un the name of the user to be removed */ public void userDel(String un) { users.remove(users.indexOf(un)); if (ignores.contains(un)) { ignores.remove(ignores.indexOf(un)); } if (afks.contains(un)) { afks.remove(afks.indexOf(un)); } if (admins.contains(un)) { admins.remove(admins.indexOf(un)); } updateList(); serverMessage(un + " has left " + server.channel); privates.serverMessage(un, un + " has left"); }
// Checks whether a person is in the ArrayList that tracks all persons to be plotted public boolean isSelected(Person person) { if (selected.indexOf(person) != -1) { return true; } else { return false; } }
public void drawCluster(Cluster cluster) { int index = clusters.indexOf(cluster); if (index != -1) { cluster.y = maxY; cluster.x = minX + index * factor; if (cluster.size() > 1) g.setColor(Color.RED); else g.setColor(Color.BLACK); g.drawRect(cluster.x - 1, cluster.y - cluster.size(), 2, 1 + cluster.size()); } else { Cluster left = cluster.getLeft(); Cluster right = cluster.getRight(); drawCluster(left); drawCluster(right); int yBar = minY + (int) ((maxY - minY) * (cluster.getSimilarity() / threshold)); g.setColor(Color.DARK_GRAY); if (left.y > yBar) { g.drawLine(left.x, left.y - 1, left.x, yBar); writeMap(left, yBar); } if (right.y > yBar) { g.drawLine(right.x, right.y - 1, right.x, yBar); writeMap(right, yBar); } g.setColor(Color.BLACK); g.drawLine(left.x, yBar, right.x, yBar); cluster.x = (right.x + left.x) / 2; cluster.y = yBar; } }
/** * changes the name of a user, updating list of admins, afks, ignoes, and master user list * * @param on old username * @param nn new username */ public void rename(String on, String nn) { if (admins.contains(on)) { admins.remove(admins.indexOf(on)); admins.add(nn); } if (afks.contains(on)) { afks.remove(afks.indexOf(on)); afks.add(nn); } if (ignores.contains(on)) { ignores.remove(ignores.indexOf(on)); ignores.add(nn); } users.remove(on); users.add(nn); updateList(); serverMessage(on + " renamed to " + nn); }
// Mutators public void vote(String candidate) { // update the array of votes to reflect the user selection int index = _candidates.indexOf(candidate); if (index != -1) { _votes[index]++; System.out.println("Voted for: " + _candidates.get(index)); System.out.println("Current votes: " + _votes[index]); } else { System.out.println("No vote"); } }
private ProgressIndicatorEx removeFromMaps(@NotNull InlineProgressIndicator progress) { final ProgressIndicatorEx original = myInline2Original.get(progress); myInline2Original.remove(progress); myOriginal2Inlines.remove(original, progress); if (myOriginal2Inlines.get(original) == null) { final int originalIndex = myOriginals.indexOf(original); myOriginals.remove(originalIndex); myInfos.remove(originalIndex); } return original; }
// Accessors public int getIndex(String candidate) { return _candidates.indexOf(candidate); }
public int indexOf(Figure figure) { return children.indexOf(figure); }
public void setEnabled(String strTxt, boolean bEnabled) { if (m_aListValues != null && m_aListValues.contains(strTxt)) { setEnabled(m_aListValues.indexOf(strTxt), bEnabled); } }
// Returns the index of a person in the Arraylist that tracks all persons to be plotted public int getSelectedIndex(Person person) { return selected.indexOf(person); }
/* space ship has died from some sort of collision */ public void kill(ArrayList movingObjects) { int index = movingObjects.indexOf(this); movingObjects.remove(index); }