krysalis-jplugin/src/java/org/krysalis/swingx/xml DOMNodeBoundJTextArea.java,NONE,1.1 DOMNodeBoundJTextBox.java,NONE,1.1
| Newsgroups | gmane.comp.krysalis.metamorphosis.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/metamorphosis/krysalis-jplugin/src/java/org/krysalis/swingx/xml In directory sc8-pr-cvs1:/tmp/cvs-serv31983 Added Files: DOMNodeBoundJTextArea.java DOMNodeBoundJTextBox.java Log Message: Move xml stuff in xml package --- NEW FILE: DOMNodeBoundJTextArea.java --- /***************************************************************************** * Copyright (C) The Krysalis project. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Krysalis Software * * License version 1.1_01, a copy of which has been included with this * * distribution in the LICENSE file. * *****************************************************************************/ package org.krysalis.swingx.xml; import java.awt.Graphics; import javax.swing.JTextArea; import javax.swing.event.CaretEvent; /** *@author <a href="mailto:[email protected]">Nicola Ken Barozzi</a> *@created June 20, 2001 *@version 1.0 */ public class DOMNodeBoundJTextArea extends JTextArea { org.w3c.dom.Node node; /** * Constructor for the AntiAliasedDOMNodeBoundJTextArea object */ public DOMNodeBoundJTextArea() { super(); } /** * Sets the node attribute of the AntiAliasedDOMNodeBoundJTextArea object * *@param node The new node value */ public void setNode(org.w3c.dom.Node node) { if (node != null) { this.node = node; this.setText(node.getNodeValue()); this.addCaretListener( new javax.swing.event.CaretListener() { public void caretUpdate(CaretEvent e) { received_caretUpdate(e); } } ); this.setEnabled(true); } } /** * Description of the Method * *@param g1 Description of Parameter */ public void paint(Graphics g1) { super.paint(g1); } /** * Description of the Method * *@param e Description of Parameter */ void received_caretUpdate(CaretEvent e) { node.setNodeValue(this.getText()); } } --- NEW FILE: DOMNodeBoundJTextBox.java --- /***************************************************************************** * Copyright (C) The Krysalis project. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Krysalis Software * * License version 1.1_01, a copy of which has been included with this * * distribution in the LICENSE file. * *****************************************************************************/ package org.krysalis.swingx.xml; import java.awt.Graphics; import javax.swing.JTextField; import javax.swing.event.CaretEvent; /** *@author <a href="mailto:[email protected]">Nicola Ken Barozzi</a> *@created June 20, 2001 *@version 1.0 */ public class DOMNodeBoundJTextBox extends JTextField { org.w3c.dom.Node node; /** * Constructor for the AntiAliasedDOMNodeBoundJTextBox object */ public DOMNodeBoundJTextBox() { super(); super.setEnabled(false); } /** * Constructor for the AntiAliasedDOMNodeBoundJTextBox object * *@param columns Description of Parameter */ public DOMNodeBoundJTextBox(int columns) { super(columns); super.setEnabled(false); } /** * Sets the node attribute of the AntiAliasedDOMNodeBoundJTextBox object * *@param node The new node value */ public void setNode(org.w3c.dom.Node node) { if (node != null) { this.node = node; this.setText(node.getNodeValue()); this.addCaretListener( new javax.swing.event.CaretListener() { public void caretUpdate(CaretEvent e) { setTextInNode(); } } ); this.setEnabled(true); } } /** * Description of the Method * *@param g1 Description of Parameter */ public void paint(Graphics g1) { super.paint(g1); } /** * Sets the textInNode attribute of the AntiAliasedDOMNodeBoundJTextBox * object */ private void setTextInNode() { node.setNodeValue(this.getText()); } } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf