Package nodebox.client

Source Code of nodebox.client.PortPane

package nodebox.client;

import nodebox.ui.NButton;
import nodebox.ui.Pane;
import nodebox.ui.PaneHeader;
import nodebox.ui.PaneView;

import java.awt.*;

public class PortPane extends Pane {

    private final PaneHeader paneHeader;
    private final PortView portView;
    private final NodeBoxDocument document;

    public PortPane(NodeBoxDocument document) {
        this.document = document;
        setLayout(new BorderLayout());
        paneHeader = new PaneHeader("Ports");
        NButton metadataButton = new NButton("Metadata", getClass().getResourceAsStream("/port-metadata.png"));
        metadataButton.setActionMethod(this, "editMetadata");
        paneHeader.add(metadataButton);
        portView = new PortView(this, document);
        add(paneHeader, BorderLayout.NORTH);
        add(portView, BorderLayout.CENTER);
    }

    public PortView getPortView() {
        return portView;
    }

    public Pane duplicate() {
        return new PortPane(document);
    }

    public PaneHeader getPaneHeader() {
        return paneHeader;
    }

    public PaneView getPaneView() {
        return portView;
    }

    public void editMetadata() {
        document.editMetadata();
    }

    public void setHeaderTitle(String title) {
        paneHeader.setTitle(title);
    }

}
TOP

Related Classes of nodebox.client.PortPane

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.