< prev index next >

src/java.desktop/share/classes/javax/swing/text/StyleContext.java

Print this page

        

*** 55,65 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @author Timothy Prinzing */ @SuppressWarnings("serial") // Same-version serialization only --- 55,65 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @author Timothy Prinzing */ @SuppressWarnings("serial") // Same-version serialization only
*** 160,173 **** public void removeChangeListener(ChangeListener l) { styles.removeChangeListener(l); } /** ! * Returns an array of all the <code>ChangeListener</code>s added * to this StyleContext with addChangeListener(). * ! * @return all of the <code>ChangeListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return ((NamedStyle)styles).getChangeListeners(); --- 160,173 ---- public void removeChangeListener(ChangeListener l) { styles.removeChangeListener(l); } /** ! * Returns an array of all the {@code ChangeListener}s added * to this StyleContext with addChangeListener(). * ! * @return all of the {@code ChangeListener}s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return ((NamedStyle)styles).getChangeListeners();
*** 587,597 **** /** * Writes a set of attributes to the given object stream * for the purpose of serialization. This will take * special care to deal with static attribute keys that * have been registered wit the ! * <code>registerStaticAttributeKey</code> method. * Any attribute key not registered as a static key * will be serialized directly. All values are expected * to be serializable. * * @param out the output stream --- 587,597 ---- /** * Writes a set of attributes to the given object stream * for the purpose of serialization. This will take * special care to deal with static attribute keys that * have been registered wit the ! * {@code registerStaticAttributeKey} method. * Any attribute key not registered as a static key * will be serialized directly. All values are expected * to be serializable. * * @param out the output stream
*** 630,644 **** } /** * Reads a set of attributes from the given object input * stream that have been previously written out with ! * <code>writeAttributeSet</code>. This will try to restore * keys that were static objects to the static objects in * the current virtual machine considering only those keys * that have been registered with the ! * <code>registerStaticAttributeKey</code> method. * The attributes retrieved from the stream will be placed * into the given mutable set. * * @param in the object stream to read the attribute data from. * @param a the attribute set to place the attribute --- 630,644 ---- } /** * Reads a set of attributes from the given object input * stream that have been previously written out with ! * {@code writeAttributeSet}. This will try to restore * keys that were static objects to the static objects in * the current virtual machine considering only those keys * that have been registered with the ! * {@code registerStaticAttributeKey} method. * The attributes retrieved from the stream will be placed * into the given mutable set. * * @param in the object stream to read the attribute data from. * @param a the attribute set to place the attribute
*** 673,683 **** * Registers an object as a static object that is being * used as a key in attribute sets. This allows the key * to be treated specially for serialization. * <p> * For operation under a 1.1 virtual machine, this ! * uses the value returned by <code>toString</code> * concatenated to the classname. The value returned * by toString should not have the class reference * in it (ie it should be reimplemented from the * definition in Object) in order to be the same when * recomputed later. --- 673,683 ---- * Registers an object as a static object that is being * used as a key in attribute sets. This allows the key * to be treated specially for serialization. * <p> * For operation under a 1.1 virtual machine, this ! * uses the value returned by {@code toString} * concatenated to the classname. The value returned * by toString should not have the class reference * in it (ie it should be reimplemented from the * definition in Object) in order to be the same when * recomputed later.
*** 694,704 **** thawKeyMap.put(ioFmt, key); } /** * Returns the object previously registered with ! * <code>registerStaticAttributeKey</code>. * @param key the object key * @return Returns the object previously registered with * {@code registerStaticAttributeKey} */ public static Object getStaticAttribute(Object key) { --- 694,704 ---- thawKeyMap.put(ioFmt, key); } /** * Returns the object previously registered with ! * {@code registerStaticAttributeKey}. * @param key the object key * @return Returns the object previously registered with * {@code registerStaticAttributeKey} */ public static Object getStaticAttribute(Object key) {
*** 707,717 **** } return thawKeyMap.get(key); } /** ! * Returns the String that <code>key</code> will be registered with. * @see #getStaticAttribute * @see #registerStaticAttributeKey * @param key the object key * @return the String that {@code key} will be registered with */ --- 707,717 ---- } return thawKeyMap.get(key); } /** ! * Returns the String that {@code key} will be registered with. * @see #getStaticAttribute * @see #registerStaticAttributeKey * @param key the object key * @return the String that {@code key} will be registered with */
*** 874,888 **** return code; } /** * Compares this object to the specified object. ! * The result is <code>true</code> if the object is an equivalent * set of attributes. * @param obj the object to compare with. ! * @return <code>true</code> if the objects are equal; ! * <code>false</code> otherwise. */ public boolean equals(Object obj) { if (obj instanceof AttributeSet) { AttributeSet attrs = (AttributeSet) obj; return ((getAttributeCount() == attrs.getAttributeCount()) && --- 874,888 ---- return code; } /** * Compares this object to the specified object. ! * The result is {@code true} if the object is an equivalent * set of attributes. * @param obj the object to compare with. ! * @return {@code true} if the objects are equal; ! * {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof AttributeSet) { AttributeSet attrs = (AttributeSet) obj; return ((getAttributeCount() == attrs.getAttributeCount()) &&
*** 1044,1055 **** } /** * Tests if this enumeration contains more elements. * ! * @return <code>true</code> if this enumeration contains more elements; ! * <code>false</code> otherwise. * @since 1.0 */ public boolean hasMoreElements() { return i < attr.length; } --- 1044,1055 ---- } /** * Tests if this enumeration contains more elements. * ! * @return {@code true} if this enumeration contains more elements; ! * {@code false} otherwise. * @since 1.0 */ public boolean hasMoreElements() { return i < attr.length; }
*** 1244,1259 **** return fhash ^ style ^ size; } /** * Compares this object to the specified object. ! * The result is <code>true</code> if and only if the argument is not ! * <code>null</code> and is a <code>Font</code> object with the same * name, style, and point size as this font. * @param obj the object to compare this font with. ! * @return <code>true</code> if the objects are equal; ! * <code>false</code> otherwise. */ public boolean equals(Object obj) { if (obj instanceof FontKey) { FontKey font = (FontKey)obj; return (size == font.size) && (style == font.style) && (family == font.family); --- 1244,1259 ---- return fhash ^ style ^ size; } /** * Compares this object to the specified object. ! * The result is {@code true} if and only if the argument is not ! * {@code null} and is a {@code Font} object with the same * name, style, and point size as this font. * @param obj the object to compare this font with. ! * @return {@code true} if the objects are equal; ! * {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof FontKey) { FontKey font = (FontKey)obj; return (size == font.size) && (style == font.style) && (family == font.family);
*** 1275,1285 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only public class NamedStyle implements Style, Serializable { --- 1275,1285 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only public class NamedStyle implements Style, Serializable {
*** 1368,1381 **** listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the <code>ChangeListener</code>s added * to this NamedStyle with addChangeListener(). * ! * @return all of the <code>ChangeListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class); --- 1368,1381 ---- listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the {@code ChangeListener}s added * to this NamedStyle with addChangeListener(). * ! * @return all of the {@code ChangeListener}s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class);
< prev index next >