src/share/classes/javax/swing/plaf/synth/DefaultSynthStyleFactory.java
Print this page
@@ -56,27 +56,27 @@
*/
private List<StyleAssociation> _styles;
/**
* Used during lookup.
*/
- private BakedArrayList _tmpList;
+ private BakedArrayList<SynthStyle> _tmpList;
/**
* Maps from a List (BakedArrayList to be precise) to the merged style.
*/
- private Map<BakedArrayList, SynthStyle> _resolvedStyles;
+ private Map<BakedArrayList<SynthStyle>, SynthStyle> _resolvedStyles;
/**
* Used if there are no styles matching a widget.
*/
private SynthStyle _defaultStyle;
DefaultSynthStyleFactory() {
- _tmpList = new BakedArrayList(5);
- _styles = new ArrayList<StyleAssociation>();
- _resolvedStyles = new HashMap<BakedArrayList, SynthStyle>();
+ _tmpList = new BakedArrayList<SynthStyle>(5);
+ _styles = new ArrayList<>();
+ _resolvedStyles = new HashMap<>();
}
public synchronized void addStyle(DefaultSynthStyle style,
String path, int type) throws PatternSyntaxException {
if (path == null) {
@@ -98,11 +98,11 @@
*
* @param c Component asking for
* @param id ID of the Component
*/
public synchronized SynthStyle getStyle(JComponent c, Region id) {
- BakedArrayList matches = _tmpList;
+ BakedArrayList<SynthStyle> matches = _tmpList;
matches.clear();
getMatchingStyles(matches, c, id);
if (matches.size() == 0) {
@@ -136,11 +136,11 @@
/**
* Fetches any styles that match the passed into arguments into
* <code>matches</code>.
*/
- private void getMatchingStyles(List matches, JComponent c,
+ private void getMatchingStyles(List<SynthStyle> matches, JComponent c,
Region id) {
String idName = id.getLowerCaseName();
String cName = c.getName();
if (cName == null) {
@@ -164,20 +164,20 @@
}
/**
* Caches the specified style.
*/
- private void cacheStyle(List styles, SynthStyle style) {
- BakedArrayList cachedStyles = new BakedArrayList(styles);
+ private void cacheStyle(List<SynthStyle> styles, SynthStyle style) {
+ BakedArrayList<SynthStyle> cachedStyles = new BakedArrayList<>(styles);
_resolvedStyles.put(cachedStyles, style);
}
/**
* Returns the cached style from the passed in arguments.
*/
- private SynthStyle getCachedStyle(List styles) {
+ private SynthStyle getCachedStyle(List<SynthStyle> styles) { // ??
if (styles.size() == 0) {
return null;
}
return _resolvedStyles.get(styles);
}
@@ -185,11 +185,11 @@
/**
* 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.
*/
- private SynthStyle mergeStyles(List styles) {
+ private SynthStyle mergeStyles(List<SynthStyle> styles) {
int size = styles.size();
if (size == 0) {
return null;
}