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