Package jsynoptic.plugins.async.ui

Source Code of jsynoptic.plugins.async.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: TimePlotPropertiesPanel.java,v 1.7 2006/11/23 16:41:09 ogor Exp $
*
* Changes
* -------
* 29 juin 2005 : Initial public release (CC);
*
*/
package jsynoptic.plugins.async.ui;

import java.awt.FlowLayout;

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

import jsynoptic.plugins.async.TimePlot;
import simtools.ui.MenuResourceBundle;
import simtools.ui.ResourceFinder;


/**
*  Specific dialog to set plot properties
*/ 
public class TimePlotPropertiesPanel extends jsynoptic.builtin.ui.TimePlotPropertiesPanel {
 
  public static MenuResourceBundle resources = ResourceFinder.getMenu(TimePlot.class);

  /**
   * checkbox to enabled the diplay of the secondary axis
   */
  protected JCheckBox cbSecAxisEnabled;
   
  public TimePlotPropertiesPanel(int curvesSize, String shapeName) {
    super(curvesSize,shapeName);
  }
 
  /*
   * (non-Javadoc)
   *
   * @see jsynoptic.builtin.ui.PlotPropertiesPanel#getPropertyNames()
   */
  public String[] getPropertyNames() {
    String[] sprops = super.getPropertyNames();
    String[] props = new String[sprops.length + 1];
    System.arraycopy(sprops,0,props,0,sprops.length);
   
    props[props.length-1] = "DISPLAY_SEC_AXIS";
    return props;
  }

  /*
   * (non-Javadoc)
   *
   * @see jsynoptic.builtin.ui.PlotPropertiesPanel#getPropertyValue(java.lang.String)
   */
  public Object getPropertyValue(String name) {
    Object res = super.getPropertyValue(name);
    if (name.equalsIgnoreCase("DISPLAY_SEC_AXIS")) {
      res = new Boolean(cbSecAxisEnabled.isSelected());
    }
    return res;
  }

  /*
   * (non-Javadoc)
   *
   * @see jsynoptic.builtin.ui.PlotPropertiesPanel#setPropertyValue(java.lang.String,
   *      java.lang.Object)
   */
  public void setPropertyValue(String name, Object value) {
    super.setPropertyValue(name, value);
    if (name.equalsIgnoreCase("DISPLAY_SEC_AXIS")) {
      cbSecAxisEnabled.setSelected(((Boolean) value).booleanValue());
    }
  }

  /*
   * (non-Javadoc)
   *
   * @see jsynoptic.builtin.ui.TimePlotPropertiesPanel#createContent()
   */
  public void createContent() {
    super.createContent();
   
    cbSecAxisEnabled = new JCheckBox(resources.getString("displaySecXAxis"));
 
    JPanel panel = new JPanel();
    panel.setLayout(new FlowLayout(FlowLayout.LEFT));
    panel.add(cbSecAxisEnabled);
   
    axisPane.add(panel);
  }
 
 

}
TOP

Related Classes of jsynoptic.plugins.async.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.