public SolverViewFrame(Frame frame) { identifierChooser = new JComboBoxEx(); for (CharacterFacade pcf : CharacterManager.getCharacters()) { String pcname = pcf.getNameRef().get(); CharID id = pcf.getCharID(); identifierChooser.addItem(new PCRef(pcname, id)); } identifierChooser.addActionListener(new IdentifierActionListener()); objectChooser = new JComboBoxEx(); objectChooser.addActionListener(new ObjectActionListener()); scopeChooser = new JComboBoxEx(); scopeChooser.addActionListener(new ScopeActionListener()); identifierChooser.setSelectedItem(identifierChooser.getItemAt(0)); scopeChooser.setSelectedItem(scopeChooser.getItemAt(0)); varName = new JTextField(); varName.setText(varNameText); varName.getDocument().addDocumentListener(new VarNameListener()); initialize(); objectChooser.setSelectedItem(objectChooser.getItemAt(0)); }
private boolean isCompanionOpen(CompanionFacade companion) { File compFile = companion.getFileRef().getReference(); if (compFile == null) { return true; } for (CharacterFacade character : CharacterManager.getCharacters()) { File charFile = character.getFileRef().getReference(); if (compFile.equals(charFile)) { return true; } } return false; }