convex.gui.actor.AccountWindow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of convex-gui Show documentation
Show all versions of convex-gui Show documentation
Convex desktop GUI and test applications
The newest version!
package convex.gui.actor;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import convex.api.Convex;
import convex.core.State;
import convex.core.data.AccountStatus;
import convex.core.data.Address;
import convex.gui.components.AbstractGUI;
import convex.gui.models.StateModel;
import convex.gui.state.StateTreePanel;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
public class AccountWindow extends AbstractGUI {
Address account;
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
public AccountWindow(Convex convex,StateModel manager, Address account) {
super ("Account view - " + account);
this.account = account;
setLayout(new MigLayout());
AccountStatus as = manager.getValue().getAccount(account);
manager.addPropertyChangeListener(e -> {
});
add(tabbedPane, "dock center");
tabbedPane.add("Overview", new AccountInfoPanel(manager, account));
tabbedPane.add("Environment", new StateTreePanel((as==null)?null:as.getEnvironment()));
tabbedPane.add("Operations", new ActorInvokePanel(convex,manager, account));
}
@Override
public void setupFrame(JFrame frame) {
frame.getContentPane().setLayout(new MigLayout());
frame.getContentPane().add(this,"dock center");
}
}