[isidorus-cvs] r666 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets src/us/isidor/gdl/anaToMia/Widgets/base src/us/isidor/gdl/anaToMia/Widgets/button src/us/isidor/gdl/anaToMia/Widgets/view war/gdl_widgets

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Fri Jul 22 17:04:47 UTC 2011


Author: lgiessmann
Date: Fri Jul 22 10:04:46 2011
New Revision: 666

Log:
gdl-frontend: Widgets: fixed a bug when setting the GDL property content-orientation; implemted GdlRadioButton

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt	Fri Jul 22 07:06:37 2011	(r665)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/TODO.txt	Fri Jul 22 10:04:46 2011	(r666)
@@ -1,6 +1,3 @@
-* fix setting the float property in firefox
-
-
 * Implement GdlButton(s)
 * Implement GdlButton(s) positioning
 * change the GDL spec of GdlUnit => set a default constraint (or none) 

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java	Fri Jul 22 07:06:37 2011	(r665)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java	Fri Jul 22 10:04:46 2011	(r666)
@@ -103,12 +103,9 @@
 
 	
 	// this method should be invoked if a new sub-element is added to this instance
-	protected void addToContainerPanel(Widget widget){
-		if(this.containerPanel == null){
-			this.containerPanel = new VerticalPanel();
-			this.mainPanel.add(this.containerPanel);
-		}
-		
+	protected void addToContainerPanel(Widget widget) throws ExecutionException, InvalidGdlSchemaException{
+		this.setContentOrientation(this.getContentOrientation());
+				
 		this.subElements.add(widget);
 		this.containerPanel.add(widget);
 	}
@@ -1154,7 +1151,7 @@
 	
 	
 	// sets the float style property of all sub elements by using the GWT DOM class
-	public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+	public void setContentOrientation(ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
 		if(value == ContentOrientationValue.HORIZONTAL && this.containerPanel == null) this.containerPanel = new HorizontalPanel();
 		else if(this.containerPanel == null) this.containerPanel = new VerticalPanel();
 		
@@ -1467,8 +1464,6 @@
 	
 	// sets all GDL styles that are defined by the topic map representative to tha passed widget
 	public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
-		this.setContentOrientation(widget, this.getContentOrientation());
-		
 		String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
 		for (String styleClass : styleClasses) {
 			this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
@@ -1530,6 +1525,7 @@
 		this.setZindex(this.getZindex());
 		this.setFloat(this.getFloat());
 		this.setClear(this.getClear());
+		this.setContentOrientation(this.getContentOrientation());
 	}
 
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java	Fri Jul 22 07:06:37 2011	(r665)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlRadioButton.java	Fri Jul 22 10:04:46 2011	(r666)
@@ -1,12 +1,12 @@
 package us.isidor.gdl.anaToMia.Widgets.button;
 
+
+import com.google.gwt.user.client.ui.RadioButton;
 import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
 import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
 import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
 
-public class GdlRadioButton extends GdlButton {
-	// TODO: implement
-	
+public class GdlRadioButton extends GdlButton {	
 	protected GdlRadioButton(){
 		super();
 	}
@@ -14,5 +14,23 @@
 	
 	public GdlRadioButton(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
 		super(tmRepresentative);
+		// TODO: create a radio button for each tm construct
+		this.createRadioButton().setText("Radio Button 1");
+		this.createRadioButton().setText("Radio Button 2");
+		this.createRadioButton().setText("Radio Button 3");
+	}
+	
+	
+	
+	public String getGroupName() throws InvalidGdlSchemaException{
+		return this.getId() + "__RB__GROUP";
+	}
+	
+	
+	public RadioButton createRadioButton() throws InvalidGdlSchemaException, ExecutionException{
+		RadioButton rb = new RadioButton(this.getGroupName());
+		this.addToContainerPanel(rb);
+		this.setGdlStyle(rb);
+		return rb;
 	}
 }

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java	Fri Jul 22 07:06:37 2011	(r665)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java	Fri Jul 22 10:04:46 2011	(r666)
@@ -51,7 +51,7 @@
 	
 	// content orientation has no effect on a view
 	@Override
-	public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+	public void setContentOrientation(ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
 		// do nothing, no table is set for organizing content widgets, since a view does not organize
 		// its content in this manner
 	}

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm	Fri Jul 22 07:06:37 2011	(r665)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm	Fri Jul 22 10:04:46 2011	(r666)
@@ -46,13 +46,18 @@
            {"subject_identifiers":["[gdl:float]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[gdl:clear]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[gdl:resize]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+           {"subject_identifiers":["[gdl:font-size]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[doc:default-creator-topic-view-1]"], "instance_of":["si:[gdl:Default-Creator-Topic-View]"], "names":[{"value": "Def. Creator View 1", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"default_creator_topic_view_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:background-color]", "value":"#ccc"}, {"type":"si:[gdl:width]", "value":"500px"}, {"type":"si:[gdl:height]", "value":"600px"}]},
            {"subject_identifiers":["[gdl:View]"]},
+           {"subject_identifiers":["[gdl:Button]"]},
+           {"subject_identifiers":["[gdl:Input-Button]"]},
+           {"subject_identifiers":["[gdl:Radio-Button]"]},
            {"subject_identifiers":["[gdl:Space]"]},
            {"subject_identifiers":["[gdl:Text]"]},
            {"subject_identifiers":["[gdl:Title]"]},
            {"subject_identifiers":["[gdl:Reference]"]},
            {"subject_identifiers":["[gdl:List]"]},
+           {"subject_identifiers":["[doc:unit-1-radio-button]"], "instance_of":["si:[gdl:Radio-Button]"], "occurrences":[{"type":"si:[gdl:id]", "value":"unit_1_radio_button_id"},{"type":"si:[gdl:content-orientation]", "value":"horizontal"}, {"type":"si:[gdl:background-color]", "value": "lime"}, {"type":"si:[gdl:margin-left]", "value":"15pt"}, {"type":"si:[gdl:font-size]", "value":"8pt"}]},
            {"subject_identifiers":["[doc:list-item-1]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:padding-bottom]", "value":"5px"}, {"type":"si:[gdl:margin-bottom]", "value":"5px"}]},
            {"subject_identifiers":["[doc:list-item-3]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_3_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:padding-bottom]", "value":"5px"}]},
            {"subject_identifiers":["[doc:list-item-2]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_2_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:padding]", "value":"5px"}, {"type":"si:[gdl:margin-top]", "value":"5px"}]},
@@ -79,6 +84,7 @@
            {"subject_identifiers":["[gdl:right]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[gdl:bottom]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[gdl:left]"], "instance_of":["si:[tmcl:occurrence-type]"]},
+           {"subject_identifiers":["[gdl:content-orientation]"], "instance_of":["si:[tmcl:occurrence-type]"]},
            {"subject_identifiers":["[gdl:TM-Value]"]},
            {"subject_identifiers":["[gdl:Unit]"]},
            {"subject_identifiers":["[gdl:Nth-Element]"]},
@@ -134,7 +140,10 @@
                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:List]"}]},
                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Visible-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Space]"}]},
                  {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Descriptor]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Nth-Element]"}]},
-                 {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Unit]"}]},
+                 {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Unit]"}]},                 
+                 {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Text-Object]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Button]"}]},
+                 {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Input-Button]"}]},
+                 {"type":"si:[tmdm:supertype-subtype]", "roles":[{"type":"si:[tmdm:supertype]", "player":"si:[gdl:Input-Button]"},{"type":"si:[tmdm:subtype]", "player":"si:[gdl:Radio-Button]"}]},                 
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-1]"}]},
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-creator-topic-view-2]"}]},
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:test-schema]"},{"type":"si:[gdl:containee]", "player":"si:[doc:default-editor-topic-view]"}]},
@@ -170,7 +179,9 @@
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:unit-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:unit-1-reference]"}]},
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:unit-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:unit-1-space]"}]},
                  {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:unit-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:unit-1-text]"}]},
+                 {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[doc:unit-1]"},{"type":"si:[gdl:containee]", "player":"si:[doc:unit-1-radio-button]"}]},
                  {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-unit-1-reference]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:unit-1]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:unit-1-reference]"}]},
                  {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-unit-1-space]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:unit-1-reference]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:unit-1-space]"}]},
-                 {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-unit-1-reference]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:unit-1-space]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:unit-1-text]"}]}
+                 {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-unit-1-reference]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:unit-1-space]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:unit-1-text]"}]},
+                 {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[doc:pos-of-unit-1-reference]"},{"type":"si:[gdl:ancestor]", "player":"si:[doc:unit-1-text]"}, {"type":"si:[gdl:descendant]", "player":"si:[doc:unit-1-radio-button]"}]}
                 ]}
\ No newline at end of file




More information about the Isidorus-cvs mailing list