Skip to content

Commit 11d2c76

Browse files
several cool fixes for browsers, basics guide (help) add
1 parent f289fd1 commit 11d2c76

7 files changed

Lines changed: 150 additions & 9 deletions

File tree

cache/projectTemplate.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Class name="UMLExplorer.ClassView">
44
<Description>
55
Class contains methods that return structured classes/packages data.</Description>
6-
<TimeChanged>63686,4398.893381</TimeChanged>
6+
<TimeChanged>63686,85630.818189</TimeChanged>
77
<TimeCreated>63653,67019.989197</TimeCreated>
88

99
<Method name="getClassTree">
@@ -115,8 +115,8 @@ Return structured data about class.</Description>
115115
for i=1:1:count {
116116
set oPar = ##class(%ZEN.proxyObject).%New()
117117
set p = classDefinition.Parameters.GetAt(i)
118+
set oPar.type = p.Type
118119
do oParameters.%DispatchSetProperty(p.Name, oPar)
119-
do oPar.%DispatchSetProperty("type", p.Type)
120120
}
121121
122122
do ..collectInheritance(oData, classDefinition, package)
@@ -302,7 +302,7 @@ Returns structured package data</Description>
302302
</Class>
303303

304304

305-
<Project name="UMLExplorer" LastModified="2015-05-08 19:38:35.423206">
305+
<Project name="UMLExplorer" LastModified="2015-05-14 01:35:59.888696">
306306
<Items>
307307
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
308308
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>

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.9.1",
3+
"version": "0.9.2",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/css/extras.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@
8484
box-shadow: 0 0 5px 2px #ffcc1b;
8585
}
8686

87+
.icon.help:after {
88+
content: "?";
89+
position: absolute;
90+
color: white;
91+
display: block;
92+
font-size: 21px;
93+
font-weight: 900;
94+
height: 100%;
95+
width: 100%;
96+
text-align: center;
97+
}
98+
8799
.icon.plus:before {
88100
content: "";
89101
background-color: #fff;

web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
</div>
3838
<div class="ui-topRightToolBar">
3939
<div id="button.showInfo" class="icon info"></div>
40+
<div id="button.showHelp" class="icon help"></div>
4041
</div>
4142
<div class="ui-leftBottomToolBar">
4243
<div id="button.downloadSVG" class="icon download"></div>

web/js/CacheUMLExplorer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
1818
zoomInButton: id("button.zoomIn"),
1919
zoomOutButton: id("button.zoomOut"),
2020
zoomNormalButton: id("button.zoomNormal"),
21+
helpButton: id("button.showHelp"),
2122
infoButton: id("button.showInfo"),
2223
methodCodeView: id("methodCodeView"),
2324
closeMethodCodeView: id("closeMethodCodeView"),
@@ -53,7 +54,11 @@ CacheUMLExplorer.prototype.init = function () {
5354
this.classView.loadClass(hash.substr(7));
5455
} else if (hash.indexOf("package:") === 1) {
5556
this.classView.loadPackage(hash.substr(9));
57+
} else {
58+
this.classView.renderInfoGraphic();
5659
}
60+
} else {
61+
this.classView.renderInfoGraphic();
5762
}
5863

5964
this.elements.infoButton.addEventListener("click", function () {

web/js/ClassView.js

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,127 @@ ClassView.prototype.openClassDoc = function (className, nameSpace) {
7373

7474
};
7575

76+
/**
77+
* Render help info
78+
*/
79+
ClassView.prototype.renderInfoGraphic = function () {
80+
81+
this.cacheUMLExplorer.classTree.SELECTED_CLASS_NAME =
82+
this.cacheUMLExplorer.elements.className.innerHTML =
83+
"Welcome to Cach&eacute; UML explorer!";
84+
85+
location.hash = "help";
86+
87+
this.showLoader();
88+
this.render({
89+
basePackageName: "Welcome to Cach? UML explorer!",
90+
classes: {
91+
"Shared object": {
92+
super: "Super object",
93+
parameters: {
94+
"Also inherit Super object": {}
95+
},
96+
methods: {},
97+
properties: {}
98+
},
99+
"Class name": {
100+
super: "Super object",
101+
ABSTRACT: 1,
102+
FINAL: 1,
103+
HIDDEN: 1,
104+
NAMESPACE: "SAMPLES",
105+
PROCEDUREBLOCK: 0,
106+
SYSTEM: 4,
107+
methods: {
108+
"Abstract public method": {
109+
abstract: 1
110+
},
111+
"Class method": {
112+
classMethod: 1
113+
},
114+
"Client method": {
115+
clientMethod: 1
116+
},
117+
"Final method": {
118+
final: 1
119+
},
120+
"Not inheritable method": {
121+
notInheritable: 1
122+
},
123+
"Private method": {
124+
private: 1
125+
},
126+
"Sql procedure": {
127+
sqlProc: 1
128+
},
129+
"Web method": {
130+
webMethod: 1
131+
},
132+
"ZEN method": {
133+
zenMethod: 1
134+
},
135+
"Method": {
136+
returns: "%Return type"
137+
}
138+
},
139+
parameters: {
140+
"PARAMETER WITHOUT TYPE": {},
141+
"PARAMETER": {
142+
type: "Type"
143+
}
144+
},
145+
properties: {
146+
"Public property name": {
147+
private: 0
148+
},
149+
"Private property name": {
150+
private: 1
151+
},
152+
"Public read-only property": {
153+
private: 0,
154+
readOnly: 1
155+
},
156+
"Property": {
157+
type: "Type of property"
158+
},
159+
"Other object": {
160+
private: 0,
161+
type: "Shared object"
162+
},
163+
"Another object": {
164+
private: 1,
165+
type: "Not shared object"
166+
}
167+
}
168+
},
169+
"Super object": {
170+
methods: {},
171+
properties: {},
172+
parameters: {}
173+
},
174+
"HELP": {
175+
parameters: {
176+
"See the basics here!": {}
177+
}
178+
}
179+
},
180+
composition: {},
181+
aggregation: {
182+
"Class name": {
183+
"Shared object": "1..1"
184+
}
185+
},
186+
inheritance: {
187+
"Class name": { "Super object": 1 },
188+
"Shared object": { "Super object": 1 }
189+
},
190+
restrictPackage: 1
191+
});
192+
193+
this.removeLoader();
194+
195+
};
196+
76197
/**
77198
* Returns array of signs to render or empry array.
78199
*
@@ -368,7 +489,7 @@ ClassView.prototype.loadClass = function (className) {
368489
self.showLoader("Unable to get " + self.cacheUMLExplorer.classTree.SELECTED_CLASS_NAME);
369490
console.error.call(console, err);
370491
} else {
371-
self.cacheUMLExplorer.classView.render(data);
492+
self.render(data);
372493
}
373494
});
374495

@@ -390,7 +511,7 @@ ClassView.prototype.loadPackage = function (packageName) {
390511
self.showLoader("Unable to get package " + packageName);
391512
console.error.call(console, err);
392513
} else {
393-
self.cacheUMLExplorer.classView.render(data);
514+
self.render(data);
394515
}
395516
});
396517

@@ -502,6 +623,9 @@ ClassView.prototype.init = function () {
502623
this.cacheUMLExplorer.elements.closeMethodCodeView.addEventListener("click", function () {
503624
self.hideMethodCode();
504625
});
626+
this.cacheUMLExplorer.elements.helpButton.addEventListener("click", function () {
627+
self.renderInfoGraphic();
628+
});
505629

506630
this.SYMBOL_12_WIDTH = (function () {
507631
var e = document.createElementNS("http://www.w3.org/2000/svg", "text"),

web/jsLib/joint.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17211,7 +17211,7 @@ if ( typeof window === "object" && typeof window.document === "object" ) {
1721117211

1721217212
for (; i < lines.length; i++) {
1721317213

17214-
var jj, setup, box, iconLeft, xOrigin = this.attr('x') || 0,
17214+
var jj, setup, iconLeft, xOrigin = this.attr('x') || 0,
1721517215
iconXOrigin = (opt["ref-x"] || 0) + xOrigin;
1721617216

1721717217
// Shift all the <tspan> but first by one line (`1em`)
@@ -17242,13 +17242,12 @@ if ( typeof window === "object" && typeof window.document === "object" ) {
1724217242

1724317243
if (lines[i].icons instanceof Array) {
1724417244
iconLeft = iconXOrigin;
17245-
box = tspan.bbox();
1724617245
_.each(lines[i].icons, function (ic) {
1724717246
image = V("image");
1724817247
image.attr("xlink:href", ic.src);
1724917248
image.attr("width", 10);
1725017249
image.attr("height", 10);
17251-
image.attr("y", box.y + box.height - (opt["font-size"] || 14));
17250+
image.attr("y", textNode.getBoundingClientRect().top + i*(opt["font-size"] || 14) + 2);
1725217251
image.attr("x", iconLeft);
1725317252
iconLeft += 10;
1725417253
V(textNode.parentNode).append(image);

0 commit comments

Comments
 (0)