|
From: Harry E. <har...@us...> - 2006-09-18 11:07:02
|
Update of /cvsroot/synclast/client/src/com/synclast/ui In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9729/src/com/synclast/ui Modified Files: Style.java Widget.java Log Message: Fixed a type in the FONT_STYLE hashtable in Style ("smalle"=>"small") Made setClassStyleName return a Widget (this) so that it can be changed like the set(property, value) call. Index: Widget.java =================================================================== RCS file: /cvsroot/synclast/client/src/com/synclast/ui/Widget.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Widget.java 18 Sep 2006 07:59:05 -0000 1.23 --- Widget.java 18 Sep 2006 11:06:53 -0000 1.24 *************** *** 338,343 **** * A selector for styles that allows additional styling of a widget beyond the styling avialable from getStyleName(). See <code>StyleSheet</code> for a more detailed explanation of how the classStyleName effects widget styling. Since settinng this value causes the classStyleName, and hence the styling for the widget to change, this operation may be expensive, as it triggers a refetching of all applicably widget styles, an invalidation of the widget, and if a container, the same set of steps for all contained widgets. * @param aStyleName the new classStyleName to use for this widget. */ ! public void setClassStyleName(String aStyleName) { //Go through all this effort below, to avoid calling init unless //absolutely necessary (because it is so expensive) --- 338,344 ---- * A selector for styles that allows additional styling of a widget beyond the styling avialable from getStyleName(). See <code>StyleSheet</code> for a more detailed explanation of how the classStyleName effects widget styling. Since settinng this value causes the classStyleName, and hence the styling for the widget to change, this operation may be expensive, as it triggers a refetching of all applicably widget styles, an invalidation of the widget, and if a container, the same set of steps for all contained widgets. * @param aStyleName the new classStyleName to use for this widget. + * @return this Widget, to allow it to be used in chained calls, like set() */ ! public Widget setClassStyleName(String aStyleName) { //Go through all this effort below, to avoid calling init unless //absolutely necessary (because it is so expensive) *************** *** 345,349 **** //if they are both null, then nothing to do //also avoid null case for later checks. - return; } else if((classStyleName == null && aStyleName != null) || (classStyleName != null && aStyleName == null) || --- 346,349 ---- *************** *** 352,355 **** --- 352,357 ---- init(); } + //just like set, allow this method to be chained + return this; } } Index: Style.java =================================================================== RCS file: /cvsroot/synclast/client/src/com/synclast/ui/Style.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Style.java 18 Sep 2006 07:59:05 -0000 1.1 --- Style.java 18 Sep 2006 11:06:53 -0000 1.2 *************** *** 123,127 **** FONT_SIZE.put("large", new Integer(Font.SIZE_LARGE)); FONT_SIZE.put("medium", new Integer(Font.SIZE_MEDIUM)); ! FONT_SIZE.put("smalle", new Integer(Font.SIZE_SMALL)); FONT_FACE = new Hashtable(); FONT_FACE.put("monospace", new Integer(Font.FACE_MONOSPACE)); --- 123,127 ---- FONT_SIZE.put("large", new Integer(Font.SIZE_LARGE)); FONT_SIZE.put("medium", new Integer(Font.SIZE_MEDIUM)); ! FONT_SIZE.put("small", new Integer(Font.SIZE_SMALL)); FONT_FACE = new Hashtable(); FONT_FACE.put("monospace", new Integer(Font.FACE_MONOSPACE)); |