コード例 #1
0
ファイル: CompanionInfoTab.java プロジェクト: kne1p/pcgen
 @Override
 public boolean accept(String context, CompanionStubFacade element) {
   if (context == null) {
     return true;
   }
   return context.equals(element.getCompanionType());
 }
コード例 #2
0
ファイル: CompanionInfoTab.java プロジェクト: kne1p/pcgen
 @Override
 public void actionPerformed(ActionEvent e) {
   if (!"null".equals(e.getActionCommand())) {
     if ("SELECT".equals(e.getActionCommand()) || (JTreeTable.ACTION_DOUBLECLICK == e.getID())) {
       newCompanion =
           CharacterManager.createNewCharacter(
               character.getUIDelegate(), character.getDataSet());
       CompanionStubFacade selected = (CompanionStubFacade) raceTable.getSelectedObject();
       newCompanion.setRace(selected.getRaceRef().getReference());
       character.getCompanionSupport().addCompanion(newCompanion, companionType);
       setVisible(false);
     } else {
       newCompanion = null;
       setVisible(false);
     }
   }
 }