< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 477,489 **** * Create a compact set of attributes that might be shared. * This is a hook for subclasses that want to alter the * behavior of SmallAttributeSet. This can be reimplemented * to return an AttributeSet that provides some sort of * attribute conversion. - * * @param a The set of attributes to be represented in the * the compact form. */ protected SmallAttributeSet createSmallAttributeSet(AttributeSet a) { return new SmallAttributeSet(a); } --- 477,489 ---- * Create a compact set of attributes that might be shared. * This is a hook for subclasses that want to alter the * behavior of SmallAttributeSet. This can be reimplemented * to return an AttributeSet that provides some sort of * attribute conversion. * @param a The set of attributes to be represented in the * the compact form. + * @return a compact set of attributes that might be shared */ protected SmallAttributeSet createSmallAttributeSet(AttributeSet a) { return new SmallAttributeSet(a); }
*** 496,505 **** --- 496,507 ---- * to return a MutableAttributeSet that provides some sort of * attribute conversion. * * @param a The set of attributes to be represented in the * the larger form. + * @return a large set of attributes that should trade off + * space for time */ protected MutableAttributeSet createLargeAttributeSet(AttributeSet a) { return new SimpleAttributeSet(a); }
*** 556,573 **** --- 558,585 ---- // --- serialization --------------------------------------------- /** * Context-specific handling of writing out attributes + * @param out the output stream + * @param a the attribute set + * @exception IOException on any I/O error */ public void writeAttributes(ObjectOutputStream out, AttributeSet a) throws IOException { writeAttributeSet(out, a); } /** * Context-specific handling of reading in attributes + * @param in the object stream to read the attribute data from. + * @param a the attribute set to place the attribute + * definitions in. + * @exception ClassNotFoundException passed upward if encountered + * when reading the object stream. + * @exception IOException passed upward if encountered when + * reading the object stream. */ public void readAttributes(ObjectInputStream in, MutableAttributeSet a) throws ClassNotFoundException, IOException { readAttributeSet(in, a); }
*** 683,704 **** } /** * Returns the object previously registered with * <code>registerStaticAttributeKey</code>. */ public static Object getStaticAttribute(Object key) { if (thawKeyMap == null || key == null) { return null; } return thawKeyMap.get(key); } /** ! * Returns the String that <code>key</code> will be registered with * @see #getStaticAttribute * @see #registerStaticAttributeKey */ public static Object getStaticAttributeKey(Object key) { return key.getClass().getName() + "." + key.toString(); } --- 695,721 ---- } /** * 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) { if (thawKeyMap == null || key == null) { return null; } 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 */ public static Object getStaticAttributeKey(Object key) { return key.getClass().getName() + "." + key.toString(); }
*** 770,784 **** --- 787,809 ---- * default, this is the class that will be used to store attributes * when held in the compact sharable form. */ public class SmallAttributeSet implements AttributeSet { + /** + * Constructs a SmallAttributeSet. + * @param attributes the attributes + */ public SmallAttributeSet(Object[] attributes) { this.attributes = attributes; updateResolveParent(); } + /** + * Constructs a SmallAttributeSet. + * @param attrs the attributes + */ public SmallAttributeSet(AttributeSet attrs) { int n = attrs.getAttributeCount(); Object[] tbl = new Object[2 * n]; Enumeration<?> names = attrs.getAttributeNames(); int i = 0;
*** 816,826 **** } // --- Object methods ------------------------- /** ! * Returns a string showing the key/value pairs */ public String toString() { String s = "{"; Object[] tbl = attributes; for (int i = 0; i < tbl.length; i += 2) { --- 841,852 ---- } // --- Object methods ------------------------- /** ! * Returns a string showing the key/value pairs. ! * @return a string showing the key/value pairs */ public String toString() { String s = "{"; Object[] tbl = attributes; for (int i = 0; i < tbl.length; i += 2) {
*** 1380,1390 **** } /** * Return an array of all the listeners of the given type that * were added to this model. ! * * @return all of the objects receiving <em>listenerType</em> notifications * from this model * * @since 1.3 */ --- 1406,1417 ---- } /** * Return an array of all the listeners of the given type that * were added to this model. ! * @param <T> the listener type ! * @param listenerType the type of listeners requested * @return all of the objects receiving <em>listenerType</em> notifications * from this model * * @since 1.3 */
< prev index next >