From: <aki...@us...> - 2007-01-07 11:49:52
|
Revision: 1484 http://svn.sourceforge.net/gridarta/?rev=1484&view=rev Author: akirschbaum Date: 2007-01-07 03:49:52 -0800 (Sun, 07 Jan 2007) Log Message: ----------- Unify GUI code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-07 11:24:59 UTC (rev 1483) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-07 11:49:52 UTC (rev 1484) @@ -273,8 +273,7 @@ if (task == GameObjectAttributesPanel.SCRIPT_OPEN) { event.openScript(); } else if (task == GameObjectAttributesPanel.SCRIPT_EDIT_PATH) { - // show popup to edit file path and plugin name - event.editScriptPath(); + event.editParameters(); eventList.set(index, event); // save changes } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { // first ask for confirmation @@ -386,14 +385,14 @@ // event type mainPanel.add(Box.createVerticalStrut(10)); final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel tlabel1 = new JLabel("Event Type: "); + final JLabel tlabel1 = new JLabel("Event type:"); line2.add(tlabel1); line2.add(eventTypeBox); //mainPanel.add(line2); line2.add(Box.createHorizontalStrut(10)); // plugin name - final JLabel tlabel2 = new JLabel("Plugin: "); + final JLabel tlabel2 = new JLabel("Plugin:"); line2.add(tlabel2); line2.add(pluginNameBox); mainPanel.add(line2); @@ -401,13 +400,8 @@ // path mainPanel.add(Box.createVerticalStrut(5)); final JPanel line3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel tlabel3 = new JLabel("Script File:"); + final JLabel tlabel3 = new JLabel("Script file:"); line3.add(tlabel3); - final int diff = tlabel1.getPreferredSize().width - tlabel3.getPreferredSize().width - 5; - if (diff > 0) { - line3.add(Box.createHorizontalStrut(diff)); - } - mainPanel.add(line3); inputScriptPath = new JTextField(defScriptName, 20); final JButton browseb = new JButton("..."); @@ -434,24 +428,23 @@ line3.add(browseb); mainPanel.add(line3); - // description + // options + mainPanel.add(Box.createVerticalStrut(5)); final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.LEFT)); + line4.add(new JLabel("Script options:")); + inputOptions = new JTextField("", 20); + line4.add(inputOptions); + mainPanel.add(line4); + + // description + final JPanel line5 = new JPanel(new FlowLayout(FlowLayout.LEFT)); final JPanel textPanel = new JPanel(); textPanel.setLayout(new BoxLayout(textPanel, BoxLayout.Y_AXIS)); final JLabel tlabel4 = new JLabel("When you specify an existing file, the new event will be linked"); textPanel.add(tlabel4); final JLabel tlabel5 = new JLabel("to that existing script. Otherwise a new script file is created."); textPanel.add(tlabel5); - line4.add(textPanel); - mainPanel.add(line4); - - // event options input - mainPanel.add(Box.createVerticalStrut(10)); - final JPanel line5 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel tlabel6 = new JLabel("Event Options: "); - line5.add(tlabel6); - inputOptions = new JTextField(25); - line5.add(inputOptions); + line5.add(textPanel); mainPanel.add(line5); // button panel: Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-07 11:24:59 UTC (rev 1483) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-07 11:49:52 UTC (rev 1484) @@ -174,7 +174,7 @@ * Edit path and plugin name for this event. A popup dialog is shown * with input textfields for file path and plugin name. */ - public void editScriptPath() { + public void editParameters() { if (pathFrame == null) { // initialize popup frame pathFrame = new JDialog(CMainControl.getInstance().getMainView(), "Edit Parameters", true); @@ -192,22 +192,22 @@ line1.add(inputScriptPath); mainPanel.add(line1); - // input line: plugin name + // input line: plugin options final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - final JLabel text2 = new JLabel("Plugin name:"); + final JLabel text2 = new JLabel("Event options:"); line2.add(text2); - inputPluginName = new JTextField(getPluginName(), 20); - line2.add(inputPluginName); + inputOptions = new JTextField(getOptions(), 20); + line2.add(inputOptions); mainPanel.add(line2); + mainPanel.add(Box.createVerticalStrut(5)); - // input line: plugin options + // input line: plugin name final JPanel line3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - final JLabel text3 = new JLabel("Event options:"); + final JLabel text3 = new JLabel("Plugin name:"); line3.add(text3); - inputOptions = new JTextField(getOptions(), 20); - line3.add(inputOptions); + inputPluginName = new JTextField(getPluginName(), 20); + line3.add(inputPluginName); mainPanel.add(line3); - mainPanel.add(Box.createVerticalStrut(5)); // button panel: final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-07 11:24:59 UTC (rev 1483) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-07 11:49:52 UTC (rev 1484) @@ -208,8 +208,7 @@ if (task == GameObjectAttributesPanel.SCRIPT_OPEN) { event.openScript(); } else if (task == GameObjectAttributesPanel.SCRIPT_EDIT_PATH) { - // show popup to edit file path and plugin name - event.editScriptPath(); + event.editParameters(); } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { // first ask for confirmation //boolean breakpath = (event.getScriptPath().length() > 15); @@ -335,14 +334,14 @@ // event type mainPanel.add(Box.createVerticalStrut(10)); final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel tlabel1 = new JLabel("Event Type: "); + final JLabel tlabel1 = new JLabel("Event type:"); line2.add(tlabel1); line2.add(eventTypeBox); //mainPanel.add(line2); line2.add(Box.createHorizontalStrut(10)); // plugin name - final JLabel tlabel2 = new JLabel("Plugin: "); + final JLabel tlabel2 = new JLabel("Plugin:"); line2.add(tlabel2); line2.add(pluginNameBox); mainPanel.add(line2); @@ -350,7 +349,7 @@ // path mainPanel.add(Box.createVerticalStrut(5)); final JPanel line3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel tlabel3 = new JLabel("Script File:"); + final JLabel tlabel3 = new JLabel("Script file:"); line3.add(tlabel3); mainPanel.add(line3); inputScriptPath = new JTextField(defScriptName, 20); @@ -381,7 +380,7 @@ // options mainPanel.add(Box.createVerticalStrut(5)); final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - line4.add(new JLabel("Script Options:")); + line4.add(new JLabel("Script options:")); inputOptions = new JTextField("", 20); line4.add(inputOptions); mainPanel.add(line4); @@ -418,6 +417,7 @@ // just set fields and show nsHeading.setText("New scripted event for \"" + archName + "\":"); inputScriptPath.setText(defScriptName); + inputOptions.setText(""); nsOkListener.setScriptArchData(this); newScriptFrame.toFront(); newScriptFrame.setVisible(true); Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-07 11:24:59 UTC (rev 1483) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-07 11:49:52 UTC (rev 1484) @@ -149,10 +149,10 @@ * Edit path and plugin name for this event. A popup dialog is shown * with input textfields for file path and plugin name. */ - public void editScriptPath() { + public void editParameters() { if (pathFrame == null) { // initialize popup frame - pathFrame = new JDialog(CMainControl.getInstance().getMainView(), "Script Path", true); + pathFrame = new JDialog(CMainControl.getInstance().getMainView(), "Edit Parameters", true); pathFrame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); final JPanel mainPanel = new JPanel(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |