Package jsynoptic.builtin.ui

Source Code of jsynoptic.builtin.ui.TimePlotPropertiesPanel

/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info:  http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2005, by :
*     Corporate:
*         EADS Astrium SAS
*         EADS CRC
*     Individual:
*         Claude Cazenave
*
* $Id$
*
* Changes
* -------
* 29 juin 2005 : Initial public release (CC);
*
*/
package jsynoptic.builtin.ui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

import jsynoptic.builtin.ui.AxePropertiesPanel;
import jsynoptic.builtin.ui.CurvePropertiesPanel;
import jsynoptic.builtin.ui.PlotPropertiesPanel;
import jsynoptic.builtin.ui.TimeAxePropertiesPanel;


/**
*  Specific dialog to set plot properties
*/ 
public class TimePlotPropertiesPanel extends PlotPropertiesPanel {
 
  public TimePlotPropertiesPanel(int curvesSize, String shapeName) {
    super(curvesSize, shapeName);
  }
 
  protected void createContent(){

    JTabbedPane plotPane = new JTabbedPane();

    // Axis pane
    JPanel axisPaneContainer = new JPanel (new BorderLayout());
    JLabel axisTitle = new JLabel(resources.getStringValue("axisLabel"));
    axisTitle.setFont(new Font("Dialog", Font.PLAIN,18));
    axisPaneContainer.add(axisTitle, BorderLayout.NORTH);
   
    axisPane = new JPanel ();
    axisPane.setLayout(new BoxLayout(axisPane, BoxLayout.Y_AXIS));
    axeprop=new AxePropertiesPanel[4];
    addPrimeAxes();
    addSecondaryAxes();
   
    axisPaneContainer.add(axisPane,BorderLayout.CENTER );
   
    JPanel s1 = new JPanel (new BorderLayout());
    s1.add(axisPaneContainer, BorderLayout.NORTH);
    plotPane.addTab(resources.getString("axisLabel"), s1);
 
    // Curves pane
    JPanel curvePaneContainer = new JPanel (new BorderLayout());
    JLabel curveTitle = new JLabel(resources.getStringValue("curveLabel"));
    curveTitle.setFont(new Font("Dialog", Font.PLAIN,18));
    curvePaneContainer.add(curveTitle, BorderLayout.NORTH);
   
    curvePane = new JPanel ();
    curvePane.setLayout(new BoxLayout(curvePane, BoxLayout.Y_AXIS));

    curvProp=new CurvePropertiesPanel(resources)
    curvePane.add(curvProp);
   
    curvePaneContainer.add(curvePane,BorderLayout.CENTER);
   
    JPanel s2 = new JPanel (new BorderLayout());
    s2.add(curvePaneContainer, BorderLayout.NORTH);
    plotPane.addTab(resources.getString("curveLabel"), s2);
   
   
    //  Limit pane
    JPanel limitPaneContainer = new JPanel (new BorderLayout());
    JLabel limitTitle = new JLabel(resources.getStringValue("limitLabel"));
    limitTitle.setFont(new Font("Dialog", Font.PLAIN,18));
    limitPaneContainer.add(limitTitle, BorderLayout.NORTH);
   
    limitPane = new JPanel ();
    limitPane.setLayout(new BoxLayout(limitPane, BoxLayout.Y_AXIS));

    limitProp=new LimitPropertiesPanel(resources);
    limitPane.add(limitProp);
   
    limitPaneContainer.add(limitPane,BorderLayout.CENTER);
   
    JPanel l = new JPanel (new BorderLayout());
    l.add(limitPaneContainer, BorderLayout.NORTH);
    plotPane.addTab(resources.getString("limitLabel"), l);

   
    // Plot settings pane
    JPanel plotSettingsContainer= new JPanel (new BorderLayout());
    JLabel plotTitle = new JLabel(resources.getStringValue("plotLabel"));
    plotTitle.setFont(new Font("Dialog", Font.PLAIN,18));
    plotSettingsContainer.add(plotTitle, BorderLayout.NORTH);

   
    plotPropertiesPane = new JPanel();
    plotPropertiesPane.setLayout(new BoxLayout(plotPropertiesPane, BoxLayout.Y_AXIS));
    plotPropertiesPane.add(Box.createVerticalStrut(10));
   
    JPanel title = new JPanel(new FlowLayout(FlowLayout.LEFT));
    title.add(new JLabel(resources.getStringValue("titleLabel")));
    tftitle = new JTextField(25);
    title.add(tftitle);
    plotPropertiesPane.add(title);
   
   
    plotPropertiesPane.add(Box.createVerticalStrut(10));
    JPanel legend = new JPanel (new FlowLayout(FlowLayout.LEFT));
    cblegend = resources.getCheckBox("legend", null);
    cbCurveInformation = resources.getCheckBox("curveInformation", null);
    legend.add(cblegend);
    legend.add(cbCurveInformation);
    plotPropertiesPane.add(legend);

    plotSettingsContainer.add(plotPropertiesPane,BorderLayout.CENTER);
    JPanel s3 = new JPanel (new BorderLayout());
    s3.add(plotSettingsContainer, BorderLayout.NORTH);
   
   
    plotPane.addTab(resources.getString("plotLabel"), s3);
   
    addOnCurrentRow(plotPane, 1, true, true, true);
  }
 
  protected void addPrimeAxes(){
    axisPane.add(axeprop[0]=new TimeAxePropertiesPanel(resources.getStringValue("primXSection"), "primX", true));
    axisPane.add(axeprop[1]=new AxePropertiesPanel(resources.getStringValue("primYSection"), "primY", false, null));
  }

  protected void addSecondaryAxes(){
    axisPane.add(axeprop[2]=new TimeAxePropertiesPanel(resources.getStringValue("secXSection"), "secX", false));
    axisPane.add(axeprop[3]=new AxePropertiesPanel(resources.getStringValue("secYSection"), "secY", false, null));
  }
}
TOP

Related Classes of jsynoptic.builtin.ui.TimePlotPropertiesPanel

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.