From b662ef8fbe00add098834cf48cb6ee08e7e5b7c5 Mon Sep 17 00:00:00 2001 From: "antonio.fabio" Date: Mon, 2 Jul 2007 12:10:03 +0200 Subject: [PATCH] fixed 'Save data as...' enabling/disabling --- src/java/org/tsho/dmc2/ui/MainFrame.java | 2 +- src/java/org/tsho/dmc2/ui/PlotComponent.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/org/tsho/dmc2/ui/MainFrame.java b/src/java/org/tsho/dmc2/ui/MainFrame.java index 28880ae..618432c 100644 --- a/src/java/org/tsho/dmc2/ui/MainFrame.java +++ b/src/java/org/tsho/dmc2/ui/MainFrame.java @@ -286,7 +286,7 @@ public class MainFrame extends JFrame { else { saveAsAction.setEnabled(true); saveAsAction.setPlotComponent(comp); - saveDataAction.setEnabled(true); + saveDataAction.setEnabled(comp.getDataobject()!=null); saveDataAction.setPlotComponent(comp); menuBar.add(comp.getCommandMenu()); menuBar.add(comp.getPlotMenu()); diff --git a/src/java/org/tsho/dmc2/ui/PlotComponent.java b/src/java/org/tsho/dmc2/ui/PlotComponent.java index e41d4b8..e07dda7 100644 --- a/src/java/org/tsho/dmc2/ui/PlotComponent.java +++ b/src/java/org/tsho/dmc2/ui/PlotComponent.java @@ -31,6 +31,7 @@ import java.io.IOException; import javax.swing.JMenu; import javax.swing.JPanel; import javax.swing.JToolBar; +import org.tsho.dmc2.core.util.DataObject; /** * @author tsho @@ -52,6 +53,7 @@ public interface PlotComponent { void saveImageAs() throws IOException; void saveDataAs() throws IOException; + DataObject getDataobject(); void dispose(); } -- 2.11.4.GIT