use of jack.rm.data.romset.MyGameSetFeatures in project rom-manager by Jakz.
the class InfoPanel method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == downloadButton) {
try {
MyGameSetFeatures helper = set.helper();
Set<RomDownloaderPlugin> downloaders = helper.settings().plugins.getEnabledPlugins(PluginRealType.ROM_DOWNLOADER);
URL url = downloaders.stream().filter(p -> p.isPlatformSupported(set.platform())).findFirst().get().getDownloadURL(set.platform(), game);
Desktop.getDesktop().browse(url.toURI());
} catch (Exception ee) {
ee.printStackTrace();
}
} else if (src == openFolderButton) {
Main.openFolder(game.rom().handle().path().getParent().toFile());
// TODO: Main.openFolder(rom.getHandle().path().getParent().toFile());
} else if (src == openArchiveButton) {
// TODO: Main.openFolder(rom.getHandle().path().toFile());
} else if (src == assetsButton) {
if (game != null)
Main.downloader.downloadArt(game);
}
}
use of jack.rm.data.romset.MyGameSetFeatures in project rom-manager by Jakz.
the class MenuListener method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
JMenuItem item = (JMenuItem) source;
MenuElement tag = MenuElement.elementForItem(item);
MyGameSetFeatures helper = Main.current.helper();
try {
if (tag == MenuElement.ROMS_SCAN_FOR_ROMS) {
helper.scanner().scanForRoms(true);
Main.mainFrame.rebuildGameList();
} else if (tag == MenuElement.ROMS_SCAN_FOR_NEW_ROMS) {
helper.scanner().scanForRoms(false);
Main.mainFrame.rebuildGameList();
} else {
// StringManager.loadLanguage(((JMenuItem)source).getText());
}
} catch (IOException ee) {
ee.printStackTrace();
}
}
use of jack.rm.data.romset.MyGameSetFeatures in project rom-manager by Jakz.
the class PatternRenamerPanel method updateFields.
public void updateFields() {
MyGameSetFeatures helper = getGameSet().helper();
patternField.setText(helper.settings().renamingPattern);
patterns.clear();
helper.settings().getRenamingPatterns().forEach(patterns::add);
// TODO: should be invoked even when plugins are changed
}
use of jack.rm.data.romset.MyGameSetFeatures in project rom-manager by Jakz.
the class PatternRenamerPanel method caretUpdate.
@Override
public void caretUpdate(CaretEvent e) {
MyGameSetFeatures helper = getGameSet().helper();
helper.settings().renamingPattern = patternField.getText();
exampleField.setText(getGameSet().getAny().getCorrectName());
}
use of jack.rm.data.romset.MyGameSetFeatures in project rom-manager by Jakz.
the class InfoPanel method updateFields.
public void updateFields(Game game) {
this.game = game;
attachments.setRom(game);
clonesTable.update(game);
romTable.update(game);
this.setVisible(true);
for (AttributeField field : fields) {
try {
field.setValue(game);
} catch (NullPointerException e) {
field.clear();
// throw new RuntimeException(String.format("Attribute %s of %s is null", field.attrib.name(), rom.getTitle()));
}
}
if (game != null) {
for (AssetImage image : images) setImage(game, image.asset, image.image);
buttons[4].setEnabled(game.getStatus() != GameStatus.MISSING);
// TODO: missing management for INCOMPLETE
if (game.getStatus() == GameStatus.MISSING) {
buttons[2].setEnabled(false);
buttons[3].setEnabled(false);
MyGameSetFeatures helper = set.helper();
buttons[0].setEnabled(helper.settings().hasDownloader(set.platform()));
} else {
buttons[3].setEnabled(true);
// TODO: different management for multiple roms per game
/*if (game.getHandle().isArchive())
openArchiveButton.setEnabled(true);*/
buttons[0].setEnabled(false);
}
}
buttons[1].setEnabled(game != null && !game.hasAllAssets());
}
Aggregations