コード例 #1
0
 /*-------------------------------------------------------------------------*/
 public PlayerCharacter getSelected() {
   if (list.getSelected() == null) {
     return null;
   } else {
     return ((GuildCharacter) list.getSelected()).pc;
   }
 }
コード例 #2
0
 /*-------------------------------------------------------------------------*/
 public void processKeyPressed(KeyEvent e) {
   switch (e.getKeyCode()) {
     case KeyEvent.VK_UP:
     case KeyEvent.VK_DOWN:
       list.processKeyPressed(e);
       break;
     default: // no op
   }
 }
コード例 #3
0
 /*-------------------------------------------------------------------------*/
 public void refresh() {
   if (list.getItems().size() > 0) {
     list.setSelected(list.getItems().get(0));
   }
 }
コード例 #4
0
 /*-------------------------------------------------------------------------*/
 public void add(PlayerCharacter pc) {
   characters.add(pc);
   list.setItems(getGuildCharactersList(characters));
 }
コード例 #5
0
 /*-------------------------------------------------------------------------*/
 public void remove(PlayerCharacter pc) {
   characters.remove(pc);
   list.setItems(getGuildCharactersList(characters));
   list.setSelected(null);
 }