556 editingComponent = null;
557 }
558
559 // Serialization support.
560 private void writeObject(ObjectOutputStream s) throws IOException {
561 Vector<Object> values = new Vector<Object>();
562
563 s.defaultWriteObject();
564 // Save the realEditor, if its Serializable.
565 if(realEditor != null && realEditor instanceof Serializable) {
566 values.addElement("realEditor");
567 values.addElement(realEditor);
568 }
569 s.writeObject(values);
570 }
571
572 private void readObject(ObjectInputStream s)
573 throws IOException, ClassNotFoundException {
574 s.defaultReadObject();
575
576 Vector values = (Vector)s.readObject();
577 int indexCounter = 0;
578 int maxCounter = values.size();
579
580 if(indexCounter < maxCounter && values.elementAt(indexCounter).
581 equals("realEditor")) {
582 realEditor = (TreeCellEditor)values.elementAt(++indexCounter);
583 indexCounter++;
584 }
585 }
586
587
588 /**
589 * <code>TextField</code> used when no editor is supplied.
590 * This textfield locks into the border it is constructed with.
591 * It also prefers its parents font over its font. And if the
592 * renderer is not <code>null</code> and no font
593 * has been specified the preferred height is that of the renderer.
594 */
595 public class DefaultTextField extends JTextField {
596 /** Border to use. */
|
556 editingComponent = null;
557 }
558
559 // Serialization support.
560 private void writeObject(ObjectOutputStream s) throws IOException {
561 Vector<Object> values = new Vector<Object>();
562
563 s.defaultWriteObject();
564 // Save the realEditor, if its Serializable.
565 if(realEditor != null && realEditor instanceof Serializable) {
566 values.addElement("realEditor");
567 values.addElement(realEditor);
568 }
569 s.writeObject(values);
570 }
571
572 private void readObject(ObjectInputStream s)
573 throws IOException, ClassNotFoundException {
574 s.defaultReadObject();
575
576 Vector<?> values = (Vector)s.readObject();
577 int indexCounter = 0;
578 int maxCounter = values.size();
579
580 if(indexCounter < maxCounter && values.elementAt(indexCounter).
581 equals("realEditor")) {
582 realEditor = (TreeCellEditor)values.elementAt(++indexCounter);
583 indexCounter++;
584 }
585 }
586
587
588 /**
589 * <code>TextField</code> used when no editor is supplied.
590 * This textfield locks into the border it is constructed with.
591 * It also prefers its parents font over its font. And if the
592 * renderer is not <code>null</code> and no font
593 * has been specified the preferred height is that of the renderer.
594 */
595 public class DefaultTextField extends JTextField {
596 /** Border to use. */
|