use of org.magic.gui.models.CardDominanceTableModel in project MtgDesktopCompanion by nicho92.
the class BestCardsDashlet method initGUI.
@Override
public void initGUI() {
JPanel panneauHaut = new JPanel();
getContentPane().add(panneauHaut, BorderLayout.NORTH);
cboFormat = new JComboBox<>();
cboFormat.setModel(new DefaultComboBoxModel<>(FORMAT.values()));
panneauHaut.add(cboFormat);
cboFilter = new JComboBox<>();
cboFilter.setModel(new DefaultComboBoxModel<>(MTGControler.getInstance().getEnabledDashBoard().getDominanceFilters()));
panneauHaut.add(cboFilter);
lblLoading = new JLabel("");
lblLoading.setIcon(MTGConstants.ICON_LOADING);
panneauHaut.add(lblLoading);
JScrollPane scrollPane = new JScrollPane();
getContentPane().add(scrollPane, BorderLayout.CENTER);
models = new CardDominanceTableModel();
table = new JXTable(models);
scrollPane.setViewportView(table);
initToolTip(table, 0, null);
cboFormat.addActionListener(ae -> init());
cboFilter.addActionListener(ae -> init());
if (getProperties().size() > 0) {
Rectangle r = new Rectangle((int) Double.parseDouble(getProperty("x")), (int) Double.parseDouble(getProperty("y")), (int) Double.parseDouble(getProperty("w")), (int) Double.parseDouble(getProperty("h")));
try {
cboFormat.setSelectedItem(getProperty("FORMAT", "standard"));
cboFilter.setSelectedItem(getProperty("FILTER", "all"));
} catch (Exception e) {
logger.error("can't get value", e);
}
setBounds(r);
}
setVisible(true);
}
Aggregations