/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Factory used for obtaining styles. Supports associating a style based on
* the name of the component as returned by <code>Component.getName()</code>,
* and the <code>Region</code> associated with the <code>JComponent</code>.
* Lookup is done using regular expressions.
*
* @author Scott Violet
*/
/**
* Used to indicate the lookup should be done based on Component name.
*/
/**
* Used to indicate the lookup should be done based on region.
*/
/**
* List containing set of StyleAssociations used in determining matching
* styles.
*/
/**
* Used during lookup.
*/
/**
* Maps from a List (BakedArrayList to be precise) to the merged style.
*/
/**
* Used if there are no styles matching a widget.
*/
}
// Make an empty path match all.
path = ".*";
}
}
}
}
/**
* Returns the style for the specified Component.
*
* @param c Component asking for
* @param id ID of the Component
*/
return getDefaultStyle();
}
// Use a cached Style if possible, otherwise create a new one.
}
}
return style;
}
/**
* Returns the style to use if there are no matching styles.
*/
if (_defaultStyle == null) {
_defaultStyle = new DefaultSynthStyle();
}
return _defaultStyle;
}
/**
* Fetches any styles that match the passed into arguments into
* <code>matches</code>.
*/
cName = "";
}
}
else {
}
}
}
}
/**
* Caches the specified style.
*/
}
/**
* Returns the cached style from the passed in arguments.
*/
return null;
}
}
/**
* Creates a single Style from the passed in styles. The passed in List
* is reverse sorted, that is the most recently added style found to
* match will be first.
*/
if (size == 0) {
return null;
}
else if (size == 1) {
}
// NOTE: merging is done backwards as DefaultSynthStyleFactory reverses
// order, that is, the most specific style is first.
}
return style;
}
}