use of net.technicpack.platform.io.FeedItem in project LauncherV3 by TechnicPack.
the class ModpackInfoPanel method setModpack.
public void setModpack(ModpackModel modpack) {
for (ActionListener listener : playButton.getActionListeners()) {
listener.actionPerformed(new ActionEvent(modpack, 0, ""));
}
modpackRefreshListener.actionPerformed(new ActionEvent(modpack, 0, ""));
this.modpack = modpack;
banner.setModpack(modpack);
dataDisplay.setModpack(modpack);
deleteButton.setVisible(modpack.getInstalledPack() != null);
ImageJob<ModpackModel> job = backgroundRepo.startImageJob(modpack);
job.addJobListener(this);
background.setImage(job.getImage());
feedGallery.removeAll();
ArrayList<FeedItem> feed = modpack.getFeed();
if (feed != null) {
for (int i = 0; i < feed.size(); i++) {
FeedItem item = feed.get(i);
FeedItemView itemView = new FeedItemView(resources, item, avatarRepo.startImageJob(item.getAuthorship()));
itemView.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
clickFeedItem((FeedItemView) e.getSource(), e.getActionCommand());
}
});
feedGallery.add(itemView);
}
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
repaint();
}
});
}
Aggregations