# HG changeset patch # User Raimund Renkert # Date 1318951224 0 # Node ID fb224f54c6430c7032798c461902d46fee425b97 # Parent d81533df413811cbf8487615f397f8300cee5820 Prepared editor UI for annotation styling. flys-client/trunk@3015 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d81533df4138 -r fb224f54c643 flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Oct 18 14:11:52 2011 +0000 +++ b/flys-client/ChangeLog Tue Oct 18 15:20:24 2011 +0000 @@ -1,3 +1,8 @@ +2011-10-18 Raimund Renkert + + * src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java: + Prepared editor UI for annotation styling. + 2011-10-18 Felix Wolfsteller Minor cosmetics. diff -r d81533df4138 -r fb224f54c643 flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Tue Oct 18 14:11:52 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Tue Oct 18 15:20:24 2011 +0000 @@ -93,8 +93,6 @@ */ protected void init() { setTitle(MSG.properties()); - setWidth(270); - setHeight(200); setCanDragReposition(true); setCanDragResize(true); @@ -121,9 +119,13 @@ buttons.addMember(cancel); buttons.setAlign(Alignment.RIGHT); - layout.addMember(createPropertyGrid());; + VLayout propGrid = createPropertyGrid(); + + layout.addMember(propGrid); layout.addMember(buttons); addItem(layout); + setWidth(270); + setHeight(propGrid.getChildren().length * 25 + 50); } @@ -198,30 +200,21 @@ FormItem f; if(type.equals("int")) { f = new SelectItem(name, dname); - LinkedHashMap valueIcons = new LinkedHashMap(); - f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-"); - f.setImageURLSuffix("px.png"); - f.setValueIconHeight(20); - f.setValueIconWidth(80); - LinkedHashMap valueMap = new LinkedHashMap(); - valueMap.put("1", ""); - valueMap.put("2", ""); - valueMap.put("3", ""); - valueMap.put("4", ""); - valueMap.put("5", ""); - valueMap.put("6", ""); - valueMap.put("7", ""); - valueMap.put("8", ""); - valueIcons.put("1", "1"); - valueIcons.put("2", "2"); - valueIcons.put("3", "3"); - valueIcons.put("4", "4"); - valueIcons.put("5", "5"); - valueIcons.put("6", "6"); - valueIcons.put("7", "7"); - valueIcons.put("8", "8"); - f.setValueIcons(valueIcons); - f.setValueMap(valueMap); + if (name.equals("linesize")) { + f = createLineSizeUI(f); + } + else if (name.equals("textsize")) { + LinkedHashMap valueMap = new LinkedHashMap(); + valueMap.put("3", "3"); + valueMap.put("5", "5"); + valueMap.put("8", "8"); + valueMap.put("10", "10"); + valueMap.put("12", "12"); + valueMap.put("14", "14"); + valueMap.put("18", "18"); + valueMap.put("24", "24"); + f.setValueMap(valueMap); + } f.setValue(value); } else if (type.equals("boolean")) { @@ -247,7 +240,7 @@ f.setImageURLSuffix(".png"); f.setValueIconHeight(20); f.setValueIconWidth(80); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = new LinkedHashMap(); valueMap.put("10", ""); valueMap.put("10,5", ""); valueMap.put("20,10", ""); @@ -262,6 +255,16 @@ f.setValueMap(valueMap); f.setValue(value); } + else if (type.equals("Font")) { + f = new SelectItem(name, dname); + LinkedHashMap valueMap = new LinkedHashMap(); + valueMap.put("arial", "Arial"); + valueMap.put("courier", "Courier"); + valueMap.put("verdana", "Verdana"); + valueMap.put("times", "Times"); + f.setValueMap(valueMap); + f.setValue(value); + } else { f = new FormItem(); } @@ -280,6 +283,35 @@ } + protected FormItem createLineSizeUI(FormItem f) { + LinkedHashMap valueIcons = new LinkedHashMap(); + f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-"); + f.setImageURLSuffix("px.png"); + f.setValueIconHeight(20); + f.setValueIconWidth(80); + LinkedHashMap valueMap = new LinkedHashMap(); + valueMap.put("1", ""); + valueMap.put("2", ""); + valueMap.put("3", ""); + valueMap.put("4", ""); + valueMap.put("5", ""); + valueMap.put("6", ""); + valueMap.put("7", ""); + valueMap.put("8", ""); + valueIcons.put("1", "1"); + valueIcons.put("2", "2"); + valueIcons.put("3", "3"); + valueIcons.put("4", "4"); + valueIcons.put("5", "5"); + valueIcons.put("6", "6"); + valueIcons.put("7", "7"); + valueIcons.put("8", "8"); + f.setValueIcons(valueIcons); + f.setValueMap(valueMap); + return f; + } + + /** * Static method to convert a color from RGB to HTML notation. * @param rgb String in RGB notation.