001    package org.LiveGraph.gui.dss;
002    
003    import java.awt.Dimension;
004    
005    import java.awt.event.WindowAdapter;
006    import java.awt.event.WindowEvent;
007    
008    import org.LiveGraph.LiveGraph;
009    import org.LiveGraph.events.Event;
010    import org.LiveGraph.gui.GUIEvent;
011    import org.LiveGraph.gui.LiveGraphFrame;
012    
013    
014    /**
015     * The "Series Settings" window of the application.
016     * 
017     * <p style="font-size:smaller;">This product includes software developed by the
018     *    <strong>LiveGraph</strong> project and its contributors.<br />
019     *    (<a href="http://www.live-graph.org" target="_blank">http://www.live-graph.org</a>)<br />
020     *    Copyright (c) 2007-2008 G. Paperin.<br />
021     *    All rights reserved.
022     * </p>
023     * <p style="font-size:smaller;">File: SeriesSettingsWindow.java</p> 
024     * <p style="font-size:smaller;">Redistribution and use in source and binary forms, with or
025     *    without modification, are permitted provided that the following terms and conditions are met:
026     * </p>
027     * <p style="font-size:smaller;">1. Redistributions of source code must retain the above
028     *    acknowledgement of the LiveGraph project and its web-site, the above copyright notice,
029     *    this list of conditions and the following disclaimer.<br />
030     *    2. Redistributions in binary form must reproduce the above acknowledgement of the
031     *    LiveGraph project and its web-site, the above copyright notice, this list of conditions
032     *    and the following disclaimer in the documentation and/or other materials provided with
033     *    the distribution.<br />
034     *    3. All advertising materials mentioning features or use of this software or any derived
035     *    software must display the following acknowledgement:<br />
036     *    <em>This product includes software developed by the LiveGraph project and its
037     *    contributors.<br />(http://www.live-graph.org)</em><br />
038     *    4. All advertising materials distributed in form of HTML pages or any other technology
039     *    permitting active hyper-links that mention features or use of this software or any
040     *    derived software must display the acknowledgment specified in condition 3 of this
041     *    agreement, and in addition, include a visible and working hyper-link to the LiveGraph
042     *    homepage (http://www.live-graph.org).
043     * </p>
044     * <p style="font-size:smaller;">THIS SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY
045     *    OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
046     *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT SHALL
047     *    THE AUTHORS, CONTRIBUTORS OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
048     *    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR
049     *    IN CONNECTION WITH THE SOFTWARE OR THE USE OR  OTHER DEALINGS IN THE SOFTWARE.
050     * </p>
051     * 
052     * @author Greg Paperin (<a href="http://www.paperin.org" target="_blank">http://www.paperin.org</a>)
053     * @version {@value org.LiveGraph.LiveGraph#version}
054     */
055    public class SeriesSettingsWindow extends LiveGraphFrame {
056    
057    /**
058     * This is the default constructor.
059     */
060    public SeriesSettingsWindow() {
061            super();
062            initialize();
063    }
064    
065    /**
066     * This method initializes the window.
067     */
068    private void initialize() {
069            
070            // Window settings:
071            Dimension frameDim = new Dimension(450, 200);
072            this.setPreferredSize(frameDim);
073            this.setBounds(480, 510, frameDim.width, frameDim.height);      
074            this.setTitle("Data series settings (LiveGraph)");
075            
076            // Hide-show listener:
077            this.addWindowListener(new WindowAdapter() {
078                    @Override public void windowClosing(WindowEvent e) {
079                            LiveGraph.application().guiManager().setDisplaySeriesSettingsWindows(false);
080                    }
081            });
082    } // private void initialize()
083    
084    
085    /**
086     * Updates local view on GUI events.
087     * 
088     * @param event A GUI event.
089     */
090    @Override
091    protected void processGUIEvent(Event<GUIEvent> event) {
092            
093            super.processGUIEvent(event);
094            if (GUIEvent.GUI_DataSeriesSettingsDisplayStateChanged == event.getType()) {
095                    setVisible(event.getInfoBoolean());
096            }
097    }
098    
099    } // public class SeriesSettingsWindow