isidorus-cvs
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- 1037 discussions

[isidorus-cvs] r599 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container environment views
by lgiessmann@common-lisp.net 11 Jul '11
by lgiessmann@common-lisp.net 11 Jul '11
11 Jul '11
Author: lgiessmann
Date: Mon Jul 11 08:17:54 2011
New Revision: 599
Log:
gdl-frontend: Widgets: started to implement GdlInstantiator
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java
Deleted:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlContainer.java Mon Jul 11 08:17:54 2011 (r599)
@@ -3,5 +3,5 @@
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
public interface IGdlContainer {
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant/*, Position position*/) throws InvalidGdlSchemaException;
+ public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException;
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 08:17:54 2011 (r599)
@@ -172,12 +172,6 @@
}
@Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public TopicMap getContent() {
// TODO Auto-generated method stub
return null;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Mon Jul 11 08:17:54 2011 (r599)
@@ -1252,7 +1252,7 @@
@Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant) throws InvalidGdlSchemaException {
+ public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException {
// TODO: implement
}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlInstantiator.java Mon Jul 11 08:17:54 2011 (r599)
@@ -0,0 +1,12 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+
+public class GdlInstantiator {
+ public static GdlVisibleObject createJavaInstance(Topic tmRepresentative) throws InvalidGdlSchemaException{
+
+
+ return null;
+ }
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -56,12 +56,6 @@
}
// TODO: implement
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
@Override
public boolean validate() {
@@ -436,4 +430,11 @@
return null;
}
+ @Override
+ public void append(GdlVisibleObject widget)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -53,12 +53,6 @@
return null;
}
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
@Override
public boolean validate() {
@@ -479,4 +473,12 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public void append(GdlVisibleObject widget)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultEditorTopicView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -30,14 +30,7 @@
// TODO Auto-generated method stub
return null;
}
- // TODO: implement
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
@Override
public boolean validate() {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -55,14 +55,7 @@
// TODO Auto-generated method stub
return null;
}
- // TODO: implement
-
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
+
@Override
public boolean validate() {
@@ -481,6 +474,14 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public void append(GdlVisibleObject widget)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -55,12 +55,7 @@
return null;
}
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
+
@Override
public boolean validate() {
@@ -482,5 +477,13 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public void append(GdlVisibleObject widget)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -57,12 +57,7 @@
return null;
}
- @Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
-
- }
+
@Override
public boolean validate() {
@@ -484,5 +479,13 @@
// TODO Auto-generated method stub
return null;
}
+
+
+ @Override
+ public void append(GdlVisibleObject widget)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 08:07:34 2011 (r598)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 08:17:54 2011 (r599)
@@ -77,6 +77,17 @@
return null;
}
+
+ public void append(GdlVisibleObject widget) throws InvalidGdlSchemaException{
+ // TODO: implement
+ }
+
+
+ public void append(Topic widget) throws InvalidGdlSchemaException {
+ // TODO: implement
+ // TODO: use GdlInstantiator
+ }
+
public abstract TopicMap getContent();
}
\ No newline at end of file
1
0

[isidorus-cvs] r598 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base complexData views
by lgiessmann@common-lisp.net 11 Jul '11
by lgiessmann@common-lisp.net 11 Jul '11
11 Jul '11
Author: lgiessmann
Date: Mon Jul 11 08:07:34 2011
New Revision: 598
Log:
gdl-frontend: Widgets: implemented the method GdlView.getStartElement that returns the a topic that represents the first visible object within a GdlView instance
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPosition.java Mon Jul 11 08:07:34 2011 (r598)
@@ -0,0 +1,15 @@
+package us.isidor.gdl.anaToMia.Widgets.base;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+
+public class GdlPosition implements GdlDescriptor {
+
+
+
+ @Override
+ public Topic getTmRepresentative() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Mon Jul 11 08:07:34 2011 (r598)
@@ -200,7 +200,7 @@
public final static String gdlPosition = gdl + "position";
public final static String gdlNthPosition = gdl + "nth-position";
public final static String gdlButtonPosition = gdl + "button-position";
- public final static String gdlTmbinding = gdl + "tm-binding";
+ public final static String gdlTmBinding = gdl + "tm-binding";
public final static String gdlViewBinding = gdl + "view-binding";
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,13 +1,21 @@
package us.isidor.gdl.anaToMia.Widgets.base;
+import java.util.ArrayList;
+
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.complexData.GdlDatePicker;
import us.isidor.gdl.anaToMia.Widgets.container.GdlUnit;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
+import us.isidor.gdl.anaToMia.Widgets.views.GdlView;
+
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -143,7 +151,38 @@
- GdlDatePicker tmp = new GdlDatePicker(tmpRepresentative);
+ GdlView tmp = new GdlView(tmpRepresentative) {
+
+ @Override
+ public boolean validate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public TopicMap getContent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Mon Jul 11 08:07:34 2011 (r598)
@@ -2,4 +2,5 @@
public class GdlDateTimePicker extends GdlComplexData {
// TODO: implement
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,5 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.BlurEvent;
@@ -16,12 +18,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -420,4 +424,16 @@
}
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,5 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.DomEvent;
@@ -11,12 +13,14 @@
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -461,4 +465,18 @@
// TODO Auto-generated method stub
}
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,5 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.BlurEvent;
@@ -16,12 +18,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -463,6 +467,20 @@
// TODO Auto-generated method stub
}
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,5 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.BlurEvent;
@@ -15,12 +17,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -464,5 +468,19 @@
// TODO Auto-generated method stub
}
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,5 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.BlurEvent;
@@ -15,12 +17,14 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -466,5 +470,19 @@
// TODO Auto-generated method stub
}
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 06:50:59 2011 (r597)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Mon Jul 11 08:07:34 2011 (r598)
@@ -1,101 +1,82 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import java.util.ArrayList;
+
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.dom.client.Style.Overflow;
-import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.user.client.ui.Widget;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Name;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Role;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
-import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
-public abstract class GdlView extends GdlVisibleObject implements IGdlContainer {
- private String viewName = "";
- private TopicMap tm = null;
- private Topic representative = null;
- // TODO: implement
-
+public abstract class GdlView extends GdlVisibleObject implements IGdlContainer, IGdlHasValue {
+ protected GdlView(){
+ super();
+ }
public GdlView(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
- // TODO: implement
}
- protected void init(TopicMap tm, Topic representative) throws InvalidGdlSchemaException {
- this.tm = tm;
- this.representative = representative;
- JsArray<Name> viewNames = representative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.NameType.gdlViewName)));
+ public String getViewName()throws InvalidGdlSchemaException {
+ JsArray<Name> viewNames = super.tmRepresentative.getNames(tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.NameType.gdlViewName)));
if(viewNames.length() != 1){
throw new InvalidGdlSchemaException("A view must be bound to a " + GdlPsis.NameType.gdlViewName + " instance");
}
-
- this.viewName = viewNames.get(0).getValue();
+ return viewNames.get(0).getValue();
}
+
-
- public String getViewName(){
- return this.viewName;
+ public void registerButtonCallback(ClickHandler handler, String id){
+ //TODO: implement
}
+
-
- public abstract boolean validate();
-
-
- public abstract TopicMap getContent();
-
-
- public abstract void registerButtonCallback(ClickHandler handler, String id);
-
-
- public abstract void deregisterButtonCallback(ClickHandler handler, String id);
-
-
- @Override
- public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ public void deregisterButtonCallback(ClickHandler handler, String id){
// TODO: implement
}
-
- public void setContentOrientation(Widget widget, ContentOrientationValue value){
- // do nothing - since all content elements are positioned vie the GDL positioning concept
+ // Searches the topic that represents the first item that is playced within this view instance
+ // i.e. such an item must not have an association that is bound to it via a role of the type
+ // gdl:ancestor.
+ protected Topic getStartElement() throws InvalidGdlSchemaException {
+ JsArray<Role> roles = this.tmRepresentative.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.RoleType.gdlContainer)), this.tm.getTopicBySubjectIdentifier(tm.createLocator(GdlPsis.AssociationType.gdlContains)));
+ for(int i = 0; i != roles.length(); ++i){
+ Association assoc = roles.get(i).getParent();
+ JsArray<Role> assocRoles = assoc.getRoles(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlContainee)));
+ ArrayList<Topic> topsWithoutAncestorPosAssoc = new ArrayList<Topic>();
+ for(int j = 0; j != assocRoles.length(); ++j){
+ Topic player = assocRoles.get(j).getPlayer();
+ if(player.getRolesPlayed(this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.RoleType.gdlAncestor)), this.tm.getTopicBySubjectIdentifier(this.tm.createLocator(GdlPsis.AssociationType.gdlPosition))).length() == 0){
+ topsWithoutAncestorPosAssoc.add(player);
+ }
+ }
+ if(topsWithoutAncestorPosAssoc.size() > 1){
+ String foundTops = "";
+ for (Topic topic : topsWithoutAncestorPosAssoc) {
+ foundTops += GdlPsis.getAnyIdOfTopic(topic) + ", ";
+ }
+ if(foundTops.length() >= 2)foundTops = foundTops.substring(0, foundTops.length() - 2);
+ throw new InvalidGdlSchemaException("A " + GdlPsis.TopicType.gdlView + " must have maximal one item that is desiganted to tbe the first item in this view, i.e. there must be zero or one items without being bound to a " + GdlPsis.RoleType.gdlAncestor + " but found: " + foundTops);
+ } else if(topsWithoutAncestorPosAssoc.size() == 1){
+ return topsWithoutAncestorPosAssoc.get(0);
+ }
+ }
+ return null;
}
-
-
-
-
- // TODO: implement addXYZhandler(handler, id);
-
-
-
- // hierarchy
- //
- // => Default-Topic-View => Default-Creator-Topic-View
- // => Default-Editor-Topic-View
- // => Topic-View
- // => Special-Topic-view => Special-Creator-Topic-view
- // => Special-Editor-Topic-View
- // Visible-Object => View
- //
- // => Association-view => Creator-Association-view
- // => Editor-Association-View
-}
+
+ public abstract TopicMap getContent();
+}
\ No newline at end of file
1
0

[isidorus-cvs] r597 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base complexData
by lgiessmann@common-lisp.net 11 Jul '11
by lgiessmann@common-lisp.net 11 Jul '11
11 Jul '11
Author: lgiessmann
Date: Mon Jul 11 06:50:59 2011
New Revision: 597
Log:
gdl-frontend: Widgets: implemnted GdlDatePicker
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 03:35:13 2011 (r596)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 06:50:59 2011 (r597)
@@ -4,6 +4,7 @@
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.complexData.GdlDatePicker;
import us.isidor.gdl.anaToMia.Widgets.container.GdlUnit;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
@@ -97,8 +98,8 @@
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
- tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
- tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
+ tmpRepresentative.createOccurrence(gdlWidth, "100px", null);
+ tmpRepresentative.createOccurrence(gdlHeight, "100px", null);
tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
@@ -142,7 +143,7 @@
- GdlUnit tmp = new GdlUnit(tmpRepresentative);
+ GdlDatePicker tmp = new GdlDatePicker(tmpRepresentative);
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Mon Jul 11 03:35:13 2011 (r596)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Mon Jul 11 06:50:59 2011 (r597)
@@ -1,5 +1,142 @@
package us.isidor.gdl.anaToMia.Widgets.complexData;
-public class GdlDatePicker extends GdlComplexData {
- // TODO: implement
+import java.util.ArrayList;
+
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasFocusHandlers;
+import com.google.gwt.event.dom.client.HasMouseDownHandlers;
+import com.google.gwt.event.dom.client.HasMouseOutHandlers;
+import com.google.gwt.event.dom.client.HasMouseOverHandlers;
+import com.google.gwt.event.dom.client.HasMouseUpHandlers;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.datepicker.client.DatePicker;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+
+
+
+public class GdlDatePicker extends GdlComplexData implements IGdlHasValue {
+
+ // some constructors
+ protected GdlDatePicker(){
+ super();
+ }
+
+
+ public GdlDatePicker(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ // create a date widget for each tm-construct
+ this.createDateWidget();
+ }
+
+
+
+ public void createDateWidget() throws InvalidGdlSchemaException, ExecutionException {
+ // this object is able to own only one sub-element
+
+ DateWidget date = new DateWidget();
+ ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
+ FocusStyleHandler fsHandler = new FocusStyleHandler(this);
+ HoverStyleHandler hsHandler = new HoverStyleHandler(this);
+ int idSuffix = 0;
+ if(this.subElements != null) idSuffix = this.subElements.size();
+ date.setId(this.getId() + "__GDL_" + idSuffix);
+ date.addMouseDownHandler(asHandler);
+ date.addMouseUpHandler(asHandler);
+ date.addMouseOverHandler(hsHandler);
+ date.addMouseOutHandler(hsHandler);
+ date.addFocusHandler(fsHandler);
+ date.addBlurHandler(fsHandler);
+
+ super.addToContainerPanel(date);
+ this.setGdlStyle(date);
+ }
+
+
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO: implement
+ return null;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public boolean validate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+
+ protected class DateWidget extends DatePicker implements HasFocusHandlers, HasBlurHandlers, HasMouseDownHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers {
+ public void setId(String id){
+ DOM.setElementAttribute(this.getElement(), "id", id);
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
+ return this.addDomHandler(handler, MouseOverEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
+ return this.addDomHandler(handler, MouseOutEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addBlurHandler(BlurHandler handler) {
+ return this.addDomHandler(handler, BlurEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addFocusHandler(FocusHandler handler) {
+ return this.addDomHandler(handler, FocusEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
+ return this.addDomHandler(handler, MouseUpEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
+ return this.addDomHandler(handler, MouseDownEvent.getType());
+ }
+ }
}
1
0

[isidorus-cvs] r596 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base complexData container text
by lgiessmann@common-lisp.net 11 Jul '11
by lgiessmann@common-lisp.net 11 Jul '11
11 Jul '11
Author: lgiessmann
Date: Mon Jul 11 03:35:13 2011
New Revision: 596
Log:
gdl-frontend: Widgets: implemnted GdlUnit
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Mon Jul 11 03:35:13 2011 (r596)
@@ -84,6 +84,15 @@
Topic gdlContentOrientation = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlContentOrientation));
Topic gdlListStyleType = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlListStyleType));
Topic gdlDirection = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlDirection));
+ Topic gdlUnitBorderTopPadding = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitBorderTopPadding));
+ Topic gdlUnitBorderColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitBorderColor));
+ Topic gdlUnitBorderWidth = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitBorderWidth));
+ Topic gdlUnitName = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitName));
+ Topic gdlUnitBorderLeftMargin = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitBorderLeftMargin));
+ Topic gdlUnitBorderRadius = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlUnitBorderRadius));
+ Topic gdlColor = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlColor));
+ Topic gdlLetterSpacing = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlLetterSpacing));
+
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
@@ -109,7 +118,13 @@
tmpRepresentative.createOccurrence(gdlDisplay, "inline", null);
tmpRepresentative.createOccurrence(gdlContentOrientation, "vertical", null);
tmpRepresentative.createOccurrence(gdlListStyleType, "square", null);
- tmpRepresentative.createOccurrence(gdlDirection, "rtl", null);
+ tmpRepresentative.createOccurrence(gdlDirection, "ltr", null);
+ tmpRepresentative.createOccurrence(gdlUnitBorderTopPadding, "100px", null);
+ tmpRepresentative.createOccurrence(gdlUnitName, "Unit Name", null);
+ tmpRepresentative.createOccurrence(gdlUnitBorderLeftMargin, "30px", null);
+ tmpRepresentative.createOccurrence(gdlUnitBorderRadius, "30px", null);
+ tmpRepresentative.createOccurrence(gdlColor, "yellow", null);
+ tmpRepresentative.createOccurrence(gdlLetterSpacing, "10px", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
bgcHover.addTheme(gdlHover);
Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
@@ -118,6 +133,13 @@
bgcFocus.addTheme(gdlFocus);
Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
fsHover.addTheme(gdlHover);
+ Occurrence ubcHover = tmpRepresentative.createOccurrence(gdlUnitBorderColor, "blue", null);
+ ubcHover.addTheme(gdlHover);
+ Occurrence ubwHover = tmpRepresentative.createOccurrence(gdlUnitBorderWidth, "5px", null);
+ ubwHover.addTheme(gdlHover);
+ Occurrence tdHover = tmpRepresentative.createOccurrence(gdlTextDecoration, "overline", null);
+ tdHover.addTheme(gdlHover);
+
GdlUnit tmp = new GdlUnit(tmpRepresentative);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Mon Jul 11 03:35:13 2011 (r596)
@@ -9,8 +9,8 @@
public class GdlAudio extends GdlComplexData {
// some constructors
- protected GdlAudio() {
- throw new NotImplementedException(GdlPsis.TopicType.gdlAudio + " is not implemented by anaToMia yet");
+ protected GdlAudio() throws ExecutionException {
+ throw new ExecutionException(GdlPsis.TopicType.gdlAudio + " is not implemented by anaToMia yet");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Mon Jul 11 03:35:13 2011 (r596)
@@ -1,7 +1,5 @@
package us.isidor.gdl.anaToMia.Widgets.complexData;
-import org.apache.commons.lang.NotImplementedException;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -9,8 +7,8 @@
public class GdlImage extends GdlComplexData {
// some constructors
- protected GdlImage() {
- throw new NotImplementedException(GdlPsis.TopicType.gdlImage + " is not implemented by anaToMia yet");
+ protected GdlImage() throws ExecutionException {
+ throw new ExecutionException(GdlPsis.TopicType.gdlImage + " is not implemented by anaToMia yet");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Mon Jul 11 03:35:13 2011 (r596)
@@ -1,7 +1,5 @@
package us.isidor.gdl.anaToMia.Widgets.complexData;
-import org.apache.commons.lang.NotImplementedException;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -9,8 +7,8 @@
public class GdlVideo extends GdlComplexData {
// some constructors
- protected GdlVideo() {
- throw new NotImplementedException(GdlPsis.TopicType.gdlVideo + " is not implemented by anaToMia yet");
+ protected GdlVideo() throws ExecutionException {
+ throw new ExecutionException(GdlPsis.TopicType.gdlVideo + " is not implemented by anaToMia yet");
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Mon Jul 11 03:35:13 2011 (r596)
@@ -1,21 +1,57 @@
package us.isidor.gdl.anaToMia.Widgets.container;
+import java.util.ArrayList;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasFocusHandlers;
+import com.google.gwt.event.dom.client.HasMouseDownHandlers;
+import com.google.gwt.event.dom.client.HasMouseOutHandlers;
+import com.google.gwt.event.dom.client.HasMouseOverHandlers;
+import com.google.gwt.event.dom.client.HasMouseUpHandlers;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.AbsolutePanel;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
+import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
+import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
public class GdlUnit extends GdlTextObject implements IGdlContainer {
+ protected ArrayList<Pair<String, String>> unitActiveCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Pair<String, String>> unitFocusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Pair<String, String>> unitHoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+
+
// some constructors
protected GdlUnit() throws InvalidGdlSchemaException, ExecutionException {
super();
@@ -25,14 +61,30 @@
public GdlUnit(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
+ // create a unit for each tm-element
this.createUnit();
}
// creates a unit element or returns the one, if there is a unit element
// in the subElements array
- private void createUnit(){
- // TODO: implement
+ private void createUnit() throws InvalidGdlSchemaException, ExecutionException{
+ // this object is able to own only one sub-element
+ UnitWidget unit = new UnitWidget();
+ ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
+ FocusStyleHandler fsHandler = new FocusStyleHandler(this);
+ HoverStyleHandler hsHandler = new HoverStyleHandler(this);
+ int idSuffix = 0;
+ if(this.subElements != null) idSuffix = this.subElements.size();
+ unit.setId(this.getId() + "__GDL_" + idSuffix);
+ unit.addMouseDownHandler(asHandler);
+ unit.addMouseUpHandler(asHandler);
+ unit.addMouseOverHandler(hsHandler);
+ unit.addMouseOutHandler(hsHandler);
+ unit.addFocusHandler(fsHandler);
+ unit.addBlurHandler(fsHandler);
+ super.addToContainerPanel(unit);
+ this.setGdlStyle(unit);
}
@@ -51,7 +103,7 @@
if(widthOcc == null && styleClass != null){
return null;
} else if(widthOcc == null) {
- return new AbsoluteNumValue();
+ return new AbsoluteNumValue("2px");
} else {
return new AbsoluteNumValue(widthOcc.getValue());
}
@@ -251,7 +303,7 @@
if(styleOcc == null && styleClass != null){
return null;
} else if(styleOcc == null) {
- return BorderStyleValue.NONE;
+ return BorderStyleValue.GROOVE;
} else {
try{
return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
@@ -359,10 +411,9 @@
}
-
// returns a String instance that represents the literal value of this elements name.
- public String getUnitBorderLeftStyle() throws InvalidGdlSchemaException {
- Occurrence nameOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftStyle);
+ public String getUnitName() throws InvalidGdlSchemaException {
+ Occurrence nameOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitName);
if(nameOcc == null){
return "";
@@ -580,7 +631,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
+ public NumUnitValue getUnitBorderRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRadius, styleClass);
@@ -602,7 +653,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ public NumUnitValue getUnitBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopLeftRadius, styleClass);
@@ -624,7 +675,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ public NumUnitValue getUnitBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitborderTopRightRadius, styleClass);
@@ -646,7 +697,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ public NumUnitValue getUnitBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomLeftRadius, styleClass);
@@ -668,7 +719,7 @@
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
- public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ public NumUnitValue getUnitBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
Occurrence radiusOcc = null;
if(styleClass != null){
radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomRightRadius, styleClass);
@@ -686,30 +737,809 @@
}
+ // adds the passed css style to the corresponding ArrayLists
+ private void addStyleToStore(String styleClass, String property, String value) throws InvalidGdlSchemaException {
+ if(styleClass == null) return;
+ else if(styleClass.equals(GdlPsis.Scope.gdlActive)) this.unitActiveCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else if(styleClass.equals(GdlPsis.Scope.gdlFocus)) this.unitFocusCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else if(styleClass.equals(GdlPsis.Scope.gdlHover)) this.unitHoverCssNamesAndStyles.add(new Pair<String, String>(property, value));
+ else {
+ String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
+ throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
+ }
+ }
+
+
+ // sets the height style property of this element by using the GWT DOM class
+ public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setHeight(value.getCssValue());
+ else this.addStyleToStore(styleClass, "height", value.getCssValue());
+ }
+ }
+
+
+ // sets the min-height style property of this element by using the GWT DOM class
+ public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMinHeight(value.getCssValue());
+ else this.addStyleToStore(styleClass, "minHeight", value.getCssValue());
+ }
+ }
+
+
+ // sets the max-height style property of this element by using the GWT DOM class
+ public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMaxHeight(value.getCssValue());
+ else this.addStyleToStore(styleClass, "maxHeight", value.getCssValue());
+ }
+ }
+
+
+ // sets the min-width style property of this element by using the GWT DOM class
+ public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "width", value.getCssValue());
+ }
+ }
+
+
+ // sets the min-width style property of this element by using the GWT DOM class
+ @Override
+ public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setTextDecoration(value.getCssValue());
+ else this.addStyleToStore(styleClass, "textDecoration", value.getCssValue());
+ }
+ }
+
+
+ // sets the max-width style property of this element by using the GWT DOM class
+ public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMinWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "minWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the max-width style property of this element by using the GWT DOM class
+ public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMaxWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "maxWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the passed string a caption/unit-name of the group item
+ public void setUnitName(Widget widget, String value){
+ ((UnitWidget)widget).setCaption(value);
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setUnitBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setUnitBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderTopWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class@Override
+ public void setUnitBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderRightWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderBottomWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setUnitBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderWidth(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderLeftWidth", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class
+ public void setUnitBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderColor(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class
+ public void setUnitBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderColor(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderTopColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class@Override
+ public void setUnitBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderColor(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderRightColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderColor(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderBottomColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-color style property of this element by using the GWT DOM class
+ public void setUnitBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderColor(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderLeftColor", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class
+ public void setUnitBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderStyle(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class
+ public void setUnitBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderStyle(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderTopStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class@Override
+ public void setUnitBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderStyle(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderRightStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderStyle(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderBottomStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-style style property of this element by using the GWT DOM class
+ public void setUnitBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderStyle(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderLeftStyle", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-padding style property of this element by using the GWT DOM class
+ public void setUnitBorderPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setPadding(value.getCssValue());
+ else this.addStyleToStore(styleClass, "padding", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-padding style property of this element by using the GWT DOM class
+ public void setUnitBorderTopPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setPaddingTop(value.getCssValue());
+ else this.addStyleToStore(styleClass, "paddingTop", value.getCssValue());
+ }
+ }
+
+ // sets the border-padding style property of this element by using the GWT DOM class@Override
+ public void setUnitBorderRightPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setPaddingRight(value.getCssValue());
+ else this.addStyleToStore(styleClass, "paddingRight", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-padding style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setPaddingBottom(value.getCssValue());
+ else this.addStyleToStore(styleClass, "paddingBottom", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-padding style property of this element by using the GWT DOM class
+ public void setUnitBorderLeftPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setPaddingLeft(value.getCssValue());
+ else this.addStyleToStore(styleClass, "paddingLeft", value.getCssValue());
+ }
+ }
+ // sets the border-margin style property of this element by using the GWT DOM class
+ public void setUnitBorderMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMargin(value.getCssValue());
+ else this.addStyleToStore(styleClass, "margin", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-margin style property of this element by using the GWT DOM class
+ public void setUnitBorderTopMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMarginTop(value.getCssValue());
+ else this.addStyleToStore(styleClass, "marginTop", value.getCssValue());
+ }
+ }
+
+ // sets the border-margin style property of this element by using the GWT DOM class@Override
+ public void setUnitBorderRightMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMarginRight(value.getCssValue());
+ else this.addStyleToStore(styleClass, "marginRight", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-margin style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMarginBottom(value.getCssValue());
+ else this.addStyleToStore(styleClass, "marginBottom", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-margin style property of this element by using the GWT DOM class
+ public void setUnitBorderLeftMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setMarginLeft(value.getCssValue());
+ else this.addStyleToStore(styleClass, "marginLeft", value.getCssValue());
+ }
+ }
+
+ // sets the border-radius style property of this element by using the GWT DOM class
+ public void setUnitBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderRadius(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-right-radius style property of this element by using the GWT DOM class
+ public void setUnitBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderTopRightRadius(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderTopRightRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-right-radius style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderBottomRightRadius(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderBottomRightRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-bottom-left-radius style property of this element by using the GWT DOM class
+ public void setUnitBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderBottomLeftRadius(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderBottomLeftRadius", value.getCssValue());
+ }
+ }
+
+
+ // sets the border-top-left-radius style property of this element by using the GWT DOM class
+ public void setUnitBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ if(styleClass == null)((UnitWidget)widget).setBorderTopLeftRadius(value.getCssValue());
+ else this.addStyleToStore(styleClass, "borderTopLeftRadius", value.getCssValue());
+ }
+ }
+ // sets all GDL styles that are defined by the topic map representative to tha passed widget
+ @Override
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
+
+ this.setUnitName(widget, this.getUnitName());
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setUnitBorderWidth(widget, this.getUnitBorderWidth(styleClass), styleClass);
+ this.setUnitBorderTopWidth(widget, this.getUnitBorderTopWidth(styleClass), styleClass);
+ this.setUnitBorderRightWidth(widget, this.getUnitBorderRightWidth(styleClass), styleClass);
+ this.setUnitBorderBottomWidth(widget, this.getUnitBorderBottomWidth(styleClass), styleClass);
+ this.setUnitBorderLeftWidth(widget, this.getUnitBorderLeftWidth(styleClass), styleClass);
+
+ this.setUnitBorderColor(widget, this.getUnitBorderColor(styleClass), styleClass);
+ this.setUnitBorderTopColor(widget, this.getUnitBorderTopColor(styleClass), styleClass);
+ this.setUnitBorderRightColor(widget, this.getUnitBorderRightColor(styleClass), styleClass);
+ this.setUnitBorderBottomColor(widget, this.getUnitBorderBottomColor(styleClass), styleClass);
+ this.setUnitBorderLeftColor(widget, this.getUnitBorderLeftColor(styleClass), styleClass);
+
+ this.setUnitBorderStyle(widget, this.getUnitBorderStyle(styleClass), styleClass);
+ this.setUnitBorderTopStyle(widget, this.getUnitBorderTopStyle(styleClass), styleClass);
+ this.setUnitBorderRightStyle(widget, this.getUnitBorderRightStyle(styleClass), styleClass);
+ this.setUnitBorderBottomStyle(widget, this.getUnitBorderBottomStyle(styleClass), styleClass);
+ this.setUnitBorderLeftStyle(widget, this.getUnitBorderLeftStyle(styleClass), styleClass);
+
+ this.setUnitBorderPadding(widget, this.getUnitBorderPadding(styleClass), styleClass);
+ this.setUnitBorderTopPadding(widget, this.getUnitBorderTopPadding(styleClass), styleClass);
+ this.setUnitBorderRightPadding(widget, this.getUnitBorderRightPadding(styleClass), styleClass);
+ this.setUnitBorderBottomPadding(widget, this.getUnitBorderBottomPadding(styleClass), styleClass);
+ this.setUnitBorderLeftPadding(widget, this.getUnitBorderLeftPadding(styleClass), styleClass);
+
+ this.setUnitBorderMargin(widget, this.getUnitBorderMargin(styleClass), styleClass);
+ this.setUnitBorderTopMargin(widget, this.getUnitBorderTopMargin(styleClass), styleClass);
+ this.setUnitBorderRightMargin(widget, this.getUnitBorderRightMargin(styleClass), styleClass);
+ this.setUnitBorderBottomMargin(widget, this.getUnitBorderBottomMargin(styleClass), styleClass);
+ this.setUnitBorderLeftMargin(widget, this.getUnitBorderLeftMargin(styleClass), styleClass);
+
+ this.setUnitBorderRadius(widget, this.getUnitBorderRadius(styleClass), styleClass);
+ this.setUnitBorderTopRightRadius(widget, this.getUnitBorderTopRightRadius(styleClass), styleClass);
+ this.setUnitBorderBottomRightRadius(widget, this.getUnitBorderBottomRightRadius(styleClass), styleClass);
+ this.setUnitBorderBottomLeftRadius(widget, this.getUnitBorderBottomLeftRadius(styleClass), styleClass);
+ this.setUnitBorderTopLeftRadius(widget, this.getUnitBorderTopLeftRadius(styleClass), styleClass);
+ }
+ }
+
+
- // TODO: getter/setter
- // setter => 5x gld:unit-border-width
- // setter => 5x gdl:unit-border-color
- // setter => 5x gdl:unit-border-style
- // setter => gdl:unit-name
- // setter => 5x gdl:unit-border-padding
- // setter => 5x gdl:unit-border-margin
- // setter => 5x gdl:unit-border-radius
+ // calls the super applies the GdlStyle for every TextArea item of this instance
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
+ super.setGdlStyle();
+
+ if(this.subElements != null){
+ for (Widget item : this.subElements) {
+ this.setGdlStyle(item);
+ }
+ }
+ }
+
- // TODO: override setter for textobject ??? => check first
+ // some handlers for applying the css style bound to the pseudo classes hover, active and focus
+ @Override
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
+ Widget source = (Widget)event.getSource();
+ super.onHoverStart(event, handler);
+ if(source.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)source;
+ for (Pair<String, String> pair : this.unitHoverCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
+ // applies the styles bound to hover and the passed element
+ @Override
+ protected void onHoverStart(Widget widget){
+ super.onHoverStart(widget);
+ if(widget.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)widget;
+ for (Pair<String, String> pair : this.unitHoverCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
+
+
+ // applies the styles bound to focus and the passed element
+ @Override
+ protected void onFocusStart(Widget widget){
+ super.onFocusStart(widget);
+ if(widget.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)widget;
+ for (Pair<String, String> pair : this.unitFocusCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ @Override
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
+ Widget source = (Widget)event.getSource();
+ super.onFocusStart(event, handler);
+ if(source.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)source;
+ for (Pair<String, String> pair : this.unitFocusCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
+
+
+ // applies the styles bound to acitve and the passed element
+ @Override
+ protected void onActiveStart(Widget widget){
+ super.onActiveStart(widget);
+ if(widget.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)widget;
+ for (Pair<String, String> pair : this.unitActiveCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
+
+
+ // shall be called to apply the styles of the active class
+ @Override
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
+ Widget source = (Widget)event.getSource();
+ super.onActiveStart(event, handler);
+ if(source.getClass().equals(UnitWidget.class)){
+ UnitWidget unit = (UnitWidget)source;
+ for (Pair<String, String> pair : this.unitActiveCssNamesAndStyles) {
+ if(pair.getFirst().equals("textDecoration"))unit.setTextDecoration(pair.getSecond());
+ else DOM.setStyleAttribute(unit.fieldset, pair.getFirst(), pair.getSecond());
+
+ if(unit.styleOfUnitWidgetBase(pair.getFirst())) DOM.setStyleAttribute(unit.basePanel.getElement(), pair.getFirst(), pair.getSecond());
+ }
+ }
+ }
@Override
public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant) throws InvalidGdlSchemaException {
// TODO: implement
}
-}
+
+
+ // wraps a fieldset with a legend item that represent a group-element
+ protected class UnitWidget extends Composite implements HasFocusHandlers, HasBlurHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseDownHandlers, HasMouseUpHandlers{
+ private AbsolutePanel basePanel = new AbsolutePanel();
+ private Element fieldset = DOM.createFieldSet();
+ private Element legend = DOM.createLegend();
+
+
+ public UnitWidget(){
+ initWidget(this.basePanel);
+ this.fieldset.appendChild(this.legend);
+ this.basePanel.getElement().appendChild(this.fieldset);
+ DOM.setStyleAttribute(this.legend, "float", "left");
+ DOM.setStyleAttribute(this.legend, "display", "none");
+ DOM.setStyleAttribute(this.legend, "marginLeft", "1em");
+ DOM.setStyleAttribute(this.legend, "marginRight", "1em");
+ }
+
+
+ // some css style setters
+ public void setHeight(String value){
+ DOM.setStyleAttribute(this.fieldset, "height", value);
+ }
+
+
+ public void setMaxHeight(String value){
+ DOM.setStyleAttribute(this.fieldset, "maxHeight", value);
+ }
+
+
+ public void setMinHeight(String value){
+ DOM.setStyleAttribute(this.fieldset, "minHeight", value);
+ }
+
+
+ public void setWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "width", value);
+ }
+
+
+ public void setMaxWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "maxWidth", value);
+ }
+
+
+ public void setMinWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "minWidth", value);
+ }
+
+
+ public void setBorderWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderWidth", value);
+ }
+
+
+ public void setBorderTopWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderTopWidth", value);
+ }
+
+
+ public void setBorderRightWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderRightWidth", value);
+ }
+
+
+ public void setBorderBottomWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderBottomWidth", value);
+ }
+
+
+ public void setBorderLeftWidth(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderLeftWidth", value);
+ }
+
+
+ public void setBorderColor(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderColor", value);
+ }
+
+
+ public void setBorderTopColor(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderTopColor", value);
+ }
+
+
+ public void setBorderRightColor(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderRightColor", value);
+ }
+
+
+ public void setTextDecoration(String value){
+ DOM.setStyleAttribute(this.legend, "textDecoration", value);
+ }
+
+
+ public void setBorderBottomColor(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderBottomColor", value);
+ }
+
+
+ public void setBorderLeftColor(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderLeftColor", value);
+ }
+
+
+ public void setBorderStyle(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderStyle", value);
+ }
+
+
+ public void setBorderTopStyle(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderTopStyle", value);
+ }
+
+
+ public void setBorderRightStyle(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderRightStyle", value);
+ }
+
+
+ public void setBorderBottomStyle(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderBottomStyle", value);
+ }
+
+
+ public void setBorderLeftStyle(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderLeftStyle", value);
+ }
+
+
+ public void setPadding(String value){
+ DOM.setStyleAttribute(this.fieldset, "padding", value);
+ }
+
+
+ public void setPaddingTop(String value){
+ DOM.setStyleAttribute(this.fieldset, "paddingTop", value);
+ }
+
+
+ public void setPaddingRight(String value){
+ DOM.setStyleAttribute(this.fieldset, "paddingRight", value);
+ }
+
+
+ public void setPaddingBottom(String value){
+ DOM.setStyleAttribute(this.fieldset, "paddingBottom", value);
+ }
+
+
+ public void setPaddingLeft(String value){
+ DOM.setStyleAttribute(this.fieldset, "paddingLeft", value);
+ }
+
+
+ public void setMargin(String value){
+ DOM.setStyleAttribute(this.fieldset, "margin", value);
+ }
+
+
+ public void setMarginTop(String value){
+ DOM.setStyleAttribute(this.fieldset, "marginTop", value);
+ }
+
+
+ public void setMarginRight(String value){
+ DOM.setStyleAttribute(this.fieldset, "marginRight", value);
+ }
+
+
+ public void setMarginBottom(String value){
+ DOM.setStyleAttribute(this.fieldset, "marginBottom", value);
+ }
+
+
+ public void setMarginLeft(String value){
+ DOM.setStyleAttribute(this.fieldset, "marginLeft", value);
+ }
+
+
+ public void setBorderRadius(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderRadius", value);
+ }
+
+
+ public void setBorderTopRightRadius(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderTopRightRadius", value);
+ }
+
+
+ public void setBorderBottomRightRadius(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderBottomRightRadius", value);
+ }
+
+
+ public void setBorderBottomLeftRadius(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderBottomLeftRadius", value);
+ }
+
+
+ public void setBorderTopLeftRadius(String value){
+ DOM.setStyleAttribute(this.fieldset, "borderTopLeftRadius", value);
+ }
+
+
+ public String getCaption() {
+ return this.legend.getInnerText();
+ }
+
+
+ // sets the unit's name. If the name is "" or null,
+ // the legend element is set to non-visible
+ public void setCaption(String caption) {
+ if(caption == null || caption.length() == 0){
+ this.legend.setInnerText("");
+ DOM.setStyleAttribute(this.legend, "display", "none");
+ } else {
+ this.legend.setInnerText(caption);
+ DOM.setStyleAttribute(this.legend, "display", "inline");
+ }
+ }
+
+
+ public void setId(String id){
+ DOM.setElementAttribute(this.basePanel.getElement(), "id", id);
+ }
+
+
+ public void insert(GdlVisibleObject widget){
+ // TODO: implement, change signature => positioning
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
+ return this.addDomHandler(handler, MouseUpEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
+ return this.addDomHandler(handler, MouseDownEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
+ return this.addDomHandler(handler, MouseOverEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
+ return this.addDomHandler(handler, MouseOutEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addBlurHandler(BlurHandler handler) {
+ return this.addDomHandler(handler, BlurEvent.getType());
+ }
+
+
+ @Override
+ public HandlerRegistration addFocusHandler(FocusHandler handler) {
+ return this.addDomHandler(handler, FocusEvent.getType());
+ }
+
+
+ // returns true if the passed style property must be applied on both the fieldset and absolutepanel
+ public boolean styleOfUnitWidgetBase(String styleProperty){
+ if(styleProperty.equals("borderWidth") || styleProperty.equals("borderTopWidth") || styleProperty.equals("borderRightWidth") || styleProperty.equals("borderBottomWidth") || styleProperty.equals("borderLeftWidth")){
+ return false;
+ }else if(styleProperty.equals("borderColor") || styleProperty.equals("borderTopColor") || styleProperty.equals("borderRightColor") || styleProperty.equals("borderBottomColor") || styleProperty.equals("borderLeftColor")){
+ return false;
+ }else if(styleProperty.equals("padding") || styleProperty.equals("paddingTop") || styleProperty.equals("paddingRight") || styleProperty.equals("paddingBottom") || styleProperty.equals("paddingLeft")){
+ return false;
+ }else if(styleProperty.equals("margin") || styleProperty.equals("marginTop") || styleProperty.equals("marginRight") || styleProperty.equals("marginBottom") || styleProperty.equals("marginLeft")){
+ return false;
+ }else if(styleProperty.equals("borderRadius") || styleProperty.equals("borderTopRightRadius") || styleProperty.equals("borderBottomRightRadius") || styleProperty.equals("borderBottomLeftRadius") || styleProperty.equals("borderTopLeftRadius")){
+ return false;
+ }else {
+ return true;
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Sun Jul 10 13:07:04 2011 (r595)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Mon Jul 11 03:35:13 2011 (r596)
@@ -337,6 +337,7 @@
if(value != null) this.setCssProperty(widget, styleClass, "letterSpacing", value.getCssValue());
}
+
// sets the word-spacing style property of this element by using the GWT DOM class
public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
if(value != null) this.setCssProperty(widget, styleClass, "wordSpacing", value.getCssValue());
1
0

[isidorus-cvs] r595 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container
by lgiessmann@common-lisp.net 10 Jul '11
by lgiessmann@common-lisp.net 10 Jul '11
10 Jul '11
Author: lgiessmann
Date: Sun Jul 10 13:07:04 2011
New Revision: 595
Log:
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Sun Jul 10 09:06:29 2011 (r594)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Sun Jul 10 13:07:04 2011 (r595)
@@ -57,6 +57,8 @@
// sets the list Element to either ol or ul depending on the gdl:ordered property
public void createList() throws InvalidGdlSchemaException, ExecutionException {
// this object is able to own only one sub-element
+ if(super.subElements != null && super.subElements.size() == 1)return;
+
ListWidget list = new ListWidget(this.getOrdered());
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
FocusStyleHandler fsHandler = new FocusStyleHandler(this);
1
0

[isidorus-cvs] r594 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: . base button complexData container text
by lgiessmann@common-lisp.net 10 Jul '11
by lgiessmann@common-lisp.net 10 Jul '11
10 Jul '11
Author: lgiessmann
Date: Sun Jul 10 09:06:29 2011
New Revision: 594
Log:
gdl-frontend: Widgets: started to implement GdlUnit, GdlComplexData, GdlButton
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/Button.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
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/IGdlHasValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml Fri Jul 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml Sun Jul 10 09:06:29 2011 (r594)
@@ -26,6 +26,9 @@
<source path="environment"/>
<source path="values"/>
<source path="isidorus"/>
+ <source path="complexData"/>
+ <source path="button"/>
+
<!-- Reference the javascript file that is necessary for tmjs -->
<script src="lib/tm.min.js" />
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Fri Jul 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Sun Jul 10 09:06:29 2011 (r594)
@@ -186,9 +186,9 @@
public final static String gdlUnitBorderBottomMargin = gdl + "unit-border-bottom-margin";
public final static String gdlUnitBorderLeftMargin = gdl + "unit-border-left-margin";
public final static String gdlUnitBorderRadius = gdl + "unit-border-radius";
- public final static String gdlUnitborderToprightRadius = gdl + "unit-border-top-right-radius";
+ public final static String gdlUnitborderTopRightRadius = gdl + "unit-border-top-right-radius";
public final static String gdlUnitBorderBottomRightRadius = gdl + "unit-border-bottom-right-radius";
- public final static String gdlUnitBoderBottomLeftRadius = gdl + "unit-border-bottom-left-radius";
+ public final static String gdlUnitBorderBottomLeftRadius = gdl + "unit-border-bottom-left-radius";
public final static String gdlUnitBorderTopLeftRadius = gdl + "unit-border-top-left-radius";
public final static String gdlContentOrientation = gdl + "content-orientation";
}
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 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Sun Jul 10 09:06:29 2011 (r594)
@@ -640,7 +640,7 @@
}
- // returns a ColorValue instance that represents the width of this element's border.
+ // returns a AbsoluteNumValue instance that represents the width of this element's border.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
// property is returned.
@@ -662,7 +662,7 @@
}
- // returns a ColorValue instance that represents the width of this element's border-top.
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-top.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
public AbsoluteNumValue getBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
@@ -681,7 +681,7 @@
}
- // returns a ColorValue instance that represents the width of this element's border-right.
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-right.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
public AbsoluteNumValue getBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
@@ -700,7 +700,7 @@
}
- // returns a ColorValue instance that represents the width of this element's border-bottom.
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-bottom.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
public AbsoluteNumValue getBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
@@ -719,7 +719,7 @@
}
- // returns a ColorValue instance that represents the width of this element's border-left.
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-left.
// If a styleClass is set, only the corresponding value of the scoped occurrence is returned
// null, null otherwise.
public AbsoluteNumValue getBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java Fri Jul 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java Sun Jul 10 09:06:29 2011 (r594)
@@ -1,8 +1,6 @@
package us.isidor.gdl.anaToMia.Widgets.base;
import java.util.ArrayList;
-
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Sun Jul 10 09:06:29 2011 (r594)
@@ -4,10 +4,8 @@
import us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine.JtmsTmEngine;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
-import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
+import us.isidor.gdl.anaToMia.Widgets.container.GdlUnit;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
-import us.isidor.gdl.anaToMia.Widgets.text.GdlReference;
-import us.isidor.gdl.anaToMia.Widgets.text.GdlTitle;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -122,7 +120,7 @@
fsHover.addTheme(gdlHover);
- GdlReference tmp = new GdlReference(tmpRepresentative);
+ GdlUnit tmp = new GdlUnit(tmpRepresentative);
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/Button.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/Button.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,7 @@
+package us.isidor.gdl.anaToMia.Widgets.button;
+
+import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
+
+public abstract class Button extends GdlTextObject {
+ // TODO: implement
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlAudio.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,20 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+import org.apache.commons.lang.NotImplementedException;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public class GdlAudio extends GdlComplexData {
+ // some constructors
+ protected GdlAudio() {
+ throw new NotImplementedException(GdlPsis.TopicType.gdlAudio + " is not implemented by anaToMia yet");
+ }
+
+
+ public GdlAudio(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ this();
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlComplexData.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,18 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public abstract class GdlComplexData extends GdlVisibleObject {
+ // some constructors
+ protected GdlComplexData() {
+ super();
+ }
+
+
+ public GdlComplexData(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDatePicker.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+public class GdlDatePicker extends GdlComplexData {
+ // TODO: implement
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlDateTimePicker.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+public class GdlDateTimePicker extends GdlComplexData {
+ // TODO: implement
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlImage.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,20 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+import org.apache.commons.lang.NotImplementedException;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public class GdlImage extends GdlComplexData {
+ // some constructors
+ protected GdlImage() {
+ throw new NotImplementedException(GdlPsis.TopicType.gdlImage + " is not implemented by anaToMia yet");
+ }
+
+
+ public GdlImage(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ this();
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlTimePicker.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+public class GdlTimePicker extends GdlComplexData {
+ // TODO: implement
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/complexData/GdlVideo.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,20 @@
+package us.isidor.gdl.anaToMia.Widgets.complexData;
+
+import org.apache.commons.lang.NotImplementedException;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public class GdlVideo extends GdlComplexData {
+ // some constructors
+ protected GdlVideo() {
+ throw new NotImplementedException(GdlPsis.TopicType.gdlVideo + " is not implemented by anaToMia yet");
+ }
+
+
+ public GdlVideo(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ this();
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Sun Jul 10 09:06:29 2011 (r594)
@@ -0,0 +1,715 @@
+package us.isidor.gdl.anaToMia.Widgets.container;
+
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
+import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
+import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
+import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
+import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
+
+
+public class GdlUnit extends GdlTextObject implements IGdlContainer {
+ // some constructors
+ protected GdlUnit() throws InvalidGdlSchemaException, ExecutionException {
+ super();
+ this.createUnit();
+ }
+
+
+ public GdlUnit(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ this.createUnit();
+ }
+
+
+ // creates a unit element or returns the one, if there is a unit element
+ // in the subElements array
+ private void createUnit(){
+ // TODO: implement
+ }
+
+
+ // returns a AbsoluteNumValue instance that represents the width of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public AbsoluteNumValue getUnitBorderWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderWidth);
+ }
+
+ if(widthOcc == null && styleClass != null){
+ return null;
+ } else if(widthOcc == null) {
+ return new AbsoluteNumValue();
+ } else {
+ return new AbsoluteNumValue(widthOcc.getValue());
+ }
+ }
+
+
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-top.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public AbsoluteNumValue getUnitBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopWidth);
+ }
+
+ if(widthOcc == null){
+ return null;
+ } else {
+ return new AbsoluteNumValue(widthOcc.getValue());
+ }
+ }
+
+
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-right.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public AbsoluteNumValue getUnitBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightWidth);
+ }
+
+ if(widthOcc == null){
+ return null;
+ } else {
+ return new AbsoluteNumValue(widthOcc.getValue());
+ }
+ }
+
+
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-bottom.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public AbsoluteNumValue getUnitBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomWidth);
+ }
+
+ if(widthOcc == null){
+ return null;
+ } else {
+ return new AbsoluteNumValue(widthOcc.getValue());
+ }
+ }
+
+
+ // returns a AbsoluteNumValue instance that represents the width of this element's border-left.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public AbsoluteNumValue getUnitBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftWidth);
+ }
+
+ if(widthOcc == null){
+ return null;
+ } else {
+ return new AbsoluteNumValue(widthOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the color of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getUnitBorderColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderColor);
+ }
+
+ if(colorOcc == null && styleClass != null){
+ return null;
+ } else if(colorOcc == null) {
+ return new ColorValue();
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the color of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getUnitBorderTopColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopColor);
+ }
+
+ if(colorOcc == null ){
+ return null;
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the color of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getUnitBorderRightColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightColor);
+ }
+
+ if(colorOcc == null ){
+ return null;
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the color of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getUnitBorderBottomColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomColor);
+ }
+
+ if(colorOcc == null ){
+ return null;
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the color of this element's group border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public ColorValue getUnitBorderLeftColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftColor);
+ }
+
+ if(colorOcc == null ){
+ return null;
+ } else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the style of this element's unit border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public BorderStyleValue getUnitBorderStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderStyle);
+ }
+
+ if(styleOcc == null && styleClass != null){
+ return null;
+ } else if(styleOcc == null) {
+ return BorderStyleValue.NONE;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the style of this element's unit border-top.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public BorderStyleValue getUnitBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopStyle);
+ }
+
+ if(styleOcc == null){
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-top-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the style of this element's border-right.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public BorderStyleValue getUnitBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightStyle);
+ }
+
+ if(styleOcc == null){
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-right-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the style of this element's border-bottom.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public BorderStyleValue getUnitBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomStyle);
+ }
+
+ if(styleOcc == null){
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-bottom-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns a ColorValue instance that represents the style of this element's border-left.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise.
+ public BorderStyleValue getUnitBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftStyle);
+ }
+
+ if(styleOcc == null){
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-left-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+
+ // returns a String instance that represents the literal value of this elements name.
+ public String getUnitBorderLeftStyle() throws InvalidGdlSchemaException {
+ Occurrence nameOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftStyle);
+
+ if(nameOcc == null){
+ return "";
+ } else {
+ return nameOcc.getValue();
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the padding of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderPadding(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence paddingOcc = null;
+ if(styleClass != null){
+ paddingOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderPadding, styleClass);
+ } else {
+ paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderPadding);
+ }
+
+ if(paddingOcc == null && styleClass != null){
+ return null;
+ } else if(paddingOcc == null) {
+ return new NumUnitValue();
+ } else {
+ return new NumUnitValue(paddingOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the padding of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderTopPadding(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence paddingOcc = null;
+ if(styleClass != null){
+ paddingOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopPadding, styleClass);
+ } else {
+ paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopPadding);
+ }
+
+ if(paddingOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(paddingOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the padding of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderRightPadding(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence paddingOcc = null;
+ if(styleClass != null){
+ paddingOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightPadding, styleClass);
+ } else {
+ paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightPadding);
+ }
+
+ if(paddingOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(paddingOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the padding of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderBottomPadding(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence paddingOcc = null;
+ if(styleClass != null){
+ paddingOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomPadding, styleClass);
+ } else {
+ paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomPadding);
+ }
+
+ if(paddingOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(paddingOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the padding of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderLeftPadding(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence paddingOcc = null;
+ if(styleClass != null){
+ paddingOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftPadding, styleClass);
+ } else {
+ paddingOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftPadding);
+ }
+
+ if(paddingOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(paddingOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the margin of this element's border padding.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderMargin(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence marginOcc = null;
+ if(styleClass != null){
+ marginOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderMargin, styleClass);
+ } else {
+ marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderMargin);
+ }
+
+ if(marginOcc == null && styleClass != null){
+ return null;
+ } else if(marginOcc == null) {
+ return new NumUnitValue();
+ } else {
+ return new NumUnitValue(marginOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the margin of this element's border padding.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderTopMargin(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence marginOcc = null;
+ if(styleClass != null){
+ marginOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopMargin, styleClass);
+ } else {
+ marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopMargin);
+ }
+
+ if(marginOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(marginOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the margin of this element's border padding.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderRightMargin(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence marginOcc = null;
+ if(styleClass != null){
+ marginOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightMargin, styleClass);
+ } else {
+ marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRightMargin);
+ }
+
+ if(marginOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(marginOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the margin of this element's border padding.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderBottomMargin(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence marginOcc = null;
+ if(styleClass != null){
+ marginOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomMargin, styleClass);
+ } else {
+ marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomMargin);
+ }
+
+ if(marginOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(marginOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the margin of this element's border padding.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getUnitBorderLeftMargin(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence marginOcc = null;
+ if(styleClass != null){
+ marginOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftMargin, styleClass);
+ } else {
+ marginOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderLeftMargin);
+ }
+
+ if(marginOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(marginOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the radius of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderRadius);
+ }
+
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null) {
+ return new NumUnitValue();
+ } else {
+ return new NumUnitValue(radiusOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the radius of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopLeftRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderTopLeftRadius);
+ }
+
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(radiusOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the radius of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitborderTopRightRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitborderTopRightRadius);
+ }
+
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(radiusOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the radius of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomLeftRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomLeftRadius);
+ }
+
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(radiusOcc.getValue());
+ }
+ }
+
+
+ // returns a NumUnitValue instance that represents the radius of this element's unit-border.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomRightRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlUnitBorderBottomRightRadius);
+ }
+
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
+ return null;
+ } else {
+ return new NumUnitValue(radiusOcc.getValue());
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+ // TODO: getter/setter
+ // setter => 5x gld:unit-border-width
+ // setter => 5x gdl:unit-border-color
+ // setter => 5x gdl:unit-border-style
+ // setter => gdl:unit-name
+ // setter => 5x gdl:unit-border-padding
+ // setter => 5x gdl:unit-border-margin
+ // setter => 5x gdl:unit-border-radius
+
+ // TODO: override setter for textobject ??? => check first
+
+
+
+
+ @Override
+ public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant) throws InvalidGdlSchemaException {
+ // TODO: implement
+ }
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 23:32:58 2011 (r593)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Sun Jul 10 09:06:29 2011 (r594)
@@ -12,10 +12,8 @@
import com.google.gwt.event.dom.client.HasFocusHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
@@ -31,6 +29,7 @@
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
+
public class GdlReference extends GdlTextObject implements IGdlHasValue{
// some constructors
protected GdlReference() throws InvalidGdlSchemaException, ExecutionException {
1
0

[isidorus-cvs] r593 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text
by lgiessmann@common-lisp.net 09 Jul '11
by lgiessmann@common-lisp.net 09 Jul '11
09 Jul '11
Author: lgiessmann
Date: Fri Jul 8 23:32:58 2011
New Revision: 593
Log:
gdl-frontend: Widgets: implemented a GdlReference click handler that is responsible for the default click behavior of a GdlReference instaince defined by the GDL
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 23:26:35 2011 (r592)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 23:32:58 2011 (r593)
@@ -4,12 +4,15 @@
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.event.dom.client.HasFocusHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
@@ -54,8 +57,7 @@
reference.addMouseOutHandler(hsHandler);
reference.addFocusHandler(fsHandler);
reference.addBlurHandler(fsHandler);
- // TODO: register a click handler that handles the reference behavior
- reference.setText("reference !!!"); // TODO: remove
+ reference.addClickHandler(new ReferenceClickHandler());
super.setGdlStyle(reference);
return reference;
}
@@ -162,6 +164,28 @@
}
+ // this class is responsible for the default click behavior of a GdlReference instance
+ protected class ReferenceClickHandler implements ClickHandler {
+ @Override
+ public void onClick(ClickEvent event) {
+ /*
+ TODO: implement
+
+ If a gdl:Reference element is bound to a gdl:Literal-Value (cf. chapter 7.16.2).
+ The set value must be treated as a network address, i.e. if this element is clicked
+ a new tabulator or a new window must appear with the content represented
+ by the given URI.
+ If a gdl:Reference element is bound to a gdl:TM-Value (cf. chapter 7.16.4),
+ the set value must be treated as a topic value, i.e. if a gdl:Reference
+ element is clicked a new tabulator or a new window must appear with the
+ gdl:Default-Editor-View bound to the topic represented by the given URI.
+ If no gdl:Default-Topic-View is defined for the requested topic,
+ a warning must be thrown followed by a regular proceeding of the GDL-frontend.
+ */
+ }
+ }
+
+
// this class wraps a Label that is used as
protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers {
public Reference(){
1
0

[isidorus-cvs] r592 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 09 Jul '11
by lgiessmann@common-lisp.net 09 Jul '11
09 Jul '11
Author: lgiessmann
Date: Fri Jul 8 23:26:35 2011
New Revision: 592
Log:
gdl-frontend: Widgets: implemented some getter methods for the default values of the GdlReference object (cursor, color, text-decoration)
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 8 13:39:15 2011 (r591)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Fri Jul 8 23:26:35 2011 (r592)
@@ -6,6 +6,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.environment.Pattern;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
+import us.isidor.gdl.anaToMia.Widgets.text.GdlReference;
import us.isidor.gdl.anaToMia.Widgets.text.GdlTitle;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
@@ -121,7 +122,7 @@
fsHover.addTheme(gdlHover);
- GdlTitle tmp = new GdlTitle(tmpRepresentative);
+ GdlReference tmp = new GdlReference(tmpRepresentative);
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 13:39:15 2011 (r591)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 23:26:35 2011 (r592)
@@ -11,9 +11,12 @@
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -21,6 +24,9 @@
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
+import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
+import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
public class GdlReference extends GdlTextObject implements IGdlHasValue{
// some constructors
@@ -30,12 +36,12 @@
public GdlReference(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
- // TODO: create a ListBox element for each TM-elem
+ // TODO: create a Reference element for each TM-elem
this.createReference();
}
- private Reference createReference() throws InvalidGdlSchemaException {
+ private Reference createReference() throws InvalidGdlSchemaException, ExecutionException {
Reference reference = new Reference();
DOM.setElementAttribute(reference.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
super.addToContainerPanel(reference);
@@ -49,32 +55,105 @@
reference.addFocusHandler(fsHandler);
reference.addBlurHandler(fsHandler);
// TODO: register a click handler that handles the reference behavior
+ reference.setText("reference !!!"); // TODO: remove
+ super.setGdlStyle(reference);
return reference;
}
- /* TODO: implement
- The default values of particular occurrences are set as follows:
- gdl:text-decoration: underline
- gdl:color (unscoped or scoped by gdl:hover and/or gdl:focus): #0000FF
- gdl:color (scoped by gdl:active): #FF0000
- gdl:cursor: pointer
- */
+ // returns a ColorValue instance that represents the text color of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ public ColorValue getColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlColor, styleClass);
+ } else {
+ colorOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlColor);
+ }
+
+ if(colorOcc == null && (styleClass == null || styleClass.equals(GdlPsis.Scope.gdlFocus) || styleClass.equals(GdlPsis.Scope.gdlHover))){
+ return new ColorValue("#0000FF");
+ }else if(colorOcc == null && styleClass.equals(GdlPsis.Scope.gdlActive)){
+ return null;
+ }else {
+ return new ColorValue(colorOcc.getValue());
+ }
+ }
+ // returns a CursorValue instance that represents the cursor of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
+ // property is returned.
+ @Override
+ public CursorValue getCursor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence cursorOcc = null;
+ if(styleClass != null){
+ cursorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlCursor, styleClass);
+ } else {
+ cursorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlCursor);
+ }
+
+ if(cursorOcc == null && styleClass != null){
+ return null;
+ } else if(cursorOcc == null) {
+ return CursorValue.POINTER;
+ } else {
+ try{
+ return CursorValue.valueOf(cursorOcc.getValue().toUpperCase().replace("-", "_"));
+ }catch(IllegalArgumentException e){
+ String values = "auto, default, crosshair, pointer, move, n-resize, ne-resize," +
+ "nw-resize, e-resize, se-resize, s-resize, sw-resize, w-resize," +
+ "text, wait, help, or progress";
+ throw new InvalidGdlSchemaException("cursor must be set to one of " + values + ", but is " + cursorOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns a TextDecoarionValue instance that represents the text-decoration of this element.
+ // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
+ // or null.
+ @Override
+ public TextDecorationValue getTextDecoration(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence decorationOcc = null;
+ if(styleClass != null){
+ decorationOcc = super.getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlTextDecoration, styleClass);
+ } else {
+ decorationOcc = super.getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlTextDecoration);
+ }
+
+ if(decorationOcc == null && styleClass != null){
+ return null;
+ } else if(decorationOcc == null) {
+ return TextDecorationValue.UNDERLINE;
+ } else {
+ try{
+ return TextDecorationValue.valueOf(decorationOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlTextDecoration + " must be set to one of \"underline\", \"overline\", \"line-through\", \"blink\" or \"none\", but is \"" + decorationOcc.getValue() + "\"");
+ }
+ }
+ }
@Override
public ArrayList<String> getStringValue() {
- // TODO Auto-generated method stub
- return null;
+ ArrayList<String> result = new ArrayList<String>();
+ for (Widget widget : this.subElements) {
+ result.add(((Reference)widget).getText());
+ }
+ return result;
}
+
@Override
public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
// TODO Auto-generated method stub
return null;
}
+
@Override
public boolean validate() {
@@ -83,10 +162,6 @@
}
-
-
-
-
// this class wraps a Label that is used as
protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers {
public Reference(){
1
0

[isidorus-cvs] r591 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text
by lgiessmann@common-lisp.net 08 Jul '11
by lgiessmann@common-lisp.net 08 Jul '11
08 Jul '11
Author: lgiessmann
Date: Fri Jul 8 13:39:15 2011
New Revision: 591
Log:
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 13:38:06 2011 (r590)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 13:39:15 2011 (r591)
@@ -53,7 +53,13 @@
}
-
+ /* TODO: implement
+ The default values of particular occurrences are set as follows:
+ gdl:text-decoration: underline
+ gdl:color (unscoped or scoped by gdl:hover and/or gdl:focus): #0000FF
+ gdl:color (scoped by gdl:active): #FF0000
+ gdl:cursor: pointer
+ */
1
0

[isidorus-cvs] r590 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text
by lgiessmann@common-lisp.net 08 Jul '11
by lgiessmann@common-lisp.net 08 Jul '11
08 Jul '11
Author: lgiessmann
Date: Fri Jul 8 13:38:06 2011
New Revision: 590
Log:
gdl-frontend: Widgets: started to implement the GdlReference class
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Jul 8 13:38:06 2011 (r590)
@@ -0,0 +1,104 @@
+package us.isidor.gdl.anaToMia.Widgets.text;
+
+import java.util.ArrayList;
+
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasFocusHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Label;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+
+public class GdlReference extends GdlTextObject implements IGdlHasValue{
+ // some constructors
+ protected GdlReference() throws InvalidGdlSchemaException, ExecutionException {
+ super();
+ }
+
+ public GdlReference(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ // TODO: create a ListBox element for each TM-elem
+ this.createReference();
+ }
+
+
+ private Reference createReference() throws InvalidGdlSchemaException {
+ Reference reference = new Reference();
+ DOM.setElementAttribute(reference.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
+ super.addToContainerPanel(reference);
+ ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
+ FocusStyleHandler fsHandler = new FocusStyleHandler(this);
+ HoverStyleHandler hsHandler = new HoverStyleHandler(this);
+ reference.addMouseDownHandler(asHandler);
+ reference.addMouseUpHandler(asHandler);
+ reference.addMouseOverHandler(hsHandler);
+ reference.addMouseOutHandler(hsHandler);
+ reference.addFocusHandler(fsHandler);
+ reference.addBlurHandler(fsHandler);
+ // TODO: register a click handler that handles the reference behavior
+ return reference;
+ }
+
+
+
+
+
+
+
+ @Override
+ public ArrayList<String> getStringValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean validate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+
+
+
+
+ // this class wraps a Label that is used as
+ protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers {
+ public Reference(){
+ super();
+ }
+
+ public Reference(String text){
+ super(text);
+ }
+
+ @Override
+ public HandlerRegistration addBlurHandler(BlurHandler handler) {
+ return this.addDomHandler(handler, BlurEvent.getType());
+ }
+
+ @Override
+ public HandlerRegistration addFocusHandler(FocusHandler handler) {
+ return this.addDomHandler(handler, FocusEvent.getType());
+ }
+ }
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Jul 8 13:00:49 2011 (r589)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Jul 8 13:38:06 2011 (r590)
@@ -3,7 +3,9 @@
import java.util.ArrayList;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
@@ -45,7 +47,7 @@
import com.google.gwt.user.client.ui.Widget;
-public class GdlTitle extends GdlTextObject {
+public class GdlTitle extends GdlTextObject implements IGdlHasValue{
protected ArrayList<Pair<String, String>> titleActiveCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> titleFocusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> titleHoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
@@ -417,6 +419,30 @@
}
+ @Override
+ public ArrayList<String> getStringValue() {
+ ArrayList<String> result = new ArrayList<String>();
+ for (Widget title : this.subElements) {
+ result.add(((TitleWidget)title).titleElement.getInnerText());
+ }
+ return result;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public boolean validate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
// this class represents the acutal content of this widget, i.e.
// it wraps a h1, h2, h3 or h4 element
protected class TitleWidget extends Composite implements HasMouseDownHandlers, HasMouseUpHandlers, HasMouseOverHandlers, HasMouseOutHandlers, HasBlurHandlers, HasFocusHandlers{
1
0