Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Apr 28, 2015
2 parents 5069262 + 6234d8e commit 2948926
Show file tree
Hide file tree
Showing 11 changed files with 258 additions and 86 deletions.
89 changes: 38 additions & 51 deletions cache/projectTemplate.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-12 16:26:04">

<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-28 19:50:48">
<Class name="UMLExplorer.ClassView">
<Description>
Class contains methods that return structured class data.</Description>
<TimeChanged>63668,60898.691763</TimeChanged>
<TimeChanged>63670,72515.130814</TimeChanged>
<TimeCreated>63653,67019.989197</TimeCreated>

<Method name="getClassTree">
Expand Down Expand Up @@ -57,6 +56,8 @@ return structured data about class</Description>
<Implementation><![CDATA[
set oClass = ##class(%ZEN.proxyObject).%New()
set basePack = $LISTTOSTRING($LIST($LISTFROMSTRING(classDefinition.Name, "."), 1, *-1),".")
set oProperties = ##class(%ZEN.proxyObject).%New()
set oClass.NAMESPACE = $NAMESPACE
set oClass.super = classDefinition.Super
Expand All @@ -69,7 +70,8 @@ return structured data about class</Description>
do oProp.%DispatchSetProperty("private", p.Private)
do oProp.%DispatchSetProperty("readOnly", p.ReadOnly)
do oProp.%DispatchSetProperty("type", p.Type)
do ..collectAggregation(oData, classDefinition.Name, p.Type)
do ..collectAggregation(oData, classDefinition.Name, p.Type, p.Private)
do ..collectAggregation(oData, classDefinition.Name, basePack _ "." _ p.Type, p.Private)
}
set oMethods = ##class(%ZEN.proxyObject).%New()
Expand Down Expand Up @@ -141,15 +143,16 @@ return structured data about class</Description>

<Method name="collectAggregation">
<ClassMethod>1</ClassMethod>
<FormalSpec>oData:%ZEN.proxyObject,className:%String,type:%String</FormalSpec>
<FormalSpec>oData:%ZEN.proxyObject,className:%String,type:%String,private:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set classDef = ##class(%Dictionary.ClassDefinition).%OpenId(type)
if (classDef '= "") {
set oAgg = oData.aggregation.%DispatchGetProperty(className)
if (private) { set t = "composition" } else { set t = "aggregation" }
set oAgg = oData.%DispatchGetProperty(t).%DispatchGetProperty(className)
if (oAgg = "") {
set oAgg = ##class(%ZEN.proxyObject).%New()
do oData.aggregation.%DispatchSetProperty(className, oAgg)
do oData.%DispatchGetProperty(t).%DispatchSetProperty(className, oAgg)
}
} else { quit $$$OK }
Expand Down Expand Up @@ -196,6 +199,7 @@ return structured data about class</Description>
set oData.classes = ##class(%ZEN.proxyObject).%New()
set oData.inheritance = ##class(%ZEN.proxyObject).%New()
set oData.aggregation = ##class(%ZEN.proxyObject).%New()
set oData.composition = ##class(%ZEN.proxyObject).%New()
set classes = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
do classes.Execute()
Expand All @@ -216,11 +220,11 @@ return structured data about class</Description>
</Class>


<Project name="UMLExplorer" LastModified="2015-04-26 00:42:57.542208">
<Project name="UMLExplorer" LastModified="2015-04-28 19:55:49.450783">
<Items>
<ProjectItem name="UMLExplorer.ClassView" type="CLS"/>
<ProjectItem name="UMLExplorer.Router" type="CLS"/>
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"/>
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
</Items>
</Project>

Expand All @@ -229,7 +233,7 @@ return structured data about class</Description>
<Description>
REST interface for UMLExplorer</Description>
<Super>%CSP.REST</Super>
<TimeChanged>63667,85509.960346</TimeChanged>
<TimeChanged>63670,71431.319061</TimeChanged>
<TimeCreated>63648,30450.187229</TimeCreated>

<XData name="UrlMap">
Expand Down Expand Up @@ -286,93 +290,76 @@ Returns all package class trees by given package name</Description>
]]></Implementation>
</Method>

<Method name="Test">
<Description>
Method to test accessibility of REST interface.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set resp = ##class(%ZEN.proxyObject).%New()
set resp2 = ##class(%ZEN.proxyObject).%New()
set resp2.Status = "OK"
set resp.obj = resp2
do resp.%ToJSON(, "o")
return $$$OK
]]></Implementation>
</Method>

<Method name="GetCss">
<Description>
Method returns user application CSS.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set %response.CharSet = "utf-8"
set %response.ContentType = "text/css"
do ##class(UMLExplorer.StaticContent).WriteCSS()
do ##class(StaticContent).Write("CSS")
return $$$OK
]]></Implementation>
</Method>

<Method name="GetJs">
<Description>
Method returns user application JavaScript.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set %response.CharSet = "utf-8"
set %response.ContentType = "text/javascript"
do ##class(UMLExplorer.StaticContent).WriteJS()
do ##class(StaticContent).Write("JS")
return $$$OK
]]></Implementation>
</Method>

<Method name="Index">
<Description>
Method returns user application.</Description>
Method returns user application HTML.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
&html<
{{replace:html}}
>
do ##class(StaticContent).Write("HTML")
return $$$OK
]]></Implementation>
</Method>
</Class>


<Class name="UMLExplorer.StaticContent">
<TimeChanged>63663,76108.945861</TimeChanged>
<TimeChanged>63670,71368.846177</TimeChanged>
<TimeCreated>63663,71456.865723</TimeCreated>

<Method name="WriteCSS">
<Method name="Write">
<Description>
Outputs css code for UMLExplorer application</Description>
Write the contents of xData tag</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>Const:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||CSS").Data
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||"_Const).Data
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
return $$$OK
]]></Implementation>
</Method>

<Method name="WriteJS">
<Description>
Outputs js code for UMLExplorer application</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||JS").Data
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
return $$$OK
]]></Implementation>
</Method>
<XData name="HTML">
<Data><![CDATA[
<data><![CDATA[
{{replace:html}}
]]]]><![CDATA[></data>
]]></Data>
</XData>

<XData name="CSS">
<Data><![CDATA[
<data>
<data><![CDATA[
{{replace:css}}
</data>
]]]]><![CDATA[></data>
]]></Data>
</XData>

Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ gulp.task("clean", function () {
gulp.task("gatherLibs", ["clean"], function () {
return gulp.src([
"web/jsLib/joint.js",
"web/jsLib/joint.shapes.uml.js"
"web/jsLib/joint.shapes.uml.js",
"web/jsLib/ImageExporter.js"
])
.pipe(uglify({
output: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CacheUMLExplorer",
"version": "0.3.0",
"version": "0.5.0",
"description": "An UML Class explorer for InterSystems Caché",
"directories": {
"test": "test"
Expand Down
23 changes: 23 additions & 0 deletions web/css/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,29 @@
left: 5px;
}

.icon.download:before {
content: "";
border: 8px solid transparent;
border-right-width: 0;
border-left-color: #fff;
left: 8px;
right: auto;
position: absolute;
top: 16px;
transform: translateY(-50%) rotate(90deg);
}

.icon.download:after {
content: "";
background-color: #fff;
width: 6px;
height: 10px;
border-radius: 1px;
position: absolute;
top: 5px;
left: 9px;
}

.icon.scaleNormal:after {
content: "1:1";
position: absolute;
Expand Down
9 changes: 8 additions & 1 deletion web/css/interface.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,20 @@ html, body {
font-size: 18pt;
}

.ui-toolBar {
.ui-rightBottomToolBar {
position: absolute;
bottom: 0;
right: 0;
padding: .5em;
}

.ui-leftBottomToolBar {
position: absolute;
bottom: 0;
left: 0;
padding: .5em;
}

#className {
text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
}
11 changes: 10 additions & 1 deletion web/css/treeView.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
cursor: pointer;
border-radius: 5px;
-webkit-transition: all .2s ease;
user-select: none;
-moz-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}

.tv-class-name:hover, .tv-package-name:hover {
Expand Down Expand Up @@ -54,6 +57,9 @@
border: 1px solid gray;
border-radius: 2px 2px 0 2px;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
}

.tv-package-name:after {
Expand All @@ -69,6 +75,9 @@
border: 1px solid gray;
border-radius: 0 2px 2px 2px;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
}

.tv-package-name:hover:before {
Expand Down
7 changes: 6 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<script type="text/javascript" src="jsLib/joint.js"></script>
<script type="text/javascript" src="jsLib/joint.shapes.uml.js"></script>
<script type="text/javascript" src="jsLib/joint.layout.DirectedGraph.min.js"></script>
<script type="text/javascript" src="jsLib/ImageExporter.js"></script>
<script type="text/javascript" src="js/ClassView.js"></script>
<script type="text/javascript" src="js/Lib.js"></script>
<script type="text/javascript" src="js/CacheUMLExplorer.js"></script>
Expand All @@ -32,7 +33,10 @@
<div class="ui-ClassInfo">
<span id="className"></span>
</div>
<div class="ui-toolBar">
<div class="ui-leftBottomToolBar">
<div id="button.downloadSVG" class="icon download"></div>
</div>
<div class="ui-rightBottomToolBar">
<div id="button.zoomIn" class="icon plus"></div>
<div id="button.zoomNormal" class="icon scaleNormal"></div>
<div id="button.zoomOut" class="icon minus"></div>
Expand All @@ -42,5 +46,6 @@
</div>
</div>
</div>
<canvas id="canvas" width="1000px" height="600px"></canvas>
</body>
</html>
2 changes: 2 additions & 0 deletions web/js/CacheUMLExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ CacheUMLExplorer.prototype.init = function () {
}
}

enableSVGDownload(this.classTree);

};
Loading

0 comments on commit 2948926

Please sign in to comment.