From: <der...@us...> - 2006-06-11 14:22:32
|
Revision: 142 Author: derdanny Date: 2006-06-11 07:21:34 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=142&view=rev Log Message: ----------- Added final modifiers to variables. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribBitmask.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/COptionDialog.java trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/crossfire/src/cfeditor/menu/BasicAction.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java trunk/crossfire/src/cfeditor/menu/MenuChangeEvent.java trunk/crossfire/src/cfeditor/menu/MenuEntry.java trunk/crossfire/src/cfeditor/menu/MenuGroup.java trunk/crossfire/src/cfeditor/menu/MenuHelper.java trunk/crossfire/src/cfeditor/menu/MenuManager.java trunk/crossfire/src/cfeditor/menu/SimpleMenuEntry.java trunk/crossfire/src/cfeditor/menu/SimpleMenuLocation.java trunk/crossfire/src/cfeditor/menu/SwitchedMenuEntry.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/FilterParameter.java trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java trunk/crossfire/src/cfeditor/parameter/StringParameter.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java trunk/crossfire/src/cfeditor/textedit/textarea/PythonTokenMarker.java trunk/crossfire/src/cfeditor/textedit/textarea/TextAreaPainter.java trunk/crossfire/src/cfeditor/textedit/textarea/Token.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/textedit/textarea/TextAreaPainter.java trunk/daimonin/src/daieditor/textedit/textarea/Token.java Modified: trunk/crossfire/src/cfeditor/CAttribBitmask.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-06-11 14:21:34 UTC (rev 142) @@ -98,7 +98,7 @@ int maxBit = 0; for (int i = 0; entries != null && i < entries.size(); i++) { elem = (Element) entries.get(i); - Attribute a; + final Attribute a; if ((a = elem.getAttribute("bit")) == null || elem.getAttribute("name") == null) { LOG.warn("Parse error: Found bitmask entry without 'bit' or 'name'."); elem.detach(); // remove element from DOM tree Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-06-11 14:21:34 UTC (rev 142) @@ -26,8 +26,6 @@ import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; -import net.sf.gridarta.help.Help; -import net.sf.gridarta.GridderException; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -68,6 +66,8 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.GridderException; +import net.sf.gridarta.help.Help; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -340,7 +340,7 @@ * @param boxWidth width of the JChooseBox in pixels * @return a <code>JPanel</code> with the combo box in it */ - private JPanel buildTypesBox(int boxWidth) { + private JPanel buildTypesBox(final int boxWidth) { final JPanel lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); // layout for this line final String []namelist = new String[typelist.getLength()]; // list of typenames @@ -577,7 +577,7 @@ if (initialCall) { // if this is the first time call: // create a scrollpane and put the tabbedpane inside - JScrollPane scrollPane = new JScrollPane(tabbedPane); + final JScrollPane scrollPane = new JScrollPane(tabbedPane); scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); @@ -1206,7 +1206,7 @@ String newFace = null; String newMsg = null; for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - int dType = attr.ref.getDataType(); + final int dType = attr.ref.getDataType(); if (dType == CFArchAttrib.T_BOOL) { // a boolean attribute (flag) Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-06-11 14:21:34 UTC (rev 142) @@ -24,12 +24,10 @@ package cfeditor; -import java.io.BufferedReader; -import java.io.IOException; +import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.Vector; -import java.util.ArrayList; import org.apache.log4j.Logger; import org.jdom.Attribute; import org.jdom.Element; @@ -251,7 +249,7 @@ } // parse all attributes in the section - List schildren = elem.getChildren(); + final List schildren = elem.getChildren(); for (int k = 0; schildren != null && k < schildren.size(); k++) { elem = (Element) schildren.get(k); if (elem.getName().equalsIgnoreCase(XML_ATTRIBUTE)) { Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-06-11 14:21:34 UTC (rev 142) @@ -77,7 +77,7 @@ */ CFArchTypeList() { CFArchType cfType = head; // index of CFArchType list - boolean headLoaded = false; // true when the default type (=head) is loaded + final boolean headLoaded = false; // true when the default type (=head) is loaded CFileReader fread = null; // file reader for "types.txt" // initialize the arrays of "special-data" @@ -123,7 +123,7 @@ if (elem.getAttribute("name") == null) { LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { - Vector list = parseListFromElement(elem); + final Vector list = parseListFromElement(elem); if (list != null && list.size() > 0) { listTable.put(elem.getAttribute("name").getValue(), list); } @@ -136,7 +136,7 @@ LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); } else { // create a new CFArchType element - CFArchType newType = new CFArchType(head); + final CFArchType newType = new CFArchType(head); // attach the new CFArchType element to the list // if we manage to parse it properly from the file @@ -153,11 +153,11 @@ if (elem.getAttribute("name") == null) { LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); } else { - String lname = elem.getAttribute("name").getValue().trim(); - List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); + final String lname = elem.getAttribute("name").getValue().trim(); + final List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); if (children2 != null && children2.size() > 0) { // load all attribute entries - Vector content = new Vector(); + final Vector content = new Vector(); for (int k = 0; k < children2.size(); k++) { elem = (Element) children2.get(k); if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { @@ -180,7 +180,7 @@ LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); } else { // create a new CFArchType element - CFArchType newType = new CFArchType(head); + final CFArchType newType = new CFArchType(head); // attach the new CFArchType element to the list // if we manage to parse it properly from the file @@ -213,14 +213,14 @@ * Parse a list vector from an xml list element. * @param root */ - private Vector parseListFromElement(Element root) { - Vector list = new Vector(); // list vector + private Vector parseListFromElement(final Element root) { + final Vector list = new Vector(); // list vector int num; // number for list element String string; // string for list element Element elem; Attribute a; - List entries = root.getChildren("entry"); + final List entries = root.getChildren("entry"); for (int i = 0; entries != null && i < entries.size(); i++) { elem = (Element) entries.get(i); if (elem.getAttribute("value") == null || elem.getAttribute("name") == null) { @@ -285,25 +285,25 @@ spellName = null; spellNum = null; CFileReader reader = null; // input reader - int spnum = 0; // number of spells + final int spnum = 0; // number of spells try { // open reading stream to the spells xml file - String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR); + final String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR); reader = new CFileReader(baseDir, IGUIConstants.SPELL_FILE); // parse xml document - SAXBuilder builder = new SAXBuilder(); - Document doc = builder.build(reader.getReader()); + final SAXBuilder builder = new SAXBuilder(); + final Document doc = builder.build(reader.getReader()); // retrieve the spell data from the xml - Element root = doc.getRootElement(); + final Element root = doc.getRootElement(); Element spellElem; Attribute a; if (root == null || !root.getName().equalsIgnoreCase("spells")) { LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); } else { - List spells = root.getChildren("spell"); + final List spells = root.getChildren("spell"); if (spells == null || spells.size() == 0) { LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); } else { @@ -400,8 +400,8 @@ Vector list = null; // growable array of spellnames+numbers String tmp; // tmp String for spell names - FileWriter fileWriter; // file writer for "spells.def" - BufferedWriter bufferedWriter; // buffered writer + final FileWriter fileWriter; // file writer for "spells.def" + final BufferedWriter bufferedWriter; // buffered writer if (spellfile.getName().equalsIgnoreCase("spellist.h")) { list = new Vector(); @@ -494,8 +494,8 @@ // write spell-entries: for (int i = 0; i < list.size(); i++) { tmp = String.valueOf(list.elementAt(i)); - String id = tmp.substring(0, tmp.indexOf(" ")).trim(); - String name = tmp.substring(tmp.indexOf(" ") + 1).trim(); + final String id = tmp.substring(0, tmp.indexOf(" ")).trim(); + final String name = tmp.substring(tmp.indexOf(" ") + 1).trim(); String space = ""; if (id.length() == 1) { space = " "; @@ -552,7 +552,7 @@ boolean match = true; for (int t = 0; t < argsNum * 2; t += 2) { - String archvalue = arch.getAttributeString(tmp.getTypeAttr()[t], defarch); + final String archvalue = arch.getAttributeString(tmp.getTypeAttr()[t], defarch); if (!archvalue.equals(tmp.getTypeAttr()[t + 1]) && !(tmp.getTypeAttr()[t + 1].equals("0") && archvalue.length() == 0)) { Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-06-11 14:21:34 UTC (rev 142) @@ -26,8 +26,6 @@ import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; -import net.sf.gridarta.help.Help; -import net.sf.gridarta.GridderException; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -54,6 +52,8 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; +import net.sf.gridarta.GridderException; +import net.sf.gridarta.help.Help; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -319,7 +319,7 @@ // do second linking to link all what is left processSecondLinking = true; - int x = needSecondLink.size(); + final int x = needSecondLink.size(); for (int i = 0; i < x; i++) { // 'node' is a sub-treasurelist which needs to be linked to it's content final TreasureTreeNode node = (TreasureTreeNode) needSecondLink.elementAt(i); @@ -406,7 +406,7 @@ * @param parentNode parent treenode * @param needLink vector containing all sub-treasurelist nodes which need linking */ - private void readInsideList(TreasureTreeNode parentNode, BufferedReader reader, Vector needLink) throws IOException { + private void readInsideList(final TreasureTreeNode parentNode, final BufferedReader reader, final Vector needLink) throws IOException { String line; // read line of file TreasureTreeNode node = null; // tmp. treenode Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-06-11 14:21:34 UTC (rev 142) @@ -498,7 +498,7 @@ entry.setMnemonic('V'); final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - UIManager.LookAndFeelInfo[] aInfos = UIManager.getInstalledLookAndFeels(); + final UIManager.LookAndFeelInfo[] aInfos = UIManager.getInstalledLookAndFeels(); final MenuGroup group = new MenuGroup(); //JCheckBoxMenuItem selectedMenuItem = null; final String strSelectedLNFName = settings.getProperty(CMainView.SELECTED_LNF_KEY, Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-06-11 14:21:34 UTC (rev 142) @@ -382,11 +382,11 @@ if (arch.getFaceName() != null) { // we have a non-default face - int index = ArchObjectStack.getFaceIndex(arch.getFaceName()); + final int index = ArchObjectStack.getFaceIndex(arch.getFaceName()); arch.setFaceNr(index); } else { // we have the default face - int index = ArchObjectStack.getFaceIndex(defarch.getFaceName()); + final int index = ArchObjectStack.getFaceIndex(defarch.getFaceName()); arch.setFaceNr(index); } Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-11 14:21:34 UTC (rev 142) @@ -57,7 +57,7 @@ private String fname; - public CMapFileEncode(CMainControl mainControl) { + public CMapFileEncode(final CMainControl mainControl) { this.mainControl = mainControl; } Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-11 14:21:34 UTC (rev 142) @@ -50,8 +50,8 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.GridderException; import net.sf.gridarta.help.Help; -import net.sf.gridarta.GridderException; /** * Dialog used to ask the user the properties for the new level. @@ -204,7 +204,7 @@ final JTabbedPane tabPane = new JTabbedPane(JTabbedPane.TOP); tabPane.setBorder(BorderFactory.createEmptyBorder(0, 3, 3, 0)); - JPanel optionPanel = new JPanel(new GridLayout(1, 1)); + final JPanel optionPanel = new JPanel(new GridLayout(1, 1)); if (IGUIConstants.isoView) { optionPanel.setBorder( new CompoundBorder( Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-11 14:21:34 UTC (rev 142) @@ -639,9 +639,9 @@ new Color(0.0f, 1.0f, 1.0f, 0.33f)}; resizeBackBuffer(); /*taken from java doc, scroll while dragged*/ - MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { + final MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { @Override public void mouseDragged(final MouseEvent e) { - Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); + final Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); ((JComponent) e.getSource()).scrollRectToVisible(r); } }; @@ -1103,7 +1103,7 @@ new Color(0.0f, 1.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 1.0f, 0.33f)}; /*taken from java doc, scroll while dragged*/ - MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { + final MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { @Override public void mouseDragged(final MouseEvent e) { final Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); ((JComponent) e.getSource()).scrollRectToVisible(r); @@ -1198,7 +1198,7 @@ mainControl.getUnknownTileIcon().paintIcon(this, grfx, xstart, ystart); } } else { - Iterator it = mapModel.getArchObjects(x, y); + final Iterator it = mapModel.getArchObjects(x, y); while (it.hasNext()) { ArchObject node = (ArchObject) it.next(); @@ -1715,7 +1715,7 @@ drawInternDrag = drawInternCount; Point[] needRedraw = null; // array of tile coords which need to be redrawn - Point dragPoint = event.getPoint(); // Mouse pointer + final Point dragPoint = event.getPoint(); // Mouse pointer xp = (int) dragPoint.getX(); yp = (int) dragPoint.getY(); final Point temp = renderer.getTileLocationAt(dragPoint); // tile under Mouse pointer Modified: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-06-11 14:21:34 UTC (rev 142) @@ -204,7 +204,7 @@ final JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { + public void actionPerformed(final ActionEvent event) { dispose(); } }); Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-06-11 14:21:34 UTC (rev 142) @@ -56,7 +56,7 @@ private File file; - public CResourceLoader(String filename) { + public CResourceLoader(final String filename) { this(filename, true, true, true); } Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-06-11 14:21:34 UTC (rev 142) @@ -61,7 +61,7 @@ private JFrame scriptManager = null; /** @param controller controller of this ScriptView */ - public CScriptView(CScriptController controller) { + public CScriptView(final CScriptController controller) { super(); this.ctrl = controller; } @@ -206,7 +206,7 @@ }; choose.setFileFilter(filter); if (choose.showOpenDialog(ctrl.getMainControl().getMainView()) == JFileChooser.APPROVE_OPTION) { - File f = choose.getSelectedFile(); + final File f = choose.getSelectedFile(); try { ctrl.importXML(new FileReader(f), true); } catch (final FileNotFoundException ex) { Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-06-11 14:21:34 UTC (rev 142) @@ -82,7 +82,7 @@ try { if (file.startsWith("file:")) { - URL localJar = new URL(file); + final URL localJar = new URL(file); final StringTokenizer st = new StringTokenizer(localJar.getFile(), "!"); this.jarFileName = st.nextToken(); init(); Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-06-11 14:21:34 UTC (rev 142) @@ -576,7 +576,7 @@ if (couldCreateFile) { // file has been created, now link it to the event - ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, eventOptions); + final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, eventOptions); if (replaceIndex != -1) { eventList.setElementAt(event, replaceIndex); } else { Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-06-11 14:21:34 UTC (rev 142) @@ -196,7 +196,7 @@ * @param checkType bitmask containing the edit type(s) to be calculated * @return new editType for this arch */ - public int calculateEditType(int checkType) { + public int calculateEditType(final int checkType) { final ArchObject defarch = getDefaultArch(); // default arch /* if one of the types in check_type already is in editType, @@ -305,7 +305,7 @@ int result = 0; for (i = 0, j = 0; i < aText.length(); i++) { if (aText.charAt(i) == '\n') { - String line = aText.substring(j, i).trim(); + final String line = aText.substring(j, i).trim(); try { // try to read the value behind 'attr' @@ -358,7 +358,7 @@ int i; for (i = 0, j = 0; i < aText.length(); i++) { if (aText.charAt(i) == '\n') { - String line = aText.substring(j, i).trim(); + final String line = aText.substring(j, i).trim(); // take the String behind 'attr' if (line.startsWith(attr)) { @@ -406,7 +406,7 @@ String result = ""; for (i = 0, j = 0; i < aText.length(); i++) { if (aText.charAt(i) == '\n') { - String line = aText.substring(j, i).trim(); + final String line = aText.substring(j, i).trim(); // take the String behind 'attr' if (!line.startsWith(attr)) { @@ -449,7 +449,7 @@ String result = ""; for (i = 0, j = 0; i < aText.length(); i++) { if (aText.charAt(i) == '\n') { - String line = aText.substring(j, i).trim(); + final String line = aText.substring(j, i).trim(); // take the String behind 'attr' if (!line.startsWith(attr)) { @@ -1052,7 +1052,7 @@ } else { // not ignoring the value-part try { - String test = diffTextString(this.getArchText(), line, ignoreValues); + final String test = diffTextString(this.getArchText(), line, ignoreValues); char c = '\n'; if (test != null) { c = test.charAt(0); @@ -1417,7 +1417,7 @@ line = line.trim(); // get only the key-part of the attribute - String attrKey; + final String attrKey; if (line.indexOf(" ") <= 0) { // this line doesn't even have the proper format: "key value" // we assume the missing value part means zero-value Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-11 14:21:34 UTC (rev 142) @@ -458,7 +458,7 @@ for (t = 0; t < 3; t++) { face += String.valueOf((char) stream.read()); } - char l = (char) stream.read(); + final char l = (char) stream.read(); if (face.indexOf("/") >= 0) { face = face.substring(face.lastIndexOf("/") + 1); Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-06-11 14:21:34 UTC (rev 142) @@ -79,7 +79,7 @@ //--- Constructor(s) --- - public CloseableTabbedPane(ImageIcon closingIcon) { + public CloseableTabbedPane(final ImageIcon closingIcon) { this.closingIcon = closingIcon; addMouseListener(new ClosingListener()); @@ -91,7 +91,7 @@ //--- Method(s) --- - public void addTab(String title, Component component, boolean closeable) { + public void addTab(final String title, final Component component, final boolean closeable) { if (closeable) { super.addTab(title, new ClosingIcon(closingIcon), component); } else { @@ -100,7 +100,7 @@ setSelectedComponent(component); } - @Override public void addTab(String title, Component component) { + @Override public void addTab(final String title, final Component component) { addTab(title, component, true); } @@ -108,15 +108,15 @@ protected class ClosingListener extends MouseAdapter { - @Override public void mouseReleased(MouseEvent e) { - int i = getSelectedIndex(); + @Override public void mouseReleased(final MouseEvent e) { + final int i = getSelectedIndex(); // nothing selected if (i == -1) { return; } - ClosingIcon icon = (ClosingIcon) getIconAt(i); + final ClosingIcon icon = (ClosingIcon) getIconAt(i); // close tab, if icon was clicked if (icon != null && icon.contains(e.getX(), e.getY())) { @@ -146,7 +146,7 @@ //--- Constructor(s) --- - public ClosingIcon(ImageIcon icon) { + public ClosingIcon(final ImageIcon icon) { this.icon = icon; if (icon != null) { @@ -170,7 +170,7 @@ * this is a rather rude approach just to find out if the closingIcon * was pressed. */ - public void paintIcon(Component c, Graphics g, int x, int y) { + public void paintIcon(final Component c, final Graphics g, final int x, final int y) { this.x = x; this.y = y; @@ -182,7 +182,7 @@ } /** Verifies if x and y are within the icon's borders. */ - public boolean contains(int xEvent, int yEvent) { + public boolean contains(final int xEvent, final int yEvent) { if (!(xEvent >= x) || !(xEvent <= x + width)) { return false; } Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-06-11 14:21:34 UTC (rev 142) @@ -86,31 +86,31 @@ private int selectedCol = -1; private final MouseListener cellMouseListener = new MouseListener() { - public void mouseClicked(MouseEvent e) { + public void mouseClicked(final MouseEvent e) { selectTableComponent((Component) e.getSource()); } - public void mouseEntered(MouseEvent e) { + public void mouseEntered(final MouseEvent e) { } - public void mouseExited(MouseEvent e) { + public void mouseExited(final MouseEvent e) { } - public void mousePressed(MouseEvent e) { + public void mousePressed(final MouseEvent e) { selectTableComponent((Component) e.getSource()); } - public void mouseReleased(MouseEvent e) { + public void mouseReleased(final MouseEvent e) { selectTableComponent((Component) e.getSource()); } }; private final FocusListener cellFocusListener = new FocusListener() { - public void focusGained(FocusEvent e) { + public void focusGained(final FocusEvent e) { selectTableComponent((Component) e.getSource()); } - public void focusLost(FocusEvent e) { + public void focusLost(final FocusEvent e) { } }; @@ -126,14 +126,14 @@ * Create a visual JComponent used to edit the given script * @param script the script object to edit */ - public ScriptEditor(CScriptModel script) { + public ScriptEditor(final CScriptModel script) { super(); this.script = script; tabs = new JTabbedPane(); this.setLayout(new BorderLayout()); this.add(tabs); optionsTab = new JPanel(new GridBagLayout()); - GridBagConstraints gbc = new GridBagConstraints(); + final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.gridwidth = 2; @@ -160,7 +160,7 @@ gbc.anchor = GridBagConstraints.WEST; typeAutorun = new JCheckBox("autorun at application startup"); typeAutorun.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().setAutoboot(typeAutorun.isSelected()); } }); @@ -169,7 +169,7 @@ gbc.gridy = 2; typeFilter = new JCheckBox("reference in the filters list"); typeFilter.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().setFilter(typeFilter.isSelected()); } }); @@ -178,7 +178,7 @@ gbc.gridy = 3; typeBash = new JCheckBox("reference in the manual run list"); typeBash.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().setBash(typeBash.isSelected()); } }); @@ -189,7 +189,7 @@ JButton btn = new JButton("re-register script"); btn.setToolTipText("Force plugin manager to unregister this plugin from filter list, launch the autrun (if plugin is autostart) and re-register it (if filter plugin)"); btn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().getController().reRegister(getScript().getName()); } }); @@ -199,7 +199,7 @@ btn = new JButton("Export script..."); btn.setToolTipText("Export the specified plugin as XML (for distribution)"); btn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().getController().exportScript(getScript()); } }); @@ -209,29 +209,29 @@ paramTable = new JPanel(new GridBagLayout()); redrawTable(); script.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { + public void stateChanged(final ChangeEvent e) { redrawTable(); } }); JScrollPane scrl = new JScrollPane(paramTable); parameterTab.add(scrl, BorderLayout.CENTER); //parameterTab.add(paramTable, BorderLayout.CENTER); - JPanel paramButtons = new JPanel(); + final JPanel paramButtons = new JPanel(); paramButtons.setLayout(new StackLayout(5)); addParameter = new JButton("Add parameter"); addParameter.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().newParameter(); } }); removeParameter = new JButton("Remove parameter"); removeParameter.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { if (selectedRow < 0) { return; } - String name = getScript().getParamName(selectedRow); + final String name = getScript().getParamName(selectedRow); if (JOptionPane.showConfirmDialog(removeParameter, "Delete " + name + "?", "Delete?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { getScript().removeParameter(selectedRow); @@ -248,25 +248,25 @@ code.setText(script.getCode()); code.setFont(new Font("Monospaced", Font.PLAIN, 14)); code.getDocument().addDocumentListener(new DocumentListener() { - public void changedUpdate(DocumentEvent e) { + public void changedUpdate(final DocumentEvent e) { getScript().setCode(code.getText()); } - public void insertUpdate(DocumentEvent e) { + public void insertUpdate(final DocumentEvent e) { getScript().setCode(code.getText()); } - public void removeUpdate(DocumentEvent e) { + public void removeUpdate(final DocumentEvent e) { getScript().setCode(code.getText()); } }); scrl = new JScrollPane(code); - JPanel codePanel = new JPanel(new BorderLayout()); + final JPanel codePanel = new JPanel(new BorderLayout()); codePanel.add(scrl, BorderLayout.CENTER); - JPanel codeBottom = new JPanel(new FlowLayout()); - JButton test = new JButton("Run Script..."); + final JPanel codeBottom = new JPanel(new FlowLayout()); + final JButton test = new JButton("Run Script..."); test.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { getScript().getController().runScript(getScript()); } }); @@ -275,9 +275,9 @@ tabs.addTab("Code", codePanel); } - public void selectTableComponent(Component c) { - GridBagLayout l = (GridBagLayout) paramTable.getLayout(); - GridBagConstraints gbc = l.getConstraints(c); + public void selectTableComponent(final Component c) { + final GridBagLayout l = (GridBagLayout) paramTable.getLayout(); + final GridBagConstraints gbc = l.getConstraints(c); if (gbc != null) { selectedRow = gbc.gridy - 1; selectedCol = gbc.gridx; @@ -285,7 +285,7 @@ } private void redrawTable() { - GridBagConstraints gbc; + final GridBagConstraints gbc; gbc = new GridBagConstraints(0, 0, 1, 1, 0.1, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 5, 0); paramTable.removeAll(); paramTable.add(new JLabel("Name"), gbc); @@ -308,12 +308,12 @@ repaint(); } - private void newTableComponent(Component c) { + private void newTableComponent(final Component c) { c.addFocusListener(cellFocusListener); c.addMouseListener(cellMouseListener); } - private ParameterNameEditor getParameterNameEditor(PluginParameter param) { + private ParameterNameEditor getParameterNameEditor(final PluginParameter param) { if (log.isDebugEnabled()) { log.debug("Doing " + param); } @@ -329,7 +329,7 @@ return o; } - private ParameterDescriptionEditor getParameterDescriptionEditor(PluginParameter param) { + private ParameterDescriptionEditor getParameterDescriptionEditor(final PluginParameter param) { ParameterDescriptionEditor o = (ParameterDescriptionEditor) paramDescriptionEditors.get(param); if (o != null) { return o; @@ -341,7 +341,7 @@ return o; } - private ParameterTypeEditor getParameterTypeEditor(PluginParameter param) { + private ParameterTypeEditor getParameterTypeEditor(final PluginParameter param) { ParameterTypeEditor o = (ParameterTypeEditor) paramTypeEditors.get(param); if (o != null) { return o; @@ -353,7 +353,7 @@ return o; } - private PluginParameterView getParameterView(PluginParameter param) { + private PluginParameterView getParameterView(final PluginParameter param) { PluginParameterView o = (PluginParameterView) paramViews.get(param); if (o != null) { return o; @@ -374,7 +374,7 @@ return o; } - private void putRow(GridBagConstraints gbc, PluginParameter param) { + private void putRow(final GridBagConstraints gbc, final PluginParameter param) { gbc.gridx = 0; paramTable.add(getParameterNameEditor(param), gbc); gbc.gridx = 1; Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-06-11 14:21:34 UTC (rev 142) @@ -56,28 +56,28 @@ private static final long serialVersionUID = -3819064077177259928L; /** @throws java.awt.HeadlessException */ - public ScriptManager(CScriptController scriptController) { + public ScriptManager(final CScriptController scriptController) { super("Editor plugins management"); this.ctrl = scriptController; this.getContentPane().setLayout(new BorderLayout()); - JPanel left = new JPanel(new BorderLayout()); + final JPanel left = new JPanel(new BorderLayout()); scriptLayout = new CardLayout(); scriptPanel = new JPanel(scriptLayout); this.getContentPane().add(left, BorderLayout.WEST); this.getContentPane().add(scriptPanel, BorderLayout.CENTER); - ListModel mdl = new AbstractListModel() { + final ListModel mdl = new AbstractListModel() { private static final long serialVersionUID = 7636033005940159801L; { - ChangeListener l = new ChangeListener() { - public void stateChanged(ChangeEvent e) { + final ChangeListener l = new ChangeListener() { + public void stateChanged(final ChangeEvent e) { fireContentsChanged(scripts, 0, getController().getScriptCount() + 1); } }; getController().addChangeListener(l); } - @Nullable public Object getElementAt(int index) { + @Nullable public Object getElementAt(final int index) { try { return ctrl.getScript(index); } catch (Exception e) { @@ -91,7 +91,7 @@ }; scripts = new JList(mdl); scripts.addListSelectionListener(new ListSelectionListener() { - public void valueChanged(ListSelectionEvent e) { + public void valueChanged(final ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { showScript((CScriptModel) scripts.getSelectedValue()); } @@ -100,12 +100,12 @@ scripts.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); scripts.setBorder(new LineBorder(Color.black, 1)); left.add(scripts, BorderLayout.CENTER); - JButton addScriptBtn = new JButton("New..."); + final JButton addScriptBtn = new JButton("New..."); addScriptBtn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - String name = JOptionPane.showInputDialog(scripts, "Name of the new Beanshell plugin?"); + public void actionPerformed(final ActionEvent e) { + final String name = JOptionPane.showInputDialog(scripts, "Name of the new Beanshell plugin?"); if (name != null) { - CScriptModel m = new CScriptModel(ctrl); + final CScriptModel m = new CScriptModel(ctrl); m.setName(name); m.setCode("//input your beanshell Code"); getController().addScript(m); @@ -113,10 +113,10 @@ } } }); - JButton removeScriptBtn = new JButton("Remove"); + final JButton removeScriptBtn = new JButton("Remove"); removeScriptBtn.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - CScriptModel m = (CScriptModel) scripts.getSelectedValue(); + public void actionPerformed(final ActionEvent e) { + final CScriptModel m = (CScriptModel) scripts.getSelectedValue(); if (m == null) { return; } @@ -133,7 +133,7 @@ } } }); - JPanel bottomLeft = new JPanel(new GridLayout(2, 1)); + final JPanel bottomLeft = new JPanel(new GridLayout(2, 1)); bottomLeft.add(addScriptBtn); bottomLeft.add(removeScriptBtn); left.add(bottomLeft, BorderLayout.SOUTH); @@ -146,7 +146,7 @@ return this.ctrl; } - private void showScript(CScriptModel model) { + private void showScript(final CScriptModel model) { /* using a cardlayout is a necessary trick as * simply removing previous component and putting * the new one in the JPanel lead to problem unless @@ -167,8 +167,8 @@ scriptLayout.show(scriptPanel, c.getUid()); } - private void removeScript(CScriptModel model) { - ScriptEditor c = (ScriptEditor) components.get(model); + private void removeScript(final CScriptModel model) { + final ScriptEditor c = (ScriptEditor) components.get(model); if (c != null) { components.remove(model); scriptPanel.remove(c); Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-06-11 14:21:34 UTC (rev 142) @@ -24,17 +24,17 @@ private final MenuLocation location; - public WrappedMenuLocation(MenuLocation location, String parentName) { + public WrappedMenuLocation(final MenuLocation location, final String parentName) { this.location = location; this.parentName = parentName; name = parentName + "." + location.getName(); } - public void addMenuEntry(MenuEntry entry) { + public void addMenuEntry(final MenuEntry entry) { location.addMenuEntry(entry); } - public boolean contains(MenuEntry entry) { + public boolean contains(final MenuEntry entry) { return location.contains(entry); } @@ -46,11 +46,11 @@ return name; } - public void removeMenuEntry(MenuEntry entry) { + public void removeMenuEntry(final MenuEntry entry) { location.removeMenuEntry(entry); } - public void setMenuManager(MenuManager menuManager) { + public void setMenuManager(final MenuManager menuManager) { location.setMenuManager(menuManager); } @@ -58,9 +58,9 @@ return location; } - @Override public boolean equals(Object obj) { + @Override public boolean equals(final Object obj) { if (obj instanceof WrappedMenuLocation) { - WrappedMenuLocation loc = (WrappedMenuLocation) obj; + final WrappedMenuLocation loc = (WrappedMenuLocation) obj; return ((loc.name == null ? name == null : loc.equals(name)) && (loc.location == null ? location == null : loc.equals(location))); } @@ -83,19 +83,19 @@ private MenuManager menuManager = null; - public AggregateMenuLocation(String name) { + public AggregateMenuLocation(final String name) { super(name); subMenus = new LinkedHashMap(); } - public void addMenuLocation(MenuLocation location) { + public void addMenuLocation(final MenuLocation location) { if (subMenus.containsKey(location.getName())) { if (log.isInfoEnabled()) { log.info("Tried to add location" + location.getName() + " twice to " + getName()); } return; } - WrappedMenuLocation wml = new WrappedMenuLocation(location, getName()); + final WrappedMenuLocation wml = new WrappedMenuLocation(location, getName()); subMenus.put(location.getName(), wml); if (menuManager != null) { menuManager.addMenuLocation(wml); @@ -107,8 +107,8 @@ * @param location The location name. This should not include the * AggregateMenuLocation name as parent. It is a relative path. */ - @Nullable public MenuLocation getMenuLocation(String location) { - WrappedMenuLocation wml = (WrappedMenuLocation) subMenus.get(location); + @Nullable public MenuLocation getMenuLocation(final String location) { + final WrappedMenuLocation wml = (WrappedMenuLocation) subMenus.get(location); if (wml != null) { return wml.getLocation(); } else { @@ -116,7 +116,7 @@ } } - @Override public boolean contains(MenuEntry entry) { + @Override public boolean contains(final MenuEntry entry) { if (super.contains(entry)) { return true; } @@ -129,7 +129,7 @@ return false; } - @Override public void setMenuManager(MenuManager menuManager) { + @Override public void setMenuManager(final MenuManager menuManager) { if (log.isDebugEnabled()) { log.debug("Setting menu Manager for " + getName()); } Modified: trunk/crossfire/src/cfeditor/menu/BasicAction.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/menu/BasicAction.java 2006-06-11 14:21:34 UTC (rev 142) @@ -27,47 +27,47 @@ private static final long serialVersionUID = -9018592526345334501L; - public BasicAction(BasicMenuEntry entry) { + public BasicAction(final BasicMenuEntry entry) { super(); this.entry = entry; } - public BasicAction(BasicMenuEntry entry, String name) { + public BasicAction(final BasicMenuEntry entry, final String name) { super(name); this.entry = entry; } - public BasicAction(BasicMenuEntry entry, String name, Icon icon) { + public BasicAction(final BasicMenuEntry entry, final String name, final Icon icon) { super(name, icon); this.entry = entry; } - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { log.debug("ActionPerformed: " + e); entry.actionPerformed(e); } - public void setName(String name) { + public void setName(final String name) { putValue(NAME, name); } - public void setKeyStroke(KeyStroke key) { + public void setKeyStroke(final KeyStroke key) { putValue(ACCELERATOR_KEY, key); } - public void setActionCommand(String command) { + public void setActionCommand(final String command) { putValue(ACTION_COMMAND_KEY, command); } - public void setIcon(Icon icon) { + public void setIcon(final Icon icon) { putValue(SMALL_ICON, icon); } - public void setMnemonic(int key) { + public void setMnemonic(final int key) { putValue(MNEMONIC_KEY, new Integer(key)); } - @Override public Object getValue(String key) { + @Override public Object getValue(final String key) { if (log.isDebugEnabled()) { log.debug("getValue(" + key + ") -> " + super.getValue(key)); } Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-06-11 14:21:34 UTC (rev 142) @@ -49,27 +49,27 @@ private boolean enabled = true; - public BasicMenuEntry(String name) { + public BasicMenuEntry(final String name) { setName(name); } - public void setAccelerator(KeyStroke accelerator) { + public void setAccelerator(final KeyStroke accelerator) { this.accelerator = accelerator; fireUpdate(); } - public void setMnemonic(char mnemonic) { + public void setMnemonic(final char mnemonic) { this.mnemonic = mnemonic; fireUpdate(); } - public void addActionListener(ActionListener listener) { + public void addActionListener(final ActionListener listener) { synchronized (listeners) { listeners.add(listener); } } - protected void initItem(AbstractButton item) { + protected void initItem(final AbstractButton item) { log.debug("initItem()"); item.setAction(getBasicAction()); updateItem(item); @@ -80,7 +80,7 @@ if (action == null) { synchronized (this) { if (action == null) { - BasicAction bas = new BasicAction(this, getName()); + final BasicAction bas = new BasicAction(this, getName()); action = bas; } } @@ -88,7 +88,7 @@ return action; } - private void referenceItem(Object item) { + private void referenceItem(final Object item) { log.debug("referenceMenuItem()"); synchronized (refs) { refs.add(new WeakReference(item, componentQueue)); @@ -99,7 +99,7 @@ protected abstract void update(); - protected void defaultUpdateItem(JComponent item) { + protected void defaultUpdateItem(final JComponent item) { log.debug("defaultUpdateJMenuItem"); if (log.isDebugEnabled()) { log.debug("item " + item.getClass() + ": " + name + " (" + mnemonic + ") -> " + accelerator); @@ -116,7 +116,7 @@ } } - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { synchronized (listeners) { for (Iterator i = listeners.iterator(); i.hasNext();) { log.debug("One more actionPerformed Listerner"); @@ -137,8 +137,8 @@ cleanUpQueue(componentQueue); synchronized (refs) { for (Iterator i = refs.iterator(); i.hasNext();) { - WeakReference wf = (WeakReference) i.next(); - JComponent item = (JComponent) wf.get(); + final WeakReference wf = (WeakReference) i.next(); + final JComponent item = (JComponent) wf.get(); if (log.isDebugEnabled()) { log.debug("Updating item: " + item); } @@ -149,7 +149,7 @@ } } - private void cleanUpQueue(ReferenceQueue queue) { + private void cleanUpQueue(final ReferenceQueue queue) { Reference r; synchronized (refs) { while ((r = queue.poll()) != null) { @@ -162,7 +162,7 @@ return name; } - public void setName(String name) { + public void setName(final String name) { if (log.isDebugEnabled()) { log.debug("setName(" + name + ")"); } @@ -183,7 +183,7 @@ return enabled; } - public void setEnabled(boolean enabled) { + public void setEnabled(final boolean enabled) { this.enabled = enabled; fireUpdate(); } Modified: trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-06-11 12:47:11 UTC (rev 141) +++ trunk/crossfire/src/cfeditor/menu/CheckBoxMenuEntry.java 2006-06-11 14:21:34 UTC (rev 142) @@ -33,7 +33,7 @@ private MenuGroup group = null; /** @param name */ - public CheckBoxMenuEntry(String name) { + public CheckBoxMenuEntry(final String name) { super(name); } @@ -41,9 +41,9 @@ return checked; } - public void setChecked(boolean checked) { + public void setChecked(final boolean checked) { if (group == null) { - boolean oldChecked = this.checked; + final boolean oldChecked = this.checked; this.checked = checked; if (this.checked != oldChecked) { fireUpdate(); @@ -59,7 +59,7 @@ //getModel().setSelected(isChecked()); } - @Override protected void updateItem(JComponent item) { + @Override protected void updateItem(final JComponent item) { defaultUpdateItem(item); if (item instanceof JCheckBoxMenuItem) { ((JCheckBoxMenuItem) item).setSelected(isChecked()); @@ -75,22 +75,22 @@ @Override public JComponent getMenuItemComponent() { log.debug("getMenuItemComponent()"); - JCheckBoxMenuItem chk = new JCheckBoxMenuItem(); + final JCheckBoxMenuItem chk = new JCheckBoxMenuItem(); ... [truncated message content] |