From: <chr...@us...> - 2006-11-01 15:42:15
|
Revision: 597 http://svn.sourceforge.net/gridarta/?rev=597&view=rev Author: christianhujer Date: 2006-11-01 07:41:56 -0800 (Wed, 01 Nov 2006) Log Message: ----------- Some unification on ScriptArchData. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/daimonin/src/daieditor/ScriptArchData.java Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-11-01 14:51:47 UTC (rev 596) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-11-01 15:41:56 UTC (rev 597) @@ -484,7 +484,7 @@ nsHeading.setText("New scripted event for \"" + archName + "\":"); inputNFPath.setText(defScriptName); inputEventOptions.setText(""); - nsOkListener.setSdata(this); + nsOkListener.setScriptArchData(this); newScriptFrame.toFront(); newScriptFrame.setVisible(true); } @@ -828,39 +828,53 @@ private final boolean isOkButton; - private ScriptedEvent target; // target event + /** + * The target event to script. + */ + private ScriptedEvent scriptedEvent; // target event - private ScriptArchData sdata; // script arch data + /** + * The ScriptArchData to operate on. + */ + private ScriptArchData scriptArchData; /** * Constructor * @param isOkButton true for ok-buttons * @param frame frame this listener belongs to - * @param sdata this is only set for the ok-button of "create new" frame, otherwise null + * @param scriptArchData this is only set for the ok-button of "create new" frame, otherwise null */ - PathButtonListener(final boolean isOkButton, final JDialog frame, final ScriptArchData sdata) { + PathButtonListener(final boolean isOkButton, final JDialog frame, @Nullable final ScriptArchData scriptArchData) { this.isOkButton = isOkButton; this.frame = frame; - this.sdata = sdata; + this.scriptArchData = scriptArchData; } - public void setTargetEvent(final ScriptedEvent newt) { - target = newt; + /** + * Set the target event to script. + * @param scriptedEvent new target event to script. + */ + public void setTargetEvent(final ScriptedEvent scriptedEvent) { + this.scriptedEvent = scriptedEvent; } - public void setSdata(final ScriptArchData newsd) { - sdata = newsd; + /** + * Set the ScriptArchData to operate on. + * @param scriptArchData ScriptArchData to operate on. + */ + public void setScriptArchData(final ScriptArchData scriptArchData) { + this.scriptArchData = scriptArchData; } /** {@inheritDoc} */ public void actionPerformed(final ActionEvent e) { - if (isOkButton && sdata == null && target != null) { - target.modifyEventPath(); // ok button for modifying path + if (isOkButton && scriptArchData == null && scriptedEvent != null) { + scriptedEvent.modifyEventPath(); // ok button for modifying path } - if (isOkButton && sdata != null) { + if (isOkButton && scriptArchData != null) { // ok button for creating a new event/script - sdata.createNewEvent(frame); + scriptArchData.createNewEvent(frame); } else { frame.setVisible(false); // hide dialog } Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-01 14:51:47 UTC (rev 596) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-01 15:41:56 UTC (rev 597) @@ -431,7 +431,7 @@ // just set fields and show nsHeading.setText("New scripted event for \"" + archName + "\":"); inputNFPath.setText(defScriptName); - nsOkListener.setSdata(this); + nsOkListener.setScriptArchData(this); newScriptFrame.toFront(); newScriptFrame.setVisible(true); } @@ -802,40 +802,54 @@ private final boolean isOkButton; - private ScriptedEvent target; // target event + /** + * The target event to script. + */ + private ScriptedEvent scriptedEvent; // target event - private ScriptArchData sdata; // script arch data + /** + * The ScriptArchData to operate on. + */ + private ScriptArchData scriptArchData; /** * Constructor * @param isOkButton true for ok-buttons * @param frame frame this listener belongs to - * @param sdata this is only set for the ok-button of "create new" frame, otherwise null + * @param scriptArchData this is only set for the ok-button of "create new" frame, otherwise null */ - PathButtonListener(final boolean isOkButton, final JDialog frame, final ScriptArchData sdata) { + PathButtonListener(final boolean isOkButton, final JDialog frame, @Nullable final ScriptArchData scriptArchData) { this.isOkButton = isOkButton; this.frame = frame; - this.sdata = sdata; + this.scriptArchData = scriptArchData; } - public void setTargetEvent(final ScriptedEvent newt) { - target = newt; + /** + * Set the target event to script. + * @param scriptedEvent new target event to script. + */ + public void setTargetEvent(final ScriptedEvent scriptedEvent) { + this.scriptedEvent = scriptedEvent; } - public void setSdata(final ScriptArchData newsd) { - sdata = newsd; + /** + * Set the ScriptArchData to operate on. + * @param scriptArchData ScriptArchData to operate on. + */ + public void setScriptArchData(final ScriptArchData scriptArchData) { + this.scriptArchData = scriptArchData; } /** {@inheritDoc} */ public void actionPerformed(final ActionEvent e) { - if (isOkButton && sdata == null && target != null) { - target.modifyEventPath(); // ok button for modifying path + if (isOkButton && scriptArchData == null && scriptedEvent != null) { + scriptedEvent.modifyEventPath(); // ok button for modifying path } - if (isOkButton && sdata != null) { + if (isOkButton && scriptArchData != null) { // ok button for creating a new event/script - sdata.createNewEvent(frame); - sdata.changed = true; + scriptArchData.createNewEvent(frame); + scriptArchData.changed = true; } else { frame.setVisible(false); // hide dialog } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |