diff flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java @ 1345:92074508a387

Added documentation. flys-client/trunk@3003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 18 Oct 2011 12:33:23 +0000
parents e26088566e8a
children fb224f54c643
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Oct 17 17:33:27 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Tue Oct 18 12:33:23 2011 +0000
@@ -67,6 +67,12 @@
         GWT.create(CollectionItemAttributeService.class);
 
 
+    /**
+     * Setup editor dialog.
+     * @param collection The collection the current theme belongs to.
+     * @param attributes The collection attributes.
+     * @param facet      The selected facet.
+     */
     public StyleEditorWindow (
         Collection collection,
         CollectionItemAttribute attributes,
@@ -82,6 +88,9 @@
     }
 
 
+    /**
+     * Initialize the window and set the layout.
+     */
     protected void init() {
         setTitle(MSG.properties());
         setWidth(270);
@@ -94,6 +103,9 @@
     }
 
 
+    /**
+     * Initialize the static window content like buttons and main layout.
+     */
     protected void initPanels() {
         HLayout buttons = new HLayout();
         Button accept = new Button(MSG.label_ok());
@@ -115,16 +127,28 @@
     }
 
 
+    /**
+     * Setter for the parent panel.
+     * @param panel The panel.
+     */
     public void setThemePanel (ThemePanel panel) {
         this.panel = panel;
     }
 
 
+    /**
+     * this method is called when the user aborts theming.
+     * @param event The event.
+     */
     public void onClick(ClickEvent event) {
         this.hide();
     }
 
 
+    /**
+     * This method creates the property grid for available styling attributes.
+     * @return The layout containing the UI elements.
+     */
     protected VLayout createPropertyGrid() {
         VLayout properties = new VLayout();
 
@@ -154,6 +178,15 @@
     }
 
 
+    /**
+     * Create a property form.
+     * @param dname The display name.
+     * @param name The property name.
+     * @param type The property type.
+     * @param value The current value.
+     *
+     * @return The dynamic form for the attribute property.
+     */
     protected DynamicForm createPropertyUI(
         String dname,
         String name,
@@ -247,6 +280,12 @@
     }
 
 
+    /**
+     * Static method to convert a color from RGB to HTML notation.
+     * @param rgb String in RGB notation.
+     *
+     * @return String in HTML notation.
+     */
     protected static String rgbToHtml(String rgb) {
         String[] parts = rgb.split(",");
         int values[] = new int[parts.length];
@@ -270,6 +309,12 @@
     }
 
 
+    /**
+     * Static method to convert a color from HTML to RGB notation.
+     * @param html String in HTML notation.
+     *
+     * @return String in RGB notation.
+     */
     protected static String htmlToRgb(String html) {
         if (!html.startsWith("#")) {
             return "0, 0, 0";
@@ -283,6 +328,9 @@
     }
 
 
+    /**
+     * Saves the current style attributes and requests a redraw.
+     */
     protected void saveStyle () {
         GWT.log("StyleEditorWindow.saveStyle()");
         Config config = Config.getInstance();
@@ -310,6 +358,11 @@
     }
 
 
+    /**
+     * Sets a new value for an attribute.
+     * @param name Attribute name.
+     * @param value The new value.
+     */
     protected final void setNewValue(String name, String value) {
         Theme t = facet.getTheme();
         Style s = attributes.getStyle(t.getFacet(), t.getIndex());

http://dive4elements.wald.intevation.org