Commit ad91feff by Michael Koch Committed by Michael Koch

UIDefaults.java: Reformated to match classpath's version.

2003-11-27  Michael Koch  <konqueror@gmx.de>

	* javax/swing/UIDefaults.java:
	Reformated to match classpath's version.

From-SVN: r73981
parent 9121d16b
2003-11-27 Michael Koch <konqueror@gmx.de>
* javax/swing/UIDefaults.java:
Reformated to match classpath's version.
2003-11-27 Sascha Brawer <brawer@dandelis.ch> 2003-11-27 Sascha Brawer <brawer@dandelis.ch>
* javax/swing/UIManager.java (getDefaults, getDimension, * javax/swing/UIManager.java (getDefaults, getDimension,
......
...@@ -80,11 +80,11 @@ public class UIDefaults extends Hashtable ...@@ -80,11 +80,11 @@ public class UIDefaults extends Hashtable
public static class LazyInputMap implements LazyValue public static class LazyInputMap implements LazyValue
{ {
Object[] bind; Object[] bind;
public LazyInputMap (Object[] bindings) public LazyInputMap(Object[] bindings)
{ {
bind = bindings; bind = bindings;
} }
public Object createValue (UIDefaults table) public Object createValue(UIDefaults table)
{ {
InputMap im = new InputMap (); InputMap im = new InputMap ();
for (int i = 0; 2*i+1 < bind.length; ++i) for (int i = 0; 2*i+1 < bind.length; ++i)
...@@ -104,7 +104,7 @@ public class UIDefaults extends Hashtable ...@@ -104,7 +104,7 @@ public class UIDefaults extends Hashtable
public static class ProxyLazyValue implements LazyValue public static class ProxyLazyValue implements LazyValue
{ {
LazyValue inner; LazyValue inner;
public ProxyLazyValue (String s) public ProxyLazyValue(String s)
{ {
final String className = s; final String className = s;
inner = new LazyValue () inner = new LazyValue ()
...@@ -126,7 +126,7 @@ public class UIDefaults extends Hashtable ...@@ -126,7 +126,7 @@ public class UIDefaults extends Hashtable
}; };
} }
public ProxyLazyValue (String c, String m) public ProxyLazyValue(String c, String m)
{ {
final String className = c; final String className = c;
final String methodName = m; final String methodName = m;
...@@ -168,9 +168,9 @@ public class UIDefaults extends Hashtable ...@@ -168,9 +168,9 @@ public class UIDefaults extends Hashtable
.forName (className) .forName (className)
.getConstructor (clss) .getConstructor (clss)
.newInstance (objs); .newInstance (objs);
} }
catch (Exception e) catch (Exception e)
{ {
return null; return null;
} }
} }
...@@ -184,13 +184,13 @@ public class UIDefaults extends Hashtable ...@@ -184,13 +184,13 @@ public class UIDefaults extends Hashtable
final Object[] objs = os; final Object[] objs = os;
final Class[] clss = new Class[objs.length]; final Class[] clss = new Class[objs.length];
for (int i = 0; i < objs.length; ++i) for (int i = 0; i < objs.length; ++i)
{ {
clss[i] = objs[i].getClass (); clss[i] = objs[i].getClass ();
} }
inner = new LazyValue () inner = new LazyValue ()
{ {
public Object createValue (UIDefaults table) public Object createValue(UIDefaults table)
{ {
try try
{ {
return Class return Class
...@@ -214,14 +214,14 @@ public class UIDefaults extends Hashtable ...@@ -214,14 +214,14 @@ public class UIDefaults extends Hashtable
private static final long serialVersionUID = 7341222528856548117L; private static final long serialVersionUID = 7341222528856548117L;
public UIDefaults () public UIDefaults()
{ {
bundles = new LinkedList (); bundles = new LinkedList ();
listeners = new HashSet (); listeners = new HashSet ();
defaultLocale = Locale.getDefault (); defaultLocale = Locale.getDefault ();
} }
public UIDefaults (Object[] entries) public UIDefaults(Object[] entries)
{ {
bundles = new LinkedList (); bundles = new LinkedList ();
listeners = new HashSet (); listeners = new HashSet ();
...@@ -233,7 +233,7 @@ public class UIDefaults extends Hashtable ...@@ -233,7 +233,7 @@ public class UIDefaults extends Hashtable
} }
} }
public Object get (Object key) public Object get(Object key)
{ {
return this.get (key, getDefaultLocale ()); return this.get (key, getDefaultLocale ());
} }
...@@ -251,7 +251,7 @@ public class UIDefaults extends Hashtable ...@@ -251,7 +251,7 @@ public class UIDefaults extends Hashtable
String keyString = (String) key; String keyString = (String) key;
ListIterator i = bundles.listIterator (0); ListIterator i = bundles.listIterator (0);
while (i.hasNext ()) while (i.hasNext ())
{ {
String bundle_name = (String) i.next (); String bundle_name = (String) i.next ();
ResourceBundle res = ResourceBundle res =
ResourceBundle.getBundle (bundle_name, loc); ResourceBundle.getBundle (bundle_name, loc);
...@@ -303,7 +303,7 @@ public class UIDefaults extends Hashtable ...@@ -303,7 +303,7 @@ public class UIDefaults extends Hashtable
public void putDefaults(Object[] entries) public void putDefaults(Object[] entries)
{ {
for (int i = 0; (2*i+1) < entries.length; ++i) for (int i = 0; (2*i+1) < entries.length; ++i)
{ {
super.put (entries[2*i], entries[2*i+1]); super.put (entries[2*i], entries[2*i+1]);
} }
firePropertyChange ("UIDefaults", null, null); firePropertyChange ("UIDefaults", null, null);
...@@ -311,79 +311,79 @@ public class UIDefaults extends Hashtable ...@@ -311,79 +311,79 @@ public class UIDefaults extends Hashtable
public Font getFont(Object key) public Font getFont(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Font ? (Font) o : null; return o instanceof Font ? (Font) o : null;
} }
public Font getFont(Object key, Locale l) public Font getFont(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Font ? (Font) o : null; return o instanceof Font ? (Font) o : null;
} }
public Color getColor(Object key) public Color getColor(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Color ? (Color) o : null; return o instanceof Color ? (Color) o : null;
} }
public Color getColor(Object key, Locale l) public Color getColor(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Color ? (Color) o : null; return o instanceof Color ? (Color) o : null;
} }
public Icon getIcon(Object key) public Icon getIcon(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Icon ? (Icon) o : null; return o instanceof Icon ? (Icon) o : null;
} }
public Icon getIcon(Object key, Locale l) public Icon getIcon(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Icon ? (Icon) o : null; return o instanceof Icon ? (Icon) o : null;
} }
public Border getBorder(Object key) public Border getBorder(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Border ? (Border) o : null; return o instanceof Border ? (Border) o : null;
} }
public Border getBorder(Object key, Locale l) public Border getBorder(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Border ? (Border) o : null; return o instanceof Border ? (Border) o : null;
} }
public String getString(Object key) public String getString(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof String ? (String) o : null; return o instanceof String ? (String) o : null;
} }
public String getString(Object key, Locale l) public String getString(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof String ? (String) o : null; return o instanceof String ? (String) o : null;
} }
int getInt(Object key) int getInt(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Integer ? ((Integer) o).intValue() : 0; return o instanceof Integer ? ((Integer) o).intValue() : 0;
} }
int getInt(Object key, Locale l) int getInt(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Integer ? ((Integer) o).intValue() : 0; return o instanceof Integer ? ((Integer) o).intValue() : 0;
} }
public boolean getBoolean(Object key) public boolean getBoolean(Object key)
{ {
return Boolean.TRUE.equals (get (key)); return Boolean.TRUE.equals(get(key));
} }
public boolean getBoolean(Object key, Locale l) public boolean getBoolean(Object key, Locale l)
...@@ -393,25 +393,25 @@ public class UIDefaults extends Hashtable ...@@ -393,25 +393,25 @@ public class UIDefaults extends Hashtable
public Insets getInsets(Object key) public Insets getInsets(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Insets ? (Insets) o : null; return o instanceof Insets ? (Insets) o : null;
} }
public Insets getInsets(Object key, Locale l) public Insets getInsets(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Insets ? (Insets) o : null; return o instanceof Insets ? (Insets) o : null;
} }
public Dimension getDimension(Object key) public Dimension getDimension(Object key)
{ {
Object o = get (key); Object o = get(key);
return o instanceof Dimension ? (Dimension) o : null; return o instanceof Dimension ? (Dimension) o : null;
} }
public Dimension getDimension(Object key, Locale l) public Dimension getDimension(Object key, Locale l)
{ {
Object o = get (key, l); Object o = get(key, l);
return o instanceof Dimension ? (Dimension) o : null; return o instanceof Dimension ? (Dimension) o : null;
} }
...@@ -436,7 +436,7 @@ public class UIDefaults extends Hashtable ...@@ -436,7 +436,7 @@ public class UIDefaults extends Hashtable
{ {
return getUIClass (id, null); return getUIClass (id, null);
} }
protected void getUIError(String msg) protected void getUIError(String msg)
{ {
System.err.println ("UIDefaults.getUIError: " + msg); System.err.println ("UIDefaults.getUIError: " + msg);
...@@ -462,21 +462,21 @@ public class UIDefaults extends Hashtable ...@@ -462,21 +462,21 @@ public class UIDefaults extends Hashtable
{ {
getUIError ("failed to locate createUI method on " + cls.toString ()); getUIError ("failed to locate createUI method on " + cls.toString ());
return null; return null;
} }
try try
{ {
return (ComponentUI) factory.invoke (null, new Object[] { target }); return (ComponentUI) factory.invoke (null, new Object[] { target });
} }
catch (java.lang.reflect.InvocationTargetException ite) catch (java.lang.reflect.InvocationTargetException ite)
{ {
getUIError ("InvocationTargetException ("+ ite.getTargetException() getUIError ("InvocationTargetException ("+ ite.getTargetException()
+") calling createUI(...) on " + cls.toString ()); +") calling createUI(...) on " + cls.toString ());
return null; return null;
} }
catch (Exception e) catch (Exception e)
{ {
getUIError ("exception calling createUI(...) on " + cls.toString ()); getUIError ("exception calling createUI(...) on " + cls.toString ());
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment