use of org.magic.gui.models.CardsShakerTableModel in project MtgDesktopCompanion by nicho92.
the class BestTrendingDashlet method initGUI.
@Override
public void initGUI() {
JPanel panneauHaut = new JPanel();
getContentPane().add(panneauHaut, BorderLayout.NORTH);
Action a = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
init();
}
};
boxS = new JCheckBox();
boxS.setAction(a);
boxS.setText("STD");
boxM = new JCheckBox();
boxM.setAction(a);
boxM.setText("MDN");
boxL = new JCheckBox();
boxL.setAction(a);
boxL.setText("LEG");
boxV = new JCheckBox("V");
boxV.setAction(a);
boxV.setText("VIN");
spinner = new JSpinner();
spinner.addChangeListener(ce -> init());
spinner.setModel(new SpinnerNumberModel(5, 1, null, 1));
panneauHaut.add(spinner);
panneauHaut.add(boxS);
panneauHaut.add(boxM);
panneauHaut.add(boxL);
panneauHaut.add(boxV);
JScrollPane scrollPane = new JScrollPane();
getContentPane().add(scrollPane, BorderLayout.CENTER);
modStandard = new CardsShakerTableModel();
table = new JXTable(modStandard);
scrollPane.setViewportView(table);
initToolTip(table, 0, 1);
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 {
spinner.setValue(Integer.parseInt(getProperty("LIMIT", "5")));
} catch (Exception e) {
logger.error("can't get LIMIT value", e);
}
try {
boxS.setSelected(Boolean.parseBoolean(getProperty("STD", "false")));
boxM.setSelected(Boolean.parseBoolean(getProperty("MDN", "true")));
boxL.setSelected(Boolean.parseBoolean(getProperty("LEG", "false")));
boxV.setSelected(Boolean.parseBoolean(getProperty("VIN", "false")));
} catch (Exception e) {
logger.error("can't get LIMIT value", e);
}
setBounds(r);
}
setVisible(true);
}
use of org.magic.gui.models.CardsShakerTableModel in project MtgDesktopCompanion by nicho92.
the class TrendingDashlet method initGUI.
public void initGUI() {
JButton btnRefresh;
JPanel panel;
JPanel panneauHaut = new JPanel();
getContentPane().add(panneauHaut, BorderLayout.NORTH);
cboFormats = new JComboBox<>(new DefaultComboBoxModel<FORMAT>(FORMAT.values()));
cboFormats.addItemListener(ie -> init());
panneauHaut.add(cboFormats);
lblLoading = new JLabel("");
lblLoading.setIcon(MTGConstants.ICON_LOADING);
lblLoading.setVisible(false);
btnRefresh = new JButton("");
btnRefresh.addActionListener(ae -> init());
btnRefresh.setIcon(MTGConstants.ICON_REFRESH);
panneauHaut.add(btnRefresh);
panneauHaut.add(lblLoading);
JScrollPane scrollPane = new JScrollPane();
getContentPane().add(scrollPane, BorderLayout.CENTER);
modStandard = new CardsShakerTableModel();
table = new JXTable();
scrollPane.setViewportView(table);
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 {
cboFormats.setSelectedItem(FORMAT.valueOf(getProperty("FORMAT")));
} catch (Exception e) {
MTGLogger.printStackTrace(e);
}
setBounds(r);
}
new TableFilterHeader(table, AutoChoices.ENABLED);
initToolTip(table, 0, 1);
panel = new JPanel();
getContentPane().add(panel, BorderLayout.SOUTH);
lblInfoUpdate = new JLabel("");
panel.add(lblInfoUpdate);
setVisible(true);
}
Aggregations