Skip to content

Commit 2948926

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents 5069262 + 6234d8e commit 2948926

File tree

11 files changed

+258
-86
lines changed

11 files changed

+258
-86
lines changed

cache/projectTemplate.xml

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-12 16:26:04">
3-
2+
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-28 19:50:48">
43
<Class name="UMLExplorer.ClassView">
54
<Description>
65
Class contains methods that return structured class data.</Description>
7-
<TimeChanged>63668,60898.691763</TimeChanged>
6+
<TimeChanged>63670,72515.130814</TimeChanged>
87
<TimeCreated>63653,67019.989197</TimeCreated>
98

109
<Method name="getClassTree">
@@ -57,6 +56,8 @@ return structured data about class</Description>
5756
<Implementation><![CDATA[
5857
set oClass = ##class(%ZEN.proxyObject).%New()
5958
59+
set basePack = $LISTTOSTRING($LIST($LISTFROMSTRING(classDefinition.Name, "."), 1, *-1),".")
60+
6061
set oProperties = ##class(%ZEN.proxyObject).%New()
6162
set oClass.NAMESPACE = $NAMESPACE
6263
set oClass.super = classDefinition.Super
@@ -69,7 +70,8 @@ return structured data about class</Description>
6970
do oProp.%DispatchSetProperty("private", p.Private)
7071
do oProp.%DispatchSetProperty("readOnly", p.ReadOnly)
7172
do oProp.%DispatchSetProperty("type", p.Type)
72-
do ..collectAggregation(oData, classDefinition.Name, p.Type)
73+
do ..collectAggregation(oData, classDefinition.Name, p.Type, p.Private)
74+
do ..collectAggregation(oData, classDefinition.Name, basePack _ "." _ p.Type, p.Private)
7375
}
7476
7577
set oMethods = ##class(%ZEN.proxyObject).%New()
@@ -141,15 +143,16 @@ return structured data about class</Description>
141143

142144
<Method name="collectAggregation">
143145
<ClassMethod>1</ClassMethod>
144-
<FormalSpec>oData:%ZEN.proxyObject,className:%String,type:%String</FormalSpec>
146+
<FormalSpec>oData:%ZEN.proxyObject,className:%String,type:%String,private:%String</FormalSpec>
145147
<ReturnType>%Status</ReturnType>
146148
<Implementation><![CDATA[
147149
set classDef = ##class(%Dictionary.ClassDefinition).%OpenId(type)
148150
if (classDef '= "") {
149-
set oAgg = oData.aggregation.%DispatchGetProperty(className)
151+
if (private) { set t = "composition" } else { set t = "aggregation" }
152+
set oAgg = oData.%DispatchGetProperty(t).%DispatchGetProperty(className)
150153
if (oAgg = "") {
151154
set oAgg = ##class(%ZEN.proxyObject).%New()
152-
do oData.aggregation.%DispatchSetProperty(className, oAgg)
155+
do oData.%DispatchGetProperty(t).%DispatchSetProperty(className, oAgg)
153156
}
154157
} else { quit $$$OK }
155158
@@ -196,6 +199,7 @@ return structured data about class</Description>
196199
set oData.classes = ##class(%ZEN.proxyObject).%New()
197200
set oData.inheritance = ##class(%ZEN.proxyObject).%New()
198201
set oData.aggregation = ##class(%ZEN.proxyObject).%New()
202+
set oData.composition = ##class(%ZEN.proxyObject).%New()
199203
200204
set classes = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
201205
do classes.Execute()
@@ -216,11 +220,11 @@ return structured data about class</Description>
216220
</Class>
217221

218222

219-
<Project name="UMLExplorer" LastModified="2015-04-26 00:42:57.542208">
223+
<Project name="UMLExplorer" LastModified="2015-04-28 19:55:49.450783">
220224
<Items>
221-
<ProjectItem name="UMLExplorer.ClassView" type="CLS"/>
222-
<ProjectItem name="UMLExplorer.Router" type="CLS"/>
223-
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"/>
225+
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
226+
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
227+
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
224228
</Items>
225229
</Project>
226230

@@ -229,7 +233,7 @@ return structured data about class</Description>
229233
<Description>
230234
REST interface for UMLExplorer</Description>
231235
<Super>%CSP.REST</Super>
232-
<TimeChanged>63667,85509.960346</TimeChanged>
236+
<TimeChanged>63670,71431.319061</TimeChanged>
233237
<TimeCreated>63648,30450.187229</TimeCreated>
234238

235239
<XData name="UrlMap">
@@ -286,93 +290,76 @@ Returns all package class trees by given package name</Description>
286290
]]></Implementation>
287291
</Method>
288292

289-
<Method name="Test">
290-
<Description>
291-
Method to test accessibility of REST interface.</Description>
292-
<ClassMethod>1</ClassMethod>
293-
<ReturnType>%Status</ReturnType>
294-
<Implementation><![CDATA[
295-
set resp = ##class(%ZEN.proxyObject).%New()
296-
set resp2 = ##class(%ZEN.proxyObject).%New()
297-
set resp2.Status = "OK"
298-
set resp.obj = resp2
299-
do resp.%ToJSON(, "o")
300-
return $$$OK
301-
]]></Implementation>
302-
</Method>
303-
304293
<Method name="GetCss">
294+
<Description>
295+
Method returns user application CSS.</Description>
305296
<ClassMethod>1</ClassMethod>
306297
<ReturnType>%Status</ReturnType>
307298
<Implementation><![CDATA[
308299
set %response.CharSet = "utf-8"
309300
set %response.ContentType = "text/css"
310-
do ##class(UMLExplorer.StaticContent).WriteCSS()
301+
do ##class(StaticContent).Write("CSS")
311302
return $$$OK
312303
]]></Implementation>
313304
</Method>
314305

315306
<Method name="GetJs">
307+
<Description>
308+
Method returns user application JavaScript.</Description>
316309
<ClassMethod>1</ClassMethod>
317310
<ReturnType>%Status</ReturnType>
318311
<Implementation><![CDATA[
319312
set %response.CharSet = "utf-8"
320313
set %response.ContentType = "text/javascript"
321-
do ##class(UMLExplorer.StaticContent).WriteJS()
314+
do ##class(StaticContent).Write("JS")
322315
return $$$OK
323316
]]></Implementation>
324317
</Method>
325318

326319
<Method name="Index">
327320
<Description>
328-
Method returns user application.</Description>
321+
Method returns user application HTML.</Description>
329322
<ClassMethod>1</ClassMethod>
330323
<ReturnType>%Status</ReturnType>
331324
<Implementation><![CDATA[
332-
&html<
333-
{{replace:html}}
334-
>
325+
do ##class(StaticContent).Write("HTML")
335326
return $$$OK
336327
]]></Implementation>
337328
</Method>
338329
</Class>
339330

340331

341332
<Class name="UMLExplorer.StaticContent">
342-
<TimeChanged>63663,76108.945861</TimeChanged>
333+
<TimeChanged>63670,71368.846177</TimeChanged>
343334
<TimeCreated>63663,71456.865723</TimeCreated>
344335

345-
<Method name="WriteCSS">
336+
<Method name="Write">
346337
<Description>
347-
Outputs css code for UMLExplorer application</Description>
338+
Write the contents of xData tag</Description>
348339
<ClassMethod>1</ClassMethod>
340+
<FormalSpec>Const:%String</FormalSpec>
349341
<ReturnType>%Status</ReturnType>
350342
<Implementation><![CDATA[
351-
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||CSS").Data
343+
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||"_Const).Data
352344
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
353345
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
354346
return $$$OK
355347
]]></Implementation>
356348
</Method>
357349

358-
<Method name="WriteJS">
359-
<Description>
360-
Outputs js code for UMLExplorer application</Description>
361-
<ClassMethod>1</ClassMethod>
362-
<ReturnType>%Status</ReturnType>
363-
<Implementation><![CDATA[
364-
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||JS").Data
365-
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
366-
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
367-
return $$$OK
368-
]]></Implementation>
369-
</Method>
350+
<XData name="HTML">
351+
<Data><![CDATA[
352+
<data><![CDATA[
353+
{{replace:html}}
354+
]]]]><![CDATA[></data>
355+
]]></Data>
356+
</XData>
370357

371358
<XData name="CSS">
372359
<Data><![CDATA[
373-
<data>
360+
<data><![CDATA[
374361
{{replace:css}}
375-
</data>
362+
]]]]><![CDATA[></data>
376363
]]></Data>
377364
</XData>
378365

gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ gulp.task("clean", function () {
3636
gulp.task("gatherLibs", ["clean"], function () {
3737
return gulp.src([
3838
"web/jsLib/joint.js",
39-
"web/jsLib/joint.shapes.uml.js"
39+
"web/jsLib/joint.shapes.uml.js",
40+
"web/jsLib/ImageExporter.js"
4041
])
4142
.pipe(uglify({
4243
output: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "0.3.0",
3+
"version": "0.5.0",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/css/extras.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,29 @@
117117
left: 5px;
118118
}
119119

120+
.icon.download:before {
121+
content: "";
122+
border: 8px solid transparent;
123+
border-right-width: 0;
124+
border-left-color: #fff;
125+
left: 8px;
126+
right: auto;
127+
position: absolute;
128+
top: 16px;
129+
transform: translateY(-50%) rotate(90deg);
130+
}
131+
132+
.icon.download:after {
133+
content: "";
134+
background-color: #fff;
135+
width: 6px;
136+
height: 10px;
137+
border-radius: 1px;
138+
position: absolute;
139+
top: 5px;
140+
left: 9px;
141+
}
142+
120143
.icon.scaleNormal:after {
121144
content: "1:1";
122145
position: absolute;

web/css/interface.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,20 @@ html, body {
3434
font-size: 18pt;
3535
}
3636

37-
.ui-toolBar {
37+
.ui-rightBottomToolBar {
3838
position: absolute;
3939
bottom: 0;
4040
right: 0;
4141
padding: .5em;
4242
}
4343

44+
.ui-leftBottomToolBar {
45+
position: absolute;
46+
bottom: 0;
47+
left: 0;
48+
padding: .5em;
49+
}
50+
4451
#className {
4552
text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
4653
}

web/css/treeView.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@
2121
cursor: pointer;
2222
border-radius: 5px;
2323
-webkit-transition: all .2s ease;
24-
user-select: none;
24+
-moz-transition: all .2s ease;
25+
-o-transition: all .2s ease;
26+
transition: all .2s ease;
2527
-webkit-user-select: none;
2628
-ms-user-select: none;
29+
user-select: none;
2730
}
2831

2932
.tv-class-name:hover, .tv-package-name:hover {
@@ -54,6 +57,9 @@
5457
border: 1px solid gray;
5558
border-radius: 2px 2px 0 2px;
5659
-webkit-transition: all .2s ease;
60+
-moz-transition: all .2s ease;
61+
-o-transition: all .2s ease;
62+
transition: all .2s ease;
5763
}
5864

5965
.tv-package-name:after {
@@ -69,6 +75,9 @@
6975
border: 1px solid gray;
7076
border-radius: 0 2px 2px 2px;
7177
-webkit-transition: all .2s ease;
78+
-moz-transition: all .2s ease;
79+
-o-transition: all .2s ease;
80+
transition: all .2s ease;
7281
}
7382

7483
.tv-package-name:hover:before {

web/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<script type="text/javascript" src="jsLib/joint.js"></script>
1515
<script type="text/javascript" src="jsLib/joint.shapes.uml.js"></script>
1616
<script type="text/javascript" src="jsLib/joint.layout.DirectedGraph.min.js"></script>
17+
<script type="text/javascript" src="jsLib/ImageExporter.js"></script>
1718
<script type="text/javascript" src="js/ClassView.js"></script>
1819
<script type="text/javascript" src="js/Lib.js"></script>
1920
<script type="text/javascript" src="js/CacheUMLExplorer.js"></script>
@@ -32,7 +33,10 @@
3233
<div class="ui-ClassInfo">
3334
<span id="className"></span>
3435
</div>
35-
<div class="ui-toolBar">
36+
<div class="ui-leftBottomToolBar">
37+
<div id="button.downloadSVG" class="icon download"></div>
38+
</div>
39+
<div class="ui-rightBottomToolBar">
3640
<div id="button.zoomIn" class="icon plus"></div>
3741
<div id="button.zoomNormal" class="icon scaleNormal"></div>
3842
<div id="button.zoomOut" class="icon minus"></div>
@@ -42,5 +46,6 @@
4246
</div>
4347
</div>
4448
</div>
49+
<canvas id="canvas" width="1000px" height="600px"></canvas>
4550
</body>
4651
</html>

web/js/CacheUMLExplorer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ CacheUMLExplorer.prototype.init = function () {
4343
}
4444
}
4545

46+
enableSVGDownload(this.classTree);
47+
4648
};

0 commit comments

Comments
 (0)