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

convex.gui.manager.windows.actor.ActorInvokePanel Maven / Gradle / Ivy

There is a newer version: 0.7.15
Show newest version
package convex.gui.manager.windows.actor;

import java.awt.BorderLayout;

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

import convex.core.data.ASet;
import convex.core.data.AccountStatus;
import convex.core.data.Address;
import convex.core.data.Symbol;
import convex.gui.components.AccountChooserPanel;
import convex.gui.components.ScrollyList;
import convex.gui.manager.PeerGUI;

@SuppressWarnings("serial")
public class ActorInvokePanel extends JPanel {

	protected PeerGUI manager;
	protected Address contract;
	AccountChooserPanel execPanel = new AccountChooserPanel();

	DefaultListModel exportList = new DefaultListModel();

	public ActorInvokePanel(PeerGUI manager, Address contract) {
		this.manager = manager;
		this.contract = contract;

		setLayout(new BorderLayout());

		AccountStatus as = PeerGUI.getLatestState().getAccount(contract);
		ASet exports = as.getCallableFunctions();
		for (Symbol s : exports) {
			exportList.addElement(s);
		}

		ScrollyList scrollyList = new ScrollyList(exportList,
				sym -> new SmartOpComponent(this, contract, sym));
		add(scrollyList, BorderLayout.CENTER);

		add(execPanel, BorderLayout.NORTH);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy