Search in sources :

Example 1 with MonitorPanel

use of org.apache.airavata.xbaya.ui.views.MonitorPanel in project airavata by apache.

the class XBayaGUI method initPane.

/**
 * Initializes the GUI.
 */
private void initPane() {
    Container contentPane = this.frame.getContentPane();
    // Error window
    this.errorWindow = new ErrorWindow(contentPane);
    contentPane.add(getToolbar().getSwingComponent(), BorderLayout.PAGE_START);
    this.portViewer = new PortViewer();
    this.componentViewer = new ComponentViewer();
    this.componentSelector = new ComponentSelector(this.engine);
    this.componentSelector.addComponentSelectorListener(this.componentViewer);
    this.monitorPane = new MonitorPanel(this, this.engine.getMonitor());
    compTreeXBayapanel = new ScrollPanel(this.componentSelector, ComponentSelector.TITLE);
    ScrollPanel compViewXBayaPanel = new ScrollPanel(this.componentViewer, ComponentViewer.TITLE);
    this.rightBottomTabbedPane = new JTabbedPane();
    this.rightBottomTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
    this.rightBottomTabbedPane.setPreferredSize(new Dimension(0, 200));
    this.rightBottomTabbedPane.addTab(PortViewer.TITLE, this.portViewer.getSwingComponent());
    this.rightBottomTabbedPane.addTab(MonitorPanel.TITLE, this.monitorPane.getSwingComponent());
    this.graphTabbedPane = new JTabbedPane();
    this.graphTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
    this.graphTabbedPane.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                toggleMaximizeGraphPanel();
            }
        }
    });
    this.graphTabbedPane.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent event) {
            // Called when the active tab changed.
            // Note that this is not called when a tab is removed.
            logger.debug(event.toString());
            XBayaGUI.this.activeTabChanged();
        }
    });
    this.leftSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
    this.rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
    this.mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.leftSplitPane, this.rightSplitPane);
    contentPane.add(this.mainSplitPane, BorderLayout.CENTER);
    this.leftSplitPane.setOneTouchExpandable(true);
    this.rightSplitPane.setOneTouchExpandable(true);
    this.mainSplitPane.setOneTouchExpandable(true);
    // this.leftSplitPane.setTopComponent(compTreeXBayapanel.getSwingComponent());
    // this.leftSplitPane.setTopComponent(new JCRBrowserPanel(engine));
    this.componentTabbedPane = new JTabbedPane();
    this.componentTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
    this.leftSplitPane.setTopComponent(this.componentTabbedPane);
    this.componentTabbedPane.add(this.compTreeXBayapanel.getSwingComponent());
    this.componentTabbedPane.setTitleAt(0, "Component");
    this.leftSplitPane.setBottomComponent(compViewXBayaPanel.getSwingComponent());
    this.rightSplitPane.setTopComponent(this.graphTabbedPane);
    this.rightSplitPane.setBottomComponent(this.rightBottomTabbedPane);
    this.leftSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
    this.rightSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
    // 
    // Adjust sizes
    // 
    // Need to pack the frame first to get the size of each component.
    this.frame.pack();
    final int leftPanelWidth = 250;
    final int portViewHight = 200;
    this.mainSplitPane.setDividerLocation(leftPanelWidth);
    this.leftSplitPane.setDividerLocation(0.5);
    this.leftSplitPane.setResizeWeight(0.5);
    this.rightSplitPane.setDividerLocation(this.rightSplitPane.getSize().height - portViewHight);
    // The bottom component to stay the same size
    this.rightSplitPane.setResizeWeight(1.0);
}
Also used : PortViewer(org.apache.airavata.xbaya.ui.views.PortViewer) MouseEvent(java.awt.event.MouseEvent) ComponentSelector(org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector) JTabbedPane(javax.swing.JTabbedPane) MouseAdapter(java.awt.event.MouseAdapter) Dimension(java.awt.Dimension) Container(java.awt.Container) ComponentViewer(org.apache.airavata.xbaya.ui.views.ComponentViewer) ErrorWindow(org.apache.airavata.xbaya.ui.dialogs.ErrorWindow) ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener) MonitorPanel(org.apache.airavata.xbaya.ui.views.MonitorPanel) JSplitPane(javax.swing.JSplitPane) ScrollPanel(org.apache.airavata.xbaya.ui.widgets.ScrollPanel)

Example 2 with MonitorPanel

use of org.apache.airavata.xbaya.ui.views.MonitorPanel in project airavata by apache.

the class ServiceInteractionWindow method initGui.

/**
 */
private void initGui() {
    GridPanel mainPanel = new GridPanel();
    MonitorPanel monitorPanel = new MonitorPanel(this.xbayaGUI, this.nodeID, monitor);
    this.consoleTextArea = new XBayaTextArea();
    XBayaLabel consoleLabel = new XBayaLabel("Console", this.consoleTextArea);
    this.commandField = new XBayaTextField();
    XBayaLabel commandLabel = new XBayaLabel("Command", this.commandField);
    mainPanel.add(monitorPanel);
    mainPanel.add(consoleLabel);
    mainPanel.add(this.consoleTextArea);
    mainPanel.add(commandLabel);
    mainPanel.add(this.commandField);
    mainPanel.layout(5, 1, GridPanel.WEIGHT_NONE, 1);
    JButton sendButton = new JButton("Send");
    sendButton.addActionListener(new AbstractAction() {

        /**
         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
         */
        public void actionPerformed(ActionEvent e) {
            send();
        }
    });
    JButton cancelButton = new JButton("Done");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(sendButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Deploy workflow to ODE and Registry", mainPanel, buttonPanel);
    this.dialog.setDefaultButton(sendButton);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) MonitorPanel(org.apache.airavata.xbaya.ui.views.MonitorPanel) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Aggregations

MonitorPanel (org.apache.airavata.xbaya.ui.views.MonitorPanel)2 Container (java.awt.Container)1 Dimension (java.awt.Dimension)1 ActionEvent (java.awt.event.ActionEvent)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 AbstractAction (javax.swing.AbstractAction)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1 JSplitPane (javax.swing.JSplitPane)1 JTabbedPane (javax.swing.JTabbedPane)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 ErrorWindow (org.apache.airavata.xbaya.ui.dialogs.ErrorWindow)1 XBayaDialog (org.apache.airavata.xbaya.ui.dialogs.XBayaDialog)1 ComponentViewer (org.apache.airavata.xbaya.ui.views.ComponentViewer)1 PortViewer (org.apache.airavata.xbaya.ui.views.PortViewer)1 GridPanel (org.apache.airavata.xbaya.ui.widgets.GridPanel)1 ScrollPanel (org.apache.airavata.xbaya.ui.widgets.ScrollPanel)1 XBayaLabel (org.apache.airavata.xbaya.ui.widgets.XBayaLabel)1