All Downloads are FREE. Search and download functionalities are using the official Maven repository.

convex.gui.actor.MarketsPanel Maven / Gradle / Ivy

The newest version!
package convex.gui.actor;

import java.awt.BorderLayout;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JPanel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import convex.api.ConvexLocal;
import convex.core.State;
import convex.core.data.Address;
import convex.gui.components.ActionPanel;
import convex.gui.components.ScrollyList;
import convex.gui.components.account.AccountChooserPanel;

/**
 * Panel displaying current prediction markets
 */
@SuppressWarnings("serial")
public class MarketsPanel extends JPanel {

	private static final Logger log = LoggerFactory.getLogger(MarketsPanel.class.getName());
	AccountChooserPanel acctChooser;
	private ConvexLocal manager;

	static DefaultListModel
marketList = new DefaultListModel
(); public MarketsPanel(ConvexLocal peer) { this.setLayout(new BorderLayout()); this.manager=peer; // =========================================== // Top panel acctChooser = new AccountChooserPanel(peer); this.add(acctChooser, BorderLayout.NORTH); // =========================================== // Central scrolling list ScrollyList
scrollyList = new ScrollyList
(marketList, addr -> new MarketComponent(this, addr)); add(scrollyList, BorderLayout.CENTER); // ============================================ // Action buttons ActionPanel actionPanel = new ActionPanel(); add(actionPanel, BorderLayout.SOUTH); JButton scanButton = new JButton("Scan"); actionPanel.add(scanButton); scanButton.addActionListener(e -> { log.info("Scanning for prediction market Actors..."); }); } public State getLatestState() { return manager.getState(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy