Sfoglia il codice sorgente

first work on graphics and table for tree structure

DS 3 anni fa
parent
commit
30f12edb9b
5 ha cambiato i file con 220 aggiunte e 0 eliminazioni
  1. 83 0
      graphics/Gauge.svg
  2. 47 0
      index.html
  3. 2 0
      js/jquery-3.6.0.min.js
  4. 24 0
      js/myEvents.js
  5. 64 0
      styles/grapheditor.css

+ 83 - 0
graphics/Gauge.svg

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="21mm"
+   height="29mm"
+   viewBox="0 0 210 297"
+   version="1.1"
+   id="svg8"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
+   sodipodi:docname="Gauge.svg">
+  <defs
+     id="defs2" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.0041055"
+     inkscape:cx="268.36851"
+     inkscape:cy="560.51836"
+     inkscape:document-units="mm"
+     inkscape:current-layer="layer1"
+     inkscape:document-rotation="0"
+     showgrid="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1001"
+     inkscape:window-x="-9"
+     inkscape:window-y="-9"
+     inkscape:window-maximized="1">
+    <inkscape:grid
+       type="xygrid"
+       id="grid873" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <circle
+       style="opacity:0.997;fill:#ffffff;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+       id="path835"
+       cx="54.790253"
+       cy="180.13965"
+       r="50" />
+    <circle
+       style="opacity:0.997;fill:#ffffff;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+       id="path833-2"
+       cx="54.528358"
+       cy="179.87239"
+       r="45" />
+    <g
+       id="g871"
+       transform="translate(0,-3.7041668)">
+      <path
+         style="fill:none;stroke:#000000;stroke-width:3.67883;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 17.963822,182.5625 H 89.401324"
+         id="path875" />
+      <path
+         style="fill:none;stroke:#000000;stroke-width:2.63413;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 55.5625,182.5625 40.523031,161.82733"
+         id="path877" />
+    </g>
+  </g>
+</svg>

+ 47 - 0
index.html

@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+	 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+	 <script src="js/myEvents.js"></script>
+     <script>
+	 
+     </script>
+	<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
+ </head>
+ <body>
+    <div class="topContainer">
+		  MODELING TOOL
+	</div>
+	<div class="sidebarContainer">
+		 <button id="load_nodeset" type="button">
+             Load Nodeset file
+         </button>
+		 <button id="delete_nodeset" type="button">
+             Delete Nodeset file
+         </button>
+		 <button id="export_model" type="button">
+             Export new model
+         </button>
+	</div>
+	<div class="addressSpaceContainer">
+		<div class="aSTableStart">
+			<table>
+				<tbody>
+					<tr>
+						<td>
+						<img class="nodeRoot" src="graphics/Gauge.svg" height="100" width="100"></img>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+		</div>
+		<div class="aSTableMain">
+			<table>
+				<tbody id="tree">
+				</tbody>
+			</table>
+		</div>  
+     </section>
+	</div>
+</body>
+</html>

File diff suppressed because it is too large
+ 2 - 0
js/jquery-3.6.0.min.js


+ 24 - 0
js/myEvents.js

@@ -0,0 +1,24 @@
+$(document).ready(function(){
+    function newElementaddressSpace(){
+		var $tr = $('<tr>');
+		$tr.append('<td><img src='+'graphics/Gauge.svg'+' height='+"100"+' width='+"100"+'></img></td></tr>');
+		
+		$('#tree').append($tr);
+		console.log("this funct");
+	}
+	
+	
+	$(".nodeRoot").click(function () {
+		console.log("Here");
+        $(this).css("border","5px solid green");
+    })
+	
+	$("#load_nodeset").click(function(){
+		
+		newElementaddressSpace();
+		console.log("Button1 clicked")
+	})
+	
+	
+	
+});

+ 64 - 0
styles/grapheditor.css

@@ -0,0 +1,64 @@
+.topContainer{
+	background:#C0C0C0;
+	overflow:hidden;
+	position:absolute;
+	left: 0px; 
+	top: 0px; 
+	width:100%; 
+	bottom:0px;
+	overflow:auto;
+	
+}
+.sidebarContainer {
+	background:#C0C0C0;
+	overflow:hidden;
+	position:absolute;
+	left: 0px; 
+	top: 103px; 
+	width: 150px; 
+	bottom: 38px;
+	overflow:auto;
+	
+}
+.addressSpaceContainer {
+	background:#ffffff;
+	overflow:hidden;
+	position:absolute;
+	left: 150px; 
+	top: 103px; 
+	width: 400px; 
+	bottom: 38px;
+	overflow:auto;
+	border-style:solid;
+}
+.aSTableStart{
+	background:#ffffff;
+	overflow:hidden;
+	position:absolute;
+	left: 0px; 
+	top: 0px; 
+	width: 300px; 
+	height: 120px;
+	overflow:auto;
+	border-style:dotted;
+}
+.aSTableMain{
+	background:#ffffff;
+	overflow:hidden;
+	position:absolute;
+	left: 0px; 
+	top: 120px; 
+	width: 300px; 
+	overflow:auto;
+	border-style:dotted;
+}
+.nodeInstance{
+	
+}
+.nodeRoot{
+	background:#ffffff;
+	overflow:hidden;
+	position:absolute;
+	overflow:auto;
+	border-style:dotted;
+}