Changeset 961 for trunk/autoquest-plugin-html/src/main/java/de
- Timestamp:
- 10/30/12 14:02:07 (12 years ago)
- Location:
- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java
r950 r961 44 44 import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea; 45 45 import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 46 import de.ugoe.cs.autoquest.plugin.html. eventcore.HTMLEvent;47 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTML GUIElementSpec;46 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageElementSpec; 47 import de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLPageSpec; 48 48 import de.ugoe.cs.util.FileTools; 49 49 import de.ugoe.cs.util.console.Console; … … 257 257 List<IGUIElementSpec> guiElementPath = new ArrayList<IGUIElementSpec>(); 258 258 259 HTMLPageSpec page = new HTMLPageSpec(url, title); 260 261 guiElementPath.add(page.getServer()); 262 guiElementPath.add(page); 263 259 264 for (String pathElement : pathElements) { 260 265 if ((pathElement != null) && (!"".equals(pathElement))) { … … 274 279 } 275 280 276 guiElementPath.add(new HTML GUIElementSpec(url, title, type, id, index));281 guiElementPath.add(new HTMLPageElementSpec(page, type, id, index)); 277 282 } 278 283 } … … 352 357 String agent) 353 358 { 354 return new HTMLEvent(clientId, interaction, guiElement, timestamp, agent); 359 Event event = new Event(interaction, guiElement); 360 event.setParameter("clientId", clientId); 361 event.setParameter("timestamp", Long.toString(timestamp)); 362 event.setParameter("agent", agent); 363 364 return event; 355 365 } 356 366 -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLButton.java
r950 r961 24 24 * @author Patrick Harms 25 25 */ 26 public class HTMLButton extends HTML GUIElement implements IButton {26 public class HTMLButton extends HTMLPageElement implements IButton { 27 27 28 28 /** */ … … 37 37 * @param parent 38 38 */ 39 public HTMLButton(HTML GUIElementSpec specification, HTMLGUIElement parent) {39 public HTMLButton(HTMLPageElementSpec specification, HTMLGUIElement parent) { 40 40 super(specification, parent); 41 41 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLGUIElement.java
r950 r961 14 14 15 15 package de.ugoe.cs.autoquest.plugin.html.guimodel; 16 17 import java.net.URL;18 16 19 17 import de.ugoe.cs.autoquest.eventcore.guimodel.AbstractDefaultGUIElement; … … 39 37 /** 40 38 * <p> 41 * Specification of the GUI Element42 * </p>43 */44 private HTMLGUIElementSpec specification;45 46 /**47 * <p>48 39 * Constructor. Creates a new HTMLGUIElement. 49 40 * </p> … … 57 48 public HTMLGUIElement(HTMLGUIElementSpec specification, HTMLGUIElement parent) { 58 49 super(specification, parent); 59 this.specification = specification;60 50 } 61 51 … … 70 60 } 71 61 72 /**73 * <p>74 * Returns web page to which this GUI element belongs75 * </p>76 *77 * @return the page URL78 */79 URL getPageURL() {80 return specification.getPageURL();81 }82 83 /**84 * <p>85 * Returns the title of the page to which the GUI element belongs86 * </p>87 *88 * @return the title89 */90 String getPageTitle() {91 return specification.getPageTitle();92 }93 94 /**95 * <p>96 * Returns the type of the GUI element, i.e., the name of its tag in HTML97 * </p>98 *99 * @return the tag in HTML100 */101 String getTagName() {102 return specification.getType();103 }104 105 /**106 * <p>107 * Returns the id of the tag in HTML108 * </p>109 *110 * @return the id of the HTML tag111 */112 String getTagId() {113 return specification.getTagId();114 }115 116 /**117 * <p>118 * Returns the child index of the tag referring to all tags with the same type within the same119 * parent tag120 * </p>121 *122 * @return the index123 */124 int getIndex() {125 return specification.getIndex();126 }127 128 62 /* 129 63 * (non-Javadoc) … … 135 69 @Override 136 70 public void updateSpecification(IGUIElementSpec updateSpecification) { 137 if (updateSpecification instanceof HTMLGUIElementSpec) { 138 specification.update(((HTMLGUIElementSpec) updateSpecification)); 139 } 71 // nothing to do. There is not need for handle things such as name changes, etc. 140 72 } 141 73 … … 154 86 } 155 87 156 /*157 * (non-Javadoc)158 *159 * @see java.lang.Object#toString()160 */161 @Override162 public String toString() {163 String str = getElementDescriptor() + "(" + getTagName();164 if (getTagId() != null) {165 str += "(id=" + getTagId() + ")";166 }167 else {168 str += "[" + getIndex() + "]";169 }170 171 str += ")";172 return str;173 }174 175 88 /** 176 89 * <p> -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLGUIElementSpec.java
r950 r961 15 15 package de.ugoe.cs.autoquest.plugin.html.guimodel; 16 16 17 import java.net.URL;18 19 17 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 20 18 … … 32 30 33 31 /** */ 34 private URL pageURL;35 36 /** */37 private String pageTitle;38 39 /** */40 32 private String type; 41 33 42 /** */43 private String id;44 45 /** */46 private int index;47 48 34 /** 49 35 * <p> … … 55 41 * @param id 56 42 */ 57 public HTMLGUIElementSpec(URL pageURL, String pageTitle, String type, String id, int index) { 58 if (pageURL == null) { 59 throw new IllegalArgumentException("page URL must not be null"); 60 } 61 else if (type == null) { 43 HTMLGUIElementSpec(String type) { 44 if (type == null) { 62 45 throw new IllegalArgumentException("type must not be null"); 63 46 } 64 else if ((id == null) && (index < 0)) { 65 throw new IllegalArgumentException 66 ("either id must not be null or the index must be greater or equal to 0"); 67 } 68 69 this.pageURL = pageURL; 70 this.pageTitle = pageTitle; 47 71 48 this.type = type; 72 this.id = id;73 this.index = index;74 49 } 75 50 … … 89 64 if (other instanceof HTMLGUIElementSpec) { 90 65 HTMLGUIElementSpec otherSpec = (HTMLGUIElementSpec) other; 91 92 if (!type.equals(otherSpec.type)) { 93 return false; 94 } 95 96 if (id != null) { 97 return id.equals(otherSpec.id); 98 } 99 else if (index >= 0) { 100 return index == otherSpec.index; 101 } 66 return type.equals(otherSpec.type); 102 67 } 103 68 … … 105 70 } 106 71 107 /**108 * <p>109 * TODO: comment110 * </p>111 *112 * @return113 */114 URL getPageURL() {115 return pageURL;116 }117 118 /**119 * <p>120 * TODO: comment121 * </p>122 *123 * @return124 */125 String getPageTitle() {126 return pageTitle;127 }128 129 /**130 * <p>131 * TODO: comment132 * </p>133 *134 * @return135 */136 String getTagId() {137 return id;138 }139 140 /**141 * <p>142 * TODO: comment143 * </p>144 *145 * @return146 */147 int getIndex() {148 return index;149 }150 151 /**152 * <p>153 * TODO: comment154 * </p>155 *156 * @param htmlguiElementSpec157 */158 void update(HTMLGUIElementSpec htmlguiElementSpec) {159 // TODO Auto-generated method stub160 System.out.println("TODO: implement HTMLGUIElementSpec.update ");161 162 }163 164 72 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLLink.java
r950 r961 24 24 * @author Patrick Harms 25 25 */ 26 public class HTMLLink extends HTML GUIElement implements IButton {26 public class HTMLLink extends HTMLPageElement implements IButton { 27 27 28 28 /** */ … … 37 37 * @param parent 38 38 */ 39 public HTMLLink(HTML GUIElementSpec specification, HTMLGUIElement parent) {39 public HTMLLink(HTMLPageElementSpec specification, HTMLGUIElement parent) { 40 40 super(specification, parent); 41 41 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPanel.java
r950 r961 24 24 * @author Patrick Harms 25 25 */ 26 public class HTMLPanel extends HTML GUIElement implements IPanel {26 public class HTMLPanel extends HTMLPageElement implements IPanel { 27 27 28 28 /** */ … … 37 37 * @param parent 38 38 */ 39 public HTMLPanel(HTML GUIElementSpec specification, HTMLGUIElement parent) {39 public HTMLPanel(HTMLPageElementSpec specification, HTMLGUIElement parent) { 40 40 super(specification, parent); 41 41 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLTextArea.java
r950 r961 24 24 * @author Patrick Harms 25 25 */ 26 public class HTMLTextArea extends HTML GUIElement implements ITextArea {26 public class HTMLTextArea extends HTMLPageElement implements ITextArea { 27 27 28 28 /** */ … … 37 37 * @param parent 38 38 */ 39 public HTMLTextArea(HTML GUIElementSpec specification, HTMLGUIElement parent) {39 public HTMLTextArea(HTMLPageElementSpec specification, HTMLGUIElement parent) { 40 40 super(specification, parent); 41 41 }
Note: See TracChangeset
for help on using the changeset viewer.