private void useButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useButtonActionPerformed
// Find the selected avatar. If the avatar does not require high-res
// graphics, then simply set the avatar in use and return.
AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
if (avatar.isHighResolution() == false) {
registry.setAvatarInUse(avatar, false);
return;
}
if (!AvatarImiJME.supportsHighQualityAvatars()) {
String msg = "Unfortunately your system graphics does not" +
" support the shaders which are required to use" +
" this avatar";
String title = "Advanced Shaders Required";
JFrame frame = JmeClientMain.getFrame().getFrame();
JOptionPane.showMessageDialog(frame, msg, title, JOptionPane.ERROR_MESSAGE);
return;
}
// Tell the server to use the selected avatar. Since the Use button is
// only enabled when an item is selected, we assume something is
// selected in the list. At this point, we also know the graphics system
// supports the avatar, if high-res.
registry.setAvatarInUse(avatar, false);
}//GEN-LAST:event_useButtonActionPerformed