Et flerspråklig datamodelleringsverktøy. med XML som modellrepresentasjon. Eirik Meland. vedlegg til hovedfagsoppgave

Størrelse: px
Begynne med side:

Download "Et flerspråklig datamodelleringsverktøy. med XML som modellrepresentasjon. Eirik Meland. vedlegg til hovedfagsoppgave"

Transkript

1 Universitetet i Oslo Institutt for informatikk Et flerspråklig datamodelleringsverktøy med XML som modellrepresentasjon Eirik Meland vedlegg til hovedfagsoppgave February 16, 2004

2 2

3 Contents 1 DTD niamderthal.dtd XSLT identify.xslt util.xslt Java no.uio.ifi.niamderthal.canvas no.uio.ifi.niamderthal.constants no.uio.ifi.niamderthal.niamderthal no.uio.ifi.niamderthal.orm.backgroundpopup no.uio.ifi.niamderthal.orm.facade no.uio.ifi.niamderthal.orm.figures no.uio.ifi.niamderthal.orm.figures.constants no.uio.ifi.niamderthal.orm.figures.entity no.uio.ifi.niamderthal.orm.figures.object no.uio.ifi.niamderthal.orm.figures.objectifiedrelationship no.uio.ifi.niamderthal.orm.figures.relationship no.uio.ifi.niamderthal.orm.figures.role no.uio.ifi.niamderthal.orm.figures.symbol no.uio.ifi.niamderthal.orm.figures.value no.uio.ifi.niamderthal.orm.figures.constraints no.uio.ifi.niamderthal.orm.figures.constraints.cardinalityconstraint no.uio.ifi.niamderthal.orm.figures.constraints.equalityconstraint no.uio.ifi.niamderthal.orm.figures.constraints.frequencyconstraint no.uio.ifi.niamderthal.orm.figures.constraints.inequalityconstraint no.uio.ifi.niamderthal.orm.figures.constraints.mandatoryconstraint no.uio.ifi.niamderthal.orm.figures.constraints.ringconstraint no.uio.ifi.niamderthal.orm.figures.constraints.roleconstraint no.uio.ifi.niamderthal.orm.figures.constraints.subsetconstraint no.uio.ifi.niamderthal.orm.figures.constraints.subtype no.uio.ifi.niamderthal.orm.figures.constraints.valueconstraint no.uio.ifi.niamderthal.orm.tools no.uio.ifi.niamderthal.orm.tools.empty no.uio.ifi.niamderthal.orm.tools.objectrelationship no.uio.ifi.niamderthal.orm.tools.relationship no.uio.ifi.niamderthal.orm.tools.role

4 3.31 no.uio.ifi.niamderthal.orm.tools.roleconstraint no.uio.ifi.niamderthal.orm.tools.subtype no.uio.ifi.niamderthal.uml no.uio.ifi.niamderthal.uml.backgroudpopup no.uio.ifi.niamderthal.uml.figures.association no.uio.ifi.niamderthal.uml.figures.concept no.uio.ifi.niamderthal.uml.figures.constants no.uio.ifi.niamderthal.uml.figures.constraint no.uio.ifi.niamderthal.uml.figures.generalization no.uio.ifi.niamderthal.uml.figures.multiplicity no.uio.ifi.niamderthal.uml.figures.role no.uio.ifi.niamderthal.uml.figures.symbol no.uio.ifi.niamderthal.uml.tools.association no.uio.ifi.niamderthal.uml.tools.concept no.uio.ifi.niamderthal.uml.tools.empty no.uio.ifi.niamderthal.uml.tools.generalization no.uio.ifi.niamderthal.common.constants no.uio.ifi.niamderthal.common.backgroundpopup no.uio.ifi.niamderthal.common.figures.symbol no.uio.ifi.niamderthal.common.figures.note no.uio.ifi.niamderthal.common.figures.connectorline no.uio.ifi.niamderthal.common.figures.moveablepoint no.uio.ifi.niamderthal.common.figures.moveabletext no.uio.ifi.niamderthal.common.figures.constraint.constraint no.uio.ifi.niamderthal.common.tools no.uio.ifi.niamderthal.common.tools.empty no.uio.ifi.niamderthal.common.tools.note no.uio.ifi.niamderthal.common.tools.select no.uio.ifi.niamderthal.xml no.uio.ifi.niamderthal.xml.constants no.uio.ifi.niamderthal.xml.model no.uio.ifi.niamderthal.xml.project no.uio.ifi.niamderthal.xml.view no.uio.ifi.niamderthal.model no.uio.ifi.niamderthal.model.empty no.uio.ifi.niamderthal.model.entity no.uio.ifi.niamderthal.model.object no.uio.ifi.niamderthal.model.role no.uio.ifi.niamderthal.model.relationship no.uio.ifi.niamderthal.model.value no.uio.ifi.niamderthal.model.constraints.cardinalityconstraint no.uio.ifi.niamderthal.model.constraints.constraint no.uio.ifi.niamderthal.model.constraints.mandatoryconstraint no.uio.ifi.niamderthal.model.constraints.subtype no.uio.ifi.niamderthal.model.constraints.valueconstraint

5 Chapter 1 DTD 1.1 niamderthal.dtd 1 <! orm > 2 <!ELEMENT orm ( meta?, model, view ) > 3 4 <! meta > 5 <!ELEMENT meta ( meta content?, meta intellectual property?, meta instantiation? ) > 6 <! content > 7 <!ELEMENT meta content ( meta title, meta subject, 8 meta description, meta type, 9 meta source, meta relation, 10 meta coverage ) > 11 <! title > 12 <! The name given to the resource, usually by the Creator 13 or Publisher. > 14 <!ELEMENT meta title ( #PCDATA ) > 15 <! subject > 16 <! The topic of the resource. Typically, subject will be 17 expressed as keywords or phrases that describe the subject 18 or content of the resource. The use of controlled 19 vocabularies and formal classification schemes is encouraged. > 20 <!ELEMENT meta subject ( #PCDATA ) > 21 <! description > 22 <! A textual description of the content of the resource, including 23 abstracts in the case of document like objects or content 24 descriptions in the case of visual resources. > 25 <!ELEMENT meta description ( #PCDATA ) > 26 <! type > 27 <! The category of the resource, such as home page, novel, poem, 28 working paper, technical report, essay, dictionary. For the sake 29 of interoperability, Type should be selected from an enumerated 30 list that is currently under development in the workshop series I need to find better alternatives here 33 > 34 <!ELEMENT meta type ( #PCDATA ) > 35 <! source > 36 <! Information about a second resource from which the present 37 resource is derived. While it is generally recommended that 38 elements contain information about the present resource only, 39 this element may contain metadata for the second resource when it 40 is considered important for discovery of the present resource. 41 > 5

6 42 <!ELEMENT meta source ( #PCDATA ) > 43 <! relation > 44 <! An identifier of a second resource and its relationship to the 45 present resource. This element is used to express linkages among 46 related resources. For the sake of interoperability, 47 relationships should be selected from an enumerated list that is 48 currently under development in the workshop series "Workshop series"? 51 > 52 <!ELEMENT meta relation ( #PCDATA ) > 53 <! coverage > 54 <! The spatial or temporal characteristics of the intellectual 55 content of the resource. Spatial coverage refers to a physical 56 region ( e.g., celestial sector ) using place names or coordinates 57 ( e. g., longitude and latitude ). Temporal coverage refers to what 58 the resource is about rather than when it was created or made 59 available ( the latter belonging in the Date element ). Temporal 60 coverage is typically specified using named time periods ( e.g., 61 neolithic ) or the same date/time format [3] as recommended for 62 the Date element. 63 > 64 <!ELEMENT meta coverage ( #PCDATA ) > <! intellectual property > 67 <!ELEMENT meta intellectual property 68 ( meta creator, meta publisher, 69 meta contributor, meta rights ) > 70 <! creator > 71 <! The person or organization primarily responsible for creating 72 the intellectual content of the resource. For example, 73 authors in the case of written documents, artists, photographers, 74 or illustrators in the case of visual resources. > 75 <!ELEMENT meta creator ( #PCDATA ) > 76 <! contributor > 77 <! 78 A person or organization not specified in a Creator element who has 79 made significant intellectual contributions to the resource but 80 whose contribution is secondary to any person or organization 81 specified in a Creator element ( for example, editor, transcriber, 82 and illustrator ). 83 > 84 <!ELEMENT meta contributor ( #PCDATA ) > 85 <! publisher > 86 <! The entity responsible for making the resource available in its 87 present form, such as a publishing house, a university 88 department, or a corporate entity. > 89 <!ELEMENT meta publisher ( #PCDATA ) > 90 <! rights > 91 <! A rig h ts management statement, an identifier that links to a 92 rights management statement, or an identifier that links to a 93 service providing information about rights management for the 94 resource. 95 > 96 <!ELEMENT meta rights ( #PCDATA ) > <! instantiation > 99 <!ELEMENT meta instantiation 100 ( meta date, meta format, 101 meta identifier, meta language ) > 102 <! date > 103 <! A date associated with the creation or availability of the 6

7 104 resource. Recommended best practice is defined in a profile of 105 ISO 8601 [3] that includes (among others ) d a t es o f t h e forms YYYY 106 and YYYY MM DD. In this scheme, for example, the date corresponds to November 5, > 109 <!ELEMENT meta date ( #PCDATA ) > 110 <! format > 111 <! The data format and, optionally, dimensions ( e.g., size, 112 duration ) of the resource. The format is used to identify the 113 software and possibly hardware that might be needed to display or 114 operate the resource. For the sake of interoperability, the 115 format should be selected from an enumerated list that is 116 currently under development in the workshop series. 117 > 118 <!ELEMENT meta format ( #PCDATA ) > 119 <! identifier > 120 <! 121 A string or number used to uniquely identify the resource. 122 Examples for networked resources include URLs and URNs (when 123 implemented ). Other globally unique identifiers, such as 124 International Standard Book Numbers (ISBN ) or other formal names 125 are also candidates for this element. 126 > 127 <!ELEMENT meta identifier 128 ( #PCDATA ) > 129 <! language > 130 <! The language of the intellectual content of the resource. 131 Recommended best practice is defined in RFC 1766 [4]. 132 > 133 <!ELEMENT meta language ( #PCDATA ) > <! model > 137 <!ELEMENT model ( tables?, objects, 138 relationships, constraints ) > <! tables > 141 <!ELEMENT tables ( table + ) > 142 <! table > 143 <!ELEMENT table ( attributes? ) > 144 <!ATTLIST table 145 id ID #REQUIRED 146 source IDREF #REQUIRED > <! attributes > 149 <!ELEMENT attributes ( key attribute )+ > <! key > 152 <!ELEMENT key ( attribute + ) > <! attribute > 155 <!ELEMENT attribute EMPTY > 156 <!ATTLIST attribute 157 entity ref IDREF #REQUIRED 158 not null ( true false ) "false" > <! objects > 163 <!ELEMENT objects ( entity value ) > <! entity > 7

8 166 <!ELEMENT entity ( representation? ) > 167 <!ATTLIST entity 168 id ID #REQUIRED 169 name CDATA #REQUIRED > <! representation > 172 <!ELEMENT representation 173 ( ( value ref entity ref )+, criterion ) > <! value ref > 176 <!ELEMENT value ref EMPTY > 177 <!ATTLIST value ref 178 ref IDREF #REQUIRED > <! entity ref > 181 <!ELEMENT entity ref EMPTY > 182 <!ATTLIST entity ref 183 ref IDREF #REQUIRED > <! criterion > 186 <!ELEMENT criterion ( relationship ref constraint ref )+ > <! relationship ref > 189 <!ELEMENT relationship ref 190 EMPTY > 191 <!ATTLIST relationship ref 192 ref IDREF #REQUIRED > <! constraint ref > 195 <!ELEMENT constraint ref 196 EMPTY > 197 <!ATTLIST constraint ref 198 ref IDREF #REQUIRED > <! value > 202 <!ELEMENT value EMPTY > 203 <!ATTLIST value 204 id ID #REQUIRED 205 name CDATA #REQUIRED 206 datatype (numeric text ) "text" > <! relationships > 209 <!ELEMENT relationships ( relationship ) > <! relationship > 212 <!ELEMENT relationship ( role, role ) > 213 <!ATTLIST relationship 214 id ID #REQUIRED > <! role > 217 <!ELEMENT role EMPTY > 218 <!ATTLIST role 219 id ID #REQUIRED 220 object ref IDREF #REQUIRED 221 name CDATA #IMPLIED > 222 <! 223 cardinality (1 many ) "many" 224 mandatory ( true false ) "false" 225 > <! constraints > 8

9 228 <! <!ELEMENT constraints ( uc mc unique external vc subtype definition ) > > 229 <!ELEMENT constraints ( uc mc vc subtype definition ) > <! unique constraint > 232 <!ELEMENT uc EMPTY > 233 <!ATTLIST uc 234 id ID #REQUIRED 235 roles IDREFS #REQUIRED > <! mandatory constraint > 238 <!ELEMENT mc EMPTY > 239 <!ATTLIST mc 240 id ID #REQUIRED 241 roles IDREFS #REQUIRED > <! unique external > 244 <!ELEMENT unique external 245 EMPTY > 246 <!ATTLIST unique external 247 id ID #REQUIRED 248 roles IDREFS #REQUIRED > <! value constraint > 251 <!ELEMENT vc 252 (vc value ) > 253 <!ATTLIST vc 254 id ID #REQUIRED 255 value ref IDREF #REQUIRED > <! val > 258 <!ELEMENT vc value EMPTY > 259 <!ATTLIST vc value 260 val CDATA #REQUIRED > <! subtype definition > 263 <!ELEMENT subtype definition 264 ( subtype constraint ) > 265 <!ATTLIST subtype definition 266 id ID #REQUIRED 267 subtype IDREF #REQUIRED 268 supertype IDREF #REQUIRED > 269 <! subtype constraint > 270 <!ELEMENT subtype constraint 271 ( sc rc sc not ) > 272 <! relationship constraint > 273 <!ELEMENT sc rc 274 ( sc vc ) > 275 <!ATTLIST sc rc 276 relationship ref 277 IDREF #REQUIRED > <! value constraint > 280 <!ELEMENT sc vc 281 EMPTY > 282 <!ATTLIST sc vc 283 value CDATA #REQUIRED > <! subtype constraint_not > 286 <!ELEMENT sc not EMPTY > 287 <!ATTLIST sc not 288 subtype ref IDREF #REQUIRED > 9

10 Chapter 2 XSLT 2.1 identify.xslt 1 <?xml version="1.0"?> 2 <xsl:stylesheet version="2.0" 3 xmlns:xsl="http: // 4 xmlns:orm=" http: / / folk. i f i. uio.no/ eirikm /orm" 5 xmlns:orm util=" http: / / folk. i f i. uio.no/ eirikm /orm util"> 6 7 <xsl:include href=".. / util / util. xslt "/> 8 <xsl:output method="xml"/> 9 10 <xsl:param name=" eid "/> <xsl:variable name="objects" select=" // objects"/> 13 <xsl:variable name="relationships " select=" // relationships "/> 14 <xsl:variable name="constraints" select=" // constraints"/> <! global helper variables > 17 <xsl:variable name="connected relationships " 18 select="orm util:get connected relationships () "/> <xsl:template match=" / "> 21 <xsl:variable name="entity" select="$objects / entity[@id = $eid]"/> 22 <! check if entity exists > 23 <xsl:if test="$entity"> 24 <xsl:element name=" {name($entity )} "> 25 <xsl:attribute name="id"> 26 <xsl:value of select="$entity /@id"/> 27 </xsl:attribute > 28 <xsl:attribute name="name"> 29 <xsl:value of select="$entity /@name"/> 30 </xsl:attribute > <xsl:choose> 33 <xsl:when test="$entity / representation"> 34 <xsl:copy of select="$entity / representation "/> 35 </xsl:when> 36 <xsl:otherwise> 37 <! check for perfect bridge > 38 <xsl:variable name="perfect bridges" select="orm:get perfect bridges () "/> 39 <! debug 40 <xsl:copy of select="$perfect bridges"/> 10

11 41 > <! check for indirect identifying > 44 <xsl:variable name="indirect ident" select="orm:get indirect identifiers () "/> 45 <! debug 46 <xsl:copy of select="$indirect ident"/> 47 > <! check for supertype > 50 <xsl:variable name="supertype ident" select="orm:identify by supertype($eid)"/> <xsl:choose> 53 <xsl:when test=" 54 (count($perfect bridges / perfect bridge ) 55 + count($indirect ident/ indirectly identified) 56 + count($supertype ident/ identified by supertype )) = 1"> 57 <xsl:element name="representation "> 58 <xsl:choose> 59 <xsl:when test="count($ perfect bridges / perfect bridge) = 1"> 60 <xsl:copy of select="$perfect bridges / perfect bridge / "/> 61 </xsl:when> 62 <xsl:when test="count($ indirect ident/ indirectly identified) = 1"> 63 <xsl:copy of select="$indirect ident/ indirectly identified/ "/> 64 </xsl:when> 65 <xsl:otherwise> 66 <xsl:copy of select="$supertype ident/ identified by supertype / "/> 67 </xsl:otherwise> 68 </xsl:choose> 69 </xsl:element> 70 </xsl:when> 71 <xsl:otherwise> 72 <xsl:copy of select="$perfect bridges"/> 73 <xsl:copy of select="$indirect ident"/> 74 <xsl:copy of select="$supertype ident"/> 75 </xsl:otherwise> 76 </xsl:choose> 77 </xsl:otherwise> 78 </xsl:choose> 79 </xsl:element> 80 </xsl:if > 81 </xsl:template> <! orm:identify by supertype 84 input: eid 85 returns formatted representation 86 > 87 <xsl:function name="orm:identify by supertype "> 88 <xsl:param name=" eid"/> 89 <xsl:variable name="supertype"> 90 <xsl:copy of select="orm:find supertype ($ eid ) "/> 91 </xsl:variable> 92 <xsl:variable name="result"> 93 <xsl:if test="count($supertype / ) > 0"> 94 <xsl:element name=" identified by supertype "> 95 <xsl:element name="entity ref"> 96 <xsl:attribute name="ref"> 97 <xsl:value of select ="$supertype / entity /> 98 </xsl:attribute > 99 </xsl:element> 100 <xsl:element name="criterion"> 101 <xsl:element name="constraint ref"> 102 <xsl:attribute name="ref"> 11

12 103 <xsl:value of select=" 104 $constraints/subtype definition 105 = $eid 106 and = $supertype / entity /@id 108 ] /> 109 </xsl:attribute > 110 </xsl:element> 111 </xsl:element> 112 </xsl:element> 113 </xsl:if > 114 </xsl:variable> 115 <xsl:sequence select="$result "/> 116 </xsl:function> <! orm:find supertype 119 input: eid 120 returns supertype entity ( if it exists ) 121 > 122 <xsl:function name="orm:find supertype "> 123 <xsl:param name=" eid"/> 124 <xsl:variable name="subtypes"> 125 <xsl:copy of select=" 126 $constraints/subtype definition [@subtype = $eid]"/> 127 </xsl:variable> 128 <xsl:sequence select=" 129 $objects / = $subtypes / subtype definition /@supertype]"/> 130 </xsl:function> <! orm:get indirect identifiers 133 expects: $eid and $connected relationships 134 input: none ( expects eid to be set ) 135 output: formatted indirect identifiers 136 > 137 <xsl:function name="orm:get indirect identifiers "> 138 <xsl:variable name="result"> 139 <xsl:variable name="matching rels cons" 140 select="orm util:get matching rels cons($connected relationships )"/> 141 <! debug 142 <xsl:copy of select="$matching rels cons"/> 143 > <xsl:for each select ="$matching rels cons /match"> 146 <xsl:element name=" indirectly identified"> 147 <! find objects referenced > 148 <xsl:variable name="objs"> 149 <xsl:copy of select=" 150 for $rel in relationship 151 return $objects / = orm util:get other role($rel ref ]"/> 152 </xsl:variable> 153 <! print objects > 154 <xsl:for each select="$objs/ "> 155 <xsl:element name=" {name()} ref"> 156 <xsl:attribute name="ref"> 157 <xsl:value of select="@id"/> 158 </xsl:attribute > 159 </xsl:element> 160 </ xsl:for each> 161 <xsl:element name="criterion"> 162 <! relationships > 163 <xsl:for each select="relationship "> 164 <xsl:element name="relationship ref"> 12

13 165 <xsl:attribute name="ref"> 166 <xsl:value of /> 167 </xsl:attribute > 168 </xsl:element> 169 </ xsl:for each> 170 <! constraints > 171 <xsl:for each select=" (mc uc) "> 172 <xsl:element name="constraint ref"> 173 <xsl:attribute name="ref"> 174 <xsl:value of /> 175 </xsl:attribute > 176 </xsl:element> 177 </ xsl:for each> 178 </xsl:element> 179 </xsl:element> 180 </ xsl:for each> 181 </xsl:variable> 182 <xsl:sequence select="$result "/> 183 </xsl:function> <! orm:get perfect bridges 186 expects: $eid and $connected relationships 187 input: none 188 output: sequence of "formatted " perfect bridges output all perfect bridges 191 > 192 <xsl:function name="orm:get perfect bridges"> 193 <xsl:variable name="perfect bridges"> 194 <xsl:for each select="$connected relationships "> 195 <! define connected role > 196 <xsl:variable name="con role" 197 select="orm util:get connected role ( current ()) "/> 198 <! define other role > 199 <xsl:variable name="other role" 200 select="orm util:get other role ( current ()) "/> 201 <! define connected constraints > 202 <xsl:variable name="con con " 203 select="orm util:get connected constraints(current ()) "/> <! split connected constraints into 206 mandatory constraints and unique constraints > 207 <xsl:variable name="mcs" select="$con con /mc" /> 208 <xsl:variable name="ucs" select="$con con / uc" /> <! check to see if this is a perfect bridge > 211 <xsl:if test=" 212 count($mcs) = 1 and count($ucs) = and 214 $mcs = $con role and $ucs = $con role ] 215 and 216 $ucs = $other role 217 and 218 name($ o b j e c t s / = $other role /@object ref]) = value 219 "> 220 <xsl:element name="perfect bridge "> 221 <! value > 222 <xsl:element name="value ref"> 223 <xsl:attribute name="ref"> 224 <xsl:value of select="$other role /@object ref"/> 225 </xsl:attribute > 226 </xsl:element> 13

14 227 <xsl:element name="criterion"> 228 <! relationship > 229 <xsl:element name="relationship ref"> 230 <xsl:attribute name="ref"> 231 <xsl:value of /> 232 </xsl:attribute > 233 </xsl:element> 234 <! constraints > 235 <xsl:for each select ="$con con / "> 236 <xsl:element name="constraint ref"> 237 <xsl:attribute name="ref"> 238 <xsl:value of select ="@id" /> 239 </xsl:attribute > 240 </xsl:element> 241 </ xsl:for each> 242 </xsl:element> 243 </xsl:element> 244 </xsl:if > 245 </ xsl:for each> 246 </xsl:variable> 247 <xsl:sequence select="$perfect bridges"/> 248 </xsl:function> </xsl:stylesheet> 2.2 util.xslt 1 <?xml version="1.0"?> 2 <xsl:stylesheet version="2.0" 3 xmlns:xsl="http: // 4 xmlns:orm util=" http: / / folk. i f i. uio.no/ eirikm /orm util"> 5 6 <xsl:output method="xml"/> 7 8 <! this stylesheet expects following variables to be defined: 9 $eid 10 $ objects 11 $ relationships 12 $ constraints 13 > <! orm util:get connected role 17 input: entity id for current entity relationship 18 output: role find role that is connected to 21 provided entity from provided relationship 22 ( used by perfect bridge) 23 > 24 <xsl:function name="orm util:get connected role"> 25 <! 26 <xsl:param name="eid"/> 27 > 28 <xsl:param name="relationship "/> 29 <xsl:sequence select="$relationship [1]/ ref = $eid ]"/> 30 </xsl:function> <! orm util:other role 33 input: entity id for current entity relationship 34 output: role 35 14

15 36 find role that is not connected 37 to provided entity 38 from provided relationship 39 ( used by perfect bridge) 40 > 41 <xsl:function name="orm util:get other role"> 42 <! 43 <xsl:param name="eid"/> 44 > 45 <xsl:param name="relationship "/> 46 <xsl:sequence select="$relationship [1]/ role[ ref = $eid ) ]"/> 47 </xsl:function> <! orm util:get connected relationships 50 input: entity id for current entity 51 output: sequence of relationships Find relationships connected to entity 54 ( used by perfect bridge) 55 > 56 <xsl:function name="orm util:get connected relationships "> 57 <! 58 <xsl:param name="eid"/> 59 > 60 <xsl:sequence select=" 61 $relationships / relationship[ role /@object ref = $eid ] 62 "/> 63 </xsl:function> <! orm util:get connected constraints 66 input: relationship node 67 returns all constraints that is connected to this and only this relationship 68 ( without root element) 69 ( used by perfect bridge) 70 > 71 <xsl:function name="orm util:get connected constraints"> 72 <xsl:param name=" rel "/> 73 <xsl:variable name="result"> 74 <xsl:copy of select=" 75 $constraints /(mc uc)[ every $r in tokenize(@roles, ) 76 satisfies $rel / role[@id = $r ] ] " /> 77 </xsl:variable> 78 <xsl:sequence select="$result "/> 79 </xsl:function> <! orm util:get matching rels cons 82 expects: $constraints 83 input: relationships 84 returns: sequence of matching relationships and constraints 85 > 86 <! finnes det noen garanti for at denne ikke 87 inkluderer de samme gruppene flere ganger 88 > 89 <xsl:function name="orm util:get matching rels cons"> 90 <xsl:param name=" rels "/> 91 <xsl:variable name="result"> 92 <! her er det en liten feil i variabelnavningen 93 det er ikke bare snakk om uce, men også mce. 94 I tillegg er det mulig å få med interneskranker som spenner 95 to roller i samme assosiasjon mc skal ikke inkluderes her! 15

16 98 > 99 <xsl:variable name="uces" select=" 100 $constraints /(mc uc)[ every $r in ) 101 satisfies $rels / role[@id = $r ] 102 and 103 count( tokenize(@roles, )) > 1 ]"/> 104 <xsl:for each select ="$uces "> 105 <! find matching relationships > 106 <xsl:variable name="matching rels"> 107 <xsl:copy of select=" 108 for $r in tokenize(@roles, ) 109 return $relationships / relationship [ role /@id = $r ] " /> 110 </xsl:variable> 111 <! find relevant uces > 112 <! det er fremdeles mulig at det blir tatt med interne skranker her > 113 <xsl:variable name="relevant uces" select=" 114 $uces [ every $r in tokenize(@roles, ) 115 satisfies $matching rels / relationship / role /@id = $r ] " /> 116 <! debug 117 <xsl:copy of select="$relevant uces"/> 118 > <! find internal constraints matching relationships > 121 <! denne er garantert å ta med bare interne skranker, 122 med skranker som spenner to roller i samme assosiasjon 123 kommer ikke med 124 > 125 <xsl:variable name="ucis"> 126 <xsl:copy of select=" 127 $constraints /(mc = $matching rels / relationship / role /@id]"/> 128 </xsl:variable> 129 <! filter out the relevant ucis > 130 <! problemet med uci vil uansett bli 131 filtrert ut her 132 > 133 <xsl:variable name="relevant ucis"> 134 <xsl:copy of select=" 135 $ucis /(mc uc )[some $rel in $matching rels / relationship 136 = orm util:get connected role($rel )/@id]"/> 137 </xsl:variable> 138 <! debug 139 <xsl:copy of select="$relevant ucis"/> 140 > 141 <! find objects on the other end > 142 <xsl:variable name="objs"> 143 <xsl:copy of select=" 144 for $rel in $matching rels / relationship 145 return $objects / = orm util:get other role($rel ref]"/> 146 </xsl:variable> 147 < x s l : i f test=" count($matching rels / relationship) > 0"> 148 <! print out nicely > 149 <xsl:element name="match"> 150 <! relationships > 151 <xsl:copy of select="$matching rels"/> 152 <! constraints > 153 <xsl:copy of select="$relevant ucis/ "/> 154 <xsl:copy of select="$relevant uces"/> 155 </xsl:element> 156 </xsl:if > 157 </ xsl:for each> 158 </xsl:variable> 159 <xsl:sequence select="$result "/> 16

17 160 </xsl:function> </xsl:stylesheet> 17

18 Chapter 3 Java 3.1 no.uio.ifi.niamderthal.canvas Lerret. Subklasse av JPanel. Hvert View har en egen Canvas (lerret). Dette er en klasse som subklasser JPanel. Den overskygger paint, og delegerer opptegning av symboler til symbolene selv. Canvas har flere lag, og hvert symbol vet hvilket lag det skal legge seg på, ved hjelp av sentralt definerte konstanter. Dette gjør at kunnskapen om hvilket lag symbolene skal ligge på er distribuert, og det blir lettere å lage et generisk lerret som virker for alle typer figurer. Ved opptegning går Canvas gjennom alle lagene i stigende rekkefølge og ber hvert symbol tegne seg selv. Ved sjekk om noe er «truffet» av museklikk går Canvas gjennom lagene i synkende rekkefølge og spør hvert symbol om det inneholder koordinatet der museklikket forekom. På denne måten vil symbolet som ligger øverst på lerretet få «prioritet» i mustreff, hvis to eller flere symboler overlapper. 1 package no. uio. i f i. Niamderthal; 2 3 // make this no. uio. i f i. Niamderthal.common. Facade ; 4 import java.awt. BasicStroke ; 5 import java.awt. Color ; 6 import java.awt. Container; 7 import java.awt. Graphics2D; 8 import java.awt. Graphics; 9 import java.awt. RenderingHints ; 10 import java.awt. event.itemevent; 11 import java.awt. event. ItemListener ; 12 import java.awt.geom. AffineTransform ; 13 import java.awt.geom.point2d ; 14 import java. util. Vector ; 15 import javax.swing.jcheckboxmenuitem; 16 import javax.swing.jframe; 17 import javax. swing. JLabel ; 18 import javax.swing. JPanel; 19 import no. uio. i f i. Niamderthal.common. figures. Symbol; 20 import no. uio. i f i. Niamderthal.orm. Facade ; 21 import org. apache. log4j. Category; / 24 Specialized panel for this application 18

19 25 Delegates drawing to the container 26 <a href="mailto : eirikm@joe">eirik Meland</a> / 30 public class Canvas 31 extends JPanel implements ItemListener { 32 / 33 Log instance for this object 34 / 35 private static Category log = Category. getinstance( "Common container" ); 36 / 37 This Container holds many containers ( containing view objects ) 38 / 39 private Vector [] containercontainer = new Vector[ Constants.NO_LAYERS]; 40 / 41 Default tool and the tool currently used 42 / 43 private no. uio. ifi.niamderthal.common. tools.empty defaulttool, currenttool; 44 / 45 The statusbar used by i. e. tools to tell the user what to do. 46 / 47 private JLabel statusbar ; 48 / 49 Parent frame ( is this neccesary?) 50 / 51 private JFrame frame ; 52 / 53 checkbox used to state if user should be prompted 54 for name on each creation of an object 55 / 56 private JCheckBoxMenuItem 57 askrenamecb, 58 antialiasingcb; 59 private no. uio. ifi.niamderthal.xml. Project project ; 60 private AffineTransform at = null ; 61 private no. uio. i f i. Niamderthal.common. BackgroundPopup bgpopup; 62 private no. uio. i f i. Niamderthal.xml.View view ; 63 // HACK 64 private Facade facade ; / 67 Creates a new < code >NPanel</code > instance. 68 p a <code>container</code > value 70 / 71 public Canvas ( no. uio. i f i. Niamderthal. xml. View view, 72 JLabel statusbar, 73 JCheckBoxMenuItem askrenamecb, 74 JCheckBoxMenuItem antialiasingcb, 75 JCheckBoxMenuItem drawwhilemoving, 76 int mode ) { 77 // JPanel s t u f f 78 super (); this. statusbar = statusbar ; 81 this.view = view; 82 this. frame = frame ; 83 this. askrenamecb = askrenamecb; 84 this. askrenamecb. additemlistener ( this ); 85 this. antialiasingcb = antialiasingcb; 86 this. antialiasingcb. additemlistener ( this ); 19

20 87 88 // init project?!? 89 // this will be moved to View // project = new Project(mode); 91 // try { 92 // project.printxml (); 93 // proj ect. getmodel ( ). printxml ( ) ; 94 // } catch ( Exception e ) { 95 // } / / end of try catch for ( int i = 0 ; i < Constants. NO_LAYERS ; i + + ) { 98 containercontainer [ i ] = new Vector ( ); 99 } // end of for ( int = 0; < ; ++) // sets tool, bgpopup etc 102 changeview(mode ) ; defaulttool = new no. uio. i f i. Niamderthal 105. common. t o o l s. S e l e c t ( this, drawwhilemoving ) ; 106 currenttool = defaulttool ; 107 addmouselistener( currenttool ) ; 108 addmousemotionlistener( currenttool ) ; // init 111 setbackground(color. white ); 112 } / 115 starts painting of all the components 116 sets renderinghints g a <code>graphics</code > value 118 / 119 public void paintcomponent( Graphics g ) { 120 super. paintcomponent(g ) ; 121 Graphics2D g2 = ( Graphics2D ) g ; 122 g2. setrenderinghint (RenderingHints.KEY_ANTIALIASING, 123 antialiasingcb. getstate () 124? RenderingHints. VALUE_ANTIALIAS_ON : RenderingHints. VALUE_ANTIALIAS_OF 125 g2. setrenderinghint ( RenderingHints.KEY_RENDERING, 126 RenderingHints.VALUE_RENDER_QUALITY ) ; // container.draw(g2 ); 130 at = g2. gettransform ( ) ; 131 g2. setstroke(new BasicStroke()); // draw all ( layer for layer ) 134 for ( int i = 0 ; i < Constants. NO_LAYERS ; i + + ) { 135 Vector container = containercontainer [ i ]; 136 for ( int j = 0; j < container. size ( ); j ++) { 137 (( Symbol) container. elementat( j ) ). draw(g2, at ) ; 138 } // end of for ( int = 0; < ; ++) 139 } // end of for ( int = 0; < ; ++) 140 } public void changeview( int view ) { 144 if (bgpopup!= null ) { 145 removemouselistener(bgpopup) ; 146 } // end of i f ( ) // >ORM 20

21 149 if (view == Constants.ORM_VIEW) { 150 for ( int i = 0 ; i < Constants.NO_LAYERS ; i + + ) { 151 Vector container = ( Vector ) containercontainer [ i ]. clone (); 152 for ( int j = 0; j < container. size (); j ++) { 153 no. uio. i f i. Niamderthal. model.empty model = 154 ((Symbol) container.elementat( j )). getmodel (); 155 if ( model! = null ) { 156 model. changeview( Constants.ORM_VIEW) ; 157 } // end of i f ( ) 158 } // end of for ( int = 0; < ; ++) 159 } // end of for ( int = 0; < ; ++) 160 this. facade = new no. uio. i f i. Niamderthal.orm. Facade( this, 161 this.view); 162 this.bgpopup = new no. uio. i f i. Niamderthal.orm. BackgroundPopup ( this ); 163 } // end of i f ( ) // >UML 166 else if (view == Constants.UML_VIEW) { 167 for ( int i = 0 ; i < Constants.NO_LAYERS ; i + + ) { 168 Vector container = ( Vector ) containercontainer [ i ]. clone (); 169 for ( int j = 0; j < container. size (); j ++) { 170 no. uio. i f i. Niamderthal. model.empty model = 171 ((Symbol) container.elementat( j )). getmodel (); 172 if ( model! = null ) { 173 model. changeview( Constants.UML_VIEW) ; 174 } // end of i f ( ) 175 } // end of for ( int = 0; < ; ++) 176 } // end of for ( int = 0; < ; ++) 177 // bgpopup = new no. uio. i f i. Niamderthal.uml 178 //. BackgroundPopup( this, 179 // new no. uio. i f i. Niamderthal.uml. Facade( view ) ) ; 180 } // end of e l s e i f ( ) 181 else { 182 log.warn( "this should never happen" ) ; 183 } // end of e l s e addmouselistener(bgpopup) ; 186 repaint (); 187 } / 190 Sets mouselistener and MouseMotionListeners for canvas 191 to the listeners provided by the current tool / 194 private void setlisteners () { 195 addmouselistener( currenttool ) ; 196 addmousemotionlistener( currenttool ) ; 197 } / 200 Replace currenttool with provided tool 201 tool a <code>no. uio. i f i. Niamderthal.uml. tools.empty</code > value 203 / 204 public void replacetool (no. uio. ifi.niamderthal.common. tools.empty tool ) { 205 removemouselistener(currenttool ); 206 removemouselistener(bgpopup) ; 207 removemousemotionlistener(currenttool ); 208 currenttool = tool ; 209 setlisteners (); 210 } 21

22 / 215 Revert currenttool to defaulttool 216 statu s a < code >String </code > value 218 / 219 public void reverttool ( String status ) { 220 replacetool ( defaulttool ); 221 addmouselistener(bgpopup) ; 222 statusbar. settext ( status ); 223 } / 226 gets symbol containing the point where mousebutton is pressed 227 point a <code>point2d</code > value a <code>symbol</code > value 230 / 231 public Symbol gethit ( Point2D point ) { 232 Symbol symbol ; 233 Vector container ; for ( int i = Constants. NO_LAYERS 1; i >= 0; i ){ 236 container = containercontainer [ i ]; 237 for ( int j = container. size() 1; j >= 0; j ){ 238 symbol = (Symbol) container.elementat( j ); 239 if ( symbol. contains(point )) { 240 return symbol ; 241 } // end of i f ( ) 242 } // end of for ( int = 0; < ; ++) 243 } // end of for ( int = 0; < ; ++) 244 return null ; 245 } / 248 gets state if objects should be named on creation 249 a <code>boolean</code > value 251 / 252 public boolean renameoncreation ( ) { 253 return askrenamecb. getstate (); 254 } // final implementations 258 public final void addsymbol( Symbol s, int layer ) { 259 if (! containercontainer [ layer ]. contains(s )) { 260 containercontainer[layer].addelement(s); 261 } // end of i f ( ) 262 } 263 public final void removesymbol (Symbol s, int layer ) { 264 containercontainer[layer].removeelement(s); 265 } 266 public final void setstatusbartext ( String s ) { statusbar. settext (s ) ; } // Implementation of java.awt. event. ItemListener / 272 Describe <code>itemstatechanged</code > method here. 22

23 273 itemevent an < code >ItemEvent </code > value 275 / 276 public void itemstatechanged(itemevent itemevent ) { 277 repaint (); 278 } // getters and setters 282 public Facade getfacade ( ) { return facade ; } / 285 get pointer to frame 286 a <code>jframe</code > value 288 / 289 public Container getframe ( ) { return getparent (); } 290 } 3.2 no.uio.ifi.niamderthal.constants Globale konstanter for applikasjonen. 1 package no. uio. i f i. Niamderthal; 2 3 public class Constants { 4 public static final int 5 ORM_VIEW = 0, 6 UML_VIEW = 1 ; 7 8 public static final String 9 XML_ENCODING_SCHEME = " iso " ; / 12 Holds the size of the container container. 13 / 14 public static final int NO_LAYERS = 1 0 ; } 3.3 no.uio.ifi.niamderthal.niamderthal Oppstartsklasse og subklasse av JFrame. Oppstartsklasse for hele applikasjonen og rot-gui-elementet. Den har ansvaret for menubar-menyene, og delegerer oppgaver videre til Project. I fremtiden er det meningen at denne klassen skal kunne håndtere flere prosjekter samtidig, men foreløpig er denne delen forenklet til å bare kunne ha ett prosjekt åpent om gangen. Subklasse av JFrame. 1 package no. uio. i f i. Niamderthal; 2 3 / Eirik Meland / 7 23

24 8 import java.awt. BorderLayout ; 9 import java.awt.event; 10 import java.awt. event. ActionEvent; 11 import java.awt. event. ActionListener; 12 import java.awt. event.keyevent; 13 import java. io. File ; 14 import javax.swing.jcheckboxmenuitem; 15 import javax.swing. JFileChooser; 16 import javax.swing.jframe; 17 import javax. swing. JLabel ; 18 import javax.swing.jmenu; 19 import javax. swing. JMenuBar ; 20 import javax.swing.jmenuitem; 21 import javax. swing. JSeparator ; 22 import javax.swing. KeyStroke; 23 import javax.swing. filechooser. FileFilter ; 24 import no. uio. i f i. Niamderthal. Canvas ; 25 import no. uio. ifi.niamderthal.xml. Project ; 26 import org. apache. log4j. Category; / 29 This class is supposed to be start the application 30 It is also the main Frame of the application 31 and has the menubar It is supposed to handle global commands 34 Eirik Meland 36 / 37 public class Niamderthal 38 extends JFrame 39 implements ActionListener { 40 / 41 canvas to paint components onto 42 / 43 private Canvas canvas = null ; 44 / 45 Menuitems 46 / 47 private JMenuItem 48 newormitem, 49 newumlitem, 50 openitem, 51 saveitem, 52 saveasitem, 53 exititem, 54 printprojectxmlitem; private JMenu 57 newprojectmenu; 58 / 59 statusbar to show operation status etc. 60 / 61 private JLabel statusbar ; 62 / 63 checkbox used to state if user should be prompted 64 for name on each creation of an object 65 / 66 private JCheckBoxMenuItem 67 askrename, 68 antialiasing, 69 drawwhilemoving ; 24

25 70 private Project project ; // log 73 private static Category log = Category. getinstance( "Main" ); //Create a file chooser 76 final private JFileChooser fc = new JFileChooser ( ); / 79 Creates a new <code>niamderthal</code > instance. 80 name a < code >String </code > value ( frame name ) 82 / 83 public Niamderthal ( ) { 84 super ( "Niamderthal" ) ; makemainmenu ( ) ; getcontentpane ( ). setlayout (new BorderLayout()); statusbar = new JLabel ( "> = Niamderthal = <" ) ; 91 getcontentpane ( ). add( statusbar, BorderLayout.SOUTH) ; setdefaultcloseoperation (EXIT_ON_CLOSE); 94 setvisible(true ); 95 setsize(800,600); fc. setcurrentdirectory(new File ( " /home/ eirikm / niamderthal/ " ) ) ; 98 } / 101 makes topline menu in this JFrame 102 / 103 private void makemainmenu ( ) { 104 JMenuBar mbar = new JMenuBar ( ) ; // File 107 JMenu f i l e = new JMenu("File" ); 108 f i l e. setmnemonic ( F ) ; // New Project 111 newprojectmenu = new JMenu( "New Project " ); 112 newprojectmenu. setmnemonic ( N ) ; newormitem = new JMenuItem( "ORM" ) ; 115 newormitem. setmnemonic ( O ) ; 116 newormitem. addactionlistener (this ); 117 newprojectmenu. add(newormitem) ; newumlitem = new JMenuItem( "UML" ) ; 120 newumlitem. setmnemonic ( U ) ; 121 newumlitem. addactionlistener ( this ); 122 newprojectmenu. add(newumlitem ) ; f i l e. add( newprojectmenu ) ; // Open 127 openitem = new JMenuItem( "Open Project " ); 128 openitem. setmnemonic ( O ) ; 129 openitem. addactionlistener ( this ); 130 openitem. setaccelerator ( KeyStroke. getkeystroke(keyevent.vk_o, 131 Event.CTRL_MASK ) ) ; 25

26 132 file.add(openitem); // Save 135 saveitem = new JMenuItem( " Save Project " ); 136 saveitem. addactionlistener (this ); 137 saveitem. setmnemonic ( S ) ; 138 saveitem. setaccelerator ( KeyStroke. getkeystroke(keyevent.vk_s, 139 Event.CTRL_MASK ) ) ; 140 file.add(saveitem); 141 saveitem. setenabled( false ); // Save as 144 saveasitem = new JMenuItem( " Save Project As" ) ; 145 file.add(saveasitem); 146 saveasitem. setenabled( false ); file.add(new JSeparator()); // Exit 151 exititem = new JMenuItem( " Exit " ) ; 152 exititem. addactionlistener (new ActionListener () { 153 public void actionperformed(actionevent e ) { 154 System. exit ( 0 ) ; 155 } 156 }); 157 exititem. setaccelerator ( KeyStroke. getkeystroke(keyevent.vk_q, 158 Event.CTRL_MASK ) ) ; 159 file.add( exititem ); 160 mbar. add ( f i l e ) ; // options 163 JMenu options = new JMenu( " Options " ) ; 164 options.setmnemonic( O ); 165 askrename = new JCheckBoxMenuItem( "Ask for name on creation" ); 166 askrename. setselected ( false ); 167 options.add(askrename); antialiasing = new JCheckBoxMenuItem( "Antialiased drawing" ) ; 170 antialiasing. setselected(true ); 171 options.add( antialiasing); drawwhilemoving = new JCheckBoxMenuItem( "Draw figures while moving" ) ; 174 drawwhilemoving. setselected ( true ); 175 options. add( drawwhilemoving ) ; mbar. add ( options ) ; JMenu debug = new JMenu( " Debug" ) ; 180 debug. setmnemonic ( D ) ; printprojectxmlitem = new JMenuItem( " Print Project XML" ) ; 183 printprojectxmlitem. addactionlistener (this ); 184 debug. add( printprojectxmlitem ) ; mbar. add ( debug ) ; // help 189 JMenu help = new JMenu( " Help " ) ; 190 help. setmnemonic ( H ) ; 191 JMenuItem helpitem = new JMenuItem( " Help " ) ; 192 help.add( helpitem ); 193 helpitem. setenabled( false ); 26

27 194 mbar. add ( help ) ; setjmenubar(mbar ) ; 197 } public void newormproject ( ) { 200 log.debug( "ORM" ); project = new Project (statusbar, 203 askrename, 204 antialiasing, 205 drawwhilemoving ) ; 206 project.addview(constants.orm_view); 207 if (canvas!= null ) { 208 getcontentpane ( ). remove ( canvas ) ; 209 } // end of i f ( ) 210 canvas = project. getcurrentcanvas ( ) ; 211 getcontentpane ( ). add(canvas, 212 BorderLayout.CENTER ) ; 213 saveitem. setenabled(true ); 214 } public void newumlproject ( ) { 217 // log. debug ( "UML" ) ; 218 // if (panel!= null) { 219 // getcontentpane ( ). remove ( panel ); 220 // } / / end of i f ( ) // panel = new NPanel ( statusbar, 223 // this, 224 // askrename, 225 // antialiasing, 226 // drawwhilemoving, 227 // Constants.UML_VIEW); 228 // getcontentpane ( ). add(panel, 229 // BorderLayout.CENTER) ; 230 } // Implementation of java.awt. event. ActionListener / 235 Describe <code>actionperformed</code > method here. 236 actionevent an < code >ActionEvent </code > value 238 / 239 public void actionperformed(actionevent e ) { 240 Object src = e. getsource ( ); if (src == saveitem) { 243 log.warn( "save is not completely implemented" ) ; 244 if ( project.save(this, fc ) ) { 245 statusbar. settext ( " Project saved" ) ; 246 } 247 else { 248 statusbar. settext ( " Project Save canceled " ); 249 } // end of e l s e 250 } // end of i f ( ) 251 else if (src == saveasitem) { 252 log.warn( "saveas is not completely implemented" ) ; 253 fc. showsavedialog( this ); 254 } // end of e l s e i f ( ) 255 else if ( src == openitem ) { 27

28 256 log. warn( "open is not completely implemented" ) ; 257 project = new Project ( statusbar, 258 askrename, 259 antialiasing, 260 drawwhilemoving ) ; 261 if ( project.open(this, fc ) ) { 262 if (canvas!= null ) { 263 getcontentpane ( ). remove( canvas ) ; 264 } // end of i f ( ) 265 canvas = project. getcurrentcanvas ( ) ; 266 getcontentpane ( ). add(canvas, 267 BorderLayout.CENTER) ; 268 saveitem. setenabled(true ); 269 validate (); 270 repaint (); 271 } else { 272 statusbar. settext ( " Open Project canceled " ); 273 } // end of e l s e 274 } // end of e l s e i f ( ) 275 else if ( src == printprojectxmlitem ) { 276 try { 277 System.out.println(project.getXML()); 278 } catch ( Exception ex ) { 279 } // end of try catch 280 } // end of e l s e i f ( ) 281 else if ( src == newormitem ) { 282 newormproject ( ) ; 283 validate (); 284 repaint (); 285 } // end of e l s e i f ( ) 286 else if ( src = = newumlitem ) { 287 newumlproject ( ) ; 288 validate (); 289 repaint (); 290 } // end of e l s e i f ( ) 291 } / 295 startup method 296 args a < code >String [] </ code > value 298 / 299 public static void main ( String [ ] args ) { 300 new Niamderthal ( ) ; 301 } 302 } 3.4 no.uio.ifi.niamderthal.orm.backgroundpopup Bakgrunnsmeny for ORM. Denne menyen er med på å bestemme hvilken modus (ORM/UML etc) som er i bruk, ettersom det er denne menyen som avgjør hva som er mulig å tegne på et tomt lerret. 1 package no. uio. i f i. Niamderthal.orm; 2 3 import java.awt. event. ActionEvent; 4 import java.awt. event.mouseevent; 5 import java.awt.geom.point2d ; 28

29 6 import java. util. Vector ; 7 import javax.swing.jmenu; 8 import javax.swing.jmenuitem; 9 import no. uio. i f i. Niamderthal. Canvas ; 10 import no. uio. i f i. Niamderthal.orm. figures.symbol; 11 import java.awt. event. ActionListener; 12 import java. awt. event. MouseListener ; 13 import java.awt. event.mouseevent; 14 import javax.swing.jpopupmenu; 15 import no. uio. i f i. Niamderthal. Constants; 16 import org. apache. log4j. Category; / 19 Select tool. This is the default tool. 20 <a href="mailto : eirikm@joe">eirik Meland</a> / 24 public class BackgroundPopup 25 extends no. uio. i f i. Niamderthal.common. BackgroundPopup { 26 private Category log = Category. getinstance( "orm.bgpopup" ); 27 / 28 Different menues used in the popup 29 / 30 private JMenu 31 addmenu, deletemenu, showasmenu, 32 selectviewmenu; 33 / 34 menuitems 35 / 36 private JMenuItem 37 addentityitem, addvalueitem, relationshipitem, 38 addlayeritem, 39 deletelayeritem, 40 showasumlitem, showasormitem; / 43 temporary store for symbol that was hit when the mousebutton was pressed 44 / 45 // private Symbol mousepressedat = null ; 46 private boolean mousedragged; 47 private Vector selected = new Vector ( ); 48 private Point2D lastpressedpoint ; public BackgroundPopup (Canvas canvas ) { 51 super (canvas); makepopup(); 54 } public void makepopup ( ) { 57 // addmenu 58 addmenu = new JMenu( "Add" ) ; addentityitem = new JMenuItem( " Entity " ) ; 61 addentityitem. addactionlistener (this ); 62 addmenu. add ( addentityitem ) ; addvalueitem = new JMenuItem( "Value" ) ; 65 addvalueitem. addactionlistener ( this ); 66 addmenu. add( addvalueitem ) ; 67 29

30 68 addlayeritem = new JMenuItem( " Layer " ) ; 69 addlayeritem. addactionlistener ( this ); 70 addmenu. add( addlayeritem ) ; 71 addlayeritem. setenabled( false ); popup. add(addmenu) ; // deletemenu 76 deletemenu = new JMenu( "Delete" ); deletelayeritem = new JMenuItem( " Layer " ) ; 79 deletelayeritem. addactionlistener (this ); 80 deletemenu.add(deletelayeritem); 81 deletelayeritem. setenabled( false ); popup. add( deletemenu ) ; 84 deletemenu. setenabled( false ); // selectviewmenu 87 selectviewmenu = new JMenu("Select View" ) ; showasormitem = new JMenuItem( "ORM" ) ; 90 showasormitem. addactionlistener (this ); 91 selectviewmenu. add(showasormitem) ; 92 showasormitem. setenabled( false ); showasumlitem = new JMenuItem( "UML" ) ; 95 showasumlitem. addactionlistener ( this ); 96 selectviewmenu. add(showasumlitem ) ; 97 showasumlitem. setenabled(true ); selectviewmenu. setenabled( false ); 100 popup. add( selectviewmenu) ; 101 } / 104 actionlistener for the popup 105 / 106 public void actionperformed(actionevent e ) { 107 java. lang. Object src = e. getsource () ; 108 if ( src == addentityitem ) { 109 no. uio. ifi. Niamderthal.orm. figures. Entity 110 tmpentity = canvas.getfacade (). createentity ( lastpos ); 111 if ( canvas. renameoncreation ( ) ) { 112 tmpentity.rename ( ) ; 113 } 114 canvas. repaint (); 115 } 116 else if ( src == addvalueitem ) { 117 no. uio. i f i. Niamderthal.orm. figures. Value 118 tmpvalue = canvas. getfacade ( ). createvalue ( lastpos ) ; 119 if ( canvas. renameoncreation ( ) ) { 120 tmpvalue. rename ( ) ; 121 } 122 canvas. repaint (); 123 } 124 else if ( src == showasumlitem ) { 125 canvas. changeview( Constants.UML_VIEW) ; 126 } // end of e l s e i f ( ) }

31 130 // Implementation of java.awt. event. MouseListener / 133 Describe <code>mouseclicked</code > method here. 134 mouseevent a <code>mouseevent</code > value 136 / 137 public void mouseclicked (MouseEvent mouseevent) { } / 142 Describe <code>mousereleased</code > method here. 143 mouseevent a <code>mouseevent</code > value 145 / 146 public void mousereleased (MouseEvent mouseevent ) { } / 151 Describe <code>mouseentered </code > method here. 152 mouseevent a <code>mouseevent</code > value 154 / 155 public void mouseentered(mouseevent mouseevent ) { } / 160 Describe <code>mouseexited</code > method here. 161 mouseevent a <code>mouseevent</code > value 163 / 164 public void mouseexited ( MouseEvent mouseevent ) { } } 3.5 no.uio.ifi.niamderthal.orm.facade Denne klassen tilbyr et enkelt API for å opprette ulike ORM-symboler. 1 package no. uio. i f i. Niamderthal.orm; 2 3 import java.awt.geom.point2d ; 4 import java. util. Vector ; 5 import no. uio. i f i. Niamderthal. Canvas ; 6 import no. uio. i f i. Niamderthal.orm. figures.symbol; 7 import no. uio. ifi. Niamderthal.orm. figures. Entity ; 8 import no. uio. ifi.niamderthal.orm. figures. Relationship; 9 import no. uio. i f i. Niamderthal.orm. figures. Value ; 10 import no. uio. i f i. Niamderthal.orm. figures. Role ; 11 import no. uio. i f i. Niamderthal.orm. figures. constraints. MandatoryConstraint ; 12 import no. uio. ifi.niamderthal.orm. figures. constraints. CardinalityConstraint; 13 import no. uio. i f i. Niamderthal. xml. Model; 14 import no. uio. i f i. Niamderthal. xml.view ; 15 import org. apache. log4j. Category; 16 31

EKSAMEN I FAG TDT4180 MMI Mandag 18. mai 2009 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 MMI Mandag 18. mai 2009 Tid: kl. 0900-1300 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 MMI Mandag 18. mai 2009

Detaljer

Unit Relational Algebra 1 1. Relational Algebra 1. Unit 3.3

Unit Relational Algebra 1 1. Relational Algebra 1. Unit 3.3 Relational Algebra 1 Unit 3.3 Unit 3.3 - Relational Algebra 1 1 Relational Algebra Relational Algebra is : the formal description of how a relational database operates the mathematics which underpin SQL

Detaljer

INF 1010, vår 2005 Løsningsforslag uke 10

INF 1010, vår 2005 Løsningsforslag uke 10 INF 1010, vår 2005 Løsningsforslag uke 10 Anders Brunland 1. april 2005 Oppgave 1 Oppgave 15.4 i i Rett på Java. Løsningsforslag De forskjellige komponentene settes i metoden initcomponents. Her settes

Detaljer

Information search for the research protocol in IIC/IID

Information search for the research protocol in IIC/IID Information search for the research protocol in IIC/IID 1 Medical Library, 2013 Library services for students working with the research protocol and thesis (hovedoppgaven) Open library courses: http://www.ntnu.no/ub/fagside/medisin/medbiblkurs

Detaljer

EKSAMEN I FAG TDT4180 - MMI Lørdag 11. august 2012 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 - MMI Lørdag 11. august 2012 Tid: kl. 0900-1300 Side 1 av 8 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 - MMI Lørdag

Detaljer

Mål med kurset. Java i INF 2400. Dagens tema. GUI med Swing. Dokumentasjon

Mål med kurset. Java i INF 2400. Dagens tema. GUI med Swing. Dokumentasjon Mål med kurset Java i INF 2400 Introduksjon til signalbehandling Lyd som anvendelse Få programmeringserfaring Dagens tema Utplukk av Java (GUI, kode-konvensjon, polymorfisme, classpath, javadoc) Java og

Detaljer

EKSAMEN I FAG TDT4180 - MMI Lørdag 4. juni 2005 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 - MMI Lørdag 4. juni 2005 Tid: kl. 0900-1300 Side 1 av 7 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 - MMI Lørdag

Detaljer

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS Postponed exam: ECON420 Mathematics 2: Calculus and linear algebra Date of exam: Tuesday, June 8, 203 Time for exam: 09:00 a.m. 2:00 noon The problem set covers

Detaljer

INF1010 Grafisk brukergrensesni3 med Swing og awt del 1 INF1010

INF1010 Grafisk brukergrensesni3 med Swing og awt del 1 INF1010 Grafisk brukergrensesni3 med Swing og awt del 1 GUI (Graphical User Interface)- programmering Hvordan lage et vindu på skjermen Hvordan legge ulike komponenter i vinduet (trykknapper, tekseelter, tekst,

Detaljer

buildingsmart Norge seminar Gardermoen 2. september 2010 IFD sett i sammenheng med BIM og varedata

buildingsmart Norge seminar Gardermoen 2. september 2010 IFD sett i sammenheng med BIM og varedata buildingsmart Norge seminar Gardermoen 2. september 2010 IFD sett i sammenheng med BIM og varedata IFD International Framework for Dictionaries Hvordan bygges en BIM? Hva kan hentes ut av BIM? Hvordan

Detaljer

1 User guide for the uioletter package

1 User guide for the uioletter package 1 User guide for the uioletter package The uioletter is used almost like the standard LATEX document classes. The main differences are: The letter is placed in a \begin{letter}... \end{letter} environment;

Detaljer

INF1010. Grafisk brukergrensesni. med Swing og awt del 2. INF1010 - - Grafisk brukergrensesni4 II

INF1010. Grafisk brukergrensesni. med Swing og awt del 2. INF1010 - - Grafisk brukergrensesni4 II INF1010 Grafisk brukergrensesni. med Swing og awt del 2 1 GUI (Graphical User Interface)- programmering n n n Enkel behandling av knappetrykk mm. Layout av vinduer Om å lytte på knappetrykk med musa n

Detaljer

INF Våren Li' repe$sjon om Tråder og GUI. Stein Gjessing, Ins$tu' for informa$kk, Universitetet i Oslo. Ins$tu' for informa$kk

INF Våren Li' repe$sjon om Tråder og GUI. Stein Gjessing, Ins$tu' for informa$kk, Universitetet i Oslo. Ins$tu' for informa$kk INF1010 - Våren 2015 Li' repe$sjon om Tråder og GUI Stein Gjessing,, Universitetet i Oslo 1 GUI, tråder og hendelser Op-sys (Win, Linux,..) Ditt Program sin Event Dispatch Thread Hver ting brukeren gjør

Detaljer

Oppgave 1a Definer følgende begreper: Nøkkel, supernøkkel og funksjonell avhengighet.

Oppgave 1a Definer følgende begreper: Nøkkel, supernøkkel og funksjonell avhengighet. TDT445 Øving 4 Oppgave a Definer følgende begreper: Nøkkel, supernøkkel og funksjonell avhengighet. Nøkkel: Supernøkkel: Funksjonell avhengighet: Data i en database som kan unikt identifisere (et sett

Detaljer

SAS FANS NYTT & NYTTIG FRA VERKTØYKASSA TIL SAS 4. MARS 2014, MIKKEL SØRHEIM

SAS FANS NYTT & NYTTIG FRA VERKTØYKASSA TIL SAS 4. MARS 2014, MIKKEL SØRHEIM SAS FANS NYTT & NYTTIG FRA VERKTØYKASSA TIL SAS 4. MARS 2014, MIKKEL SØRHEIM 2 TEMA 1 MULTIPROSESSERING MED DATASTEGET Multiprosessering har lenge vært et tema i SAS Stadig ny funksjonalitet er med på

Detaljer

XSLT 2. David Massey MBIB

XSLT 2. David Massey MBIB XSLT 2 David Massey MBIB4140 21-9-2017 Demo html.xsl mondial.xsl albania 1214489 1618829

Detaljer

Databases 1. Extended Relational Algebra

Databases 1. Extended Relational Algebra Databases 1 Extended Relational Algebra Relational Algebra What is an Algebra? Mathematical system consisting of: Operands --- variables or values from which new values can be constructed. Operators ---

Detaljer

pnvdb Documentation Release Jan Tore Kyrdalen

pnvdb Documentation Release Jan Tore Kyrdalen pnvdb Documentation Release 0.1.0 Jan Tore Kyrdalen Oct 31, 2017 Contents 1 Installation 3 2 Getting started 5 3 Methods 7 3.1 status................................................... 7 3.2 objekt...................................................

Detaljer

Elektronisk innlevering/electronic solution for submission:

Elektronisk innlevering/electronic solution for submission: VIKINGTIDSMUSEET Plan- og designkonkurranse/design competition Elektronisk innlevering/electronic solution for submission: Det benyttes en egen elektronisk løsning for innlevering (Byggeweb Anbud). Dette

Detaljer

Grafisk Brukergrensesnitt

Grafisk Brukergrensesnitt Grafisk Brukergrensesnitt Repetisjonskurs Hva må kunnes? JFrame JPanel JComponents Layouts Listeners jframe Representerer et vindu JComponents legges på vinduet Har en tittel og størrelse Komponenter struktureres

Detaljer

Slope-Intercept Formula

Slope-Intercept Formula LESSON 7 Slope Intercept Formula LESSON 7 Slope-Intercept Formula Here are two new words that describe lines slope and intercept. The slope is given by m (a mountain has slope and starts with m), and intercept

Detaljer

INF1010 våren 2006 Uke 19: 9. mai 2006 Et større eksempel: Solitaire (kabal)

INF1010 våren 2006 Uke 19: 9. mai 2006 Et større eksempel: Solitaire (kabal) Det ferdige spillet INF1010 våren 2006 Uke 19: 9. mai 2006 Et større eksempel: Solitaire (kabal) Stein Michael Storleer Institutt for informatikk Dette er kopier av lysark for en forelesning. Sidene er

Detaljer

LO191D/LC191D Videregående programmering

LO191D/LC191D Videregående programmering LO191D/LC191D Videregående programmering Eksamen mai 2012 Løsningsforslag Oppgave 1 Klassen Destinasjon: // Oppgaven er uklar på hva som skal inn i klassen Destinasjon. // Her følger en minimumsutgave

Detaljer

EKSAMEN. TILLATTE HJELPEMIDLER: Alle trykte og skrevne. INNFØRING MED PENN, evt. trykkblyant som gir gjennomslag

EKSAMEN. TILLATTE HJELPEMIDLER: Alle trykte og skrevne. INNFØRING MED PENN, evt. trykkblyant som gir gjennomslag KANDIDATNUMMER: EKSAMEN EMNENAVN: Programutvikling EMNENUMMER: IMT3281 EKSAMENSDATO:05/12-2007 KLASSE: 06HBINDA/06HBINDP TID: 09.00 13.00 EMNEANSVARLIG: Øivind Kolloen ANTALL SIDER UTLEVERT: 7 TILLATTE

Detaljer

EKSAMEN I FAG TDT MMI Mandag 15. august 2011 Tid: kl

EKSAMEN I FAG TDT MMI Mandag 15. august 2011 Tid: kl Side 1 av 9 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 - MMI Mandag

Detaljer

Eksamensoppgave i TDT4180 Menneske-Maskin- Interaksjon (MMI)

Eksamensoppgave i TDT4180 Menneske-Maskin- Interaksjon (MMI) Institutt for Datateknikk og Informasjonsvitenskap Eksamensoppgave i TDT4180 Menneske-Maskin- Interaksjon (MMI) Faglig kontakt under eksamen: Dag Svanæs Tlf.: 91897536 Eksamensdato: 5. August Eksamenstid

Detaljer

EKSAMEN I FAG TDT4180 MMI Lørdag 21. august 2010 Tid: kl

EKSAMEN I FAG TDT4180 MMI Lørdag 21. august 2010 Tid: kl NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 MMI Lørdag 21. august

Detaljer

Moving Objects. We need to move our objects in 3D space.

Moving Objects. We need to move our objects in 3D space. Transformations Moving Objects We need to move our objects in 3D space. Moving Objects We need to move our objects in 3D space. An object/model (box, car, building, character,... ) is defined in one position

Detaljer

UNIVERSITETET I OSLO

UNIVERSITETET I OSLO UNIVERSITETET I OSLO Det matematisk-naturvitenskapelige fakultet Eksamen i INF 3230 Formell modellering og analyse av kommuniserende systemer Eksamensdag: 4. juni 2010 Tid for eksamen: 9.00 12.00 Oppgavesettet

Detaljer

AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner kvitteringsliste L00202 levert i CSV fil

AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner kvitteringsliste L00202 levert i CSV fil AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner kvitteringsliste L00202 levert i CSV fil Kvitteringsliste L00202 for avviste oppdrag, transaksjoner og informasjonsmeldinger CSV Format:

Detaljer

Rom-Linker Software User s Manual

Rom-Linker Software User s Manual Rom-Linker Software User s Manual Tel.: +886-2-2274-1347 Fax. +886-2-2273-3014 Http://www.hmt.com.tw e-mail: hmtsales@hmt.com.tw Contents Catalogue Page (1) Rom-Linker Starting Screen... 01 (2) Rom-Linker

Detaljer

EN Skriving for kommunikasjon og tenkning

EN Skriving for kommunikasjon og tenkning EN-435 1 Skriving for kommunikasjon og tenkning Oppgaver Oppgavetype Vurdering 1 EN-435 16/12-15 Introduction Flervalg Automatisk poengsum 2 EN-435 16/12-15 Task 1 Skriveoppgave Manuell poengsum 3 EN-435

Detaljer

From a table based Feature Catalogue to GML Application schemas

From a table based Feature Catalogue to GML Application schemas From a table based Feature Catalogue to GML Application schemas 05/ 09/ 2015 EuroSDR Data modelling workshop, Copenhagen 28.-30.1.2015 Knut Jetlund Norwegian Public Roads Administration knut.jetlund@vegvesen.no

Detaljer

Du må håndtere disse hendelsene ved å implementere funksjonene init(), changeh(), changev() og escape(), som beskrevet nedenfor.

Du må håndtere disse hendelsene ved å implementere funksjonene init(), changeh(), changev() og escape(), som beskrevet nedenfor. 6-13 July 2013 Brisbane, Australia Norwegian 1.0 Brisbane har blitt tatt over av store, muterte wombater, og du må lede folket i sikkerhet. Veiene i Brisbane danner et stort rutenett. Det finnes R horisontale

Detaljer

EMPIC MEDICAL. Etterutdanningskurs flyleger 21. april Lars (Lasse) Holm Prosjektleder Telefon: E-post:

EMPIC MEDICAL. Etterutdanningskurs flyleger 21. april Lars (Lasse) Holm Prosjektleder Telefon: E-post: EMPIC MEDICAL Etterutdanningskurs flyleger 21. april 2017 Lars (Lasse) Holm Prosjektleder Telefon: +47 976 90 799 E-post: Lrh@caa.no it-vakt@caa.no Luftfartstilsynet T: +47 75 58 50 00 F: +47 75 58 50

Detaljer

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT UNIVERSITETET I OSLO ØKONOMISK INSTITUTT Eksamen i: ECON30/40 Matematikk : Matematisk analyse og lineær algebra Exam: ECON30/40 Mathematics : Calculus and Linear Algebra Eksamensdag: Tirsdag 0. desember

Detaljer

Den europeiske byggenæringen blir digital. hva skjer i Europa? Steen Sunesen Oslo,

Den europeiske byggenæringen blir digital. hva skjer i Europa? Steen Sunesen Oslo, Den europeiske byggenæringen blir digital hva skjer i Europa? Steen Sunesen Oslo, 30.04.2019 Agenda 1. 2. CEN-veileder til ISO 19650 del 1 og 2 3. EFCA Guide Oppdragsgivers krav til BIMleveranser og prosess.

Detaljer

Smart High-Side Power Switch BTS730

Smart High-Side Power Switch BTS730 PG-DSO20 RoHS compliant (green product) AEC qualified 1 Ω Ω µ Data Sheet 1 V1.0, 2007-12-17 Data Sheet 2 V1.0, 2007-12-17 Ω µ µ Data Sheet 3 V1.0, 2007-12-17 µ µ Data Sheet 4 V1.0, 2007-12-17 Data Sheet

Detaljer

IN2010: Algoritmer og Datastrukturer Series 2

IN2010: Algoritmer og Datastrukturer Series 2 Universitetet i Oslo Institutt for Informatikk S.M. Storleer, S. Kittilsen IN2010: Algoritmer og Datastrukturer Series 2 Tema: Grafteori 1 Publisert: 02. 09. 2019 Utvalgte løsningsforslag Oppgave 1 (Fra

Detaljer

Call function of two parameters

Call function of two parameters Call function of two parameters APPLYUSER USER x fµ 1 x 2 eµ x 1 x 2 distinct e 1 0 0 v 1 1 1 e 2 1 1 v 2 2 2 2 e x 1 v 1 x 2 v 2 v APPLY f e 1 e 2 0 v 2 0 µ Evaluating function application The math demands

Detaljer

EKSAMEN I FAG TDT4180 - MMI Mandag 4. august 2008 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 - MMI Mandag 4. august 2008 Tid: kl. 0900-1300 Side 1 av 11 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 - MMI Mandag

Detaljer

Public roadmap for information management, governance and exchange. 2015-09-15 SINTEF david.norheim@brreg.no

Public roadmap for information management, governance and exchange. 2015-09-15 SINTEF david.norheim@brreg.no Public roadmap for information management, governance and exchange 2015-09-15 SINTEF david.norheim@brreg.no Skate Skate (governance and coordination of services in egovernment) is a strategic cooperation

Detaljer

of color printers at university); helps in learning GIS.

of color printers at university); helps in learning GIS. Making a Home Page Why a Web Page? Easier to submit labs electronically (lack of color printers at university); Easier to grade many labs; Provides additional computer experience that helps in learning

Detaljer

Dynamic Programming Longest Common Subsequence. Class 27

Dynamic Programming Longest Common Subsequence. Class 27 Dynamic Programming Longest Common Subsequence Class 27 Protein a protein is a complex molecule composed of long single-strand chains of amino acid molecules there are 20 amino acids that make up proteins

Detaljer

Endringer i neste revisjon av EHF / Changes in the next revision of EHF 1. October 2015

Endringer i neste revisjon av EHF / Changes in the next revision of EHF 1. October 2015 Endringer i neste revisjon av / Changes in the next revision of 1. October 2015 INFORMASJON PÅ NORSK 2 INTRODUKSJON 2 ENDRINGER FOR KATALOG 1.0.3 OG PAKKSEDDEL 1.0.2 3 ENDRINGER FOR ORDRE 1.0.3 4 ENDRINGER

Detaljer

EKSAMEN I FAG TDT4180 MMI Lørdag 15. august 2009 Tid: kl

EKSAMEN I FAG TDT4180 MMI Lørdag 15. august 2009 Tid: kl NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 MMI Lørdag 15. august

Detaljer

INF1010. Grafisk brukergrensesni. med Swing og awt del 2

INF1010. Grafisk brukergrensesni. med Swing og awt del 2 INF1010 Grafisk brukergrensesni. med Swing og awt del 2 GUI (Graphical User Interface)- programmering u u u Enkel behandling av knappetrykk mm. Layout av vinduer Om å lytte på knappetrykk med musa u Input

Detaljer

HONSEL process monitoring

HONSEL process monitoring 6 DMSD has stood for process monitoring in fastening technology for more than 25 years. HONSEL re- rivet processing back in 990. DMSD 2G has been continuously improved and optimised since this time. All

Detaljer

Gjennomgang av eksamen H99

Gjennomgang av eksamen H99 Gjennomgang av eksamen H99 Administrasjon av kurser, studenter og påmeldinger Ole Christian Lingjærde Gruppen for bioinformatikk Institutt for Informatikk Universitetet i Oslo Oppgave 1 (15 %) (Besvares

Detaljer

EKSAMEN I FAG TDT4180 MMI Onsdag 28. mai 2008 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 MMI Onsdag 28. mai 2008 Tid: kl. 0900-1300 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Hallvard Trætteberg, Tlf: 73 59 34 43 EKSAMEN I FAG TDT4180 MMI Onsdag 28.

Detaljer

EKSAMEN I FAG TDT4180 MMI Torsdag 27. mai 2010 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 MMI Torsdag 27. mai 2010 Tid: kl. 0900-1300 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 MMI Torsdag 27. mai 2010

Detaljer

Sascha Schubert Product Manager Data Mining SAS International Copyright 2006, SAS Institute Inc. All rights reserved.

Sascha Schubert Product Manager Data Mining SAS International Copyright 2006, SAS Institute Inc. All rights reserved. Extending SAS Enterprise Miner Sascha Schubert Product Manager Data Mining SAS International Agenda Architecture of SAS Enterprise Miner 5.2 Access to SAS Data Mining Functionality The Flexibility of the

Detaljer

ISO 41001:2018 «Den nye læreboka for FM» Pro-FM. Norsk tittel: Fasilitetsstyring (FM) - Ledelsessystemer - Krav og brukerveiledning

ISO 41001:2018 «Den nye læreboka for FM» Pro-FM. Norsk tittel: Fasilitetsstyring (FM) - Ledelsessystemer - Krav og brukerveiledning ISO 41001:2018 «Den nye læreboka for FM» Norsk tittel: Fasilitetsstyring (FM) - Ledelsessystemer - Krav og brukerveiledning ISO 41001:2018 Kvalitetsverktøy i utvikling og forandring Krav - kapittel 4 til

Detaljer

MPEG-7. Problemstilling:

MPEG-7. Problemstilling: MPEG-7 Knut Holmqvist Problemstilling: Hva tilsvarer fritekstsøk i video- og audiodatabaser? Må kunne Indeksere Spørre Søke Se gjennom Levere Multimedia Informasjon om data Metadata Dublin Core Resource

Detaljer

AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner for KID bytte kvitteringsliste L02625 levert i CSV format

AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner for KID bytte kvitteringsliste L02625 levert i CSV format AvtaleGiro beskrivelse av feilmeldinger for oppdrag og transaksjoner for KID bytte kvitteringsliste L02625 levert i CSV format Kvitteringsliste L02625 for avviste oppdrag, transaksjoner og informasjonsmeldinger

Detaljer

Utplukk av Java (GUI, kode-konvensjon, Introduksjon til første Java øving. polymorfisme, classpath, javadoc) Java og signalbehandling UNIVERSITETET

Utplukk av Java (GUI, kode-konvensjon, Introduksjon til første Java øving. polymorfisme, classpath, javadoc) Java og signalbehandling UNIVERSITETET Java i INF 155 INSTITUTT FOR INFORMATIKK SVEIN BØE 1 GUI med Swing import java.awt.*; import javax.swing.*; public class GUI { public static main(string[] args) { JFrame frame = new JFrame("window title");

Detaljer

Uke mars 2005 GUI - del 2. GUI (Graphical User Interface)-programmering

Uke mars 2005 GUI - del 2. GUI (Graphical User Interface)-programmering Uke10 29. mars 2005 GUI - del 2 Stein Gjessing Inst for Informatikk Univ. i Oslo GUI (Graphical User Interface)-programmering Forrige gang Hvordan få laget et vindu på skjermen Hvordan legge ulike komponenter

Detaljer

EXAM TTM4128 SERVICE AND RESOURCE MANAGEMENT EKSAM I TTM4128 TJENESTE- OG RESSURSADMINISTRASJON

EXAM TTM4128 SERVICE AND RESOURCE MANAGEMENT EKSAM I TTM4128 TJENESTE- OG RESSURSADMINISTRASJON Side 1 av 5 NTNU Norges teknisk-naturvitenskapelige universitet Institutt for telematikk EXAM TTM4128 SERVICE AND RESOURCE MANAGEMENT EKSAM I TTM4128 TJENESTE- OG RESSURSADMINISTRASJON Contact person /

Detaljer

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT UNIVERSITETET I OSLO ØKONOMISK INSTITUTT Eksamen i: ECON20/420 Matematikk 2: Matematisk analyse og lineær algebra Exam: ECON20/420 Mathematics 2: Calculus and Linear Algebra Eksamensdag: Fredag 2. mai

Detaljer

åpenbim av eksisterende bygg? Produktbiblioteker (i Open BIM) som støtte for FDV dokumentasjon.

åpenbim av eksisterende bygg? Produktbiblioteker (i Open BIM) som støtte for FDV dokumentasjon. åpenbim av eksisterende bygg? Produktbiblioteker (i Open BIM) som støtte for FDV dokumentasjon. Bjørn K Stangeland - Data Design System Product Bibilioteker i Open BIM buildingsmart implementers agreement

Detaljer

Hvordan føre reiseregninger i Unit4 Business World Forfatter:

Hvordan føre reiseregninger i Unit4 Business World Forfatter: Hvordan føre reiseregninger i Unit4 Business World Forfatter: dag.syversen@unit4.com Denne e-guiden beskriver hvordan du registrerer en reiseregning med ulike typer utlegg. 1. Introduksjon 2. Åpne vinduet

Detaljer

DecisionMaker Frequent error codes (valid from version 7.x and up)

DecisionMaker Frequent error codes (valid from version 7.x and up) DecisionMaker Frequent error codes (valid from version 7.x and up) DM Frequent Error Codes Bisnode Credit IT 03.02.2014 1 (5) CONTENTS 1 Target... 3 2 About this document... 3 3 Error codes an messages...

Detaljer

5 E Lesson: Solving Monohybrid Punnett Squares with Coding

5 E Lesson: Solving Monohybrid Punnett Squares with Coding 5 E Lesson: Solving Monohybrid Punnett Squares with Coding Genetics Fill in the Brown colour Blank Options Hair texture A field of biology that studies heredity, or the passing of traits from parents to

Detaljer

Han Ola of Han Per: A Norwegian-American Comic Strip/En Norsk-amerikansk tegneserie (Skrifter. Serie B, LXIX)

Han Ola of Han Per: A Norwegian-American Comic Strip/En Norsk-amerikansk tegneserie (Skrifter. Serie B, LXIX) Han Ola of Han Per: A Norwegian-American Comic Strip/En Norsk-amerikansk tegneserie (Skrifter. Serie B, LXIX) Peter J. Rosendahl Click here if your download doesn"t start automatically Han Ola of Han Per:

Detaljer

INF1010, 21. februar Om å gå gjennom egne beholdere (iteratorer) Stein Gjessing Inst. for Informatikk Universitetet i Oslo

INF1010, 21. februar Om å gå gjennom egne beholdere (iteratorer) Stein Gjessing Inst. for Informatikk Universitetet i Oslo INF1010, 21. februar 2013 Om å gå gjennom egne beholdere (iteratorer) Stein Gjessing Inst. for Informatikk Universitetet i Oslo Ikke noe nytt her From the Java language specification (version 6): 14.14.2

Detaljer

Physical origin of the Gouy phase shift by Simin Feng, Herbert G. Winful Opt. Lett. 26, (2001)

Physical origin of the Gouy phase shift by Simin Feng, Herbert G. Winful Opt. Lett. 26, (2001) by Simin Feng, Herbert G. Winful Opt. Lett. 26, 485-487 (2001) http://smos.sogang.ac.r April 18, 2014 Introduction What is the Gouy phase shift? For Gaussian beam or TEM 00 mode, ( w 0 r 2 E(r, z) = E

Detaljer

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT UNIVERSITETET I OSLO ØKONOMISK INSTITUTT Eksamen i: ECON320/420 Matematikk 2: Matematisk analyse og lineær algebra Exam: ECON320/420 Mathematics 2: Calculus and Linear Algebra Eksamensdag: Tirsdag 7. juni

Detaljer

Neural Network. Sensors Sorter

Neural Network. Sensors Sorter CSC 302 1.5 Neural Networks Simple Neural Nets for Pattern Recognition 1 Apple-Banana Sorter Neural Network Sensors Sorter Apples Bananas 2 Prototype Vectors Measurement vector p = [shape, texture, weight]

Detaljer

Vi lærte sist å lage vinduer. Om å lage et vindu. GUI (Graphical User Interface)-programmering. Inf 1010-2008 GUI - del 2

Vi lærte sist å lage vinduer. Om å lage et vindu. GUI (Graphical User Interface)-programmering. Inf 1010-2008 GUI - del 2 GUI (Graphical User Interface)-programmering Inf 1010-2008 GUI - del 2 Stein Gjessing Inst for Informatikk Univ. i Oslo Tidligere Hvordan få laget et vindu på skjermen Grafikk (tegning i vinduet) Hvordan

Detaljer

Compello Fakturagodkjenning Versjon 10.5 As a Service. Tilgang til Compello Desktop - Regnskapsføring og Dokument import

Compello Fakturagodkjenning Versjon 10.5 As a Service. Tilgang til Compello Desktop - Regnskapsføring og Dokument import Compello Fakturagodkjenning Versjon 10.5 As a Service Tilgang til Compello Desktop - Regnskapsføring og Dokument import Dokumentopplysninger 2018 Compello AS. Med enerett. Microsoft, MS-DOS og Windows

Detaljer

Den som gjør godt, er av Gud (Multilingual Edition)

Den som gjør godt, er av Gud (Multilingual Edition) Den som gjør godt, er av Gud (Multilingual Edition) Arne Jordly Click here if your download doesn"t start automatically Den som gjør godt, er av Gud (Multilingual Edition) Arne Jordly Den som gjør godt,

Detaljer

Prosedyrer. Lars Vidar Magnusson. October 26, Lars Vidar Magnusson () Forelesning i DAS October 26, / 19

Prosedyrer. Lars Vidar Magnusson. October 26, Lars Vidar Magnusson () Forelesning i DAS October 26, / 19 Prosedyrer Lars Vidar Magnusson October 26, 2011 Lars Vidar Magnusson () Forelesning i DAS 11.10.2011 October 26, 2011 1 / 19 Repetisjon om triggere og prosedyrer Triggere og prosedyrer ligner på hverandre

Detaljer

Server-Side Eclipse. Bernd Kolb Martin Lippert it-agile GmbH

Server-Side Eclipse. Bernd Kolb Martin Lippert it-agile GmbH Server-Side Eclipse Bernd Kolb b.kolb@kolbware.de Martin Lippert it-agile GmbH lippert@acm.org 2006 by Martin Lippert, lippert@acm.org; made available under the EPL v1.0 Outline Introduction Why Eclipse?

Detaljer

NKKN typeforslag versjon 2.0.1. Definisjon av grunntypene

NKKN typeforslag versjon 2.0.1. Definisjon av grunntypene NKKN typeforslag versjon 2.0.1 For å lette innsamling av typedata er det laget en importrutine i NKKN som muliggjør automatisering. Foreløpig kan en kun sende forslag via email, en webservice er planlagt

Detaljer

20.01.2012. Brukerkrav og use case diagrammer og -tekst 19. januar 2012. Agenda. Brukerkrav og use case. Diagrammer Tekst.

20.01.2012. Brukerkrav og use case diagrammer og -tekst 19. januar 2012. Agenda. Brukerkrav og use case. Diagrammer Tekst. Brukerkrav og use case diagrammer og -tekst 19. januar 2012 Agenda Brukerkrav og use case Diagrammer Tekst Praktisk eksempel 1 OOAD i livsløpsperspektiv Krav Design Konstruksjon Her er vi i nå Testing

Detaljer

Juridiske aspekter ved publisering i åpne institusjonelle arkiv

Juridiske aspekter ved publisering i åpne institusjonelle arkiv Juridiske aspekter ved publisering i åpne institusjonelle arkiv Professor dr juris Olav Torvund Publisering i åpne institusjonelle arkiv Førstegangspublisering Masteroppgaver Doktoravhandlinger (?) Grålitteratur

Detaljer

import javax.swing.*; import java.awt.*;

import javax.swing.*; import java.awt.*; import javax.swing.*; import java.awt.*; import javax.swing.*; import java.awt.*; Pluss mange Implementasjoner av forskjellige grensesnitt class RammeDemo { public static void main(string[] args) { JFrame

Detaljer

Del 3: Evaluere uttrykk

Del 3: Evaluere uttrykk Del 3: Evaluere uttrykk Hva skal vi gjøre? Hvordan lagre Asp-verdier Hvilke operasjoner må jeg implementere? Er operasjonen lovlig? Utføre operasjonen Strukturen til interpreten vår f.asp 3&4 Interpret

Detaljer

Java i INF 2310 Dagens tema

Java i INF 2310 Dagens tema Mål med kurset Introduksjon til bildebehandling Få programmeringserfaring Java i INF 2310 Dagens tema Utplukk av Java (GUI, kode-konvensjon, polymorfisme, classpath, javadoc) Java og bildebehandling i

Detaljer

GUI - del 2. Stein Gjessing Inst for Informatikk Univ. i Oslo

GUI - del 2. Stein Gjessing Inst for Informatikk Univ. i Oslo Inf 1010-2009 GUI - del 2 Stein Gjessing Inst for Informatikk Univ. i Oslo GUI (Graphical User Interface)-programmering g Tidligere Hvordan få laget et vindu på skjermen Hvordan legge ulike komponenter

Detaljer

Start Here USB *CC * *CC * USB USB

Start Here USB *CC * *CC * USB USB 1 USB Start Here USB 11 USB WARNING: To ensure that the software is installed correctly, do not connect the USB cable until step 11. 11 USB 2 a. b. Lower both the paper tray and the print cartridge door.

Detaljer

Utplukk av Java (GUI, kode-konvensjon, Java og bildebehandling i J2SE. BufferedImage m/venner. polymorfisme, classpath, javadoc) UNIVERSITETET I OSLO

Utplukk av Java (GUI, kode-konvensjon, Java og bildebehandling i J2SE. BufferedImage m/venner. polymorfisme, classpath, javadoc) UNIVERSITETET I OSLO Java i INF 160 INSTITUTT FOR INFORMATIKK SVEIN BØE 1 GUI med Swing import java.awt.*; import javax.swing.*; public class GUI { public static main(string[] args) { JFrame frame = new JFrame("window title");

Detaljer

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT

UNIVERSITETET I OSLO ØKONOMISK INSTITUTT UNIVERSITETET I OSLO ØKONOMISK INSTITUTT Exam: ECON320/420 Mathematics 2: Calculus and Linear Algebra Eksamen i: ECON320/420 Matematikk 2: Matematisk analyse og lineær algebra Date of exam: Friday, May

Detaljer

Compello Fakturagodkjenning Versjon 10 Software as a service. Tilgang til ny modulen Regnskapsføring

Compello Fakturagodkjenning Versjon 10 Software as a service. Tilgang til ny modulen Regnskapsføring Compello Fakturagodkjenning Versjon 10 Software as a service Tilgang til ny modulen Regnskapsføring Dokumentopplysninger 2018 Compello AS. Med enerett. Microsoft, MS-DOS og Windows er registrerte varemerker

Detaljer

Kartleggingsskjema / Survey

Kartleggingsskjema / Survey Kartleggingsskjema / Survey 1. Informasjon om opphold i Norge / Information on resident permit in Norway Hvilken oppholdstillatelse har du i Norge? / What residence permit do you have in Norway? YES No

Detaljer

Andrew Gendreau, Olga Rosenbaum, Anthony Taylor, Kenneth Wong, Karl Dusen

Andrew Gendreau, Olga Rosenbaum, Anthony Taylor, Kenneth Wong, Karl Dusen Andrew Gendreau, Olga Rosenbaum, Anthony Taylor, Kenneth Wong, Karl Dusen The Process Goal Definition Data Collection Data Preprocessing EDA Choice of Variables Choice of Method(s) Performance Evaluation

Detaljer

SmartPass Mini User Manual BBNORGE.NO

SmartPass Mini User Manual BBNORGE.NO SmartPass Mini User Manual BBNORGE.NO Intro Welcome to the usermanual for your SmartPass Mini system. The first time you start the SmartPass you have to request a License. This is to regiser your license

Detaljer

< T extends Comparable<T> > Indre klasser mm. «Det du bør ha hørt om før oblig 4»

< T extends Comparable<T> > Indre klasser mm. «Det du bør ha hørt om før oblig 4» < T extends Comparable > Indre klasser mm. «Det du bør ha hørt om før oblig 4» Strukturen i oblig 3 null null null null Personbeholder pl null null Person p "Adnan" michael@ifi.uio.no INF1010 21. februar

Detaljer

Exercise 1: Phase Splitter DC Operation

Exercise 1: Phase Splitter DC Operation Exercise 1: DC Operation When you have completed this exercise, you will be able to measure dc operating voltages and currents by using a typical transistor phase splitter circuit. You will verify your

Detaljer

GeWare: A data warehouse for gene expression analysis

GeWare: A data warehouse for gene expression analysis GeWare: A data warehouse for gene expression analysis T. Kirsten, H.-H. Do, E. Rahm WG 1, IZBI, University of Leipzig www.izbi.de, dbs.uni-leipzig.de Outline Motivation GeWare Architecture Annotation Integration

Detaljer

Western Alaska CDQ Program. State of Alaska Department of Community & Economic Development

Western Alaska CDQ Program. State of Alaska Department of Community & Economic Development Western Alaska State of Alaska Department of Community & Economic Development The CDQ program was formally approved in 1992 by the North Pacific Fishery Management Council and implemented by Governor

Detaljer

AVDELING FOR INGENIØRUTDANNING EKSAMENSOPPGAVE

AVDELING FOR INGENIØRUTDANNING EKSAMENSOPPGAVE AVDELING FOR INGENIØRUTDANNING EKSAMENSOPPGAVE Emne: Informatikk II Emnekode: LO325E Faglig veileder: G.Milvang og H.Hemmer Gruppe(r): 2EA,2EB,2EC Dato:12.12.03 Eksamenstid:9 00-14 00 Eksamensoppgaven

Detaljer

Server-Side Eclipse. Martin Lippert akquinet agile GmbH

Server-Side Eclipse. Martin Lippert akquinet agile GmbH Server-Side Eclipse Martin Lippert akquinet agile GmbH martin.lippert@akquinet.de 2006 by Martin Lippert, martin.lippert@akquinet.de; made available under the EPL v1.0 Outline Introduction Why Eclipse?

Detaljer

Paul Hinsch. MICADO AS Utviklet MapBasic applikasjoner i 10 år. Registreringsknapper og Objektdialog

Paul Hinsch. MICADO AS Utviklet MapBasic applikasjoner i 10 år. Registreringsknapper og Objektdialog Brukerdefinerte registreringsknapper og objektdialog Paul Hinsch MICADO AS Utviklet MapBasic applikasjoner i 10 år Paul Hinsch MICADO AS 2011 Brukere klarer ikke alltid selv å styre hvilket kartlag data

Detaljer

UNIVERSITETET I OSLO

UNIVERSITETET I OSLO UNIVERSITETET I OSLO Det matematisk-naturvitenskapelige fakultet Eksamen i: INF1010 Objektorientert programmering Dato: 9. juni 2016 Tid for eksamen: 09.00 15.00 (6 timer) Oppgavesettet er på 7 sider.

Detaljer

EKSAMEN I FAG TDT4180 - MMI Lørdag 26. mai 2012 Tid: kl. 0900-1300

EKSAMEN I FAG TDT4180 - MMI Lørdag 26. mai 2012 Tid: kl. 0900-1300 Side 1 av 9 NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET INSTITUTT FOR DATATEKNIKK OG INFORMASJONSVITENSKAP Faglig kontakt under eksamen: Dag Svanæs, Tlf: 73 59 18 42 EKSAMEN I FAG TDT4180 - MMI Lørdag

Detaljer

(MVC - Model, View, Control)

(MVC - Model, View, Control) INF1010 - våren 2008 Modell - Utsyn - Kontroll (MVC - Model, View, Control) Stein Gjessing Inst. for informatikk Et bankprogram Vi skal lage et program som håndterer kontoene i en bank. En konto eies av

Detaljer

Inf 1010 GUI - del 2

Inf 1010 GUI - del 2 Inf 1010 GUI - del 2 Stein Gjessing Institutt for Informatikk Universitetet i Oslo 1 GUI (Graphical User Interface)-programmering Tidligere Hvordan få laget et vindu på skjermen Hvordan legge ulike komponenter

Detaljer

Brukerdokumentasjon Brukerdokumentasjon

Brukerdokumentasjon Brukerdokumentasjon Brukerdokumentasjon Brukerdokumentasjon 2 Brukerveiledning For en som skal ta en test: For den som skal ta en test er det mening at en bruksanvisning skal være unødvendig. De få informasjonene som en bruker

Detaljer

Microsoft Dynamics C5 Version 2008 Oversigt over Microsoft Reporting Services rapporter

Microsoft Dynamics C5 Version 2008 Oversigt over Microsoft Reporting Services rapporter Reporting Services - oversigt Microsoft Dynamics C5 Version 2008 Oversigt over Microsoft Reporting Services rapporter Summary Efterfølgende vises en oversigt over de rapporter som er indeholdt i Microsoft

Detaljer