Package com.neptuny.xgrapher.cli

Source Code of com.neptuny.xgrapher.cli.XGrapherTaskPane

/*******************************************************************************
*   Copyright 2007 Neptuny s.r.l. - www.neptuny.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
*******************************************************************************/
package com.neptuny.xgrapher.cli;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JCheckBox;
import javax.swing.JPanel;

import com.l2fprod.common.swing.JTaskPane;
import com.l2fprod.common.swing.JTaskPaneGroup;
import com.neptuny.xgrapher.cli.controller.Application;

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode;

/**
* This panel contains the details and actions panes, relative to the current selection in the
* main contents area.
*
* @author Riccardo Govoni [riccardo.govoni@neptuny.it]
* @since Sep 25, 2007
*
*/
public class XGrapherTaskPane extends JTaskPane {
 
  private JTaskPaneGroup actionsPane ;
  private JTaskPaneGroup detailsPane;
  private Application app;
 
  public XGrapherTaskPane(Application app) {
    this.app = app ;
               
                JPanel panel = new JPanel(new FlowLayout());
                final JCheckBox checkbox = new JCheckBox("pick mode");
                panel.add(checkbox);
                checkbox.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent e) {
                        if (checkbox.isSelected()) {
                            XGrapherTaskPane.this.app.getModalGraphMouse().setMode(Mode.PICKING);
                        } else {
                            XGrapherTaskPane.this.app.getModalGraphMouse().setMode(Mode.TRANSFORMING);
                        }
                    }
                });               
   
    actionsPane = new JTaskPaneGroup();
    actionsPane.setTitle("Actions");
    actionsPane.setToolTipText("This pane contains Actions which apply to the selected item");
    actionsPane.setExpanded(false);   
    actionsPane.add(panel);
   
   
    XGrapherPropertySheet propertySheet = new XGrapherPropertySheet(app);

    detailsPane = new JTaskPaneGroup();
    detailsPane.setTitle("Details");
    detailsPane.setToolTipText("This pane contains Details which apply to the selected item");
    detailsPane.setExpanded(true);   
    detailsPane.add(propertySheet);   
   
    add(actionsPane);
    add(detailsPane);
  }
 
}
TOP

Related Classes of com.neptuny.xgrapher.cli.XGrapherTaskPane

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.