From: <aki...@us...> - 2008-08-01 22:03:23
|
Revision: 4669 http://gridarta.svn.sourceforge.net/gridarta/?rev=4669&view=rev Author: akirschbaum Date: 2008-08-01 22:03:30 +0000 (Fri, 01 Aug 2008) Log Message: ----------- Remove call to AbstractMainControl.getInstance(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2008-08-01 22:00:10 UTC (rev 4668) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2008-08-01 22:03:30 UTC (rev 4669) @@ -140,7 +140,7 @@ final ScriptedEvent event = new ScriptedEvent(oldEvent); // now decide what to do: if (task == GameObjectAttributesPanel.SCRIPT_OPEN) { - ScriptedEventEditor.openScript(mainControl, event.getScriptPath()); + ScriptedEventEditor.openScript(mainControl, event.getScriptPath(), parent); } else if (task == GameObjectAttributesPanel.SCRIPT_EDIT_PATH) { ScriptedEventEditor.editParameters(event, parent); } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2008-08-01 22:00:10 UTC (rev 4668) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2008-08-01 22:03:30 UTC (rev 4669) @@ -139,7 +139,7 @@ final ScriptedEvent event = new ScriptedEvent(oldEvent); // now decide what to do: if (task == GameObjectAttributesPanel.SCRIPT_OPEN) { - ScriptedEventEditor.openScript(mainControl, event.getScriptPath()); + ScriptedEventEditor.openScript(mainControl, event.getScriptPath(), parent); } else if (task == GameObjectAttributesPanel.SCRIPT_EDIT_PATH) { ScriptedEventEditor.editParameters(event, parent); } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { Modified: trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java 2008-08-01 22:00:10 UTC (rev 4668) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java 2008-08-01 22:03:30 UTC (rev 4669) @@ -19,6 +19,7 @@ package net.sf.gridarta.gameobject.scripts; +import java.awt.Component; import java.awt.FlowLayout; import java.awt.Frame; import java.io.File; @@ -31,7 +32,6 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; -import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.MainControl; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; @@ -80,8 +80,9 @@ * Opens the script pad to display a script. * @param mainControl the main control instance * @param scriptPath the script path + * @param parent the parent component for dialog boxes */ - public static void openScript(@NotNull final MainControl<?, ?, ?, ?> mainControl, final String scriptPath) { + public static void openScript(@NotNull final MainControl<?, ?, ?, ?> mainControl, final String scriptPath, @NotNull final Component parent) { // trying to get the absolute path to scriptfile: final StringBuilder tmpPath = new StringBuilder(); if (scriptPath.startsWith("/")) { @@ -105,7 +106,7 @@ ScriptEditControlInstance.getInstance().openScriptFile(scriptFile.getAbsolutePath()); } else { // file does not exist! - ACTION_FACTORY.showMessageDialog(AbstractMainControl.getInstance().getMainView(), "openScriptNotFound", path); + ACTION_FACTORY.showMessageDialog(parent, "openScriptNotFound", path); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |