Name | Value |
---|---|
+
+
"+getPatternAt(index).getName()+" | TEST |
Already have Macromedia Flash Player? Click here if you have Flash Player "+ this.version +" installed.
"; + + if (c) this.color = this.addParam('bgcolor', c); + this.addParam('quality', 'high'); // default to high + this.doDetect = getQueryParamValue('detectflash'); +} + +var FOP = FlashObject.prototype; + +FOP.addParam = function(name, value) { this.params[name] = value; } + +FOP.getParams = function() { return this.params; } + +FOP.getParam = function(name) { return this.params[name]; } + +FOP.addVariable = function(name, value) { this.variables[name] = value; } + +FOP.getVariable = function(name) { return this.variables[name]; } + +FOP.getVariables = function() { return this.variables; } + +FOP.getParamTags = function() { + var paramTags = ""; + for (var param in this.getParams()) { + paramTags += ''; + } + return (paramTags == "") ? false:paramTags; +} + +FOP.getHTML = function() { + var flashHTML = ""; + if (navigator.plugins && navigator.mimeTypes.length) { // netscape plugin architecture + flashHTML += ''; + } else { // PC IE + flashHTML += ''; + } + return flashHTML; +} + +FOP.getVariablePairs = function() { + var variablePairs = new Array(); + for (var name in this.getVariables()) { + variablePairs.push(name + "=" + escape(this.getVariable(name))); + } + return (variablePairs.length > 0) ? variablePairs.join("&"):false; +} + +FOP.write = function(elementId) { + if(detectFlash(this.version) || this.doDetect=='false') { + if (elementId) { + document.getElementById(elementId).innerHTML = this.getHTML(); + } else { + document.write(this.getHTML()); + } + } else { + if (this.redirect != "") { + document.location.replace(this.redirect); + } else if (this.altTxt) { + if (elementId) { + document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt; + } else { + document.write(this.altTxt +""+ this.bypassTxt); + } + } + } +} + +/* ---- detection functions ---- */ +function getFlashVersion() { + var flashversion = 0; + if (navigator.plugins && navigator.mimeTypes.length) { + var x = navigator.plugins["Shockwave Flash"]; + if(x && x.description) { + var y = x.description; + flashversion = y.charAt(y.indexOf('.')-1); + var aux= y.charAt(y.indexOf('.')-2); + if("0123456789".indexOf(aux)!=-1) flashversion=aux+flashversion; + } + } else { + result = false; + for(var i = 15; i >= 3 && result != true; i--){ + execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript'); + flashversion = i; + } + } + return flashversion; +} + +function detectFlash(ver) { return (getFlashVersion() >= ver) ? true:false; } + +// get value of query string param +function getQueryParamValue(param) { + var q = document.location.search || document.location.href.split("#")[1]; + if (q) { + var detectIndex = q.indexOf(param +"="); + var endIndex = (q.indexOf("&", detectIndex) > -1) ? q.indexOf("&", detectIndex) : q.length; + if (q.length > 1 && detectIndex > -1) { + return q.substring(q.indexOf("=", detectIndex)+1, endIndex); + } else { + return ""; + } + } +} + +/* add Array.push if needed */ +if(Array.prototype.push == null){ + Array.prototype.push = function(item) { this[this.length] = item; return this.length; } +} Binary files /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/flash/visorFreemind.swf and /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/flash/visorFreemind.swf differ diff -Nru /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/FormatNewNodes.java /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/FormatNewNodes.java --- freemind-0.7.1/accessories/plugins/FormatNewNodes.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.9.0RC6/accessories/plugins/FormatNewNodes.java 2007-08-12 09:03:07.000000000 +0100 @@ -0,0 +1,123 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *This program is free software; you can redistribute it and/or + *modify it under the terms of the GNU General Public License + *as published by the Free Software Foundation; either version 2 + *of the License, or (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Created on 25.08.2004 + */ +/* $Id: FormatNewNodes.java,v 1.1.4.3.2.3 2007/08/12 08:03:07 dpolivaev Exp $ */ +package accessories.plugins; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.logging.Logger; + +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.FormatNodeAction; +import freemind.controller.actions.generated.instance.NewNodeAction; +import freemind.controller.actions.generated.instance.NodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.HookRegistration; +import freemind.modes.MindMap; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapController; +import freemind.modes.mindmapmode.actions.xml.ActionFilter; +import freemind.modes.mindmapmode.actions.xml.ActionHandler; +import freemind.modes.mindmapmode.actions.xml.ActionPair; + +/** This plugin formats new nodes using the formats given to former nodes. + * @author foltin + */ +public class FormatNewNodes implements ActionHandler, ActionFilter, + HookRegistration { + + private MindMapController controller; + + private MindMap mMap; + + private Logger logger; + + private HashMap formatActions; + + public FormatNewNodes(ModeController controller, MindMap map) { + this.controller = (MindMapController) controller; + mMap = map; + logger = controller.getFrame().getLogger(this.getClass().getName()); + this.formatActions = new HashMap(); + } + + public void register() { + controller.getActionFactory().registerHandler(this); + controller.getActionFactory().registerFilter(this); + + } + + public void deRegister() { + controller.getActionFactory().deregisterHandler(this); + controller.getActionFactory().deregisterFilter(this); + } + + public void executeAction(XmlAction action) { + // detect format changes: + detectFormatChanges(action); + } + + /** + */ + private void detectFormatChanges(XmlAction doAction) { + if (doAction instanceof CompoundAction) { + CompoundAction compAction = (CompoundAction) doAction; + for (Iterator i = compAction + .getListChoiceList() + .iterator(); i.hasNext();) { + XmlAction childAction = (XmlAction) i.next(); + detectFormatChanges(childAction); + } + } else if (doAction instanceof FormatNodeAction) { + formatActions.put(doAction.getClass().getName(), doAction); + } + + } + + public void startTransaction(String name) { + } + + public void endTransaction(String name) { + } + + public ActionPair filterAction(ActionPair pair) { + if (pair.getDoAction() instanceof NewNodeAction) { + NewNodeAction newNodeAction = (NewNodeAction) pair + .getDoAction(); + // add to a compound the newNodeAction and the other formats we + // have: + CompoundAction compound = new CompoundAction(); + compound.addChoice(newNodeAction); + for (Iterator i = formatActions.values().iterator(); i.hasNext();) { + NodeAction formatAction = (NodeAction) i.next(); + // deep copy: + FormatNodeAction copiedFormatAction = (FormatNodeAction) controller.unMarshall(controller.marshall(formatAction)); + copiedFormatAction.setNode(newNodeAction.getNewId()); + compound.addChoice(copiedFormatAction); + } + ActionPair newPair = new ActionPair(compound, pair.getUndoAction()); + return newPair; + } + return pair; + } + +} diff -Nru /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/FormatNewNodes.xml /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/FormatNewNodes.xml --- freemind-0.7.1/accessories/plugins/FormatNewNodes.xml 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.9.0RC6/accessories/plugins/FormatNewNodes.xml 2006-07-21 06:28:12.000000000 +0100 @@ -0,0 +1,5 @@ + +\n \n
\n \n\n"; + + public final static String EMPTY_EDITOR_STRING_ALTERNATIVE = "\n \n \n \n \n\n \n
\n \n\n"; + + public void startupMapHook() { + super.startupMapHook(); + String foldingType = getResourceString("command"); + // get registration: + NodeNoteRegistration registration = (NodeNoteRegistration) this.getPluginBaseClass(); + JSplitPane splitPane = null; + if (foldingType.equals("jump")) { + // jump to the notes: + splitPane = getSplitPaneToScreen(registration); + int oldSize = splitPane.getDividerLocation(); + NodeNoteRegistration.sPositionToRecover = new Integer(oldSize); +// int maximumDividerLocation = splitPane.getMaximumDividerLocation(); +// if (maximumDividerLocation < oldSize) { +// openSplitPane(splitPane, maximumDividerLocation); +// } else { +// NodeNoteRegistration.sPositionToRecover = null; +// } + KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); + EventQueue.invokeLater(new Runnable(){ + public void run() { + NodeNoteRegistration.getHtmlEditorPanel() + .getMostRecentFocusOwner().requestFocus(); + } + }); + } else { + // show hidden window: + if(registration.getSplitPane() == null) { + // the window is currently hidden. show it: + splitPane = getSplitPaneToScreen(registration); +// openSplitPane(splitPane, maximumDividerLocation); + } else { + // it is shown, hide it: +// int newLoc = splitPane.getHeight() - splitPane.getDividerSize(); +// int currentLoc = splitPane.getDividerLocation(); +// splitPane.setDividerLocation(newLoc); +// splitPane.setLastDividerLocation(currentLoc); + registration.hideNotesPanel(); + getMindMapController().getFrame().setProperty( + FreeMind.RESOURCES_USE_SPLIT_PANE, "false"); + } + + } + } + + private JSplitPane getSplitPaneToScreen(NodeNoteRegistration registration) { + JSplitPane splitPane; + splitPane = registration.getSplitPane(); + if (splitPane == null) { + // no split panes are used. + // jump to the notes: + registration.showNotesPanel(); + splitPane = registration.getSplitPane(); + getMindMapController().getFrame().setProperty( + FreeMind.RESOURCES_USE_SPLIT_PANE, "true"); + } + return splitPane; + } + + private void openSplitPane(JSplitPane splitPane, int maximumDividerLocation) { + int newLoc = splitPane.getLastDividerLocation(); + int currentLoc = splitPane.getDividerLocation(); + if(newLoc > maximumDividerLocation) { + newLoc = maximumDividerLocation; + } + splitPane.setDividerLocation(newLoc); + splitPane.setLastDividerLocation(currentLoc); + } + +} diff -Nru /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/NodeNoteRegistration.java /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/NodeNoteRegistration.java --- freemind-0.7.1/accessories/plugins/NodeNoteRegistration.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.9.0RC6/accessories/plugins/NodeNoteRegistration.java 2009-07-04 21:38:27.000000000 +0100 @@ -0,0 +1,446 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2007 Christian Foltin, Dimitry Polivaev and others. + * + *See COPYING for Details + * + *This program is free software; you can redistribute it and/or + *modify it under the terms of the GNU General Public License + *as published by the Free Software Foundation; either version 2 + *of the License, or (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + *but WITHOUT ANY WARRANTY; without even the implied warranty of + *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *GNU General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Created on 11.09.2007 + */ +/*$Id: NodeNoteRegistration.java,v 1.1.2.18 2009/07/04 20:38:27 christianfoltin Exp $*/ + +package accessories.plugins; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JEditorPane; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.KeyStroke; +import javax.swing.UIManager; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.Style; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.StyleSheet; + +import com.lightdev.app.shtm.SHTMLPanel; +import com.lightdev.app.shtm.TextResources; + +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.MenuItemSelectedListener; +import freemind.controller.actions.generated.instance.EditNoteToNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.HookRegistration; +import freemind.main.FreeMind; +import freemind.main.FreeMindMain; +import freemind.main.Resources; +import freemind.main.Tools; +import freemind.modes.MindMap; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.ModeController.NodeLifetimeListener; +import freemind.modes.ModeController.NodeSelectionListener; +import freemind.modes.common.plugins.NodeNoteBase; +import freemind.modes.mindmapmode.MindMapController; +import freemind.modes.mindmapmode.actions.xml.ActorXml; +import freemind.view.mindmapview.NodeView; + +public class NodeNoteRegistration implements HookRegistration, ActorXml, MenuItemSelectedListener { + public static final class SimplyHtmlResources implements TextResources { + public String getString(String pKey) { + // no splash for SimplyHtml. + if(Tools.safeEquals("show_splash_screen", pKey)) { + return "false"; + } + pKey = "simplyhtml." + pKey; + String resourceString = Resources.getInstance().getResourceString(pKey, null); + if(resourceString == null){ + resourceString = Resources.getInstance().getProperty(pKey); + } + return resourceString; + } + } + + + + private static class SouthPanel extends JPanel { + public SouthPanel() { + super(new BorderLayout()); + setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + } + + protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { + return super.processKeyBinding(ks, e, condition, pressed) + || e.getKeyChar() == KeyEvent.VK_SPACE + || e.getKeyChar() == KeyEvent.VK_ALT; + } + } + + + + private final class NoteDocumentListener implements DocumentListener { + public void changedUpdate(DocumentEvent arg0) { + docEvent(); + } + + private void docEvent() { + // make map dirty in order to enable automatic save on note + // change. + getMindMapController().getMap().setSaved(false); + } + + public void insertUpdate(DocumentEvent arg0) { + docEvent(); + } + + public void removeUpdate(DocumentEvent arg0) { + docEvent(); + } + } + + // private NodeTextListener listener; + + private final class NotesManager implements NodeSelectionListener, + NodeLifetimeListener { + + private MindMapNode node; + + public NotesManager() { + } + + public void onDeselectHook(NodeView node) { + // logger.info("onLooseFocuse for node " + node.toString() + " + // and noteViewerComponent=" + noteViewerComponent); + noteViewerComponent.getDocument().removeDocumentListener( + mNoteDocumentListener); + // store its content: + onSaveNode(node.getModel()); + this.node = null; + // getHtmlEditorPanel().setCurrentDocumentContent("Note", ""); + } + + public void onSelectHook(NodeView nodeView) { + this.node = nodeView.getModel(); + HTMLDocument document = noteViewerComponent.getDocument(); + // remove listener to avoid unnecessary dirty events. + document.removeDocumentListener( + mNoteDocumentListener); + try { +// Dimitry: +// Images referenced from documents with bases given by +// pFile.toURI().toURL() are not shown in SimplyHTML +// (bug [ freemind-Bugs-2019223 ] Images are not shown in the Notes view) +// => the old method File.toURL() must be used again. + document.setBase(node.getMap().getFile().toURL()); + } + catch (Exception e) {} + + // logger.info("onReceiveFocuse for node " + node.toString()); + String note = node.getNoteText(); + if (note != null) { + noteViewerComponent.setCurrentDocumentContent(note); + mLastContentEmpty = false; + } else if (!mLastContentEmpty) { + noteViewerComponent.setCurrentDocumentContent(""); + mLastContentEmpty = true; + } + document.addDocumentListener( + mNoteDocumentListener); + } + + public void onUpdateNodeHook(MindMapNode node) { + } + + public void onSaveNode(MindMapNode node) { + if (this.node != node) { + return; + } + boolean editorContentEmpty = true; +// // TODO: Save the style with the note. +// StyleSheet styleSheet = noteViewerComponent.getDocument() +// .getStyleSheet(); +// styleSheet.removeStyle("body"); +// styleSheet.removeStyle("p"); + JEditorPane editorPane = noteViewerComponent.getEditorPane(); + int caretPosition = editorPane.getCaretPosition(); + int selectionStart = editorPane.getSelectionStart(); + int selectionEnd = editorPane.getSelectionEnd(); + String documentText = noteViewerComponent.getDocumentText(); + // (?s) makes . matching newline as well. + documentText = documentText.replaceFirst("(?s)Font
for this component
+ */
+ public void setFont(Font font) {
+ if (comboBox != null) {
+ comboBox.setFont(font);
+ }
+ super.setFont(font);
+ }
+
+ /**
+ * Updates the UI.
+ *
+ * @see javax.swing.JPanel#updateUI()
+ */
+ public void updateUI() {
+ final JSpinner testSpinner = new JSpinner();
+ if (spinner != null) {
+ if ("Windows".equals(UIManager.getLookAndFeel().getID())) {
+ spinner.setBorder(testSpinner.getBorder());
+ } else {
+ spinner.setBorder(new EmptyBorder(0, 0, 0, 0));
+ }
+ }
+ }
+
+ /**
+ * Creates a JFrame with a JMonthChooser inside and can be used for testing.
+ *
+ * @param s
+ * The command line arguments
+ */
+ public static void main(String[] s) {
+ JFrame frame = new JFrame("MonthChooser");
+ frame.getContentPane().add(new JMonthChooser());
+ frame.pack();
+ frame.setVisible(true);
+ }
+}
\ No newline at end of file
diff -Nru /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/time/JSpinField.java /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/time/JSpinField.java
--- freemind-0.7.1/accessories/plugins/time/JSpinField.java 1970-01-01 01:00:00.000000000 +0100
+++ freemind-0.9.0RC6/accessories/plugins/time/JSpinField.java 2007-01-04 00:13:27.000000000 +0000
@@ -0,0 +1,366 @@
+/*
+ * JSpinField.java - A spin field using a JSpinner (JDK 1.4)
+ * Copyright (C) 2004 Kai Toedter
+ * kai@toedter.com
+ * www.toedter.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package accessories.plugins.time;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.JTextField;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+/**
+ * JSpinField is a numeric field with 2 spin buttons to increase or decrease the
+ * value. It has the same interface as the "old" JSpinField but uses a JSpinner
+ * internally (since J2SE SDK 1.4) rather than a scrollbar for emulating the
+ * spin buttons.
+ *
+ * @author Kai Toedter
+ * @version $LastChangedRevision: 85 $
+ * @version $LastChangedDate: 2006-04-28 13:50:52 +0200 (Fr, 28 Apr 2006) $
+ */
+public class JSpinField extends JPanel implements ChangeListener, CaretListener, ActionListener,
+ FocusListener {
+ private static final long serialVersionUID = 1694904792717740650L;
+
+ protected JSpinner spinner;
+
+ /** the text (number) field */
+ protected JTextField textField;
+ protected int min;
+ protected int max;
+ protected int value;
+ protected Color darkGreen;
+
+ /**
+ * Default JSpinField constructor. The valid value range is between
+ * Integer.MIN_VALUE and Integer.MAX_VALUE. The initial value is 0.
+ */
+ public JSpinField() {
+ this(Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
+
+ /**
+ * JSpinField constructor with given minimum and maximum vaues and initial
+ * value 0.
+ */
+ public JSpinField(int min, int max) {
+ super();
+ setName("JSpinField");
+ this.min = min;
+ if (max < min)
+ max = min;
+ this.max = max;
+ value = 0;
+ if (value < min)
+ value = min;
+ if (value > max)
+ value = max;
+
+ darkGreen = new Color(0, 150, 0);
+ setLayout(new BorderLayout());
+ textField = new JTextField();
+ textField.addCaretListener(this);
+ textField.addActionListener(this);
+ textField.setHorizontalAlignment(SwingConstants.RIGHT);
+ textField.setBorder(BorderFactory.createEmptyBorder());
+ textField.setText(Integer.toString(value));
+ textField.addFocusListener(this);
+ spinner = new JSpinner() {
+ private static final long serialVersionUID = -6287709243342021172L;
+ private JTextField textField = new JTextField();
+
+ public Dimension getPreferredSize() {
+ Dimension size = super.getPreferredSize();
+ return new Dimension(size.width, textField.getPreferredSize().height);
+ }
+ };
+ spinner.setEditor(textField);
+ spinner.addChangeListener(this);
+ // spinner.setSize(spinner.getWidth(), textField.getHeight());
+ add(spinner, BorderLayout.CENTER);
+ }
+
+ public void adjustWidthToMaximumValue() {
+ JTextField testTextField = new JTextField(Integer.toString(max));
+ int width = testTextField.getPreferredSize().width;
+ int height = testTextField.getPreferredSize().height;
+ textField.setPreferredSize(new Dimension(width, height));
+ textField.revalidate();
+ }
+
+ /**
+ * Is invoked when the spinner model changes
+ *
+ * @param e
+ * the ChangeEvent
+ */
+ public void stateChanged(ChangeEvent e) {
+ SpinnerNumberModel model = (SpinnerNumberModel) spinner.getModel();
+ int value = model.getNumber().intValue();
+ setValue(value);
+ }
+
+ /**
+ * Sets the value attribute of the JSpinField object.
+ *
+ * @param newValue
+ * The new value
+ * @param updateTextField
+ * true if text field should be updated
+ */
+ protected void setValue(int newValue, boolean updateTextField, boolean firePropertyChange) {
+ int oldValue = value;
+ if (newValue < min) {
+ value = min;
+ } else if (newValue > max) {
+ value = max;
+ } else {
+ value = newValue;
+ }
+
+ if (updateTextField) {
+ textField.setText(Integer.toString(value));
+ textField.setForeground(Color.black);
+ }
+
+ if (firePropertyChange) {
+ firePropertyChange("value", oldValue, value);
+ }
+ }
+
+ /**
+ * Sets the value. This is a bound property.
+ *
+ * @param newValue
+ * the new value
+ *
+ * @see #getValue
+ */
+ public void setValue(int newValue) {
+ setValue(newValue, true, true);
+ spinner.setValue(new Integer(value));
+ }
+
+ /**
+ * Returns the value.
+ *
+ * @return the value value
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the minimum value.
+ *
+ * @param newMinimum
+ * the new minimum value
+ *
+ * @see #getMinimum
+ */
+ public void setMinimum(int newMinimum) {
+ min = newMinimum;
+ }
+
+ /**
+ * Returns the minimum value.
+ *
+ * @return the minimum value
+ */
+ public int getMinimum() {
+ return min;
+ }
+
+ /**
+ * Sets the maximum value and adjusts the preferred width.
+ *
+ * @param newMaximum
+ * the new maximum value
+ *
+ * @see #getMaximum
+ */
+ public void setMaximum(int newMaximum) {
+ max = newMaximum;
+ }
+
+ /**
+ * Sets the horizontal alignment of the displayed value.
+ *
+ * @param alignment
+ * the horizontal alignment
+ */
+ public void setHorizontalAlignment(int alignment) {
+ textField.setHorizontalAlignment(alignment);
+ }
+
+ /**
+ * Returns the maximum value.
+ *
+ * @return the maximum value
+ */
+ public int getMaximum() {
+ return max;
+ }
+
+ /**
+ * Sets the font property.
+ *
+ * @param font
+ * the new font
+ */
+ public void setFont(Font font) {
+ if (textField != null) {
+ textField.setFont(font);
+ }
+ }
+
+ /**
+ * Sets the foreground
+ *
+ * @param fg
+ * the foreground
+ */
+ public void setForeground(Color fg) {
+ if (textField != null) {
+ textField.setForeground(fg);
+ }
+ }
+
+ /**
+ * After any user input, the value of the textfield is proofed. Depending on
+ * being an integer, the value is colored green or red.
+ *
+ * @param e
+ * the caret event
+ */
+ public void caretUpdate(CaretEvent e) {
+ try {
+ int testValue = Integer.valueOf(textField.getText()).intValue();
+
+ if ((testValue >= min) && (testValue <= max)) {
+ textField.setForeground(darkGreen);
+ setValue(testValue, false, true);
+ } else {
+ textField.setForeground(Color.red);
+ }
+ } catch (Exception ex) {
+ if (ex instanceof NumberFormatException) {
+ textField.setForeground(Color.red);
+ }
+
+ // Ignore all other exceptions, e.g. illegal state exception
+ }
+
+ textField.repaint();
+ }
+
+ /**
+ * After any user input, the value of the textfield is proofed. Depending on
+ * being an integer, the value is colored green or red. If the textfield is
+ * green, the enter key is accepted and the new value is set.
+ *
+ * @param e
+ * Description of the Parameter
+ */
+ public void actionPerformed(ActionEvent e) {
+ if (textField.getForeground().equals(darkGreen)) {
+ setValue(Integer.valueOf(textField.getText()).intValue());
+ }
+ }
+
+ /**
+ * Enable or disable the JSpinField.
+ *
+ * @param enabled
+ * The new enabled value
+ */
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ spinner.setEnabled(enabled);
+ textField.setEnabled(enabled);
+ /*
+ * Fixes the background bug
+ * 4991597 and sets the background explicitely to a
+ * TextField.inactiveBackground.
+ */
+ if (!enabled) {
+ textField.setBackground(UIManager.getColor("TextField.inactiveBackground"));
+ }
+ }
+
+ /**
+ * Returns the year chooser's spinner (which allow the focus to be set to
+ * it).
+ *
+ * @return Component the spinner or null, if the month chooser has no
+ * spinner
+ */
+ public Component getSpinner() {
+ return spinner;
+ }
+
+ /**
+ * Creates a JFrame with a JSpinField inside and can be used for testing.
+ *
+ * @param s
+ * The command line arguments
+ */
+ public static void main(String[] s) {
+ JFrame frame = new JFrame("JSpinField");
+ frame.getContentPane().add(new JSpinField());
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
+ */
+ public void focusGained(FocusEvent e) {
+ }
+
+ /**
+ * The value of the text field is checked against a valid (green) value. If
+ * valid, the value is set and a property change is fired.
+ */
+ public void focusLost(FocusEvent e) {
+ actionPerformed(null);
+ }
+}
\ No newline at end of file
diff -Nru /tmp/KlNFtGuqJM/freemind-0.7.1/accessories/plugins/time/JTripleCalendar.java /tmp/7aYJDoZC1R/freemind-0.9.0RC6/accessories/plugins/time/JTripleCalendar.java
--- freemind-0.7.1/accessories/plugins/time/JTripleCalendar.java 1970-01-01 01:00:00.000000000 +0100
+++ freemind-0.9.0RC6/accessories/plugins/time/JTripleCalendar.java 2007-02-25 21:12:50.000000000 +0000
@@ -0,0 +1,159 @@
+/*FreeMind - A Program for creating and viewing Mindmaps
+ *Copyright (C) 2007 Christian Foltin Name | Value |
---|---|