diff --git a/.travis.yml b/.travis.yml index 4e319f1f..1821846b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ dist: trusty env: global: - - NODE_VERSION=5 + - NODE_VERSION=6 - USE_SYSTEM_FPM=true - secure: E0ghqUHn8cFewr+wYJgnLSpn/e+3RPhnoLNAYMuhpGhPtpVgmlTqb7oqHHLVOjQtfDEp495tMolYeaJZaqGAC4RnEPtn664wrgoEI+FLegNV3SJx+oFF53LmT3zZnwVhbF6J3ZwF8QLYPKad5PcCqVo8SMvMMyWD5m6TzJFJ+1caNi6wJrKkQBqHtCkKOkazp0ZXwpl1SVQl24bofCZfGn7zbmRJ0+VXvfeg1GqkF1GFqkDKc2SkGQn9VUH1d2ejahWxV3dH+VPuyqUuTlPIrv7TjUU4OH9hr3mjQPtWMOnvK0BzOQKu2B9tpAUHbuT5z74TSc7TYQjDA0zQG02h1ALll0Fm+9UOYJQZMidNNiawCDXx1a0Fu+SLWNK9KX/R3FD2ip4wVKKjl/DyTy5Nnw/BsWX4UkYijW3IuegV7a0UokISD6OJqLeo+gmmNon2ngxum+Av1veB/z9c/zZanQwx+CumeqAD7eHCbxZv+bwMAFfsoC6Bv6CtTlU+uBeu7wSUyMxVzaW8qF+MbeMboG3ht12+K6Xxdp+C26eGbkQr7YlITumy5glhd4jlCAxI+DT1uZAWPnIfdOtRWUPd78ABy9G3y98ppnlqCNPbxShI3Tgtp8mTDEpM0znVnZOXcQFzrEX7r2IsGmnIuoUf77lmdpuDTYPq6KAbAOtkjCE= @@ -15,8 +15,8 @@ language: c matrix: include: - os: linux - env: CC=clang CXX=clang++ npm_config_clang=1 - compiler: clang + #env: CC=clang CXX=clang++ npm_config_clang=1 + #compiler: clang - os: osx cache: @@ -31,11 +31,11 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 + #- llvm-toolchain-precise-3.7 packages: - libgnome-keyring-dev - icnsutils - - clang-3.7 + #- clang-3.7 - graphicsmagick - xz-utils - rpm @@ -48,14 +48,12 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git-lfs-1.2.0/git-lfs pull; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y ruby-dev gcc make; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gem install --no-ri --no-rdoc fpm; fi - # https://github.com/electron-userland/electron-builder/issues/398 - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then security import "certs/sca.code2.crt" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign; fi install: - nvm install $NODE_VERSION - npm install npm -g - npm install - - npm install git+https://github.com/mbrainiac/electron-builder.git#v3.26.1.2 + - npm install electron-builder@4.2.6 - npm prune script: diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..d25fc009 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,3 @@ + +* Operating system: +* Pencil version: diff --git a/app/app.js b/app/app.js index 844d9231..ab7bfde2 100644 --- a/app/app.js +++ b/app/app.js @@ -1,26 +1,24 @@ -const clipboard = require("electron").clipboard; +const {clipboard, remote, nativeImage, shell, ipcRenderer, webFrame} = require("electron"); + +const _ = require("lodash"); +const rimraf = require("rimraf"); +const QP = require("q"); + const tmp = require("tmp"); const path = require("path"); const moment = require("moment"); const fs = require("fs"); const os = require("os"); const unzip = require("unzip2"); -const dialog = require("electron").remote.dialog; -const nativeImage = require('electron').nativeImage; const pkgInfo = require("./package.json"); const fontManager = require("./lib/loader").fontManager; -const ipcRenderer = require('electron').ipcRenderer; const QueueHandler = require("./pencil-core/common/QueueHandler"); -const shell = require('electron').shell; const sharedUtil = require("./pencil-core/common/shared-util"); -const _ = require("lodash"); -const rimraf = require("rimraf"); -const QP = require("q"); +const dialog = remote.dialog; tmp.setGracefulCleanup(); -var webFrame = require("electron").webFrame; webFrame.registerURLSchemeAsPrivileged("file"); webFrame.registerURLSchemeAsSecure("file"); webFrame.registerURLSchemeAsBypassingCSP("file"); diff --git a/app/css/theme.css b/app/css/theme.css index 0fbe5b40..f7ef682b 100644 --- a/app/css/theme.css +++ b/app/css/theme.css @@ -30,6 +30,10 @@ button { display: inline-flex; align-items: center; } +button:focus { + outline: dotted 1px rgba(0, 0, 0, 0.3); + outline-offset: -0.3em; +} button[disabled] { background: rgba(255, 255, 255, 0.2); cursor: default; @@ -54,9 +58,16 @@ button > i { -webkit-font-smoothing: subpixel-antialiased; opacity: 0.7; } -button > i[rotated="true"] { +button > i[rotated="true"], +button > i[rotated="right"] { transform: rotate(90deg); } +button > i[rotated="left"] { + transform: rotate(-90deg); +} +button > i[flipped="true"] { + transform: rotate(180deg); +} button > * { vertical-align: middle; } @@ -73,43 +84,48 @@ button[mode='icon'] { hbox.ButtonGroup > button { box-shadow: none !important; } -hbox.ButtonGroup > button:first-child, -hbox.ButtonGroup > button + button { +hbox.ButtonGroup > *:first-child:not(:last-child), +hbox.ButtonGroup > * + input[type]:not(:last-child), +hbox.ButtonGroup > * + *:not(:last-child) { border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-right-width: 0px; } -hbox.ButtonGroup > button:first-child > i, -hbox.ButtonGroup > button + button > i { +hbox.ButtonGroup > *:first-child > i, +hbox.ButtonGroup > * + * > i { padding-right: 1px; } -hbox.ButtonGroup > button + button { +hbox.ButtonGroup > * + input[type], +hbox.ButtonGroup > * + button { border-top-left-radius: 0px; border-bottom-left-radius: 0px; border-left-width: 0px; } -hbox.ButtonGroup > button + button > i { +hbox.ButtonGroup > * + * > i { padding-left: 1px; } -hbox.ButtonGroup > button:last-child { - border-top-right-radius: 0.3ex; - border-bottom-right-radius: 0.3ex; - border-right-width: 1px; -} -hbox.ButtonGroup > button:last-child > i { +hbox.ButtonGroup > *:last-child > i { padding-right: 0px; } -hbox.ButtonGroup > button[disabled] + button:not([disabled]), -hbox.ButtonGroup > button:not([disabled]) + button[disabled] { +hbox.ButtonGroup > *[disabled] + *:not([disabled]), +hbox.ButtonGroup > *:not([disabled]) + *[disabled] { border-left-width: 1px; } -hbox.ButtonGroup > button[disabled] + button:not([disabled]) > i, -hbox.ButtonGroup > button:not([disabled]) + button[disabled] > i { +hbox.ButtonGroup > *[disabled] + *:not([disabled]) > i, +hbox.ButtonGroup > *:not([disabled]) + *[disabled] > i { padding-left: 0px; } +hbox.ButtonGroup > input[type]:not(:last-child) { + border-right: solid 1px rgba(0, 0, 0, 0.1); !important; +} +hbox.ButtonGroup > button + input[type], +hbox.ButtonGroup > .AdoptedOrphan + * { + border-left: solid 1px rgba(0, 0, 0, 0.1); !important; +} hbox.ButtonGroup { display: inline-flex; } + button[selected='true'], button[checked='true'] { background: #C8C8C8; diff --git a/app/css/variables.less b/app/css/variables.less index 70700b1a..21e8ff82 100644 --- a/app/css/variables.less +++ b/app/css/variables.less @@ -8,7 +8,7 @@ @popup_border: darken(@app_bg, 5%); @toolbar_spacing: 0.4em; @selected_button_bg: #C8C8C8; - +@toolbar_gap: 0.4em; @iconify: { display: inline-block; line-height: 1em; diff --git a/app/desktop.js b/app/desktop.js index 100c9a76..e91f2e99 100644 --- a/app/desktop.js +++ b/app/desktop.js @@ -8,6 +8,7 @@ module.exports = function () { "cinamon": [{command: "dconf", params: ["read", "/org/cinnamon/desktop/interface/font-name"]}, {command: "gsettings", params: ["get", "org.cinnamon.desktop.interface", "font-name"]}], "gnome": [{command: "gsettings", params: ["get", "org.gnome.desktop.interface", "font-name"]}], + "ubuntu": [{command: "gsettings", params: ["get", "org.gnome.desktop.interface", "font-name"]}] } var fontNameReader = function(registry, callback, index) { var child = spawn(registry.command, registry.params); @@ -62,6 +63,9 @@ module.exports = function () { var platformHandlers = { linux: function (callback) { var d = process.env.DESKTOP_SESSION; + if (/ubuntu/ig.exec(d)) { + d = "ubuntu"; + } var fontRegistry = fontCommandRegistry[d]; if (!fontRegistry) { console.error("Coud not found font command registry for ", d); @@ -138,6 +142,9 @@ module.exports = function () { style = RegExp.$1; } + // TODO: use default fontsize + size = 11; + callback({ family: family, weight: weight, diff --git a/app/index.js b/app/index.js index b08bf2d9..36f4fe98 100644 --- a/app/index.js +++ b/app/index.js @@ -4,9 +4,7 @@ if (require('electron-squirrel-startup')) { return; } -const electron = require("electron"); -const app = electron.app; -const Console = require("console").Console; +const {app, protocol, shell, BrowserWindow} = require("electron"); const pkg = require("./package.json"); const fs = require("fs"); const path = require("path"); @@ -14,17 +12,17 @@ const path = require("path"); app.commandLine.appendSwitch("allow-file-access-from-files"); app.commandLine.appendSwitch("allow-file-access"); -const BrowserWindow = electron.BrowserWindow; - +// Disable hardware acceleration by default for Linux +// TODO: implement a setting for this one and requires a restart after changing that value +if (process.platform.trim().toLowerCase() == "linux" && app.disableHardwareAcceleration) { + console.log("Hardware acceleration disabled for Linux."); + app.disableHardwareAcceleration(); +} -// logs -const output = fs.createWriteStream(app.getPath("userData") + "/user.log"); -const errorOutput = fs.createWriteStream(app.getPath("userData") + "/error.log"); -const logger = new Console(output, errorOutput); var handleRedirect = (e, url) => { e.preventDefault(); - electron.shell.openExternal(url); + shell.openExternal(url); } var mainWindow = null; @@ -89,9 +87,6 @@ app.on("window-all-closed", function() { }); app.on('ready', function() { - var protocol = require('protocol'); - var fs = require('fs'); - protocol.registerBufferProtocol("ref", function(request, callback) { var path = request.url.substr(6); console.log("PATH", path); @@ -128,7 +123,7 @@ app.on("activate", function() { }); process.on('uncaughtException', function (error) { - logger.error(error); + console.error(error); }); console.log("Platform: " + process.platform.trim()); diff --git a/app/lib/font-manager/darwin/fontmanager.node b/app/lib/font-manager/darwin/fontmanager.node old mode 100644 new mode 100755 index 15f67df6..d8aee898 Binary files a/app/lib/font-manager/darwin/fontmanager.node and b/app/lib/font-manager/darwin/fontmanager.node differ diff --git a/app/lib/font-manager/linux/fontmanager.node b/app/lib/font-manager/linux/fontmanager.node old mode 100644 new mode 100755 index 6acbcd66..fbe7b089 Binary files a/app/lib/font-manager/linux/fontmanager.node and b/app/lib/font-manager/linux/fontmanager.node differ diff --git a/app/lib/font-manager/win32/fontmanager.node b/app/lib/font-manager/win32/fontmanager.node index a852c77c..f4399dc2 100644 Binary files a/app/lib/font-manager/win32/fontmanager.node and b/app/lib/font-manager/win32/fontmanager.node differ diff --git a/app/lib/font-manager/win32/x64/fontmanager.node b/app/lib/font-manager/win32/x64/fontmanager.node index 1d81aba2..2f7a8fbb 100644 Binary files a/app/lib/font-manager/win32/x64/fontmanager.node and b/app/lib/font-manager/win32/x64/fontmanager.node differ diff --git a/app/lib/widget/Common.js b/app/lib/widget/Common.js index 19f07f6c..e8aa3892 100644 --- a/app/lib/widget/Common.js +++ b/app/lib/widget/Common.js @@ -107,7 +107,7 @@ widget.Util = function() { selectors = selectors.replace(/@([a-z])/gi, ".AnonId_" + (templateName + "_") + "$1"); } selectors = selectors.replace(/[ \r\n\t]\,[ \r\n\t]+/g, ","); - if (!selectors.match(/^[ \t]*body /) && !selectors.match(/^[ \t]*@media /)) { + if (!selectors.match(/^[ \t]*body[ \.\[:]/) && !selectors.match(/^[ \t]*@media /)) { selectors = prefix + " " + selectors.replace(/\,/g, ",\n" + prefix + " "); } @@ -767,19 +767,23 @@ BaseWidget.handleGlobalMouseDown = function (event) { }; BaseWidget.tryCloseClosableOnBlur = function (closable, event) { - var container = closable.getClosableContainer ? closable.getClosableContainer() : closable; - var found = Dom.findUpward(event.target, function (node) { - return node == container; - }); - if (found) return; + if (event) { + var container = closable.getClosableContainer ? closable.getClosableContainer() : closable; + var found = Dom.findUpward(event.target, function (node) { + return node == container; + }); + if (found) return; + } - var shouldClose = closable.shouldCloseOnBlur ? closable.shouldCloseOnBlur(event) : false; + var shouldClose = closable.shouldCloseOnBlur ? (!event || closable.shouldCloseOnBlur(event)) : false; if (!shouldClose) return; BaseWidget.unregisterClosable(closable); closable.close("onBlur", event); - event.preventDefault(); - Dom.cancelEvent(event); + if (event) { + event.preventDefault(); + Dom.cancelEvent(event); + } }; diff --git a/app/package.json b/app/package.json index dc11a7bb..819d63c7 100644 --- a/app/package.json +++ b/app/package.json @@ -1,8 +1,8 @@ { "name": "Pencil", "productName": "Pencil", - "description": "An open-source GUI prototyping tool that's available for ALL platforms.", - "version": "3.0.0-beta.1", + "description": "An open-source GUI prototyping tool that is available for ALL platforms.", + "version": "3.0.0-beta.2", "author": { "name": "Evolus", "url": "http://evolus.vn", @@ -40,9 +40,9 @@ "drawing" ], "dependencies": { - "archiver": "^0.21.0", - "electron-squirrel-startup": "^0.1.4", - "less": "~2.5.3", + "archiver": "^1.0.0", + "electron-squirrel-startup": "^1.0.0", + "less": "~2.7.1", "lodash": "^4.13.1", "moment": "^2.13.0", "nugget": "^2.0.0", diff --git a/app/pencil-core/behavior/commonBehaviors.js b/app/pencil-core/behavior/commonBehaviors.js index 4d2afb74..e3f0a88f 100644 --- a/app/pencil-core/behavior/commonBehaviors.js +++ b/app/pencil-core/behavior/commonBehaviors.js @@ -19,7 +19,7 @@ Pencil.behaviors.Bound = function (bound) { }; Pencil.behaviors.Radius = function (rx, ry) { this.setAttribute("rx", rx); - this.setAttribute("ry", ry); + this.setAttribute("ry", typeof(ry) != "undefined" ? ry : rx); }; Pencil.behaviors.StopColor = function (color) { Svg.setStyle(this, "stop-color", color.toRGBString()); @@ -409,7 +409,7 @@ Pencil.behaviors.RichTextFit = function (width) { Svg.setHeight(this, Math.ceil(this.firstChild.scrollHeight)); }; Pencil.behaviors.Image = function (imageData) { - var url = ImageData.refStringToUrl(imageData.data) || imageData.data; + var url = imageData.w > 0 ? (ImageData.refStringToUrl(imageData.data) || imageData.data) : ""; this.setAttributeNS(PencilNamespaces.xlink, "xlink:href", url); Svg.setWidth(this, imageData.w); Svg.setHeight(this, imageData.h); diff --git a/app/pencil-core/common/Canvas.js b/app/pencil-core/common/Canvas.js index 065489c3..30789c44 100644 --- a/app/pencil-core/common/Canvas.js +++ b/app/pencil-core/common/Canvas.js @@ -33,6 +33,7 @@ function Canvas(element) { this.addEventListener("mouseup", function (event) { if (thiz.duplicateMode) { thiz.mouseUp = true; + thiz.duplicateMode = null; } }, false); @@ -188,49 +189,49 @@ function Canvas(element) { thiz.handleKeyPress(event); }, false); - this.focusableBox.addEventListener("keyup", function (event) { - if (event.keyCode == DOM_VK_SHIFT) { - if(thiz.duplicateMode) { - thiz.duplicateMode = false; - console.log(thiz.mouseUp); - if (!thiz.mouseUp) { - thiz.run(function () { - thiz.currentController.deleteTarget(); - }, thiz, Util.getMessage("action.delete.shape", - thiz.currentController.getName())); - thiz.currentController = null; - thiz._detachEditors(); - thiz.clearSelection(); - thiz._sayTargetChanged(); - event.preventDefault(); - - if (thiz.oldTargets) { - if (!thiz.oldTargets.targets) { - thiz.addToSelection(thiz.oldTargets); - thiz.currentController = thiz.oldTargets; - thiz.reClick = false; - thiz._attachEditors(thiz.currentController); - } else { - for(i in thiz.oldTargets.targets) { - thiz.addToSelection(thiz.oldTargets.targets[i]); - } - thiz.currentController = thiz.oldTargets; - } - thiz.oldTargets = null; - thiz._sayTargetChanged(); - } - } - } - } - }, false); + // this.focusableBox.addEventListener("keyup", function (event) { + // if (event.keyCode == DOM_VK_SHIFT) { + // if(thiz.duplicateMode) { + // thiz.duplicateMode = false; + // console.log(thiz.mouseUp); + // if (!thiz.mouseUp) { + // thiz.run(function () { + // thiz.currentController.deleteTarget(); + // }, thiz, Util.getMessage("action.delete.shape", + // thiz.currentController.getName())); + // thiz.currentController = null; + // thiz._detachEditors(); + // thiz.clearSelection(); + // thiz._sayTargetChanged(); + // event.preventDefault(); + // + // if (thiz.oldTargets) { + // if (!thiz.oldTargets.targets) { + // thiz.addToSelection(thiz.oldTargets); + // thiz.currentController = thiz.oldTargets; + // thiz.reClick = false; + // thiz._attachEditors(thiz.currentController); + // } else { + // for(i in thiz.oldTargets.targets) { + // thiz.addToSelection(thiz.oldTargets.targets[i]); + // } + // thiz.currentController = thiz.oldTargets; + // } + // thiz.oldTargets = null; + // thiz._sayTargetChanged(); + // } + // } + // } + // } + // }, false); this.svg.ownerDocument.addEventListener("keydown", function (event) { if (event.keyCode == DOM_VK_SPACE && thiz.spaceHeld == false) { thiz.spaceHeld = true; thiz._lastPX = thiz._currentPX; thiz._lastPY = thiz._currentPY; - thiz._lastScrollX = thiz.parentNode.scrollLeft; - thiz._lastScrollY = thiz.parentNode.scrollTop; + thiz._lastScrollX = thiz.parentNode && thiz.parentNode.scrollLeft || 0; + thiz._lastScrollY = thiz.parentNode && thiz.parentNode.scrollTop || 0; Dom.addClass(thiz, "PanDown"); } }, false); @@ -535,6 +536,9 @@ Canvas.prototype.zoomTo = function (factor) { Dom.emitEvent("p:SizeChanged", this.element, { canvas : this }); + Dom.emitEvent("p:ZoomChanged", this.element, { + canvas : this + }); }; Canvas.prototype.getZoomedGeo = function (target) { @@ -1013,6 +1017,7 @@ Canvas.prototype.handleMouseMove = function (event, fake) { this.duplicateFunc(); } } + this._currentPX = event.clientX / this.zoom; this._currentPY = event.clientY / this.zoom; @@ -1305,7 +1310,7 @@ Canvas.prototype.handleKeyPress = function (event) { if (event.shiftKey) { this.selectSibling(false); } else { - this.selectSiblOing(true); + this.selectSibling(true); } event.preventDefault(); @@ -1958,15 +1963,10 @@ Canvas.prototype.handleMouseDown = function (event) { } this.duplicateMode = true; this.mouseUp = false; - this.oldTargets = null; + var thiz = this; this.duplicateFunc = function () { console.log("current control: ",thiz.currentController); - if( thiz.currentController.targets) { - thiz.oldTargets = thiz.currentController; - } else { - thiz.oldTargets = thiz.currentController; - } var target =thiz.currentController.createTransferableData(); var contents = []; @@ -2385,9 +2385,12 @@ Canvas.prototype.setDimBackground = function (dimBackground) { }; Canvas.prototype.sizeToContent = function (hPadding, vPadding) { - this.run(this.sizeToContent__, this, Util.getMessage( - "action.canvas.resize"), [hPadding, vPadding]); - + var newSize = null; + var thiz = this; + this.run(function () { + newSize = thiz.sizeToContent__ (hPadding, vPadding); + }, this, Util.getMessage("action.canvas.resize")); + return newSize; }; Canvas.prototype.sizeToContent__ = function (hPadding, vPadding) { @@ -2452,7 +2455,6 @@ Canvas.prototype.sizeToContent__ = function (hPadding, vPadding) { width : width, height : height }; - }; Canvas.prototype.addSelectedToMyCollection = function () { if (!this.currentController) return; @@ -2469,7 +2471,6 @@ Canvas.prototype.addSelectedToMyCollection = function () { data.valueHolder = data; run(data); } - //collection: CollectionManager.shapeDefinition.collections[0] }); var run = function (data) { @@ -2502,7 +2503,8 @@ Canvas.prototype.addSelectedToMyCollection = function () { collection.shapeDefs.push(shapeDef); } - + Config.set("PrivateCollection.lastUsedCollection.id", collection.id); + Config.set("PrivateCollection.lastSelectCollection.id", collection.id); debug("generating icon... :", valueHolder.autoGenerateIcon); if (valueHolder.autoGenerateIcon) { Util.generateIcon(target, 64, 64, 2, null, function (icondata) { @@ -2735,13 +2737,13 @@ Canvas.prototype.__drop = function (event) { var thiz =this; var data = event.dataTransfer.getData("collectionId"); var collections = CollectionManager.shapeDefinition.collections; - for (var i = 0; i < collections.length; i ++) { - if (collections[i].id == data) { - var count = CollectionManager.getCollectionUsage(collections[i]); - count++; - CollectionManager.setCollectionUsage(collections[i], count); - } - } + // for (var i = 0; i < collections.length; i ++) { + // if (collections[i].id == data) { + // var count = CollectionManager.getCollectionUsage(collections[i]); + // count++; + // CollectionManager.setCollectionUsage(collections[i], count); + // } + // } this.element.removeAttribute("is-dragover"); if (this.canvasContentModifiedListener) { this.canvasContentModifiedListener(thiz); diff --git a/app/pencil-core/common/QueueHandler.js b/app/pencil-core/common/QueueHandler.js index 4491306a..f6ceb336 100644 --- a/app/pencil-core/common/QueueHandler.js +++ b/app/pencil-core/common/QueueHandler.js @@ -1,4 +1,5 @@ -function QueueHandler() { +function QueueHandler(delay) { + this.delay = delay || 0; this.tasks = []; } QueueHandler.prototype.submit = function (task) { @@ -7,13 +8,20 @@ QueueHandler.prototype.submit = function (task) { if (this.tasks.length == 1) this.start(); }; -QueueHandler.prototype.start = function (task) { - +QueueHandler.prototype.start = function () { + var thiz = this; var next = function() { - if (this.tasks.length <= 0) return; - var task = this.tasks.pop(); - task(next); - }.bind(this); + if (thiz.tasks.length <= 0) return; + let task = thiz.tasks[0]; + task(function () { + thiz.tasks.shift(); + if (thiz.delay) { + setTimeout(next, thiz.delay) + } else { + next(); + } + }); + }; next(); }; diff --git a/app/pencil-core/common/config.js b/app/pencil-core/common/config.js index 6eb0a5ad..d01d2f72 100644 --- a/app/pencil-core/common/config.js +++ b/app/pencil-core/common/config.js @@ -18,8 +18,8 @@ Config._save = function () { fs.writeFileSync(Config.getDataFilePath(Config.CONFIG_FILE_NAME), JSON.stringify(Config.data, null, 4), "utf8"); }; Config._load = function () { - var json = fs.readFileSync(Config.getDataFilePath(Config.CONFIG_FILE_NAME), "utf8"); try { + var json = fs.readFileSync(Config.getDataFilePath(Config.CONFIG_FILE_NAME), "utf8"); Config.data = JSON.parse(json); } catch (e) { console.error(e); @@ -29,8 +29,8 @@ Config._load = function () { Config.set = function (name, value) { Config.data[name] = value; Config._save(); - window.globalEventBus.broadcast("config-change", { name: name, value: value }); - return; + + window.globalEventBus && window.globalEventBus.broadcast("config-change", { name: name, value: value }); }; Config.get = function (name, defaultValue) { diff --git a/app/pencil-core/common/controller.js b/app/pencil-core/common/controller.js index 89341881..281c2baf 100644 --- a/app/pencil-core/common/controller.js +++ b/app/pencil-core/common/controller.js @@ -73,13 +73,14 @@ Controller.prototype.confirmAndclose = function (onClose) { Controller.prototype.resetDocument = function () { if (this.tempDir) this.tempDir.removeCallback(); this.tempDir = tmp.dirSync({ keep: false, unsafeCleanup: true }); - + this.doc = new PencilDocument(); this.doc.name = ""; this.documentPath = null; this.canvasPool.reset(); this.activePage = null; this.documentPath = null; + this.pendingThumbnailerMap = null; this.applicationPane.pageListView.currentParentPage = null; FontLoader.instance.setDocumentRepoDir(path.join(this.tempDir.name, "fonts")); @@ -311,54 +312,129 @@ Controller.prototype.openDocument = function (callback) { handler(); }; +Controller.prototype.parsePageFromNode = function (pageNode, callback) { + var thiz = this; + var page = new Page(this.doc); + Dom.workOn("./p:Properties/p:Property", pageNode, function (propNode) { + var name = propNode.getAttribute("name"); + var value = propNode.textContent; + if(name == "note") { + value = RichText.fromString(value); + } + if (!Page.PROPERTY_MAP[name]) return; + page[Page.PROPERTY_MAP[name]] = value; + }); + + function invalidateAndSerializePage(page) { + if (page.width) page.width = parseInt(page.width, 10); + if (page.height) page.height = parseInt(page.height, 10); + if (page.backgroundColor) page.backgroundColor = Color.fromString(page.backgroundColor); + + if (page.backgroundPageId) page.backgroundPage = thiz.findPageById(page.backgroundPageId); + + var pageFileName = "page_" + page.id + ".xml"; + page.pageFileName = pageFileName; + page.tempFilePath = path.join(thiz.tempDir.name, pageFileName); + + thiz.serializePage(page, page.tempFilePath); + delete page._contentNode; + thiz.doc.pages.push(page); + } + + var contentNode = Dom.getSingle("./p:Content", pageNode); + if (contentNode) { + var node = document.importNode(contentNode.cloneNode(true), true); + + var invalidateTasks = []; + var invalidationIndex = -1; + + + function createInvalidationTask(type, name, propertyNode) { + return function (__callback) { + var value = type.fromString(propertyNode.textContent); + type.invalidateValue(value, function (invalidatedValue, error) { + if (invalidatedValue) { + Shape.storePropertyToNode(name, invalidatedValue, propertyNode); + } + __callback(); + }); + }; + } + + function runNextValidation(callback) { + invalidationIndex ++; + if (invalidationIndex >= invalidateTasks.length) { + callback(); + return; + } + var task = invalidateTasks[invalidationIndex]; + task(function () { + runNextValidation(callback); + }); + } + + Dom.workOn(".//svg:g[@p:type='Shape']", node, function (shapeNode) { + var defId = shapeNode.getAttributeNS(PencilNamespaces.p, "def"); + var def = CollectionManager.shapeDefinition.locateDefinition(defId); + if (!def) return; + + Dom.workOn("./p:metadata/p:property", shapeNode, function (propertyNode) { + var name = propertyNode.getAttribute("name"); + var propertyDef = def.propertyMap[name]; + if (!propertyDef || !propertyDef.type.invalidateValue) return; + var type = propertyDef.type; + + invalidateTasks.push(createInvalidationTask(type, name, propertyNode)); + + }); + }); + + + runNextValidation(function () { + page._contentNode = node; + invalidateAndSerializePage(page); + callback(); + }); + } else { + page._contentNode = null; + invalidateAndSerializePage(page); + callback(); + } +}; Controller.prototype.parseOldFormatDocument = function (filePath, callback) { var targetDir = this.tempDir.name; var thiz = this; + this.pathToRefCache = null; try { if (path.extname(filePath) != ".ep" && path.extname(filePath) != ".epz") throw "Wrong format."; + + this.documentPath = filePath; + this.oldPencilDoc = true; var dom = Controller.parser.parseFromString(fs.readFileSync(filePath, "utf8"), "text/xml"); Dom.workOn("./p:Properties/p:Property", dom.documentElement, function (propNode) { thiz.doc.properties[propNode.getAttribute("name")] = propNode.textContent; }); - Dom.workOn("./p:Pages/p:Page", dom.documentElement, function (pageNode) { - var page = new Page(thiz.doc); - Dom.workOn("./p:Properties/p:Property", pageNode, function (propNode) { - var name = propNode.getAttribute("name"); - var value = propNode.textContent; - if(name == "note") { - value = RichText.fromString(value); - } - if (!Page.PROPERTY_MAP[name]) return; - page[Page.PROPERTY_MAP[name]] = value; - }); + var pageNodes = Dom.getList("./p:Pages/p:Page", dom.documentElement); - var contentNode = Dom.getSingle("./p:Content", pageNode); - if (contentNode) { - var node = dom.createElementNS(PencilNamespaces.p, "p:Content"); - node.innerHTML = document.importNode(contentNode, true).innerHTML; - page._contentNode = node; - } else page._contentNode = null; - - if (page.width) page.width = parseInt(page.width, 10); - if (page.height) page.height = parseInt(page.height, 10); - if (page.backgroundColor) page.backgroundColor = Color.fromString(page.backgroundColor); - - if (page.backgroundPageId) page.backgroundPage = thiz.findPageById(page.backgroundPageId); - - var pageFileName = "page_" + page.id + ".xml"; - page.pageFileName = pageFileName; - page.tempFilePath = path.join(thiz.tempDir.name, pageFileName); + var pageNodeIndex = -1; + function parseNextPageNode(__callback) { + pageNodeIndex ++; + if (pageNodeIndex >= pageNodes.length) { + __callback(); + return; + } - thiz.serializePage(page, page.tempFilePath); - delete page._contentNode; - thiz.doc.pages.push(page); - }); + var pageNode = pageNodes[pageNodeIndex]; + thiz.parsePageFromNode(pageNode, function () { + parseNextPageNode(__callback); + }); + } // update page thumbnails var index = -1; - function next(onDone) { + function generateNextThumbnail(onDone) { index ++; if (index >= thiz.doc.pages.length) { if (onDone) onDone(); @@ -366,21 +442,26 @@ Controller.prototype.parseOldFormatDocument = function (filePath, callback) { } var page = thiz.doc.pages[index]; thiz.updatePageThumbnail(page, function () { - next(onDone); + generateNextThumbnail(onDone); }); } - next(function () { - thiz.sayDocumentChanged(); - thiz.sayControllerStatusChanged(); - if (thiz.doc.pages.length > 0) thiz.activatePage(thiz.doc.pages[0]); - if (callback) callback(); - ApplicationPane._instance.unbusy(); + + parseNextPageNode(function () { + generateNextThumbnail(function () { + thiz.modified = false; + thiz.sayControllerStatusChanged(); + if (thiz.doc.pages.length > 0) thiz.activatePage(thiz.doc.pages[0]); + thiz.pathToRefCache = null; + if (callback) callback(); + ApplicationPane._instance.unbusy(); + }); }); - this.documentPath = filePath; + + // this.documentPath = filePath; this.doc.name = this.getDocumentName(); } catch (e) { - console.log("error:", e); + // console.log("error:", e); thiz.newDocument(); ApplicationPane._instance.unbusy(); } @@ -583,6 +664,7 @@ Controller.prototype.parseDocument = function (filePath, callback) { }, thiz); thiz.documentPath = filePath; + thiz.oldPencilDoc = false; thiz.doc.name = thiz.getDocumentName(); thiz.modified = false; //new file was loaded, update recent file list @@ -597,6 +679,7 @@ Controller.prototype.parseDocument = function (filePath, callback) { if (thiz.doc.pages.length > 0) thiz.activatePage(thiz.doc.pages[0]); } thiz.applicationPane.onDocumentChanged(); + thiz.modified = false; if (callback) callback(); ApplicationPane._instance.unbusy(); }); @@ -676,11 +759,12 @@ Controller.prototype.saveAsDocument = function (onSaved) { }.bind(this)); }; Controller.prototype.saveDocument = function (onSaved) { - if (!this.documentPath) { + if (!this.documentPath || this.oldPencilDoc) { var thiz = this; dialog.showSaveDialog({ title: "Save as", - defaultPath: path.join(Config.get("document.save.recentlyDirPath", null) || os.homedir(), "Untitled.epz"), + defaultPath: path.join(Config.get("document.save.recentlyDirPath", null) || os.homedir(), + (this.documentPath && path.basename(this.documentPath).replace(path.extname(this.documentPath), "") + ".epz") || "Untitled.epz"), filters: [ { name: "Pencil Documents", extensions: ["epz"] } ] @@ -700,10 +784,11 @@ Controller.prototype.saveDocumentImpl = function (documentPath, onSaved) { if (!documentPath) throw "Path not specified"; this.updateCanvasState(); + this.oldPencilDoc = false; + var thiz = this; ApplicationPane._instance.busy(); - this.serializeDocument(function () { this.addRecentFile(documentPath, this.getCurrentDocumentThumbnail()); @@ -854,10 +939,8 @@ Controller.prototype.swapIn = function (page, canvas) { page.careTakerTempFile = null; } - if (page.scrollTop || page.scrollLeft || page.zoom) { - var canvasState = {"scrollTop": page.scrollTop ? page.scrollTop : 0, "scrollLeft": page.scrollLeft ? page.scrollLeft : 0, "zoom": page.zoom ? page.zoom : 0}; - canvas.setCanvasState(canvasState); - } + var canvasState = {"scrollTop": page.scrollTop ? page.scrollTop : 0, "scrollLeft": page.scrollLeft ? page.scrollLeft : 0, "zoom": page.zoom ? page.zoom : 1}; + canvas.setCanvasState(canvasState); page.canvas = canvas; canvas.page = page; @@ -1147,6 +1230,8 @@ Controller.prototype.sizeToContent = function (passedPage, askForPadding) { var page = passedPage ? passedPage : this.activePage; var canvas = page.canvas; if (!canvas) return; + + var thiz = this; var padding = 0; var handler = function () { var canvas = page.canvas; @@ -1156,7 +1241,8 @@ Controller.prototype.sizeToContent = function (passedPage, askForPadding) { page.width = newSize.width; page.height = newSize.height; - this.invalidateBitmapFilePath(page); + thiz.sayDocumentChanged(); + thiz.invalidateBitmapFilePath(page); } }.bind(this); @@ -1165,7 +1251,7 @@ Controller.prototype.sizeToContent = function (passedPage, askForPadding) { paddingDialog.open({ title: "Fit content with padding", message: "Please enter the padding", - defaultValue: "0", + defaultValue: 0, callback: function (paddingString) { if (!paddingString) return; padding = parseInt(paddingString, 10); @@ -1183,7 +1269,9 @@ Controller.prototype.sizeToBestFit = function (passedPage) { var page = passedPage ? passedPage : this.activePage; var canvas = page.canvas; if (!canvas) return; - + if (canvas.zoom != 1) { + canvas.zoomTo(1); + } var newSize = this.applicationPane.getBestFitSizeObject(); if (newSize) { canvas.setSize(newSize.width, newSize.height); @@ -1191,6 +1279,7 @@ Controller.prototype.sizeToBestFit = function (passedPage) { page.height = newSize.height; Config.set("lastSize", [newSize.width, newSize.height].join("x")); this.invalidateBitmapFilePath(page); + this.sayDocumentChanged(); } }; Controller.prototype.getBestFitSize = function () { @@ -1200,6 +1289,7 @@ Controller.prototype.getBestFitSize = function () { Controller.prototype.handleCanvasModified = function (canvas) { if (!canvas || !canvas.page) return; this.modified = true; + canvas.page.lastModified = new Date(); this.invalidateBitmapFilePath(canvas.page); }; Controller.prototype.updatePageThumbnail = function (page, done) { @@ -1208,16 +1298,19 @@ Controller.prototype.updatePageThumbnail = function (page, done) { if (page.height > page.width) scale = Controller.THUMBNAIL_SIZE / page.height; var thiz = this; - this.applicationPane.rasterizer.rasterizePageToFile(page, thumbPath, function (p, error) { + this.applicationPane.rasterizer.postBitmapGeneratingTask(page, scale, thumbPath, function (p) { page.thumbPath = p; page.thumbCreated = new Date(); Dom.emitEvent("p:PageInfoChanged", thiz.applicationPane, {page: page}); if (done) done(); - }, scale); + }); }; -Controller.prototype.rasterizeCurrentPage = function () { - var page = this.activePage; +Controller.prototype.rasterizeCurrentPage = function (targetPage) { + var page = targetPage ? targetPage : (this.activePage ? this.activePage : null); + if (!page) { + return; + } dialog.showSaveDialog({ title: "Export page as PNG", defaultPath: path.join(os.homedir(), (page.name + ".png")), @@ -1253,9 +1346,24 @@ Controller.prototype.rasterizeSelection = function () { }; Controller.prototype.copyAsRef = function (sourcePath, callback) { + var originalSourcePath = sourcePath; + + if (this.pathToRefCache && this.pathToRefCache[originalSourcePath]) { + callback(this.pathToRefCache[originalSourcePath]); + return; + } + + if (!path.isAbsolute(sourcePath)) { + sourcePath = path.normalize(path.join(path.dirname(this.documentPath), sourcePath)); + console.log("Resolving relative path to: ", sourcePath); + } + var id = Util.newUUID() + path.extname(sourcePath) || ".data"; var filePath = path.join(this.makeSubDir(Controller.SUB_REFERENCE), id); + if (!this.pathToRefCache) this.pathToRefCache = {}; + this.pathToRefCache[originalSourcePath] = id; + var rd = fs.createReadStream(sourcePath); rd.on("error", function (error) { callback(null, error); @@ -1319,35 +1427,42 @@ Controller.prototype.movePageTo = function (pageId, targetPageId, left) { this.sayDocumentChanged(); }; -Controller.prototype.invalidateBitmapFilePath = function (page, invalidatedIds) { - if (!invalidatedIds) invalidatedIds = []; - if (invalidatedIds.indexOf(page.id) >= 0) return; - - if (page.bitmapFilePath) { - fs.unlinkSync(page.bitmapFilePath); - page.bitmapFilePath = null; - } - - //update page thumbnail - page.lastModified = new Date(); +Controller.prototype.scheduleUpdatePageThumbnail = function (page) { if (!this.pendingThumbnailerMap) this.pendingThumbnailerMap = {}; var pending = this.pendingThumbnailerMap[page.id]; if (pending) { window.clearTimeout(pending); } - var thiz = this; this.pendingThumbnailerMap[page.id] = window.setTimeout(function () { - thiz.pendingThumbnailerMap[page.id] = null; - thiz.updatePageThumbnail(page); - }, 3000); + this.updatePageThumbnail(page, function () { + this.pendingThumbnailerMap[page.id] = null; + }.bind(this)); + }.bind(this), 2000); +}; - invalidatedIds.push(page.id); +Controller.prototype.invalidateBitmapFilePath = function (page, invalidatedIds) { + if (!invalidatedIds) invalidatedIds = []; + if (invalidatedIds.indexOf(page.id) >= 0) return; - this.doc.pages.forEach(function (p) { + if (page.bitmapCache) { + for (var key in page.bitmapCache) { + var filePath = page.bitmapCache[key]; + try { + fs.unlinkSync(page.bitmapFilePath); + } catch (e) { + } + } + page.bitmapCache = null; + } + + this.scheduleUpdatePageThumbnail(page); + + invalidatedIds.push(page.id); + for (let p of this.doc.pages) { if (p.backgroundPageId == page.id) this.invalidateBitmapFilePath(p, invalidatedIds); - }.bind(this)); + } }; Controller.prototype.updatePageProperties = function (page, name, backgroundColor, backgroundPageId, parentPageId, width, height) { page.name = name; @@ -1420,24 +1535,23 @@ Controller.prototype.printCurrentDocument = function () { window.onbeforeunload = function (event) { + // Due to a change of Chrome 51, returning non-empty strings or true in beforeunload handler now prevents the page to unload var remote = require("electron").remote; - if (remote.app.devEnable) return true; + if (remote.app.devEnable) return; if (Controller.ignoreNextClose) { Controller.ignoreNextClose = false; - return true; + return; } if (Controller._instance.doc) { setTimeout(function () { Controller._instance.confirmAndclose(function () { - Controller.ignoreNextClose = true; + Controller.ignoreNextClose = false; var currentWindow = remote.getCurrentWindow(); currentWindow.close(); }); }, 10); - return false; + return true; } - - return true; }; diff --git a/app/pencil-core/common/externalEditorSupports.js b/app/pencil-core/common/externalEditorSupports.js index c5903f25..5295ecb6 100644 --- a/app/pencil-core/common/externalEditorSupports.js +++ b/app/pencil-core/common/externalEditorSupports.js @@ -13,6 +13,7 @@ ExternalEditorSupports.queue = []; var spawn = require("child_process").spawn; ExternalEditorSupports.handleEditRequest = function (contentProvider, contentReceiver) { var tmpFile = tmp.fileSync({postfix: "." + contentProvider.extension }); + contentProvider.saveTo(tmpFile.name, function () { var executablePath = ExternalEditorSupports.getEditorPath(contentProvider.extension); @@ -38,7 +39,6 @@ ExternalEditorSupports.handleEditRequest = function (contentProvider, contentRec fstat = fs.statSync(tmpFile.name); var lmt = fstat.mtime.getTime(); - console.log("tracker:", lmt); if (lmt > initialLastModifiedTime) { initialLastModifiedTime = lmt; contentReceiver.update(tmpFile.name); @@ -97,7 +97,6 @@ ExternalEditorSupports.editImageData = function (imageData, ext, ownerObject) { update: function (file) { window.setTimeout(function () { var handler = function (updatedImageData) { - console.log("loaded", updatedImageData); thiz.setProperty("imageData", updatedImageData); }; diff --git a/app/pencil-core/common/pencil.js b/app/pencil-core/common/pencil.js index 0deef592..4d51c097 100644 --- a/app/pencil-core/common/pencil.js +++ b/app/pencil-core/common/pencil.js @@ -16,8 +16,8 @@ Pencil.editorClasses = []; Pencil.registerEditor = function (editorClass) { Pencil.editorClasses.push(editorClass); }; - Pencil.sharedEditors = []; + Pencil.registerSharedEditor = function (sharedEditor) { Pencil.sharedEditors.push(sharedEditor); } @@ -81,7 +81,7 @@ Pencil.boot = function (event) { if (Pencil.booted) return; Pencil.app = require('electron').remote.app; - + Pencil.booted = true; Pencil.window = document.documentElement; Pencil.rasterizer = new Rasterizer("image/png"); @@ -177,6 +177,7 @@ Pencil.handleTargetChange = function (event) { Pencil.invalidateSharedEditor = function() { var canvas = Pencil.activeCanvas; var target = canvas ? canvas.currentController : null; + if (!target) { for (var i in Pencil.sharedEditors) { try { diff --git a/app/pencil-core/common/renderer.js b/app/pencil-core/common/renderer.js index 6694581d..58e09b8b 100644 --- a/app/pencil-core/common/renderer.js +++ b/app/pencil-core/common/renderer.js @@ -11,48 +11,95 @@ module.exports = function () { const app = electron.app; const BrowserWindow = electron.BrowserWindow; var QueueHandler = require("./QueueHandler"); + var sharedUtil = require("./shared-util"); var rendererWindow = null; var currentRenderHandler = null; + var fontFaceCSS = ""; - var queueHandler = new QueueHandler(); + var queueHandler = new QueueHandler(100); + + var extraJS = ( + function resolve(prefix) { + return { + p: "http://www.evolus.vn/Namespace/Pencil", + svg: "http://www.w3.org/2000/svg" + }[prefix]; + } + ).toString() + "\n" + + ( + function getList(xpath, node) { + var doc = node.ownerDocument ? node.ownerDocument : node; + var xpathResult = doc.evaluate(xpath, node, resolve, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); + var nodes = []; + var next = xpathResult.iterateNext(); + while (next) { + nodes.push(next); + next = xpathResult.iterateNext(); + } + + return nodes; + } + + ).toString() + "\n" + + ( + function postProcess() { + var objects = getList("//svg:g[@p:RelatedPage]", document); + objects.reverse(); + window.objectsWithLinking = []; + + for (var g of objects) { + var dx = 0; //rect.left; + var dy = 0; //rect.top; + + rect = g.getBoundingClientRect(); + var linkingInfo = { + pageId: g.getAttributeNS("http://www.evolus.vn/Namespace/Pencil", "RelatedPage"), + geo: { + x: rect.left - dx, + y: rect.top - dy, + w: rect.width, + h: rect.height + } + }; + if (!linkingInfo.pageId) continue; + + window.objectsWithLinking.push(linkingInfo); + } + + } + ).toString(); function createRenderTask(event, data) { return function(__callback) { //Save the svg - tmp.file({prefix: 'render-', postfix: '.html' }, function (err, path, fd, cleanupCallback) { + tmp.file({prefix: 'render-', postfix: '.xhtml' }, function (err, path, fd, cleanupCallback) { if (err) throw err; var svg = data.svg; //path - svg = '\n' + svg = '\n' + + '\n' + + '\n' + + '\n' + '\n' + '\n' @@ -62,41 +109,22 @@ module.exports = function () { + '\n'; fs.writeFileSync(path, svg, "utf8"); - console.log(svg); - - console.log("SAVED to: ", path); + rendererWindow.setSize(Math.round(data.width), Math.round(data.height), false); - rendererWindow.setContentSize(data.width, data.height, false); - rendererWindow.loadURL("file://" + path); + var url = "file://" + path; + rendererWindow.loadURL(url); var capturePendingTaskId = null; - currentRenderHandler = function (renderedEvent) { + currentRenderHandler = function (renderedEvent, renderedData) { capturePendingTaskId = null; rendererWindow.capturePage(function (nativeImage) { var dataURL = nativeImage.toDataURL(); - console.log("CAPTURED", dataURL.length); cleanupCallback(); currentRenderHandler = null; - - if (data.scale != 1) { - console.log("Got initial data, new request for scaling to " + data.scale); - ipcMain.once("render-scaled", function (scaledEvent, renderedData) { - console.log("Got scale response, size: " + renderedData.url.length); - event.sender.send("render-response", renderedData.url); - __callback(); - }); - renderedEvent.sender.send("render-scale", { - url: dataURL, - width: data.width, - height: data.height, - scale: data.scale - }); - } else { - event.sender.send("render-response", dataURL); - __callback(); - } + event.sender.send(data.id, {url: dataURL, objectsWithLinking: renderedData.objectsWithLinking}); + __callback(); }); }; @@ -106,28 +134,25 @@ module.exports = function () { function init() { - rendererWindow = new BrowserWindow({x: 0, y: 0, enableLargerThanScreen: true, show: false, frame: false, autoHideMenuBar: true, webPreferences: {webSecurity: false, defaultEncoding: "UTF-8"}}); - rendererWindow.webContents.openDevTools(); - // rendererWindow.webContents.on("did-finish-load", function () { - // // if (currentRenderHandler) currentRenderHandler(); - // }); - - - - // rendererWindow.webContents.beginFrameSubscription(function (frameBuffer) { - // console.log("Got frameBuffer at: " + new Date().getTime() + ", frameBuffer: " + frameBuffer.length); - // if (capturePendingTaskId) clearTimeout(capturePendingTaskId); - // capturePendingTaskId = setTimeout(currentRenderHandler, 500); - // }); + rendererWindow = new BrowserWindow({x: 0, y: 0, useContentSize: true, enableLargerThanScreen: true, show: false, frame: false, autoHideMenuBar: true, transparent: true, webPreferences: {webSecurity: false, defaultEncoding: "UTF-8"}}); + // rendererWindow.webContents.openDevTools(); ipcMain.on("render-request", function (event, data) { queueHandler.submit(createRenderTask(event, data)); }); ipcMain.on("render-rendered", function (event, data) { - if (currentRenderHandler) currentRenderHandler(event); + setTimeout(function () { + if (currentRenderHandler) currentRenderHandler(event, data); + }, 100); }); + ipcMain.on("font-loading-request", function (event, data) { + fontFaceCSS = sharedUtil.buildFontFaceCSS(data.faces); + event.sender.send(data.id, {}); + }); + + console.log("RENDERER started."); } function initOutProcessCanvasBasedRenderer() { diff --git a/app/pencil-core/common/shared-util.js b/app/pencil-core/common/shared-util.js index 77485e9c..3e8864a3 100644 --- a/app/pencil-core/common/shared-util.js +++ b/app/pencil-core/common/shared-util.js @@ -2,17 +2,28 @@ module.exports = function () { const path = require("path"); const fs = require("fs"); + const MIME_MAP = { + ".ttf": "application/x-font-ttf", + ".wotf": "application/x-font-woff", + ".wotf2": "application/x-font-woff2" + }; + const FORMAT_MAP = { + ".ttf": "truetype", + ".wotf": "woff", + ".wotf2": "woff2" + }; + + function filePathToURL(filePath, options) { + filePath = path.resolve(filePath).replace(/\\/g, "/"); + + if (!filePath.match(/^\/.+$/)) { + filePath = "/" + filePath; + } + + return "file://" + encodeURI(filePath); + }; + function buildEmbeddedFontFaceCSS(faces, callback) { - const MIME_MAP = { - ".ttf": "application/x-font-ttf", - ".wotf": "application/x-font-woff", - ".wotf2": "application/x-font-woff2" - }; - const FORMAT_MAP = { - ".ttf": "truetype", - ".wotf": "woff", - ".wotf2": "woff2" - }; //creating combinedCSS var combinedCSS = ""; if (!faces) { @@ -40,8 +51,6 @@ module.exports = function () { var format = FORMAT_MAP[ext]; if (!format) format = "truetype"; - console.log("mime and format", [mime, format]); - var url = "data:" + mime + ";base64," + new Buffer(bytes).toString("base64"); combinedCSS += "@font-face {\n" @@ -57,9 +66,32 @@ module.exports = function () { next(); }; + function buildFontFaceCSS(faces) { + if (!faces) return ""; + + var combinedCSS = ""; + for (var installedFace of faces) { + var ext = path.extname(installedFace.filePath).toLowerCase(); + var format = FORMAT_MAP[ext]; + if (!format) format = "truetype"; + + var url = filePathToURL(installedFace.filePath); + + combinedCSS += "@font-face {\n" + + " font-family: '" + installedFace.name + "';\n" + + " src: url('" + url + "') format('" + format + "');\n" + + " font-weight: " + installedFace.weight + ";\n" + + " font-style: " + installedFace.style + ";\n" + + "}\n"; + } + + return combinedCSS; + }; return { - buildEmbeddedFontFaceCSS: buildEmbeddedFontFaceCSS + buildEmbeddedFontFaceCSS: buildEmbeddedFontFaceCSS, + buildFontFaceCSS: buildFontFaceCSS, + filePathToURL: filePathToURL } }(); diff --git a/app/pencil-core/common/svgRasterizer.js b/app/pencil-core/common/svgRasterizer.js index 6e234e01..8b04ad3e 100644 --- a/app/pencil-core/common/svgRasterizer.js +++ b/app/pencil-core/common/svgRasterizer.js @@ -23,13 +23,25 @@ Rasterizer.ipcBasedBackend = { init: function () { ipcRenderer.send("render-init", {}); }, - rasterize: function (svgNode, width, height, scale, callback) { - ipcRenderer.once("render-response", function (event, data) { - callback(data); + rasterize: function (svgNode, width, height, scale, callback, parseLinks) { + var id = Util.newUUID(); + + ipcRenderer.once(id, function (event, data) { + callback(parseLinks ? data : data.url); }); + w = width * scale; + h = height * scale; + + if (scale != 1) { + svgNode.setAttribute("width", w + "px"); + svgNode.setAttribute("height", h + "px"); + + svgNode.setAttribute("viewBox", "0 0 " + width + " " + height); + } + var xml = Controller.serializer.serializeToString(svgNode); - ipcRenderer.send("render-request", {svg: xml, width: width, height: height, scale: scale}); + ipcRenderer.send("render-request", {svg: xml, width: w, height: h, scale: 1, id: id, processLinks: parseLinks}); } }; Rasterizer.outProcessCanvasBasedBackend = { @@ -136,7 +148,8 @@ Rasterizer.inProcessCanvasBasedBackend = { Rasterizer.prototype.getBackend = function () { //TODO: options or condition? - return Rasterizer.outProcessCanvasBasedBackend; + return Rasterizer.ipcBasedBackend; + // return Rasterizer.outProcessCanvasBasedBackend; }; Rasterizer.prototype.rasterizeSVGNodeToUrl = function (svg, callback, scale) { var s = (typeof (scale) == "undefined") ? 1 : scale; @@ -148,11 +161,12 @@ Rasterizer.prototype.rasterizePageToUrl = function (page, callback, scale, parse var thiz = this; var s = (typeof (scale) == "undefined") ? 1 : scale; var f = function () { + svg.setAttribute("page", page.name); thiz.getBackend().rasterize(svg, page.width, page.height, s, callback, parseLinks); }; if (page.backgroundPage) { - thiz.getPageBitmapFile(page.backgroundPage, function (filePath) { + thiz.getPageBitmapFileWithScale(page.backgroundPage, scale, null, function (filePath) { var image = svg.ownerDocument.createElementNS(PencilNamespaces.svg, "image"); image.setAttribute("x", "0"); image.setAttribute("y", "0"); @@ -188,16 +202,38 @@ Rasterizer.prototype.rasterizePageToUrl = function (page, callback, scale, parse } }; Rasterizer.prototype.getPageBitmapFile = function (page, callback) { - if (page.bitmapFilePath) { - callback(page.bitmapFilePath); + this.getPageBitmapFileWithScale(page, 1, null, callback); +}; +Rasterizer.prototype.getPageBitmapFileWithScale = function (page, scale, configuredFilePath, callback) { + var key = "@" + scale; + if (page.bitmapCache && page.bitmapCache[key]) { + var existingFilePath = page.bitmapCache[key]; + if (configuredFilePath && configuredFilePath != existingFilePath) { + copyFileSync(existingFilePath, configuredFilePath); + existingFilePath = configuredFilePath; + } + + callback(existingFilePath); } else { - var filePath = tmp.fileSync({ postfix: ".png" }).name; + var filePath = configuredFilePath || tmp.fileSync({ postfix: ".png" }).name; this.rasterizePageToFile(page, filePath, function (filePath) { - page.bitmapFilePath = filePath; + if (!page.bitmapCache) page.bitmapCache = {}; + page.bitmapCache[key] = filePath; callback(filePath); - }, 1); + }, scale); } }; + + +Rasterizer.prototype.postBitmapGeneratingTask = function (page, scale, configuredFilePath, callback) { + if (!this.generatingTaskQueue) this.generatingTaskQueue = new QueueHandler(100); + this.generatingTaskQueue.submit(function (__callback) { + this.getPageBitmapFileWithScale(page, scale, configuredFilePath, function (filePath) { + if (callback) callback(filePath); + __callback(); + }) + }.bind(this)); +}; Rasterizer.prototype.rasterizePageToFile = function (page, filePath, callback, scale, parseLinks) { this.rasterizePageToUrl(page, function (data) { var dataURI = parseLinks ? data.url : data; diff --git a/app/pencil-core/common/util.js b/app/pencil-core/common/util.js index a4832bd6..714dda76 100644 --- a/app/pencil-core/common/util.js +++ b/app/pencil-core/common/util.js @@ -988,8 +988,8 @@ Svg.getWidth = function (dom) { } return parseFloat(width); } catch (e) { - debug(new XMLSerializer().serializeToString(dom)); - Console.dumpError(e); + console.debug(new XMLSerializer().serializeToString(dom)); + console.error(e); } return 0; }; @@ -1188,11 +1188,7 @@ Console.dumpError = function (exception, toConsole) { "Stacktrace:\n\t" + (exception.stack ? exception.stack.replace(/\n/g, "\n\t") : "") ].join("\n"); - if (true) { - debug(s); - } else { - alert(s); - } + console.error(s); }; Console.alertError = function (exception, toConsole) { var s = [ @@ -1202,7 +1198,7 @@ Console.alertError = function (exception, toConsole) { "Stacktrace:\n\t" + (exception.stack ? exception.stack.replace(/\n/g, "\n\t") : "") ].join("\n"); - alert(s); + console.debug(s); }; var Util = {}; diff --git a/app/pencil-core/definition/collectionManager.js b/app/pencil-core/definition/collectionManager.js index 44167e7d..57cdc739 100644 --- a/app/pencil-core/definition/collectionManager.js +++ b/app/pencil-core/definition/collectionManager.js @@ -10,7 +10,7 @@ CollectionManager.addShapeDefCollection = function (collection) { CollectionManager.shapeDefinition.collections.push(collection); collection.visible = CollectionManager.isCollectionVisible(collection); collection.collapsed = CollectionManager.isCollectionCollapsed(collection); - collection.usage = CollectionManager.getCollectionUsage(collection); + //collection.usage = CollectionManager.getCollectionUsage(collection); for (var item in collection.shapeDefs) { var shapeDef = collection.shapeDefs[item]; @@ -164,7 +164,7 @@ CollectionManager.loadStencils = function(showNotification) { if (ApplicationPane._instance) ApplicationPane._instance.busy(); CollectionManager.shapeDefinition.collections = []; - CollectionManager.shapeDefinition.shapeDefMap = { }; + CollectionManager.shapeDefinition.shapeDefMap = {}; console.log("Loading system stencils..."); //load all system stencils @@ -181,14 +181,19 @@ CollectionManager.loadStencils = function(showNotification) { // CollectionManager.addShapeDefCollection(parser.parseURL("stencils/Windows7/Definition.xml")); CollectionManager._loadUserDefinedStencilsIn(Config.getDataFilePath(Config.STENCILS_DIR_NAME)); - CollectionManager.shapeDefinition.collections = CollectionManager.shapeDefinition.collections.sort(function (a, b) { - if (a.usage != b.usage) return a.usage > b.usage ? -1 : (a.usage < b.usage ? 1 : 0); - if (a.id == "Evolus.Common") return -1; - return a.displayName > b.displayName ? 1 : (a.displayName < b.displayName ? -1 : 0); - }); + CollectionManager._loadDeveloperStencil(); + var config = Config.get("Collection.collectionPosition"); + var collectionOrder = config ? (config.split(",") || []) : []; + + CollectionManager.shapeDefinition.collections = CollectionManager.shapeDefinition.collections.sort(function (a, b) { + var indexA = collectionOrder.indexOf(a.id); + var indexB = collectionOrder.indexOf(b.id); + return indexA - indexB; + }); + CollectionManager.reloadCollectionPane(); if (ApplicationPane._instance) ApplicationPane._instance.unbusy(); @@ -332,6 +337,7 @@ CollectionManager.installCollectionFromFile = function (file, callback) { } }) .finally(() => { + CollectionManager.saveCollectionOrder(); ApplicationPane._instance.unbusy(); }); }; @@ -396,16 +402,16 @@ CollectionManager.isCollectionCollapsed = function (collection) { if (collapsed == null) collapsed = false; return collapsed; }; -CollectionManager.setCollectionUsage = function (collection, value) { - collection.usage = value; - Config.set("Collection." + collection.id + ".usage", value); -}; -CollectionManager.getCollectionUsage = function (collection) { - collection.usage = value; - var value = Config.get("Collection." + collection.id + ".usage"); - if (value) return parseInt(value, 10); - return 0; -}; +// CollectionManager.setCollectionUsage = function (collection, value) { +// collection.usage = value; +// Config.set("Collection." + collection.id + ".usage", value); +// }; +// CollectionManager.getCollectionUsage = function (collection) { +// collection.usage = value; +// var value = Config.get("Collection." + collection.id + ".usage"); +// if (value) return parseInt(value, 10); +// return 0; +// }; CollectionManager.setLastUsedCollection = function (collection) { Config.set("Collection.lastUsedCollection.id", collection.id); }; @@ -434,7 +440,7 @@ CollectionManager.uninstallCollection = function (collection, callback) { if (!err) { CollectionManager.loadStencils(); } - + CollectionManager.saveCollectionOrder(); callback(err); }); }; @@ -462,6 +468,28 @@ CollectionManager.selectDeveloperStencilDir = function () { }; CollectionManager.unselectDeveloperStencilDir = function () { Config.set("dev.stencil.path", "none"); - CollectionManager.loadStencils(); + CollectionManager.reloadDeveloperStencil(); + CollectionManager.saveCollectionOrder(); NotificationPopup.show("Developer stencil is unloaded."); }; + +CollectionManager.reorderCollections = function(collectionId, targetCollectionId) { + var collections = CollectionManager.shapeDefinition.collections; + + var collection = CollectionManager.findCollection(collectionId); + var targetCollection = CollectionManager.findCollection(targetCollectionId); + var index = collections.indexOf(collection); + collections.splice(index, 1); + index = collections.indexOf(targetCollection); + collections.splice(index, 0, collection); + + CollectionManager.saveCollectionOrder(); +} + +CollectionManager.saveCollectionOrder = function () { + var positionString = ""; + for (var i = 0; i < CollectionManager.shapeDefinition.collections.length; i++) { + positionString += CollectionManager.shapeDefinition.collections[i].id + ","; + } + Config.set("Collection.collectionPosition", positionString); +} diff --git a/app/pencil-core/editor/handleEditor.js b/app/pencil-core/editor/handleEditor.js index aad6a096..2a2a4c21 100644 --- a/app/pencil-core/editor/handleEditor.js +++ b/app/pencil-core/editor/handleEditor.js @@ -12,7 +12,7 @@ HandleEditor.prototype.install = function (canvas) { this.svgElement.style.visibility = "hidden"; canvas.installControlSVGElement(this.svgElement); - + this.focusedHandleName = null; @@ -71,7 +71,7 @@ HandleEditor.prototype.nextTool = function () { HandleEditor.prototype.dettach = function () { if (!this.targetObject) return; - + //this.focusedHandleName = null; this.targetObject = null; @@ -94,7 +94,7 @@ HandleEditor.prototype.findHandle = function (element) { HandleEditor.prototype.handleMouseDown = function (event) { this.lastMatchedOutlet = null; this.currentHandle = this.findHandle(event.originalTarget); - + if (!event.fake) { this.focusedHandleName = (this.currentHandle == null ? null : this.currentHandle._def.name); this.invalidateFocusedHandle(); @@ -105,7 +105,7 @@ HandleEditor.prototype.handleMouseDown = function (event) { //finding matching outlet if (this.currentHandle) { - + var def = this.currentHandle._def; if (def.meta && def.meta.connectTo) { var classes = def.meta.connectTo; @@ -134,7 +134,7 @@ HandleEditor.prototype.handleMouseUp = function (event) { h.meta.viax = this.lastMatchedOutlet._via.x; h.meta.viay = this.lastMatchedOutlet._via.y; } - + this.targetObject.setProperty(this.currentHandle._def.name, h); } else { if (this.currentHandle._def.meta @@ -156,7 +156,7 @@ HandleEditor.prototype.handleMouseUp = function (event) { }; HandleEditor.prototype.handleKeyPressEvent = function (event) { if (!this.focusedHandleName) return false; - + var thiz = this; var focusedHandle = null; Dom.workOn("./svg:rect[@p:name='Handle']", this.svgElement, function (handle) { @@ -164,10 +164,10 @@ HandleEditor.prototype.handleKeyPressEvent = function (event) { focusedHandle = handle; } }); - + if (!focusedHandle) return; - + var fakeEvent = { preventDefault: function() { event.preventDefault(); @@ -177,33 +177,33 @@ HandleEditor.prototype.handleKeyPressEvent = function (event) { clientX: 0, clientY: 0 }; - + this.handleMouseDown(fakeEvent); - + var gridSize = Pencil.getGridSize().w; var d = event.ctrlKey ? gridSize : (event.shiftKey ? gridSize * 4 : 1); - - if (event.keyCode == event.DOM_VK_UP) { + + if (event.keyCode == DOM_VK_UP) { fakeEvent.clientY -= d; - } else if (event.keyCode == event.DOM_VK_DOWN) { + } else if (event.keyCode == DOM_VK_DOWN) { fakeEvent.clientY += d; - } else if (event.keyCode == event.DOM_VK_LEFT) { + } else if (event.keyCode == DOM_VK_LEFT) { fakeEvent.clientX -= d; - } else if (event.keyCode == event.DOM_VK_RIGHT) { + } else if (event.keyCode == DOM_VK_RIGHT) { fakeEvent.clientX += d; } else { return false; } - + this.handleMouseMove(fakeEvent); this.handleMouseUp(fakeEvent); - + return true; }; HandleEditor.prototype.handleMouseMove = function (event) { if (!this.currentHandle) return; event.preventDefault(); - + if (this.targetObject.dockingManager) { this.targetObject.dockingManager.altKey = event.altKey; } @@ -212,7 +212,7 @@ HandleEditor.prototype.handleMouseMove = function (event) { }; HandleEditor.prototype.handleMoveTo = function (x, y, event) { var handle = this.currentHandle; - + var uPoint1 = Svg.vectorInCTM(new Point(this.oX, this.oY), this.geo.ctm); var uPoint2 = Svg.vectorInCTM(new Point(x, y), this.geo.ctm); @@ -258,7 +258,7 @@ HandleEditor.prototype.handleMoveTo = function (x, y, event) { handle._newX = newX; handle._newY = newY; - + Svg.setX(handle, handle._newX); Svg.setY(handle, handle._newY); @@ -274,10 +274,10 @@ HandleEditor.prototype.handleMoveTo = function (x, y, event) { Math.abs(y - outlet.y) < delta) { this.lastMatchedOutlet = outlet; handle.setAttributeNS(PencilNamespaces.p, "p:connected", "true"); - + Svg.setX(handle, outlet.x * this.canvas.zoom); Svg.setY(handle, outlet.y * this.canvas.zoom); - + debug("Found matching outlet: " + outlet.id); found = true; break; @@ -373,7 +373,7 @@ HandleEditor.prototype.setupHandles = function () { this.createHandle(def.propertyMap[name], value); } - + this.invalidateFocusedHandle(); }; diff --git a/app/pencil-core/editor/sharedFontEditor.js b/app/pencil-core/editor/sharedFontEditor.js index 7a6f8bd9..6c6eda7b 100644 --- a/app/pencil-core/editor/sharedFontEditor.js +++ b/app/pencil-core/editor/sharedFontEditor.js @@ -14,13 +14,13 @@ SharedFontEditor.prototype.setup = function () { this.strikeButton = document.getElementById("edStrikeButton");*/ var thiz = this; - this.fontList.addEventListener("command", function(event) { + this.fontList.addEventListener("change", function(event) { if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; thiz.font.family = thiz.fontList.value; thiz._applyValue(); }, false); - this.pixelFontSize.addEventListener("command", function(event) { + this.pixelFontSize.addEventListener("input", function(event) { if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; thiz.font.size = thiz.pixelFontSize.value + "px"; thiz._applyValue(); @@ -33,29 +33,17 @@ SharedFontEditor.prototype.setup = function () { } }, false); - this.boldButton.addEventListener("command", function(event) { + this.boldButton.addEventListener("click", function(event) { if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; thiz.font.weight = thiz.boldButton.checked ? "bold" : "normal"; thiz._applyValue(); }, false); - this.italicButton.addEventListener("command", function(event) { + this.italicButton.addEventListener("click", function(event) { if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; thiz.font.style = thiz.italicButton.checked ? "italic" : "normal"; thiz._applyValue(); }, false); - - /*this.underlineButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.decor = thiz.underlineButton.checked ? "underline" : "none"; - thiz._applyValue(); - }, false); - - this.strikeButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.strike = thiz.strikeButton.checked ? "strikethrough" : "none"; - thiz._applyValue(); - }, false);*/ }; SharedFontEditor.prototype._applyValue = function () { var thiz = this; diff --git a/app/pencil-core/propertyType/imageData.js b/app/pencil-core/propertyType/imageData.js index f78c77c0..0654669d 100644 --- a/app/pencil-core/propertyType/imageData.js +++ b/app/pencil-core/propertyType/imageData.js @@ -15,6 +15,35 @@ ImageData.fromString = function (literal) { return new ImageData(literal); }; +ImageData.invalidateValue = function (oldData, callback) { + if (oldData.data.match(/^data:/)) { + var image = null; + try { + image = nativeImage.createFromDataURL(oldData.data); + } catch (e) { + } + + if (!image) { + callback(null); + return; + } + + let id = Pencil.controller.nativeImageToRefSync(image); + callback(new ImageData(oldData.w, oldData.h, ImageData.idToRefString(id)), null); + + } else if (!oldData.data.match(/^ref:\/\//)) { + Pencil.controller.copyAsRef(oldData.data, function (id, error) { + if (id) { + callback(new ImageData(oldData.w, oldData.h, ImageData.idToRefString(id)), null); + } else { + callback(null, error); + } + }); + } else { + callback(null); + } +}; + ImageData.filePathToURL = function (filePath, options) { filePath = path.resolve(filePath).replace(/\\/g, "/"); @@ -43,7 +72,7 @@ ImageData.prompt = function (callback) { title: "Select Image", defaultPath: os.homedir(), filters: [ - { name: "Stencil files", extensions: ["png", "jpg", "jpeg", "gif", "bmp", "svg"] } + { name: "Image files", extensions: ["png", "jpg", "jpeg", "gif", "bmp", "svg"] } ] }, function (filenames) { @@ -63,7 +92,6 @@ ImageData.fromExternalToImageData = function (filePath, callback) { image.src = url; }); }; - ImageData.fromUrl = function (url, callback) { ImageData.win.document.body.innerHTML = ""; var image = ImageData.win.document.createElementNS(PencilNamespaces.html, "img"); diff --git a/app/pencil-core/target/group.js b/app/pencil-core/target/group.js index a64acdae..f7c5f080 100644 --- a/app/pencil-core/target/group.js +++ b/app/pencil-core/target/group.js @@ -195,6 +195,11 @@ Group.prototype.scaleTo = function (nw, nh, group) { var policy = Group.getSizingPolicy(target); var bounding = target.getBounding(this.svg); + var egeo = target.getGeometry(); + if (egeo && egeo.dim) { + bounding.width = egeo.dim.w; + bounding.height = egeo.dim.h; + } var hLayout = Group.calculateLayout(ei.x0, ei.w0, gi.gw0, policy.xPolicy, policy.wPolicy, nw, bounding.width); var vLayout = Group.calculateLayout(ei.y0, ei.h0, gi.gh0, policy.yPolicy, policy.hPolicy, nh, bounding.height); diff --git a/app/pencil-core/target/shape.js b/app/pencil-core/target/shape.js index 5f256614..8a70d0d5 100644 --- a/app/pencil-core/target/shape.js +++ b/app/pencil-core/target/shape.js @@ -295,8 +295,12 @@ Shape.prototype.storeProperty = function (name, value) { propNode = this.metaNode.ownerDocument.createElementNS(PencilNamespaces.p, "p:property"); propNode.setAttribute("name", name); this.metaNode.appendChild(propNode); - } else Dom.empty(propNode); + } + Shape.storePropertyToNode(name, value, propNode); +}; +Shape.storePropertyToNode = function (name, value, propNode) { + Dom.empty(propNode); var attrs = propNode.attributes; for (var i = attrs.length - 1; i >= 0; i --) { if (attrs[i].namespaceURI == PencilNamespaces.p) { diff --git a/app/stencils/CommonShapes_Flowchart/Definition.xml b/app/stencils/CommonShapes_Flowchart/Definition.xml index 2751f609..5dfe9de3 100644 --- a/app/stencils/CommonShapes_Flowchart/Definition.xml +++ b/app/stencils/CommonShapes_Flowchart/Definition.xml @@ -1,311 +1,273 @@ - + + - #336699ff + #BDDFFFFF - #000000FF - 2| + #666666ff + 2| - Helvetica|normal|normal|12px - #ffffffff + Helvetica|normal|normal|12px + #000000ff - - - - - - - - - - - - + - - + + $$defaultTextFont + $$defaultTextColor + $$strokeColor + $$strokeStyle + straight + false + true + + + $$defaultTextFont + $$defaultTextColor + $$strokeColor + $$strokeStyle + multi-straight + false + true + + + $$defaultTextFont + $$defaultTextColor + $$strokeColor + $$strokeStyle + curvy + false + true + + - - 100,80 - 20,0 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + + #00000033 - [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] - $strokeColor - $strokeStyle $fillColor - - [M(0, $box.h / 2), L($box.w / 6, 0), L(5 * $box.w / 6, 0), - C(5 * $box.w / 6 + $box.w / 6 / 2, 0, $box.w, $box.h / 4, $box.w, $box.h / 2), - S(5 * $box.w / 6 + $box.w / 6 / 2, $box.h, 5 * $box.w / 6, $box.h), - L($box.w / 6, $box.h), z] - - - - $textContent - $textFont - $textColor - $textColor - - Bound.fromBox($box, $textPadding.x) - $textAlign - - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + +
- - + - 100,100 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 - - [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle - - var ay = $box.h / 3; - [M(0, ay/2), L(0, $box.h - ay/2), C(0, $box.h - ay/4, $box.w/4, $box.h, $box.w/2, $box.h), - S($box.w, $box.h - ay/4, $box.w, $box.h - ay/2), L($box.w, ay/2), - C($box.w, 3*ay/4, 3*$box.w/4, ay, $box.w/2, ay), S(0, 3*ay/4, 0, ay/2), - C(0, ay/4, $box.w/4, 0, $box.w/2, 0), S($box.w, ay/4, $box.w, ay/2) - ] - - - - [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - - var ay = $box.h / 3; - [M(0, ay/2), L(0, $box.h - ay/2), C(0, $box.h - ay/4, $box.w/4, $box.h, $box.w/2, $box.h), - S($box.w, $box.h - ay/4, $box.w, $box.h - ay/2), L($box.w, ay/2), - C($box.w, ay/4, 3*$box.w/4, 0, $box.w/2, 0), S(0, ay/4, 0, ay/2), z] - + Bound.fromBox($box) - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound(0, $box.h/3, $box.w, $box.h * 2 / 3) - $textAlign + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + new Alignment(1,1) + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - - -
- Balloon message -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -313,63 +275,125 @@ [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle - - var ay = $box.w / 3; - [M($box.w - ay/2, $box.h), L(ay/2, $box.h), C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), - S(ay/4, 0, ay/2, 0), L($box.w - ay/2, 0), - C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), - C($box.w - 3*ay/4, $box.h, $box.w - ay, 3*$box.h/4, $box.w - ay, $box.h/2), S($box.w - 3*ay/4, 0, $box.w - ay/2, 0) - ] - - - - [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - - var ay = $box.w / 3; - [M(ay/2, 0), L($box.w - ay/2, 0), C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), - S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), L(ay/2, $box.h), - C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) - ] - + Bound.fromBox($box) + + "rx" + Math.min($box.w/8, $box.h/8) + + + "ry" + Math.min($box.w/8, $box.h/8) + + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound($box.w / 6, 0, $box.w / 2, $box.h) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - - -
- Balloon message -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 + + + + + + + + $$defaultTextFont + + + $$strokeColor + @@ -379,45 +403,199 @@ $strokeStyle $fillColor - [M(5*$box.w/6, 5*$box.h/6), A($box.w / 2, $box.h / 2, 1, 1, 0, $box.w/2, $box.h), L($box.w, $box.h), - L($box.w, 5*$box.h/6), L(5*$box.w/6, 5*$box.h/6), z] + [M($box.w/2, 0), L($box.w, $box.h/2), L($box.w/2, $box.h), L(0, $box.h/2), z] + + + + $optionText1 + $optionTextFont + $optionTextColor + + new Bound($box.w / 2 + 4, -4, 1, 1) + new Alignment(0,2) + + $outputPin1.isConnected() + + + + //depends $optionText1 $optionTextFont $outputPin1 + var size = F.textSize("text1"); + size.w += 8; + size.h += 8; + + new Bound($box.w / 2, 0 - size.h, size.w, size.h); + + + + + $optionText2 + $optionTextFont + $optionTextColor + + new Bound($box.w + 4, $box.h / 2 - 4, 1, 1) + new Alignment(0,2) + + $outputPin2.isConnected() + + + + //depends $optionText2 $optionTextFont $outputPin2 + var size = F.textSize("text2"); + size.w += 8; + size.h += 8; + + new Bound($box.w, $box.h / 2 - size.h, size.w, size.h); + + + + + $optionText3 + $optionTextFont + $optionTextColor + + new Bound($box.w / 2 + 4, $box.h + 4, 1, 1) + new Alignment(0,0) + + $outputPin3.isConnected() + + + + //depends $optionText3 $optionTextFont $outputPin3 + var size = F.textSize("text3"); + size.w += 8; + size.h += 8; + + new Bound($box.w / 2, $box.h, size.w, size.h); + + + + + $optionText4 + $optionTextFont + $optionTextColor + + new Bound(-4, $box.h / 2 - 4, 1, 1) + new Alignment(2,2) + + $outputPin4.isConnected() + + + + //depends $optionText4 $optionTextFont $outputPin4 + var size = F.textSize("text4"); + size.w += 8; + size.h += 8; + + new Bound(0 - size.w, $box.h / 2 - size.h, size.w, size.h); + + + + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, 10) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -427,45 +605,108 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w/2, 0), C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), - S(3*$box.w/4, $box.h, $box.w/2, $box.h), L(0, $box.h), z] + var ay = $box.w / 3; + [M(ay/2, 0), L($box.w - ay/2, 0), C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), + S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), L(ay/2, $box.h), + C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) + ] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, 10) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -475,48 +716,90 @@ $strokeStyle $fillColor - var ay = $box.w / 3; - [M(ay/2, 0), L($box.w - ay/2, 0), C($box.w - 3*ay/4, 0, $box.w - ay, $box.h/4, $box.w - ay, $box.h/2), - S($box.w - 3*ay/4, $box.h, $box.w - ay/2, $box.h), L(ay/2, $box.h), - C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) - ] + [M(0, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), L(0, 0), M($box.w/8, 0), L($box.w/8, $box.h), M(7*$box.w/8, 0), L(7*$box.w/8, $box.h)] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound($box.w / 6, 0, $box.w / 2, $box.h) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -526,44 +809,104 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w, 0), L($box.w/2, $box.h), z] + [M(0, 0), L($box.w, 0), L($box.w, 4*$box.h/5), C(3*$box.w/4, 4*$box.h/5, 3*$box.w/4, 4*$box.h/5, $box.w/2, 9*$box.h/10), S($box.w/4, $box.h, 0, 9*$box.h/10), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound($box.w / 4, 0, $box.w / 2, $box.h / 2) - new Alignment(1,1) + Bound.fromBox({x: 0, y: 0, w: $box.w, h: 4 * $box.h / 5}, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -573,43 +916,106 @@ $strokeStyle $fillColor - [M($box.w/2, 0), L($box.w, $box.h), L(0, $box.h), z] + [M(0, $box.h/5), L(4*$box.w/5, $box.h/5), L(4*$box.w/5, 4*$box.h/5), C(3*$box.w/4, 4*$box.h/5, 3*$box.w/4, 4*$box.h/5, $box.w/2, 9*$box.h/10), S($box.w/4, $box.h, 0, 9*$box.h/10), L(0, $box.h/5), + M($box.w/10, $box.h/5), L($box.w/10, $box.h/10), L(9*$box.w/10, $box.h/10), L(9*$box.w/10, 7*$box.h/10), L(4*$box.w/5, 7*$box.h/10), + M($box.w/5, $box.h/10), L($box.w/5, 0), L($box.w, 0), L($box.w, 6*$box.h/10), L(9*$box.w/10, 6*$box.h/10)] + - $textContent $textFont $textColor - - new Bound($box.w / 4, $box.h / 2, $box.w / 2, $box.h / 2) - new Alignment(1,1) - + + $textContent + new Bound(0, $box.h / 5, 4 * $box.w / 5, 3 * $box.h / 5).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -619,43 +1025,103 @@ $strokeStyle $fillColor - [M($box.w/2, 0), L($box.w, $box.h/2), L($box.w/2, $box.h), L(0, $box.h/2), z] + [M(0, $box.h/5), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), z] + - $textContent $textFont $textColor - - new Bound($box.w / 4, $box.h / 4, $box.w / 2, $box.h / 2) - new Alignment(1,1) - + + $textContent + new Bound(0, $box.h / 5, $box.w, 4 * $box.h / 5).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -665,43 +1131,105 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w, $box.h), L(0, $box.h), L($box.w, 0), z] + [M(0, $box.h/2), L($box.w/5, 0), L(4*$box.w/5, 0), L($box.w, $box.h/2), L(4*$box.w/5, $box.h), L($box.w/5, $box.h), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound($box.w / 4, 0, $box.w / 2, $box.h) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -709,141 +1237,329 @@ [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle - - [ - M($box.w/2, 0), - C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), - C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), - L($box.w/2, $box.h), M(0, $box.h/2), L($box.w, $box.h/2) - ] - - - - [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - [ - M($box.w/2, 0), - C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), - C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), z - ] + [M($box.w/5, 0), L($box.w, 0), L(4*$box.w/5, $box.h), L(0, $box.h), z] + - $textContent $textFont $textColor - - Bound.fromBox($box, $box.w / 5, 1) - new Alignment(1,1) - + + $textContent + new Bound($box.w / 5, 0, 3 * $box.w / 5, $box.h).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 + - + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle - [ - M($box.w/2, 0 - $strokeStyle.w / 2), - C(3*$box.w/4 + $strokeStyle.w / 3, 0 - $strokeStyle.w / 2, $box.w + $strokeStyle.w / 2, $box.h/4, - $box.w + $strokeStyle.w / 2, $box.h/2), S(3*$box.w/4 + $strokeStyle.w / 3, $box.h + $strokeStyle.w / 2, - $box.w/2, $box.h + $strokeStyle.w / 2), - C($box.w/4 - $strokeStyle.w / 3, $box.h + $strokeStyle.w / 2, 0 - $strokeStyle.w / 2, 3*$box.h/4, - 0 - $strokeStyle.w / 2, $box.h/2), - S($box.w/4 - $strokeStyle.w / 3, 0 - $strokeStyle.w / 2, $box.w/2, 0 - $strokeStyle.w / 2) + var ay = $box.h / 3; + [M(0, ay/2), L(0, $box.h - ay/2), C(0, $box.h - ay/4, $box.w/4, $box.h, $box.w/2, $box.h), + S($box.w, $box.h - ay/4, $box.w, $box.h - ay/2), L($box.w, ay/2), + C($box.w, 3*ay/4, 3*$box.w/4, ay, $box.w/2, ay), S(0, 3*ay/4, 0, ay/2), + C(0, ay/4, $box.w/4, 0, $box.w/2, 0), S($box.w, ay/4, $box.w, ay/2) ] + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] + $fillColor + + var ay = $box.h / 3; + [M(0, ay/2), L(0, $box.h - ay/2), C(0, $box.h - ay/4, $box.w/4, $box.h, $box.w/2, $box.h), + S($box.w, $box.h - ay/4, $box.w, $box.h - ay/2), L($box.w, ay/2), + C($box.w, ay/4, 3*$box.w/4, 0, $box.w/2, 0), S(0, ay/4, 0, ay/2), z] + + + + + $textFont + $textColor + + $textContent + new Bound(0, $box.h / 3, $box.w, 2 * $box.h / 3).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + + + + + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 + + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle - [ - M($box.w/2, 0), - C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), - C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), - M(0, 0), L($box.w, $box.h), M($box.w, 0), L(0, $box.h)] + var ay = $box.w / 3; + [M($box.w - ay/2, $box.h), L(ay/2, $box.h), C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), + S(ay/4, 0, ay/2, 0), L($box.w - ay/2, 0), + C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), + C($box.w - 3*ay/4, $box.h, $box.w - ay, 3*$box.h/4, $box.w - ay, $box.h/2), S($box.w - 3*ay/4, 0, $box.w - ay/2, 0) + ] [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - [ - M($box.w/2, 0), - C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), - C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), z + var ay = $box.w / 3; + [M(ay/2, 0), L($box.w - ay/2, 0), C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), + S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), L(ay/2, $box.h), + C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) ] + - $textContent $textFont $textColor - - Bound.fromBox($box, $box.w / 5, 1) - new Alignment(1,1) - + + $textContent + new Bound(0, 0, 2 * $box.w / 3, $box.h).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - - - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -853,44 +1569,119 @@ $strokeStyle $fillColor - [M(0, $box.h/10), C(0, $box.h/5, $box.w/2, $box.h/5, $box.w/2, $box.h/10), S($box.w, 0, $box.w, $box.h/10), - L($box.w, 9*$box.h/10), C($box.w, 4*$box.h/5, $box.w/2, 4*$box.h/5, $box.w/2, 9*$box.h/10), S(0, $box.h, 0, 9*$box.h/10), z] + var a = 50 * Math.PI / 180; + var x = (Math.cos(a) + 1) * $box.w / 2; + var y = (Math.sin(a) + 1) * $box.h / 2; + + [M(x, y), A($box.w / 2, $box.h / 2, 1, 1, 0, $box.w/2, $box.h), L($box.w, $box.h), + L($box.w, y), L(x, y), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, 1, $box.h / 6) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin5Origin, $outputPin5Origin.translate(collection.VIA_LENGTH, 0)], $outputPin5, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -900,43 +1691,90 @@ $strokeStyle $fillColor - [M(0, $box.h / 5), L($box.w/5, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), z] + [M(0, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), L(0, 0), M($box.w/8, 0), L($box.w/8, $box.h), M(0, $box.h/8), L($box.w, $box.h/8)] + - $textContent $textFont $textColor - - new Bound(0, $box.h/5 , $box.w, $box.h * 4 / 5) - new Alignment(1,1) - + + $textContent + new Bound($box.w / 8, $box.h / 8, 7 * $box.w / 8, 7 * $box.h / 8).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -946,43 +1784,108 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w, 0), L($box.w, 4*$box.h/5), L($box.w/2, $box.h), L(0, 4*$box.h/5), z] + [M(0, $box.h/10), C(0, $box.h/5, $box.w/2, $box.h/5, $box.w/2, $box.h/10), S($box.w, 0, $box.w, $box.h/10), + L($box.w, 9*$box.h/10), C($box.w, 4*$box.h/5, $box.w/2, 4*$box.h/5, $box.w/2, 9*$box.h/10), S(0, $box.h, 0, 9*$box.h/10), z] + - $textContent $textFont $textColor - - new Bound(0, 0 , $box.w, $box.h * 4 / 5) - new Alignment(1,1) - + + $textContent + new Bound(0, $box.h / 5, $box.w, 3 * $box.h / 5).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -991,57 +1894,106 @@ $strokeColor $strokeStyle $fillColor - - "cx" - $box.w/2 - - - "cy" - $box.h/2 - - - "rx" - $box.w/2 - - - "ry" - $box.h/2 - + + [M(0, 0), L($box.w, 0), L(4*$box.w/5, $box.h), L($box.w/5, $box.h), z] + + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, $box.w / 5, 1) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign - - - - -
-
+ + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,80 + 20,0 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1051,43 +2003,107 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w, 0), L(4*$box.w/5, $box.h), L($box.w/5, $box.h), z] + [M(0, $box.h / 2), L($box.w / 6, 0), L(5 * $box.w / 6, 0), + C(5 * $box.w / 6 + $box.w / 6 / 2, 0, $box.w, $box.h / 4, $box.w, $box.h / 2), + S(5 * $box.w / 6 + $box.w / 6 / 2, $box.h, 5 * $box.w / 6, $box.h), + L($box.w / 6, $box.h), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, $box.w / 5, 1) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- - + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1097,43 +2113,106 @@ $strokeStyle $fillColor - [M(0, $box.h/5), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), z] + [M(0, 0), L($box.w/2, 0), C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), + S(3*$box.w/4, $box.h, $box.w/2, $box.h), L(0, $box.h), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound(0, $box.h/5, $box.w, $box.h * 4 / 5) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,100 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1143,43 +2222,108 @@ $strokeStyle $fillColor - [M(0, $box.h/2), L($box.w/5, 0), L(4*$box.w/5, 0), L($box.w, $box.h/2), L(4*$box.w/5, $box.h), L($box.w/5, $box.h), z] + var ay = $box.w / 3; + [M(ay/2, 0), L($box.w, 0), C($box.w - ay/4, 0, $box.w - ay / 2, $box.h/4, $box.w - ay / 2, $box.h/2), + S($box.w - ay/4, $box.h, $box.w, $box.h), L(ay/2, $box.h), + C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) + ] + - $textContent $textFont $textColor - - Bound.fromBox($box, $box.w/ 5, 1) - new Alignment(1,1) - + + $textContent + new Bound(0, 0, 5 * $box.w / 6, $box.h).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,35 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1189,47 +2333,109 @@ $strokeStyle $fillColor - var ay = $box.w / 3; - [M(ay/2, 0), L($box.w - ay/2, 0), C($box.w - ay/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), - S($box.w - ay/4, $box.h, $box.w - ay/2, $box.h), L(ay/2, $box.h), - C(ay/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S(ay/4, 0, ay/2, 0) - ] + [M(0, 0), L($box.w, 0), L($box.w/2, $box.h), z] + - $textContent $textFont $textColor - - Bound.fromBox($box, $box.w/ 6, 1) - new Alignment(1,1) - + + $textContent + new Bound($box.w / 6, 0, 2 * $box.w / 3, 2 * $box.h / 3).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + + + + + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,35 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + 0,50 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1238,42 +2444,117 @@ $strokeColor $strokeStyle $fillColor - Bound.fromBox($box) + + [M($box.w/2, 0), L($box.w, $box.h), L(0, $box.h), z] + + - $textContent $textFont $textColor - - Bound.fromBox($box, 1) - new Alignment(1,1) - + + $textContent + new Bound($box.w / 6, $box.h / 3, 2 * $box.w / 3, 2 * $box.h / 3).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin5Origin, $outputPin5Origin.translate(0, collection.VIA_LENGTH)], $outputPin5, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin6Origin, $outputPin6Origin.translate(0, collection.VIA_LENGTH)], $outputPin6, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + + + + + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1282,50 +2563,105 @@ $strokeColor $strokeStyle $fillColor - Bound.fromBox($box) - - "rx" - Math.min($box.w/8, $box.h/8) - - - "ry" - Math.min($box.w/8, $box.h/8) - + + [M($box.w/2, 0), L($box.w, $box.h/2), L($box.w/2, $box.h), L(0, $box.h/2), z] + + - $textContent $textFont $textColor - - Bound.fromBox($box, $box.w/8, 1) - new Alignment(1,1) - + + $textContent + new Bound($box.w / 5, $box.h / 5, 3 * $box.w / 5, 3 * $box.h / 5).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,70 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1335,43 +2671,106 @@ $strokeStyle $fillColor - [M($box.w/2, 0), L($box.w, $box.h/2), L($box.w/2, $box.h), L(0, $box.h/2), z] + [M(0, 0), L($box.w, $box.h), L(0, $box.h), L($box.w, 0), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, $box.w/6, $box.h/6) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,40 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1380,44 +2779,123 @@ $strokeColor $strokeStyle $fillColor - - [M($box.w/5, 0), L($box.w, 0), L(4*$box.w/5, $box.h), L(0, $box.h), z] - + + "cx" + $box.w/2 + + + "cy" + $box.h/2 + + + "rx" + $box.w/2 + + + "ry" + $box.h/2 + + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, $box.w/5, 1) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,40 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1425,91 +2903,273 @@ [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle + + [ + M($box.w/2, 0), + C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), + C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), + L($box.w/2, $box.h), M(0, $box.h/2), L($box.w, $box.h/2) + ] + + + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - [M(0, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), L(0, 0), M($box.w/8, 0), L($box.w/8, $box.h), M(7*$box.w/8, 0), L(7*$box.w/8, $box.h)] + [ + M($box.w/2, 0), + C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), + C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), z + ] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - Bound.fromBox($box, $box.w/8, 1) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,40 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] + $strokeColor + $strokeStyle + + [ + M($box.w/2, 0 - $strokeStyle.w / 2), + C(3*$box.w/4 + $strokeStyle.w / 3, 0 - $strokeStyle.w / 2, $box.w + $strokeStyle.w / 2, $box.h/4, + $box.w + $strokeStyle.w / 2, $box.h/2), S(3*$box.w/4 + $strokeStyle.w / 3, $box.h + $strokeStyle.w / 2, + $box.w/2, $box.h + $strokeStyle.w / 2), + C($box.w/4 - $strokeStyle.w / 3, $box.h + $strokeStyle.w / 2, 0 - $strokeStyle.w / 2, 3*$box.h/4, + 0 - $strokeStyle.w / 2, $box.h/2), + S($box.w/4 - $strokeStyle.w / 3, 0 - $strokeStyle.w / 2, $box.w/2, 0 - $strokeStyle.w / 2) + ] + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $strokeColor $strokeStyle + + [ + M($box.w/2, 0), + C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), + C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), + M(0, 0), L($box.w, $box.h), M($box.w, 0), L(0, $box.h)] + + + + [translate(($strokeStyle.w % 2) / 2, ($strokeStyle.w % 2) / 2)] $fillColor - [M(0, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), L(0, 0), M($box.w/8, 0), L($box.w/8, $box.h), M(0, $box.h/8), L($box.w, $box.h/8)] + [ + M($box.w/2, 0), + C(3*$box.w/4, 0, $box.w, $box.h/4, $box.w, $box.h/2), S(3*$box.w/4, $box.h, $box.w/2, $box.h), + C($box.w/4, $box.h, 0, 3*$box.h/4, 0, $box.h/2), S($box.w/4, 0, $box.w/2, 0), z + ] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound($box.w/8, $box.h/8, $box.w * 7 / 8, $box.h * 7 / 8) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 100,100 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1519,43 +3179,102 @@ $strokeStyle $fillColor - [M(0, 0), L($box.w, 0), L($box.w, 4*$box.h/5), C(3*$box.w/4, 4*$box.h/5, 3*$box.w/4, 4*$box.h/5, $box.w/2, 9*$box.h/10), S($box.w/4, $box.h, 0, 9*$box.h/10), z] + [M(0, $box.h / 5), L($box.w/5, 0), L($box.w, 0), L($box.w, $box.h), L(0, $box.h), z] + - $textContent $textFont $textColor + F.buildTextWrapDomContent(F._target, $textContent.value, $box.w - $textFont.getPixelHeight(), $textAlign) - new Bound(0, 0, $box.w, $box.h * 4 / 5) - new Alignment(1,1) + Bound.fromBox($box, $textFont.getPixelHeight() / 2) + $textAlign + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
- + - 100,80 - - - $$fillColor - $$strokeColor - $$strokeStyle - - - - $$defaultTextFont - $$defaultTextColor - 1,1 + 40,40 + 50,0 + 0,0 + 100,50 + 0,0 + 50,100 + 0,0 + 0,50 + 0,0 + + + + $$fillColor + + + + + $$strokeColor + + + $$strokeStyle + + + + + + $$defaultTextFont + + + $$defaultTextColor + + 1,1 @@ -1565,27 +3284,66 @@ $strokeStyle $fillColor - [M(0, $box.h/5), L(4*$box.w/5, $box.h/5), L(4*$box.w/5, 4*$box.h/5), C(3*$box.w/4, 4*$box.h/5, 3*$box.w/4, 4*$box.h/5, $box.w/2, 9*$box.h/10), S($box.w/4, $box.h, 0, 9*$box.h/10), L(0, $box.h/5), - M($box.w/10, $box.h/5), L($box.w/10, $box.h/10), L(9*$box.w/10, $box.h/10), L(9*$box.w/10, 7*$box.h/10), L(4*$box.w/5, 7*$box.h/10), - M($box.w/5, $box.h/10), L($box.w/5, 0), L($box.w, 0), L($box.w, 6*$box.h/10), L(9*$box.w/10, 6*$box.h/10)] + [M(0, 0), L($box.w, 0), L($box.w, 4*$box.h/5), L($box.w/2, $box.h), L(0, 4*$box.h/5), z] + - $textContent $textFont $textColor - - new Bound(0, $box.h / 5, $box.w * 4 / 5, $box.h * 4 / 5) - new Alignment(1,1) - + + $textContent + new Bound(0, 0, $box.w, 4 * $box.h / 5).narrowed($textFont.getPixelHeight() / 2) + $textAlign + + + + $strokeColor + $strokeStyle + arrowTo([$outputPin1Origin, $outputPin1Origin.translate(0, 0 - collection.VIA_LENGTH)], $outputPin1, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin2Origin, $outputPin2Origin.translate(0 + collection.VIA_LENGTH, 0)], $outputPin2, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin3Origin, $outputPin3Origin.translate(0, 0 + collection.VIA_LENGTH)], $outputPin3, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) + + + $strokeColor + $strokeStyle + arrowTo([$outputPin4Origin, $outputPin4Origin.translate(0 - collection.VIA_LENGTH, 0)], $outputPin4, $strokeStyle.w, collection.VIA_LENGTH, false, false, true, false, 0) - - - -
-
+ + + return this.def.collection.buildSnappingGuides(this); + + + + + + + + + + + + + + +
+
diff --git a/app/stencils/CommonShapes_Flowchart/Icons/Segment.png b/app/stencils/CommonShapes_Flowchart/Icons/Segment.png new file mode 100644 index 00000000..495a3e64 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/Segment.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/alternate-process.png b/app/stencils/CommonShapes_Flowchart/Icons/alternate-process.png new file mode 100644 index 00000000..f3af2662 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/alternate-process.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/card.png b/app/stencils/CommonShapes_Flowchart/Icons/card.png new file mode 100644 index 00000000..5c1c8d0c Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/card.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/collate.png b/app/stencils/CommonShapes_Flowchart/Icons/collate.png new file mode 100644 index 00000000..1114f119 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/collate.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/connector.png b/app/stencils/CommonShapes_Flowchart/Icons/connector.png new file mode 100644 index 00000000..f70e300b Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/connector.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/curvy-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/curvy-connector.png new file mode 100644 index 00000000..a3b8abbb Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/curvy-connector.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/data.png b/app/stencils/CommonShapes_Flowchart/Icons/data.png new file mode 100644 index 00000000..bf5c2650 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/data.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/decision.png b/app/stencils/CommonShapes_Flowchart/Icons/decision.png new file mode 100644 index 00000000..d0d6d15f Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/decision.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/delay.png b/app/stencils/CommonShapes_Flowchart/Icons/delay.png new file mode 100644 index 00000000..f3e971e1 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/delay.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/direct-access-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/direct-access-storage.png new file mode 100644 index 00000000..0227965a Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/direct-access-storage.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/display.png b/app/stencils/CommonShapes_Flowchart/Icons/display.png new file mode 100644 index 00000000..24ef746b Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/display.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/document.png b/app/stencils/CommonShapes_Flowchart/Icons/document.png new file mode 100644 index 00000000..a96b311b Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/document.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/extract.png b/app/stencils/CommonShapes_Flowchart/Icons/extract.png new file mode 100644 index 00000000..258a5726 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/extract.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-alternate-process.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-alternate-process.png deleted file mode 100644 index 096bcc16..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-alternate-process.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-card.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-card.png deleted file mode 100644 index ce4520f4..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-card.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-collate.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-collate.png deleted file mode 100644 index 727709b5..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-collate.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-connector.png deleted file mode 100644 index 029ced4d..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-connector.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-data.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-data.png deleted file mode 100644 index 7ccee579..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-data.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-decision.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-decision.png deleted file mode 100644 index 14978220..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-decision.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-delay.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-delay.png deleted file mode 100644 index 369434ed..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-delay.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-direct-access-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-direct-access-storage.png deleted file mode 100644 index 5dab90bb..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-direct-access-storage.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-display.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-display.png deleted file mode 100644 index 10ef46f2..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-display.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-document.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-document.png deleted file mode 100644 index 04aa5cdf..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-document.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-extract.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-extract.png deleted file mode 100644 index 169f0277..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-extract.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-internal-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-internal-storage.png deleted file mode 100644 index 918a2c42..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-internal-storage.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-magnetic-disk.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-magnetic-disk.png deleted file mode 100644 index 97537d5b..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-magnetic-disk.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-input.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-input.png deleted file mode 100644 index 62d35453..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-input.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-operation.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-operation.png deleted file mode 100644 index ec281563..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-manual-operation.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-multi-document.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-multi-document.png deleted file mode 100644 index 7cd20a37..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-multi-document.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-off-page-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-off-page-connector.png deleted file mode 100644 index a41555dc..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-off-page-connector.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-or.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-or.png deleted file mode 100644 index 36690302..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-or.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-predefined-process.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-predefined-process.png deleted file mode 100644 index cb0e2f65..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-predefined-process.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-preparation.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-preparation.png deleted file mode 100644 index 932fde63..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-preparation.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-process.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-process.png deleted file mode 100644 index a82c6a12..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-process.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-punched-tape.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-punched-tape.png deleted file mode 100644 index bc1fafbf..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-punched-tape.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-sequential-access-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-sequential-access-storage.png deleted file mode 100644 index a9231eef..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-sequential-access-storage.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-sort.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-sort.png deleted file mode 100644 index 0ce4e7b9..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-sort.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-stored-data.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-stored-data.png deleted file mode 100644 index e7cf0780..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-stored-data.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-summing-junction.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-summing-junction.png deleted file mode 100644 index 5d8b9932..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-summing-junction.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/fc-terminator.png b/app/stencils/CommonShapes_Flowchart/Icons/fc-terminator.png deleted file mode 100644 index bbbc458e..00000000 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/fc-terminator.png and /dev/null differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/internal-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/internal-storage.png new file mode 100644 index 00000000..e30befee Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/internal-storage.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/magnetic-disk.png b/app/stencils/CommonShapes_Flowchart/Icons/magnetic-disk.png new file mode 100644 index 00000000..cb43500b Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/magnetic-disk.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/manual-input.png b/app/stencils/CommonShapes_Flowchart/Icons/manual-input.png new file mode 100644 index 00000000..7c3da258 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/manual-input.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/manual-operation.png b/app/stencils/CommonShapes_Flowchart/Icons/manual-operation.png new file mode 100644 index 00000000..a1f599c1 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/manual-operation.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/merge.png b/app/stencils/CommonShapes_Flowchart/Icons/merge.png index 281e6748..e698819d 100644 Binary files a/app/stencils/CommonShapes_Flowchart/Icons/merge.png and b/app/stencils/CommonShapes_Flowchart/Icons/merge.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/multi-document.png b/app/stencils/CommonShapes_Flowchart/Icons/multi-document.png new file mode 100644 index 00000000..742260c9 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/multi-document.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/multi-segment-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/multi-segment-connector.png new file mode 100644 index 00000000..c16be6eb Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/multi-segment-connector.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/off-page-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/off-page-connector.png new file mode 100644 index 00000000..2e844b2b Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/off-page-connector.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/or.png b/app/stencils/CommonShapes_Flowchart/Icons/or.png new file mode 100644 index 00000000..50889791 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/or.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/point.png b/app/stencils/CommonShapes_Flowchart/Icons/point.png new file mode 100644 index 00000000..94eb6dc0 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/point.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/predefined-process.png b/app/stencils/CommonShapes_Flowchart/Icons/predefined-process.png new file mode 100644 index 00000000..8059e87c Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/predefined-process.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/preparation.png b/app/stencils/CommonShapes_Flowchart/Icons/preparation.png new file mode 100644 index 00000000..3ef24965 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/preparation.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/process.png b/app/stencils/CommonShapes_Flowchart/Icons/process.png new file mode 100644 index 00000000..277ba8f6 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/process.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/punched-tape.png b/app/stencils/CommonShapes_Flowchart/Icons/punched-tape.png new file mode 100644 index 00000000..d4197f70 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/punched-tape.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/sequential-access-storage.png b/app/stencils/CommonShapes_Flowchart/Icons/sequential-access-storage.png new file mode 100644 index 00000000..4af01564 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/sequential-access-storage.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/sort.png b/app/stencils/CommonShapes_Flowchart/Icons/sort.png new file mode 100644 index 00000000..b8bc05b7 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/sort.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/stored-data.png b/app/stencils/CommonShapes_Flowchart/Icons/stored-data.png new file mode 100644 index 00000000..e25c80c9 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/stored-data.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/straight-connector.png b/app/stencils/CommonShapes_Flowchart/Icons/straight-connector.png new file mode 100644 index 00000000..550c1395 Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/straight-connector.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/summing-junction.png b/app/stencils/CommonShapes_Flowchart/Icons/summing-junction.png new file mode 100644 index 00000000..dd82650f Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/summing-junction.png differ diff --git a/app/stencils/CommonShapes_Flowchart/Icons/terminator.png b/app/stencils/CommonShapes_Flowchart/Icons/terminator.png new file mode 100644 index 00000000..a862840d Binary files /dev/null and b/app/stencils/CommonShapes_Flowchart/Icons/terminator.png differ diff --git a/app/stencils/CommonShapes_Flowchart/en-US.dtd b/app/stencils/CommonShapes_Flowchart/en-US.dtd deleted file mode 100644 index 165fdc0d..00000000 --- a/app/stencils/CommonShapes_Flowchart/en-US.dtd +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/stencils/CommonShapes_Flowchart/fr.dtd b/app/stencils/CommonShapes_Flowchart/fr.dtd deleted file mode 100644 index 4cb2bfb3..00000000 --- a/app/stencils/CommonShapes_Flowchart/fr.dtd +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/stencils/ExtJSKitchenSink_Neptune/Definition.xml b/app/stencils/ExtJSKitchenSink_Neptune/Definition.xml index c6f3056b..0e4fe708 100644 --- a/app/stencils/ExtJSKitchenSink_Neptune/Definition.xml +++ b/app/stencils/ExtJSKitchenSink_Neptune/Definition.xml @@ -30,7 +30,7 @@ $$defaultTextColor $$defaultTextFont - + @@ -38,7 +38,7 @@ false text - + $$defaultTextFont @@ -46,7 +46,7 @@ 0,1 - + $box @@ -70,7 +70,7 @@ "xlink:href" - + if($type.value == "spinner") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAD1JREFUOI1jYBgFIwKkQTFRgJEEQ5HBLGoYjMuVeA0nZDAhrxN0+SigHaBZ5A1YcsNlOFWTGUlZehQMYQAABZoHn87fCfsAAAAASUVORK5CYII=" else if ($type.value == "dateField") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAE9JREFUOI1jYBgFtAaM6AIzZ878T65h6enpcPOYyDVkwADeoEhPT2cklQ9j0ywohmEYw8SQ2cjyZIcxTCOp6ZugwTBXILtmQMFoOh4FdAQAdyA8E0U2MQIAAAAASUVORK5CYII=" else if ($type.value == "combobox") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAADlJREFUOI3t0LERADAIw0AyLTNpWrJAMKT3tz5UEGFmraNGoNSeme29DKu4iq7Cr/gU/QLU9BozW7qd9BGY77JWogAAAABJRU5ErkJggg==" @@ -87,15 +87,15 @@ ($box.h - 22)/2 - + - + - + dateField 01/01/2013 @@ -109,9 +109,9 @@ true Select ... - + - + closed @@ -130,14 +130,14 @@ else if($type.value == "expandeBottom") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAQFJREFUOI2lk0FKA0EURF8bCZhLCC4TUS+TA4hzAle6zDqQuEjAO2QVt+IdFILxIC5MYHgu7IFPMyMYC4ahq6t+T/3fAwXUkfqgfqh79VPdZO681EdjX12otd2o1Uf1pM38/IuxxIvajwWWfzA3WAKknOsV6HXma0cNXB0BN8FcA9fAqsWwynt1XveACnUbPqsKPVkHft1kVqvAb46Bs3DKBUBKaa+OgafMj1NK+6jJOEXdFc2ZhuYO1EFYTwvtrozQYFI2QJ206Lao844x3QXzfYdmntQR8Eb7GG/ze9ayVwOXzQmHXKRFzPe/qxyKHPYzFYWG6syf6Xzl5z1zw1L/DQFESNQVXCxqAAAAAElFTkSuQmCC" else if($type.value == "pin") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAANdJREFUOI2VkTEKAjEQRWfELbYR3HPtXkCwsxTFygvsBbTQ22ztFfQIKwhqoWLxbEZY4iTqQEjIf/8PmYg4BVRAA1xtNUDpsZ65Jl71N3Np4AOYAQUwtPPDtCoV0Bg0d7SlaU0q4GJQ4WiFaZfufS/g7sk3OkwYsLN97BgnAfNZwCgY4tAZ4igVkAPHxDcegTz6BFW9icg22kFkY0y8bNpnp/vZ+51wiKKqJxFZOdlr074XMADaTvcWGPxk7oRMOwHTv8wWkAEHYA9kMa4fE1T1CSze5xj3AhhzLfV2T4YfAAAAAElFTkSuQmCC" else if($type.value == "search") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAP5JREFUOI2l0j8rhlEYx/HLkygLikKxGiRl8krEqp5i9mcRi9mrsEl5AyiDhcGAYpFNWSjJn+RjcJXH3X0/j/gtp873ur7XOZ0TURJ0YgQ9ZbwymMAunn3nHHXUWjVP4yWbrrCDA7zm3i46qprHsvAR0wU2gqOUbFYJtrNgtoJ34wZvGCrCdjzhusUVV3LIXON+LSIGIqIrIi6aCSLiMtfhouAhIkREfwvBYK73Zcc7xjtGq7qxn1eYLIMzCU/QV8IXk59V2duwlUV32Mh/Ucehn1mrktSwni9SzB5W8dFUkqLenL6EeYw3sIVfSZqlIFn+r+S07U+GL8lURNx+Ahd4YP1eDoPwAAAAAElFTkSuQmCC" - else if($type.value == "save") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAALxJREFUOI3F0rFKQmEYBmDjgHfQIi0aSENIU5Mu3pIX0BC4BEE0Cm6Cg6SX0E00OTg4CELU0trTUMPfx1HPOYO+2znf+3w//+HUascO6pijVxUv/OYTt2Vwhqn/eS2KzzAO+A3naaG5Z8FzwEs00sIj3tHJwQ8Br3CRFu6T4RZXyewu4DVa8YRhTukSg/B+g/auOz6F8hbf4fn60Fceyc8HbnbiZEmGScCVfpaXP/yFbmGcLKljhn5pfJL8AKZ4XHsQJZ23AAAAAElFTkSuQmCC" + else if($type.value == "save") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAALxJREFUOI3F0rFKQmEYBmDjgHfQIi0aSENIU5Mu3pIX0BC4BEE0Cm6Cg6SX0E00OTg4CELU0trTUMPfx1HPOYO+2znf+3w//+HUascO6pijVxUv/OYTt2Vwhqn/eS2KzzAO+A3naaG5Z8FzwEs00sIj3tHJwQ8Br3CRFu6T4RZXyewu4DVa8YRhTukSg/B+g/auOz6F8hbf4fn60Fceyc8HbnbiZEmGScCVfpaXP/yFbmGcLKljhn5pfJL8AKZ4XHsQJZ23AAAAAElFTkSuQmCC" else if($type.value == "collapse") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAANBJREFUOI2lk1FqwkAURc+kYHUppoJdlOspBZOupbQuQqEEvwruwQ8JhuNHpyVOjcR4YWB4zDm8Yd5AEjVXX9RKPcRVxVqenm+DY7VUj3bnqC7VUQqP1M8rYJqPM0m03poCIKhPwAZ46Lzf5TTAPAMWA2AiswhqBUwHCAC2QT0AjwAhhNCHUo3bOgN6QR2pM+C7be6TlmCXAe93dLAK6gxYM+wZn39bLwYMUvmn8meUVzfA56McJRP1TW2ugI2XPlMiytVXdavW6l79irV/3/kEKKmxgDm6evAAAAAASUVORK5CYII=" else if($type.value == "expand") "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAMxJREFUOI2lk00KwjAYBV9SqHoUq8fyPCL4cxZRjyGlK8E7uJDSMm5SSNOkFh3oJnlv+EgaKQAogC1QAm/3lW6tCPN+cQ4cgYY0DbAH8rCcA9eRYsilJ3HWAd5+jEO3uUqN/UXQACsraSMpSx5OmkzSxgClpGUsYYwx3QQJSWWAt6SZX/iGJ6ytpEmlBLWV9PDNUw7REzytpPMfE9wErP+4xnUXOPwgOMoL5MAtEYzR/5WdZAGcgHak2BJ7TIGoAHZABdTAC7i7tcFz/gBspf97tulnkQAAAABJRU5ErkJggg==" "http://www.w3.org/1999/xlink" - + @@ -151,13 +151,13 @@ - + - + - + closed @@ -183,7 +183,7 @@ "http://www.w3.org/1999/xlink" - + @@ -197,11 +197,11 @@ - + - + @@ -233,12 +233,12 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xySyshWEWoK5ijp05LJDx4ThUrBJMBc0htJkJh4bTBpEW2K8RzSH7SjGgQgKbCgnbVCHkSMNUItiAjzQoFIMFYLCZEgrAJ9ibRiJagj0oi9oJ4QL6YHQGox5ZybWuyyZ+S9rsBJg50NiAAkYBfK83rvOi6+/wxEr3eX+j0o+D8CHHApR/kItOkZynPQh3Kmt8A4pPv3zugPfV2eW5fbaqbv1czeQI1q5laSJ2zlP998DWoGAAAAAElFTkSuQmCC]]> - + Bound.fromBox($box) $fillColor $withFrame - + $withFrame.value ? Bound.fromBox($box, 5) : Bound.fromBox($box) @@ -249,7 +249,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS $fillColor var height = 31; - if(40 > $box.h) height = $box.h - 10; + if(40 > $box.h) height = $box.h - 10; $withFrame.value ? new Bound(0 , 5 , $box.w, height) : new Bound(0 , 0 , $box.w, 36) @@ -270,19 +270,13 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS $withHeader.value ? new Bound(10, 46, $box.w - 20, $box.h - 56) : Bound.fromBox($box, 10, 10) $textAlign - - + + - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image $withIcon.value - + @@ -322,7 +316,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS - + @@ -336,15 +330,15 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS - + false - + true - + @@ -353,7 +347,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS top - + $box $type.value == "white" ? Color.fromString("#FFFFFFFF") : Color.fromString("#DFEAF2FF") @@ -363,7 +357,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS [translate(0, 0.5)] $type.value == "white" - + @@ -373,7 +367,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS new SnappingData("AddingBottom", b.y + b.height, "Top", false, this.id), new SnappingData("AddingRight", b.x + b.width - 8, "Right", true, this.id), new SnappingData("AddingLeft", b.x + 8, "Left", true, this.id)] - + ]]> @@ -389,7 +383,7 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS blue - + @@ -405,11 +399,11 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS $$defaultTextFont - + 0,0 - + $box $withBG @@ -485,16 +479,16 @@ SInt1TEOwiAUxvE/0M42HsCh0VlX46AX8gzGM3gCb+IVPInGwTiU4tIYa0vLs+1ifAvJFx6/EAgo5xyS - + - 100,24 + 100,24 false false - true + true - + #666666ff @@ -512,7 +506,7 @@ rJMkCWkVIoSkvu8v8p3jOPMoip5l5u/vjh5Q7ZT+dZqmHYudruvfxc4wDMYY68hAJxlGIfS8JX0f AAAAAElFTkSuQmCC]]> - + $box [translate(0.5, 0.5)] @@ -531,13 +525,7 @@ AAAAAElFTkSuQmCC]]> - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "y" ($box.h - 16)/2 @@ -569,7 +557,7 @@ AAAAAElFTkSuQmCC]]> [translate(0.5, 0)] $withArrow.value && $splited.value - + @@ -604,7 +592,7 @@ q4QQxhDC+HVg4/c8AKHJKyYONmmAAAAAAElFTkSuQmCC - + true true @@ -617,11 +605,11 @@ q4QQxhDC+HVg4/c8AKHJKyYONmmAAAAAAElFTkSuQmCC true - + - 24,24 + 24,24 - + $box [translate(0.5, 0.5)] - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" ($box.w - 16)/2 @@ -655,7 +637,7 @@ AAAAAElFTkSuQmCC]]> ($box.h - 16)/2 - + @@ -682,7 +664,7 @@ AAAAAElFTkSuQmCC]]> - + @@ -691,9 +673,9 @@ AAAAAElFTkSuQmCC]]> false small left - center + center - + $$headerTextColor @@ -712,7 +694,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box [translate(0.5, 0.5)] @@ -722,13 +704,13 @@ J2zlP998DWoGAAAAAElFTkSuQmCC $headerColor $headerFont - + var paddingButton = 4; var paddingWithNoIcon = ($iconSize.value=="small" ? 5 : ($iconSize.value=="medium" ? 8 : 10)) + paddingButton; var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) Bound.fromBox($box, paddingWithNoIcon) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) + if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - 2*paddingWithNoIcon, $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - paddingButton ) @@ -745,13 +727,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -790,7 +766,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + @@ -819,7 +795,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + true @@ -837,13 +813,13 @@ J2zlP998DWoGAAAAAElFTkSuQmCC bottom 80,44 - + 24,24 false - small + small - + $box [translate(0.5, 0.5)] - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -897,7 +867,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC $disabled.value ? 0.5 : 1 - + @@ -926,7 +896,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + @@ -936,9 +906,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC false small left - center + center - + $$headerTextColor @@ -957,22 +927,22 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") $title @@ -985,7 +955,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) Bound.fromBox($box, paddingWithNoIcon) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) + if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - 2*paddingWithNoIcon, $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - paddingButton ) @@ -1002,13 +972,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1045,7 +1009,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC $disabled.value ? 0.5 : 1 - + @@ -1075,14 +1039,14 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + 24,24 false false - small + small - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1148,7 +1106,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC $disabled.value ? 0.5 : 1 - + @@ -1177,7 +1135,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + @@ -1187,9 +1145,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC false small left - center + center - + $$headerTextColor @@ -1208,22 +1166,22 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") $title @@ -1237,7 +1195,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) new Bound(paddingWithNoIcon, 0, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) + if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h - paddingButton ) @@ -1254,13 +1212,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1319,11 +1271,11 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "y" var arrowHeight = $iconSize.value=="small" ? 16 : ($iconSize.value=="medium" ? 23 : 29); - ($box.h - arrowHeight)/2 + ($box.h - arrowHeight)/2 - + @@ -1357,14 +1309,14 @@ YII="/> - + 55,24 false false - small + small - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1452,11 +1398,11 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "y" var arrowHeight = $iconSize.value=="small" ? 16 : ($iconSize.value=="medium" ? 23 : 29); - ($box.h - arrowHeight)/2 + ($box.h - arrowHeight)/2 - + @@ -1489,7 +1435,7 @@ YII="/> - + @@ -1499,9 +1445,9 @@ YII="/> false small left - center + center - + $$headerTextColor @@ -1520,22 +1466,22 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") $title @@ -1549,7 +1495,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - (2*paddingButton + arrowpadding)) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) + if($iconPosition.value == "left") new Bound(paddingWithIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - 2*paddingWithNoIcon, $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - paddingButton) @@ -1566,13 +1512,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1621,9 +1561,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "x" - + var arrowWidth = $iconSize.value=="small" ? 19 : ($iconSize.value=="medium" ? 27 : 34); - ($box.w - arrowWidth)/2 + ($box.w - arrowWidth)/2 @@ -1635,7 +1575,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + @@ -1670,14 +1610,14 @@ YII="/> - + 24,42 false false - small + small - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1755,9 +1689,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "x" - + var arrowWidth = $iconSize.value=="small" ? 19 : ($iconSize.value=="medium" ? 27 : 34); - ($box.w - arrowWidth)/2 + ($box.w - arrowWidth)/2 @@ -1769,7 +1703,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - + @@ -1803,7 +1737,7 @@ YII="/> - + @@ -1813,9 +1747,9 @@ YII="/> false small left - center + center - + $$headerTextColor @@ -1834,22 +1768,22 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") $title @@ -1863,7 +1797,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) new Bound(paddingWithNoIcon, 0, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) + if($iconPosition.value == "left") new Bound(paddingWithIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, 0, $box.w - (paddingWithNoIcon + paddingWithIcon + arrowPadding), $box.h) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - (2*paddingWithNoIcon + arrowPadding), $box.h - paddingButton ) @@ -1880,13 +1814,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -1945,7 +1873,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "y" var arrowHeight = $iconSize.value=="small" ? 16 : ($iconSize.value=="medium" ? 23 : 29); - ($box.h - arrowHeight)/2 + ($box.h - arrowHeight)/2 @@ -1963,7 +1891,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC [M($box.w - paddingButton - arrowPadding + 2, paddingButton), L($box.w - paddingButton - arrowPadding + 2, $box.h - paddingButton)] [translate(0.5, 0)] - + @@ -1999,14 +1927,14 @@ YII="/> - + 46,24 false false - small + small - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -2094,7 +2016,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "y" var arrowHeight = $iconSize.value=="small" ? 16 : ($iconSize.value=="medium" ? 23 : 29); - ($box.h - arrowHeight)/2 + ($box.h - arrowHeight)/2 @@ -2112,7 +2034,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC [M($box.w - paddingButton - arrowPadding + 2, paddingButton), L($box.w - paddingButton - arrowPadding + 2, $box.h - paddingButton)] [translate(0.5, 0)] - + @@ -2147,7 +2069,7 @@ YII="/> - + @@ -2157,9 +2079,9 @@ YII="/> false small left - center + center - + $$headerTextColor @@ -2178,22 +2100,22 @@ J2zlP998DWoGAAAAAElFTkSuQmCC ]]> - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") $title @@ -2207,7 +2129,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC var paddingWithIcon = ($iconSize.value=="small" ? 21 : ($iconSize.value=="medium" ? 29 : 37)) + paddingButton; if(!$withIcon.value) new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - (2*paddingButton + arrowpadding)) else { - if($iconPosition.value == "left") new Bound(paddingWithIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) + if($iconPosition.value == "left") new Bound(paddingWithIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) else if($iconPosition.value == "right") new Bound(paddingWithNoIcon, paddingButton, $box.w - (paddingWithNoIcon + paddingWithIcon), $box.h - 2*paddingButton - arrowpadding) else if($iconPosition.value == "top") new Bound(paddingWithNoIcon, paddingWithIcon, $box.w - 2*paddingWithNoIcon, $box.h - paddingWithIcon) else new Bound(paddingWithNoIcon, paddingButton, $box.w - 2*paddingWithNoIcon, $box.h - paddingButton) @@ -2224,13 +2146,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -2279,9 +2195,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "x" - + var arrowWidth = $iconSize.value=="small" ? 19 : ($iconSize.value=="medium" ? 27 : 34); - ($box.w - arrowWidth)/2 + ($box.w - arrowWidth)/2 @@ -2307,7 +2223,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC [M(paddingButton, $box.h - arrowpadding + 1), L($box.w - paddingButton, $box.h - arrowpadding + 1)] [translate(0, 0.5)] - + @@ -2344,14 +2260,14 @@ YII="/> - + 23,42 false false - small + small - + $box - [translate(0.5, 0.5)] + [translate(0.5, 0.5)] - Color.fromString($selected.value ? "#266FA3" : "#3892d3") + Color.fromString($selected.value ? "#266FA3" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#358ac8") + Color.fromString($selected.value ? "#0F5F99" : "#358ac8") - Color.fromString($selected.value ? "#0E5A91" : "#3892d3") + Color.fromString($selected.value ? "#0E5A91" : "#3892d3") - Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") + Color.fromString($selected.value ? "#0F5F99" : "#4b9cd7") - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "x" @@ -2429,9 +2339,9 @@ J2zlP998DWoGAAAAAElFTkSuQmCC "x" - + var arrowWidth = $iconSize.value=="small" ? 19 : ($iconSize.value=="medium" ? 27 : 34); - ($box.w - arrowWidth)/2 + ($box.w - arrowWidth)/2 @@ -2457,7 +2367,7 @@ J2zlP998DWoGAAAAAElFTkSuQmCC [M(paddingButton, $box.h - arrowpadding + 1), L($box.w - paddingButton, $box.h - arrowpadding + 1)] [translate(0, 0.5)] - + @@ -2493,7 +2403,7 @@ YII="/> - + @@ -2512,7 +2422,7 @@ YII="/> "xlink:href" $checked.value ? - ( !$focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAXJJREFUKJGd0r2KIkEQwPF/N4KDzCvMmpuMYir4HH6LoOI9wOGDCBsaXyjMIJjIwZkNZvMCF4jRRSMY9FRdcLuD3t66yxUUdEP/6OrqMvxHzGazr8B3A5AkSRdYAK2P4OFw+Jmm6ZOq/ioB5Hm+qNVqLd/3H8IoikjT9AlQVf1S4s+q5fs+qvoQRlGEtZZ2u206nc63EoCIoKrv4jiOCziZTHDOAWBfykZVEZE3eXvjeDym2WyS5/k9TpKE9XqNc66AcRwTxzHWWkajEY1GA1UtcAnger2y2Wy4XC6ICIPBgN1ux3a7xVrLcDikXq8jIlhr77ExhsViwWq14ng8cjqdOJ/PWGvp9/uEYYiI8NLct2+uVqvM53M8zytgr9cr4Gveln3XsCAImE6nVCoVut0uYRgWv3Cbd2W/bkSEIAhYLpd4nleU+nfcYRH5kWVZMSjlcvmfyBhDlmU45w4Fds497/d7jDEfzjZwUNXnT5x7HL8B6t7+LmbmV9sAAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAblJREFUKJGdkr1rU2EUxn/nvffN1VbxmsqlCqZDUVCK6J61rbVaRFx0c6yDg4OLgoNLwaRFFKPgPyAOIiK4JRGrLoIfi0IXi8UkpY1DCpa8Hw63toRYAx54tvM7D885R/iPSq6/v2adrwrAqYefLgpqGiHfC/y2ahcbLZsDVkMAj5q+NbY/f2Jo7z/BQrlGYbGW8x4P/nJISueP52Kcc9uCxUqdYqVOoIShOJB3V489VikLzrltVSjXUlCEe+cOEvcpABSA8ylsre1SsVJnttogELhz9gCnj+zGebZg7+HZ5yZXnn5nvW0wJtVstcHcq2UCgbkzg0wc7sNai9+AQ4C2gxsv6/z8ZTHOU5hMuP+2yd03TQKB4mTCyQ1QRDadQwAlwqPzg1x68oMXX1p8XV5nYaVNIHB7Yh/jh3ZirQVARPBIZ+aRRPNgaoBdGcXCShslMDOeZXQ42oxhjMFa253ZOcdIElKayrJnh2JmNGZsOPrr9jsy/5lkjOHogPD8Qpb+jGCM6bq31rrT2Xn/+sNSiyiK0FoT92fQWncpiiI+Lq3h8fNbzkjpZrkFstbzt/F+Hi+lnn296jceEu2UOrelXAAAAABJRU5ErkJggg==") + ( !$focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAXJJREFUKJGd0r2KIkEQwPF/N4KDzCvMmpuMYir4HH6LoOI9wOGDCBsaXyjMIJjIwZkNZvMCF4jRRSMY9FRdcLuD3t66yxUUdEP/6OrqMvxHzGazr8B3A5AkSRdYAK2P4OFw+Jmm6ZOq/ioB5Hm+qNVqLd/3H8IoikjT9AlQVf1S4s+q5fs+qvoQRlGEtZZ2u206nc63EoCIoKrv4jiOCziZTHDOAWBfykZVEZE3eXvjeDym2WyS5/k9TpKE9XqNc66AcRwTxzHWWkajEY1GA1UtcAnger2y2Wy4XC6ICIPBgN1ux3a7xVrLcDikXq8jIlhr77ExhsViwWq14ng8cjqdOJ/PWGvp9/uEYYiI8NLct2+uVqvM53M8zytgr9cr4Gveln3XsCAImE6nVCoVut0uYRgWv3Cbd2W/bkSEIAhYLpd4nleU+nfcYRH5kWVZMSjlcvmfyBhDlmU45w4Fds497/d7jDEfzjZwUNXnT5x7HL8B6t7+LmbmV9sAAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAblJREFUKJGdkr1rU2EUxn/nvffN1VbxmsqlCqZDUVCK6J61rbVaRFx0c6yDg4OLgoNLwaRFFKPgPyAOIiK4JRGrLoIfi0IXi8UkpY1DCpa8Hw63toRYAx54tvM7D885R/iPSq6/v2adrwrAqYefLgpqGiHfC/y2ahcbLZsDVkMAj5q+NbY/f2Jo7z/BQrlGYbGW8x4P/nJISueP52Kcc9uCxUqdYqVOoIShOJB3V489VikLzrltVSjXUlCEe+cOEvcpABSA8ylsre1SsVJnttogELhz9gCnj+zGebZg7+HZ5yZXnn5nvW0wJtVstcHcq2UCgbkzg0wc7sNai9+AQ4C2gxsv6/z8ZTHOU5hMuP+2yd03TQKB4mTCyQ1QRDadQwAlwqPzg1x68oMXX1p8XV5nYaVNIHB7Yh/jh3ZirQVARPBIZ+aRRPNgaoBdGcXCShslMDOeZXQ42oxhjMFa253ZOcdIElKayrJnh2JmNGZsOPrr9jsy/5lkjOHogPD8Qpb+jGCM6bq31rrT2Xn/+sNSiyiK0FoT92fQWncpiiI+Lq3h8fNbzkjpZrkFstbzt/F+Hi+lnn296jceEu2UOrelXAAAAABJRU5ErkJggg==") : ( !$focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAKtJREFUKJGlkrENg1AMRJ9RSsahZJJskInYIGtQQIovsc3/pc2lSVCkIPJFrrTu6Sz74A8ZwLIsV+AG9BXMDAxd190BSClNOWfVKOeslNIEcAGQ1Ldti6SfsS9fv8HruiKpCn77NzgikLQNj9Q0DRFxDjaz8/BXsrtXw5Jw93PJkvbXrrn2LgxUJX/633+eSyk/i2JmlFKIiMcGu/swjiNmVtPth6ShasUjPQGBp8HW9ih1vgAAAABJRU5ErkJggg==" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAOJJREFUKJGlkrFNA0EQRd/sebWpK3AJyAVcA6YEGkBUQRmna8AlkBLYDi0Bcu7IInJmZzczDo4zBxLaBUaa7L95mtmFf5QA3LZvd0J4QKizhLN2rHm6v1kCsGh3q+3+6GaW7e3+6It2twKYfEyr57MpZpYVz2dT8Pf6CjtgZrh7fk8RhtQEwLyHS8whBMxHsDuoKqqahauqwsfwYC6BReSbGSk29zvLV7Oq0nXdH8y/OFj/KiN4mFRijjFe86GHff1yOJFSIsb4Y6eUeD2ccXzzaUaax+cTyLngb/sGlyaby9UFWRmhbZeIAqkAAAAASUVORK5CYII=") ; @@ -2537,7 +2447,7 @@ YII="/> true - + @@ -2556,7 +2466,7 @@ YII="/> "xlink:href" $checked.value ? - ( $focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAl9JREFUKJF1kk9IFGEYxp/vmxnH8d+sW4FpgeWtKenooe6R0ZYURMdItIMXM8w6FKFImB2kPKzRJYJAxUKRCPpzrFuuO1IWdDBDWnedHXN2Zne/7+0gO/gHH3jgg9/7PLy8fAw7dGfS7kr7rGct4A1BkSm6SqJWl8tRg4YH26yRrbOs9OibSFzI5pX+yopq65wVgXXQgGkocHMC9koOs7aD7L/1haiB+wNt1njYcHc8EYvFF2kmuUZSyj09azsUiy/S7XH7chi+8dJOTs9vBoUQe7pU0PHCtgGA3Xo130W6OfLwfAOIaOcJdokxhr7pZYic081XA9bTapmQUoZeSrnoHP2E031v0DH6Eb9X17fxViuCTJ5387SnHDpRb0BKCSICEaF/MgE7JcGrolhIEQanEiGTUuJYnY5MTqlXPcG5qTMUiyJc7UdaoKwyAqaoIFHEr4wHKWXITV2FV+Sc60xKx98EpfbmI/vBNQ1cUcA1DVZjNGQA4PgSOpeSm3pxaW7ZD1eSUqL3bBNONlSAM+B4nYGbZ46GjIhgrwSo0Qp/VFPND00l3CenGg9ACAEiQm05x9ClJiiKAiEEfN+HlBKMMXDOMZXIokYJHgMAro7NfZtOOuR5HrmuS9lsdpdd16WNjQ2aSTp0Jf71OwBwAKhS/QeP3v/F28UAmqaBcx7eAAA459A0De9+5jH8IYVqXujf9revj32OrQt9IBLZZ11sNtFcp6HWYFjzCfMrBbxOuEhnUgs1av7es/aWiW3hkq7Fv3Q6oqw3Wyg/nBOKYnAhTc1fimjB0PP2lqdbZ/8DWleUBf2v2zIAAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAjVJREFUKJF1kr9LHEEYhp+Z3T1UPGHRdSHIimJ3KQKCVyQKWgsK2tjYX/yDLoGQRgQFS+skF60U/BGCrVx1t+wdKx4Hwux8k0YXI/jCwMD7PjPvN4zilc7Pz1eUUg2l1DIQAT3n3Klzrrm0tNR6mVXPm4uLi/fOuc/VarUxPT3N+Pg4QRBQFAWDwYAsyxgMBl9FpFmv129K+OzsrFapVP7Ozs4SRdHrMqWyLKPdbuOc+1Cv1280gOd5e0mSEEURzrk3VxRFJEmCtbYBoFqt1koYhq1arYZz7s1byzmV4vb2ln6/v+YrpRpxHCMiJdzr9djf36fdbpMkCbu7u0xNTZVwHMfked7QRVGsTkxMlLBzjoODAzqdDqOjo3S7XQ4PD0tPRKhWq1hrP/kiEvu+T1EUZbVut8vY2Bhaa0SELMsQkdJ/ysdaRFJjDEB5+sLCAr7v43kevu8zPz9fegDGGEQk1dbaH3mel5VEhK2tLZIkQSnFzMwMm5ubpeec4/7+HhE5UycnJ8thGP5eXFzEGINzDq01IyMjeJ6HtZbHx0dEBKUUQRBweXlJlmVren19/bTf739L0xTP8wCw1jIcDnl4eGA4HGKtBUBrTZqmZFn2fWNj46d+mqF5dXVFp9MhCAK01uUbPENBEJCmKdfX1xhjmv/97ePj4xqwNzk52ZibmyMMQyqVCsYY8jzn7u6OXq/3BWhub2//+Q9+1tHR0UegoZRaVUq9AzrAr6Iomjs7O6cvs/8AfEZGm2piCOMAAAAASUVORK5CYII=") + ( $focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAl9JREFUKJF1kk9IFGEYxp/vmxnH8d+sW4FpgeWtKenooe6R0ZYURMdItIMXM8w6FKFImB2kPKzRJYJAxUKRCPpzrFuuO1IWdDBDWnedHXN2Zne/7+0gO/gHH3jgg9/7PLy8fAw7dGfS7kr7rGct4A1BkSm6SqJWl8tRg4YH26yRrbOs9OibSFzI5pX+yopq65wVgXXQgGkocHMC9koOs7aD7L/1haiB+wNt1njYcHc8EYvFF2kmuUZSyj09azsUiy/S7XH7chi+8dJOTs9vBoUQe7pU0PHCtgGA3Xo130W6OfLwfAOIaOcJdokxhr7pZYic081XA9bTapmQUoZeSrnoHP2E031v0DH6Eb9X17fxViuCTJ5387SnHDpRb0BKCSICEaF/MgE7JcGrolhIEQanEiGTUuJYnY5MTqlXPcG5qTMUiyJc7UdaoKwyAqaoIFHEr4wHKWXITV2FV+Sc60xKx98EpfbmI/vBNQ1cUcA1DVZjNGQA4PgSOpeSm3pxaW7ZD1eSUqL3bBNONlSAM+B4nYGbZ46GjIhgrwSo0Qp/VFPND00l3CenGg9ACAEiQm05x9ClJiiKAiEEfN+HlBKMMXDOMZXIokYJHgMAro7NfZtOOuR5HrmuS9lsdpdd16WNjQ2aSTp0Jf71OwBwAKhS/QeP3v/F28UAmqaBcx7eAAA459A0De9+5jH8IYVqXujf9revj32OrQt9IBLZZ11sNtFcp6HWYFjzCfMrBbxOuEhnUgs1av7es/aWiW3hkq7Fv3Q6oqw3Wyg/nBOKYnAhTc1fimjB0PP2lqdbZ/8DWleUBf2v2zIAAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAjVJREFUKJF1kr9LHEEYhp+Z3T1UPGHRdSHIimJ3KQKCVyQKWgsK2tjYX/yDLoGQRgQFS+skF60U/BGCrVx1t+wdKx4Hwux8k0YXI/jCwMD7PjPvN4zilc7Pz1eUUg2l1DIQAT3n3Klzrrm0tNR6mVXPm4uLi/fOuc/VarUxPT3N+Pg4QRBQFAWDwYAsyxgMBl9FpFmv129K+OzsrFapVP7Ozs4SRdHrMqWyLKPdbuOc+1Cv1280gOd5e0mSEEURzrk3VxRFJEmCtbYBoFqt1koYhq1arYZz7s1byzmV4vb2ln6/v+YrpRpxHCMiJdzr9djf36fdbpMkCbu7u0xNTZVwHMfked7QRVGsTkxMlLBzjoODAzqdDqOjo3S7XQ4PD0tPRKhWq1hrP/kiEvu+T1EUZbVut8vY2Bhaa0SELMsQkdJ/ysdaRFJjDEB5+sLCAr7v43kevu8zPz9fegDGGEQk1dbaH3mel5VEhK2tLZIkQSnFzMwMm5ubpeec4/7+HhE5UycnJ8thGP5eXFzEGINzDq01IyMjeJ6HtZbHx0dEBKUUQRBweXlJlmVren19/bTf739L0xTP8wCw1jIcDnl4eGA4HGKtBUBrTZqmZFn2fWNj46d+mqF5dXVFp9MhCAK01uUbPENBEJCmKdfX1xhjmv/97ePj4xqwNzk52ZibmyMMQyqVCsYY8jzn7u6OXq/3BWhub2//+Q9+1tHR0UegoZRaVUq9AzrAr6Iomjs7O6cvs/8AfEZGm2piCOMAAAAASUVORK5CYII=") : ( $focused.value ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAfNJREFUKJGNUktrE2EUPXO/mUxTYiYNgpLSP2BiVj5+hJWoCK5cWLQUxE2xWKmLLnyAT7SKGgQXXYlUgxatrnTZbZKJpLps66N5TComM53Mva6MNVKaA2d3zrmcw9XQhakX9ljVpQs1VxtyfU31GRLETV6Oh/nG1WOpB5u12l9TPlN31ZVwOJIcTsawN9GPeL+OWrMN+2sL87aDX82fthUKLl07ns51EibnCicOPy7L62JdmHlLzhfrkskuycW5wsmOeWzWLr21HWFmCYJgSzKzvPvkyOhsqQwA2sSz/Fk2YvevZwYhIt0T/AdN0zD5agXsOuNUddXEoZQFZu6Zw6kYahs0rleaNJROhMHM214FABHBnt0mai2V0JsBkWVqaLeDnswAYJk6mm0i3dSYHZcpoqPnzg2XYWrMFAu1l/OrHkSkp74iguI3D9GQv0pR3bv5Mt8AEW0bICIgIuQKDUSVd5sento3U6tX7TflFpRSnVG6CQBKKSwstbBWrZYejey/QwCwQ3enZj5WsPB5A4ZhgIg6IQBARDAMA++/eLj7oYKI4U0Dm3579MnikUY7dDk+sDN5NB1FcpcBq0/Duiuwv/vIFdbxo7pWGjD86ezpg8//Mf/BSHbxXCMInXd8c9BjpUziwDLcFUv3bz09c+DeZu1vTcV1K9fWOb4AAAAASUVORK5CYII=" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAbZJREFUKJGNksGK2mAUhb//T+JKRUSj3Siu7aIbcVGnlHkBd+IrpH2eNswb6FOMVdxooTTUtWQVa0Qjukri/3czih0Q58CBuzjn3Hu5V/AK8/n8oxDCAT4D74BAaz1WSrntdntyrRXnYjabNYGv2WzWsW2bXC5HJpMhjmOOxyPr9ZrD4eAKIb63Wq0/F/N0Ov1gWdavWq2Gbduvh7kgDEN83yeO41an0/kpAYQQTr1ex7ZttNY3WS6XqdfrSCkdADEajR6KxeK42Wyitb7Z9bKnECwWC7bb7aMppXQqlQpKqTebq9UqURQ5Zpqmj/l8HqXUXSOA1ppcLsfpdOqYSqmKaZqkafomM8CLviKVUn+TJLmk3iNAkiQopdYyTdPn3W6H1hql1F1qrYmiCKXURCZJ4vq+j5TyboDWGinl+dau7Ha74zAM3SAIMAzj5vgAhmEQBAFhGD51u91n+bLDN8/zWK1WWJaFlPISAiClxLIsVqsVnueRpqkLV789GAzem6b5pVQqOY1Gg0KhcPnt/X7Pcrlks9k8JUni9vv93/+ZzxgOh58ARwjxANhACEwAt9fr/bjW/gMVlj1UCxlQEwAAAABJRU5ErkJggg==") PencilNamespaces.xlink @@ -2580,7 +2490,7 @@ YII="/> true - + @@ -2591,7 +2501,7 @@ YII="/> - + "x" $a.x - 7 @@ -2604,10 +2514,10 @@ YII="/> - + - + @@ -2623,11 +2533,11 @@ YII="/> $$defaultTextFont - + 0,0 - + "width" @@ -2639,7 +2549,7 @@ YII="/> $fillColor $withFrame - + Bound.fromBox($box) @@ -2655,12 +2565,12 @@ YII="/> ($withFrame.value || $withHeader.value) ? new Bound(10, 46, $box.w - 20, $box.h - 56) : Bound.fromBox($box, 10, 10) $textAlign - - + + ($withHeader.value || $withFrame.value) ? new Bound(0, 31, $box.w, 5) : new Bound(0, -5, $box.w, 5) - + @@ -2681,8 +2591,8 @@ YII="/> var withFrame = this.getProperty("withFrame"); if(withFrame.value) { return [ - new SnappingData("Top", b.y + 5, "Top", false, this.id), - new SnappingData("Left", b.x + 5, "Left", true, this.id), + new SnappingData("Top", b.y + 5, "Top", false, this.id), + new SnappingData("Left", b.x + 5, "Left", true, this.id), new SnappingData("Right", b.x + b.width + 5, "Right", true, this.id)] } else { if(!withHeader.value) @@ -2692,7 +2602,7 @@ YII="/> - + @@ -2709,7 +2619,7 @@ YII="/> true - + @@ -2718,7 +2628,7 @@ YII="/> false active - + $$headerTextColor @@ -2729,11 +2639,11 @@ YII="/> 1,1 - - + $box $type.value == "active" ? Color.fromString("#ADD2ED") : Color.fromString("#4B9CD7") @@ -2755,13 +2665,7 @@ YII="/> - - "xlink:href" - - $image.w > 0 ? $image.data : ""; - - "http://www.w3.org/1999/xlink" - + $image "y" ($box.h - 14)/2 @@ -2772,7 +2676,7 @@ YII="/> $type.value == "disabled" ? 0.3 : 1 - + @@ -2809,7 +2713,7 @@ YII="/> disabled - + @@ -2845,16 +2749,16 @@ YII="/> - + 150,30 - false + false center ascending - + #666666ff @@ -2863,7 +2767,7 @@ YII="/> 0,1 - + $box $selected.value ? Color.fromString("#EEF6FBFF") : Color.fromString("#f5f5f5ff") @@ -2889,7 +2793,7 @@ YII="/> "xlink:href" - + $sort.value == "ascending" ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAFhJREFUOI1jYBjUYObMmfUzZ86sx6eGEZ9mBgaGBii3IT09vZFoA9A0wwBWQzAMwKEZpyEoBhDQjNUQfGFgw8DAcBjKtU1PTz+CTR0TAdsIglEDqGDAwAMAaRsdpqFlP24AAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAGFJREFUOI1jYBhowIhLYubMmTYMDAyHoVzb9PT0I9jUMVHqglEDqGAASjROnz69gYmJqR6fhn///jVmZmY2YDWAkCHomrEagMsQbJpxGoBuCC7NBMH06dMbpk+fTrpGugIANNwpnGoxlWsAAAAASUVORK5CYII=" "http://www.w3.org/1999/xlink" @@ -2904,24 +2808,24 @@ YII="/> $selected.value - + - + @@ -2930,7 +2834,7 @@ YII="/> true - + @@ -2938,7 +2842,7 @@ YII="/> #f5f5f5ff expand - + #666666ff @@ -2947,7 +2851,7 @@ YII="/> 0,1 - + $box $fillColor @@ -2968,7 +2872,7 @@ YII="/> "xlink:href" - + $type.value == "expand" ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAHBJREFUGJWNkVsKgEAIRY/RJoeCWVtQzLaCoG3Yh9M8wIHxS/Tgvarcz6sAIEBOu6j1tdTUAzFQLFu8droOV8GFRwqTsPmQf8F0etIWYY89nJUA8xy22A4FBgt6FtApWItitTE4swKSh9eniA9L88EPL4ojo48jrg8AAAAASUVORK5CYII=" :"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAGZJREFUGJWVkVEKgEAIRGeWLhkEnW0/omsFQdewD8U1UNj8kuGpw8jrfgQAAAKw9lNDX1yTDISC1K4VRHrhByyzsPpwz+fRS3Tddh0ZaaAOw2rCBn3RBCx+sUUtRcWWMz6FOczwwRcbWhhq1r3YaQAAAABJRU5ErkJggg==" "http://www.w3.org/1999/xlink" @@ -2978,7 +2882,7 @@ YII="/> ($box.h - 11)/2 - + @@ -2993,7 +2897,7 @@ YII="/> - + @@ -3002,7 +2906,7 @@ YII="/> collapse - + @@ -3010,7 +2914,7 @@ YII="/> #ffffffff false - + $$defaultTextColor @@ -3019,7 +2923,7 @@ YII="/> 0,1 - + $box $fillColor @@ -3039,7 +2943,7 @@ YII="/> [M($box.w, $box.h), L(0, $box.h)] [translate(0.5, 0.5)] - + @@ -3053,7 +2957,7 @@ YII="/> - + @@ -3061,7 +2965,7 @@ YII="/> true - + @@ -3097,36 +3001,32 @@ YII="/> - - "xlink:href" - $image.data - "http://www.w3.org/1999/xlink" - + $image - - + return [ new SnappingData("AddingLeft", b.x + 20, "Left", true, this.id), new SnappingData("ChildSnapping", b.x + 40, "ChildSnapping", true, this.id), - new SnappingData("BottomToTop", b.y + b.height, "Top", false, this.id), + new SnappingData("BottomToTop", b.y + b.height, "Top", false, this.id), new SnappingData("TopToBottom", b.y, "Bottom", false, this.id)] ]]> @@ -3150,7 +3050,7 @@ YII="/> collapse - + @@ -3178,11 +3078,7 @@ YII="/> - - "xlink:href" - $image.data - "http://www.w3.org/1999/xlink" - + $image "x" ($type.value == "none") ? 20 : 40 @@ -3203,16 +3099,16 @@ YII="/> - @@ -3225,7 +3121,7 @@ YII="/> return [ new SnappingData("BottomToTop", b.y + b.height, "Top", false, this.id), new SnappingData("TopToBottom", b.y, "Bottom", false, this.id), - new SnappingData("ChildSnapping", b.x, "ChildSnapping", true, this.id),] + new SnappingData("ChildSnapping", b.x, "ChildSnapping", true, this.id),] ]]> @@ -3243,4 +3139,3 @@ YII="/> checked
- diff --git a/app/views/AboutDialog.xhtml b/app/views/AboutDialog.xhtml index 3f30802b..50b8cc5a 100644 --- a/app/views/AboutDialog.xhtml +++ b/app/views/AboutDialog.xhtml @@ -33,14 +33,16 @@ margin-left: 2em; } .aboutBanner { - background-color: @selected_bg; + background-color: lighten(@selected_bg, 10%); margin-bottom: 1em; margin-left: -1.5em; margin-right: -1.5em; align-items: flex-start; + margin-top: -1em; color:#fff; - padding: 1em; + padding: 1.9em; + padding-top: 0em; } .aboutBanner img { width: 3em; diff --git a/app/views/ApplicationPane.js b/app/views/ApplicationPane.js index 6bd8889e..1646b148 100644 --- a/app/views/ApplicationPane.js +++ b/app/views/ApplicationPane.js @@ -31,6 +31,10 @@ function ApplicationPane() { this.bind("p:ControllerStatusChanged", function (event) { this.invalidateUIForControllerStatus(); }); + this.bind("p:ZoomChanged", function (event) { + this.invalidateZoom(); + }); + var lastOverflowX = null; var lastOverflowY = null; @@ -75,6 +79,12 @@ function ApplicationPane() { ApplicationPane._instance = this; + this.bind("dblclick", function (event) { + if (event.target.nodeName == "input") { + event.target.select(); + } + }, this.toolbarContainer) + FontLoader.instance.loadFonts(); } __extend(BaseTemplatedWidget, ApplicationPane); @@ -142,8 +152,12 @@ ApplicationPane.prototype.createCanvas = function () { }; ApplicationPane.prototype.onDocumentChanged = function () { this.pageListView.currentPage = this.controller.activePage; + this.controller.activePage.canvas._sayTargetChanged(); this.pageListView.renderPages(); }; +ApplicationPane.prototype.activatePage = function (page) { + this.pageListView.activatePage(page); +} ApplicationPane.prototype.testSave = function () { this.controller.newDocument(); var page = this.controller.newPage("Sample page", 1000, 1000, null, null, ""); @@ -154,6 +168,7 @@ ApplicationPane.prototype.testSave = function () { ApplicationPane.prototype.setActiveCanvas = function (canvas) { if (this.activeCanvas && this.activeCanvas != canvas) { this.activeCanvas._cachedState = this.activeCanvas.getCanvasState(); + } for (var i = 0; i < this.getCanvasContainer().childNodes.length; i ++) { @@ -169,8 +184,19 @@ ApplicationPane.prototype.setActiveCanvas = function (canvas) { this.startupDocumentView.node().style.display = "none"; canvas.focus(); } + + this.invalidateZoom(); + Dom.emitEvent("p:CanvasActived", this.node(), { + canvas: canvas + }); +}; +ApplicationPane.prototype.invalidateZoom = function () { + this.zoomToolbar.setAttribute("label", Pencil.activeCanvas ? (Math.round(Pencil.activeCanvas.zoom * 100) + "%") : "100%") ; }; ApplicationPane.prototype.showStartupPane = function () { + if (Pencil.controller.activePage) { + Pencil.controller.activePage.canvas.selectNone(); + } this.setActiveCanvas(null); this.startupDocumentView.reload(); this.startupDocumentView.node().style.display = "flex"; @@ -183,10 +209,16 @@ ApplicationPane.prototype.getPreferredCanvasSize = function () { h: Math.round(this.contentBody.offsetHeight - 2 * Pencil._getCanvasPadding()) - 2 } }; - +// ApplicationPane.prototype.getScreenSize = function () { +// return { +// w: Math.round(this.contentBody.offsetWidth - 2 * Pencil._getCanvasPadding()) - 2, +// h: Math.round(this.contentBody.offsetHeight - 2 * Pencil._getCanvasPadding()) - 2 +// } +// }; ApplicationPane.prototype.getBestFitSize = function () { var zoom = Pencil.activeCanvas ? (1 / Pencil.activeCanvas.zoom) : 1; - return [zoom * (this.contentBody.offsetWidth - 2 * Pencil._getCanvasPadding() - 2), zoom * (this.contentBody.offsetHeight - 2 * Pencil._getCanvasPadding() - 2)].join("x"); + return [zoom * (this.contentBody.offsetWidth - 2 * Pencil._getCanvasPadding() - 2), + zoom * (this.contentBody.offsetHeight - 2 * Pencil._getCanvasPadding() - 2)].join("x"); }; ApplicationPane.prototype.getBestFitSizeObject = function () { var zoom = Pencil.activeCanvas ? (1 / Pencil.activeCanvas.zoom) : 1; @@ -216,3 +248,30 @@ ApplicationPane.prototype.invalidatePropertyEditor = function () { this.sharedPropertyEditor.detach(); } }; +ApplicationPane.prototype.toggleFullscreen = function () { + var browserWindow = remote.getCurrentWindow(); + var fullscreen = !browserWindow.isFullScreen(); + if (fullscreen) { + this.shouldRestoreSidePane = this.leftSidePane.isOpen(); + } + + browserWindow.setFullScreen(fullscreen); + this.validateFullScreen(); +}; +ApplicationPane.prototype.validateFullScreen = function () { + var browserWindow = remote.getCurrentWindow(); + var fullscreen = browserWindow.isFullScreen(); + Dom.toggleClass(document.body, "Fullscreen", fullscreen); + if (fullscreen) { + this.leftSidePane.collapseAll(); + } else { + if (this.shouldRestoreSidePane) this.leftSidePane.openLast(); + } +}; +ApplicationPane.prototype.toggleLeftPane = function () { + if (this.leftSidePane.isOpen()) { + this.leftSidePane.collapseAll(); + } else { + this.leftSidePane.openLast(); + } +}; diff --git a/app/views/ApplicationPane.xhtml b/app/views/ApplicationPane.xhtml index 1a68b740..75dca01f 100644 --- a/app/views/ApplicationPane.xhtml +++ b/app/views/ApplicationPane.xhtml @@ -116,6 +116,7 @@ @appName { font-size: 2em; color: darken(saturate(#da8500, 20%), 0%); + cursor: default; } @appName * { vertical-align: middle; @@ -126,11 +127,59 @@ } @toolbarContainer { flex-wrap: wrap; - margin-top: -0.4ex; + xmargin-top: -1.2ex; } @toolbarContainer > * + * { - margin-left: 0.4ex; - margin-top: 0.4ex; + margin-left: @toolbar_gap; + margin-top: @toolbar_gap; + } + @toolbarContainer *[label] { + position: relative; + } + @toolbarContainer *[label]:after { + display: block; + content: attr(label); + position: absolute; + left: 0px; + right: 0px; + top: -0.3em; + text-align: center; + color: darken(@app_bg, 15%); + text-shadow: 1px 1px 0px lighten(@app_bg, 5%); + font-size: 0.8em; + text-transform: uppercase; + } + @toolbarContainer *[label]:hover:after { + color: darken(@app_bg, 45%); + } + @toolbarContainer *[label] { + padding-top: 0.8em; + padding-bottom: 0.8em; + } + + body.Fullscreen @contentSection { + position: relative; + padding-left: 3em; + padding-right: 3em; + transform: translateZ(0); + } + + body.Fullscreen @contentSection > .widget_CollapseablePanel { + position: absolute; + top: 0px; + bottom: 0px; + z-index: 1; + } + + body.Fullscreen @contentSection @leftSidePane { + left: 0px; + } + body.Fullscreen @contentSection @rightSidePane { + right: 0px; + } + body.Fullscreen @contentSection @rightSidePane:not([closed='true']), + body.Fullscreen @contentSection @leftSidePane:not([closed='true']) { + box-shadow: 0em 0em 0.5em 0.3em rgba(0, 0, 0, 0.15); } @@ -144,20 +193,20 @@ - - - - - - - - + + + + + + + + - - + + @@ -168,7 +217,7 @@ - + diff --git a/app/views/EditPageNoteDialog.js b/app/views/EditPageNoteDialog.js index 9eff8269..be109f03 100644 --- a/app/views/EditPageNoteDialog.js +++ b/app/views/EditPageNoteDialog.js @@ -1,6 +1,7 @@ function EditPageNoteDialog () { Dialog.call(this); - this.title = "Edit Page Note"; + this.title = "Page Note"; + this.subTitle = "Edit extra note for the drawing page"; //this.initialize(); this.bind("p:PopupHidden", function () { this.selectorContainer.removePopup(); diff --git a/app/views/ExportDialog.js b/app/views/ExportDialog.js index caf7b1ca..cced32d2 100644 --- a/app/views/ExportDialog.js +++ b/app/views/ExportDialog.js @@ -1,6 +1,7 @@ function ExportDialog () { Dialog.call(this); this.title = "Export Document"; + this.subTitle = "Select source pages and target output format with options"; function sameIdComparer(a, b) { if (!a) return !b; diff --git a/app/views/PageDetailDialog.js b/app/views/PageDetailDialog.js index 0a51fb1d..1d478118 100644 --- a/app/views/PageDetailDialog.js +++ b/app/views/PageDetailDialog.js @@ -2,6 +2,7 @@ function PageDetailDialog() { Dialog.call(this); this.modified = false; this.title = "Add Page"; + this.subTitle = "Configure page properties"; this.pageCombo.renderer = function (canvas) { return canvas.name; }; @@ -32,13 +33,7 @@ function PageDetailDialog() { }, false); this.pageSizeCombo.addEventListener("p:ItemSelected", function (event) { - var pageSize = thiz.pageSizeCombo.getSelectedItem(); - thiz.widthInput.disabled = pageSize.value; - thiz.heightInput.disabled = pageSize.value; - if (pageSize.value) { - thiz.setPageSizeValue(pageSize.value); - } - + thiz.invalidatePageSizeUI(); thiz.modified = true; }, false); @@ -62,14 +57,18 @@ function PageDetailDialog() { thiz.modified = true; }, false); - this.pageTitle.addEventListener("change", function (event) { + this.pageTitle.addEventListener("input", function (event) { thiz.modified = true; }, false); this.widthInput.addEventListener("change", function () { + var value = thiz.widthInput.value; + if (!value || parseInt(value, 10) < 24) thiz.widthInput.value = 24; thiz.modified = true; }, false); this.heightInput.addEventListener("change", function () { + var value = thiz.heightInput.value; + if (!value || parseInt(value, 10) < 24) thiz.heightInput.value = 24; thiz.modified = true; }, false); @@ -112,26 +111,22 @@ Page.defaultPageSizes = [ } ]; +const SIZE_RE = /^([0-9]+)x([0-9]+)$/; + PageDetailDialog.prototype.onShown = function () { this.pageTitle.focus(); }; -PageDetailDialog.prototype.setPageSizeValue = function (value) { - var index = value.indexOf("x"); - if (index > -1) { - this.widthInput.value = value.substring(0, index); - this.heightInput.value = value.substring(index + 1); - } -} - -var createComboitems = function (pages, onDone, padding){ - padding += 1; - for(var i = 0; i < pages.length; i++) { - onDone(pages[i], padding); - if (pages[i].children) { - createComboitems(pages[i].children, onDone, padding); - } +PageDetailDialog.prototype.invalidatePageSizeUI = function () { + var pageSize = this.pageSizeCombo.getSelectedItem(); + var value = pageSize.value; + this.widthInput.disabled = value; + this.heightInput.disabled = value; + if (!value) return; + if (value.match(SIZE_RE)) { + this.widthInput.value = Math.max(24, parseInt(RegExp.$1, 10)); + this.heightInput.value = Math.max(24, parseInt(RegExp.$2, 10)); } -} +}; PageDetailDialog.prototype.setup = function (options) { var thiz = this; @@ -144,24 +139,43 @@ PageDetailDialog.prototype.setup = function (options) { var pageSizes = []; - var lastSize = Config.get("lastSize"); + var lastSizeConfig = Config.get("lastSize"); + var w = 24; + var h = 24; + + if (lastSizeConfig && lastSizeConfig.match(SIZE_RE)) { + w = Math.max(24, parseInt(RegExp.$1, 10)); + h = Math.max(24, parseInt(RegExp.$2, 10)); + } + + + var lastSize = w + "x" + h; if (lastSize) { pageSizes.push({ displayName: "Last used", - value: lastSize + value: lastSize, + dontCheckValue: true }); } - var bestFitSize = Pencil.controller.getBestFitSize(); + var bestFitSizeText = Pencil.controller.getBestFitSize(); + if (bestFitSizeText && bestFitSizeText.match(SIZE_RE)) { + w = Math.max(24, parseInt(RegExp.$1, 10)); + h = Math.max(24, parseInt(RegExp.$2, 10)); + } + + var bestFitSize = w + "x" + h; if (bestFitSize) { pageSizes.push({ displayName: "Best fit", - value: bestFitSize + value: bestFitSize, + dontCheckValue: true }); } pageSizes.push({ - displayName: "Custome size..." + displayName: "Custome size...", + dontCheckValue: true }); pageSizes = pageSizes.concat(Page.defaultPageSizes); @@ -243,37 +257,37 @@ PageDetailDialog.prototype.setup = function (options) { this.backgroundCombo.setItems(backgroundItems); var pageSize = this.pageSizeCombo.getSelectedItem(); - this.widthInput.disabled = pageSize.value; - this.heightInput.disabled = pageSize.value; if (options.parentpage) { this.pageCombo.selectItem(options.parentpage); } - if(this.originalPage) { - this.setPageItem(this.originalPage); + if (this.originalPage) { + this.updateUIWith(this.originalPage); } + + this.invalidatePageSizeUI(); + var background = thiz.backgroundCombo.getSelectedItem(); thiz.colorButton.disabled = background.value ? true : false; }; -PageDetailDialog.prototype.setPageItem = function (page) { - if(page.parentPage) { +PageDetailDialog.prototype.updateUIWith = function (page) { + if (page.parentPage) { this.pageCombo.selectItem(page.parentPage); } this.pageTitle.value = page.name; var pageSizeValue = page.width + "x" + page.height; - var index; + var index = null; for (var i in this.pageSizeCombo.items ) { - if(this.pageSizeCombo.items[i].value == pageSizeValue) { + if (!this.pageSizeCombo.items[i].dontCheckValue && this.pageSizeCombo.items[i].value == pageSizeValue) { index = this.pageSizeCombo.items[i]; } } var thiz = this; if(index != null) { this.pageSizeCombo.selectItem(index); - this.setPageSizeValue(index.value); } else { this.pageSizeCombo.selectItem({ displayName: "Custome size..." @@ -284,7 +298,7 @@ PageDetailDialog.prototype.setPageItem = function (page) { this.heightInput.value = page.height; } - if(page.backgroundColor) { + if (page.backgroundColor) { this.backgroundCombo.selectItem({ name: "Background Color" }); @@ -307,8 +321,6 @@ PageDetailDialog.prototype.setPageItem = function (page) { } } -const SIZE_RE = /^([0-9]+)x([0-9]+)$/; - PageDetailDialog.prototype.createPage = function () { var name = this.pageTitle.value; @@ -380,37 +392,38 @@ PageDetailDialog.prototype.getDialogActions = function () { { type: "cancel", title: "Cancel", isCloseHandler: true, run: function () { - if (this.modified) { - Dialog.confirm( - "Do you want to save your changes before closing?", null, - "Save", function () { - if (thiz.pageTitle.value == "" ) { - Dialog.alert("The page name is invalid. Please enter the valid page name."); - return; - } - if (thiz.isCreatePage) { - var page = thiz.createPage(); - if (thiz.onDone) thiz.onDone(page); - } else { - var page = thiz.updatePage(); - if (thiz.onDone) thiz.onDone(page); - } - thiz.close(); - }, - "No", function () { - thiz.close(); - } - ); - } else { - return true; - } + return true; + // if (this.modified) { + // Dialog.confirm( + // "Do you want to save your changes before closing?", null, + // "Save", function () { + // if (thiz.pageTitle.value == "" ) { + // Dialog.alert("The page name is invalid. Please enter the valid page name."); + // return; + // } + // if (thiz.isCreatePage) { + // var page = thiz.createPage(); + // if (thiz.onDone) thiz.onDone(page); + // } else { + // var page = thiz.updatePage(); + // if (thiz.onDone) thiz.onDone(page); + // } + // thiz.close(); + // }, + // "No", function () { + // thiz.close(); + // } + // ); + // } else { + // return true; + // } } }, { type: "accept", title: this.originalPage ? "Update" : "Create", run: function () { - if(this.pageTitle.value == "" ) { - Dialog.alert("The page name is invalid. Please enter the valid page name."); + if (this.pageTitle.value == "" ) { + Dialog.error("The page name is invalid. Please enter the valid page name."); return; } if (thiz.isCreatePage) { diff --git a/app/views/PageDetailDialog.xhtml b/app/views/PageDetailDialog.xhtml index f9ef039e..31069736 100644 --- a/app/views/PageDetailDialog.xhtml +++ b/app/views/PageDetailDialog.xhtml @@ -1,19 +1,19 @@
Please enter the page properties: @@ -42,8 +45,8 @@ - - + + diff --git a/app/views/collections/AboutCollectionDialog.js b/app/views/collections/AboutCollectionDialog.js index f8ddd93e..9a248f2a 100644 --- a/app/views/collections/AboutCollectionDialog.js +++ b/app/views/collections/AboutCollectionDialog.js @@ -3,6 +3,9 @@ function AboutCollectionDialog(collection) { this.title = function () { return collection.displayName; }; + this.subTitle = function () { + return collection.description || "Information about this shape collection"; + }; //this.title = collection.displayName; var node = Dom.newDOMElement({ @@ -33,7 +36,8 @@ function AboutCollectionDialog(collection) { _children :[ { _name: "h4", - _text: "More Information: " + _text: "More Information:", + "class": "MoreInfor" }, { _name: "a", diff --git a/app/views/collections/AboutCollectionDialog.xhtml b/app/views/collections/AboutCollectionDialog.xhtml index d8d1e66e..511b224d 100644 --- a/app/views/collections/AboutCollectionDialog.xhtml +++ b/app/views/collections/AboutCollectionDialog.xhtml @@ -22,6 +22,9 @@ padding: 0em; margin-top: 0.2em; } + @aboutContent h4.MoreInfor { + margin-right: 5px; + } diff --git a/app/views/collections/CollectionBrowserDialog.js b/app/views/collections/CollectionBrowserDialog.js index 56197c4d..622c59ea 100644 --- a/app/views/collections/CollectionBrowserDialog.js +++ b/app/views/collections/CollectionBrowserDialog.js @@ -3,7 +3,8 @@ function CollectionBrowserDialog (collectionPanel, managerDialog) { this.collectionPanel = collectionPanel; this.managerDialog = managerDialog; - this.title = "Browse Collections"; + this.title = "Collection Repository"; + this.subTitle = "Browse the user-contributed collection repository." this.collectionRepeater.populator = function (collection, binding) { binding.collectionTitle.innerHTML = Dom.htmlEncode(collection.displayName); @@ -69,6 +70,8 @@ CollectionBrowserDialog.prototype.handleItemClick = function (control) { view.setAttribute("installed", "true"); thiz.managerDialog.loadCollectionList(); + thiz.collectionPanel.reload(newCollection.id); + } }); } else if (control._role == "button-uninstall") { diff --git a/app/views/collections/CollectionBrowserDialog.xhtml b/app/views/collections/CollectionBrowserDialog.xhtml index 1fccf351..60dde43d 100644 --- a/app/views/collections/CollectionBrowserDialog.xhtml +++ b/app/views/collections/CollectionBrowserDialog.xhtml @@ -15,8 +15,8 @@ flex-wrap: wrap; overflow: auto; width: 56em; - min-height: 50em; - max-height: 50em; + min-height: 40em; + max-height: 40em; padding: 0em 1em 1em 0em; } @collectionContainer[loaded] @bootingIndicator { diff --git a/app/views/collections/CollectionManagementDialog.js b/app/views/collections/CollectionManagementDialog.js index 88eacc61..2e136cee 100644 --- a/app/views/collections/CollectionManagementDialog.js +++ b/app/views/collections/CollectionManagementDialog.js @@ -3,6 +3,7 @@ function CollectionManagementDialog (collectionPanel) { this.collectionPanel = collectionPanel; this.title = "Manage Collections"; + this.subTitle = "Browse the list of collections installed in this system."; this.loadCollectionList(); @@ -17,6 +18,77 @@ function CollectionManagementDialog (collectionPanel) { node.setAttribute("selected", "true"); }; }, false); + + this.collectionContainer.addEventListener("mouseover",function (event) { + var node = Dom.findUpwardForNodeWithData(event.target, "_collection"); + if (node) { + if (this.activeNode) { + this.activeNode.removeAttribute("active"); + this.activeNode = null; + } + this.activeNode = node; + node.setAttribute("active","true"); + } + }, false); + + var thiz = this; + this.collectionContainer.addEventListener("dblclick",function (event) { + var top = Dom.findUpwardForNodeWithData(event.target, "_collection"); + var visible = CollectionManager.isCollectionVisible (top._collection); + if (!visible) { + CollectionManager.setCollectionVisible (top._collection, true) ; + } + thiz.collectionPanel.reload(top._collection.id); + thiz.close(); + }, false); + + this.bind("dragstart", function (ev) { + var node = Dom.findUpwardForNodeWithData(event.target, "_collection"); + if (!node) return; + ev.dataTransfer.setData("collectionId", node._collection.id); + ev.dataTransfer.setData("dragType", "collection"); + if (this.currentDraggedObject) this.currentDraggedObject.removeAttribute("dragged"); + this.currentDraggedObject = node; + this.currentDraggedObject.setAttribute("dragged", "true"); + }, this.collectionContainer); + + this.bind("dragover", function (ev) { + if (event.dataTransfer.getData("dragType") != "collection") return; + if (this.hoverNode) { + this.hoverNode.removeAttribute("hover"); + this.hoverNode = null; + } + var node = Dom.findUpwardForNodeWithData(event.target, "_collection"); + if (node) { + node.setAttribute("hover", "true"); + this.hoverNode = node; + } + + }, this.collectionContainer); + + this.bind("drop", function (ev) { + if (event.dataTransfer.getData("dragType") != "collection") return; + if (this.hoverNode) { + this.hoverNode.removeAttribute("hover"); + this.hoverNode = null; + } + var node = Dom.findUpwardForNodeWithData(event.target, "_collection"); + if (!node) return; + var draggedCollectionId = ev.dataTransfer.getData("collectionId"); + var targetCollectionId = node._collection.id; + if (node._collection.id != draggedCollectionId) { + CollectionManager.reorderCollections(draggedCollectionId, targetCollectionId); + thiz.loadCollectionList(); + thiz.collectionPanel.reload(); + } + node.removeAttribute("hover"); + }, this.collectionContainer); + + this.bind("dragend", function (event) { + if (this.currentDraggedObject) this.currentDraggedObject.removeAttribute("dragged"); + this.currentDraggedObject = null; + }, this.collectionContainer); + } __extend(Dialog, CollectionManagementDialog); @@ -138,6 +210,8 @@ CollectionManagementDialog.prototype.createCollectionView = function (collection view._id = collection.displayName; view._collection = collection; view.setAttribute("selected", "false"); + view.setAttribute("draggable", "true"); + return view; } @@ -148,6 +222,7 @@ CollectionManagementDialog.prototype.loadCollectionList = function () { this.collectionContainer.appendChild(this.createCollectionView(collections[i])); } } + CollectionManagementDialog.prototype.getDialogActions = function () { var thiz = this; return [ @@ -157,6 +232,7 @@ CollectionManagementDialog.prototype.getDialogActions = function () { run: function () { CollectionManager.installNewCollection(function (err, collection) { if (!err && collection) { + thiz.collectionPanel.reload(collection.id); NotificationPopup.show("Collection was installed successfully."); thiz.loadCollectionList(); } diff --git a/app/views/collections/CollectionManagementDialog.xhtml b/app/views/collections/CollectionManagementDialog.xhtml index dfa119ad..9a5537c9 100644 --- a/app/views/collections/CollectionManagementDialog.xhtml +++ b/app/views/collections/CollectionManagementDialog.xhtml @@ -1,5 +1,20 @@ - Dialog Title +
+ Dialog Title + +
close
diff --git a/app/views/common/PageListView.js b/app/views/common/PageListView.js index 7fa88a71..2b359d8b 100644 --- a/app/views/common/PageListView.js +++ b/app/views/common/PageListView.js @@ -327,10 +327,7 @@ PageListView.prototype.renderPages = function() { var pageThumbnailView = new PageThumbnailView(); pageThumbnailView.node()._index = i; - var childrenListMenu = new ChildPageListMenu(page, function (selectedPage) { - thiz.activatePage(selectedPage); - }); - pageThumbnailView.setPage(page, childrenListMenu); + pageThumbnailView.setPage(page); this.pageListContainer.appendChild(pageThumbnailView.node()); pageThumbnailView.setAttribute("draggable", "true"); diff --git a/app/views/common/PageThumbnailView.js b/app/views/common/PageThumbnailView.js index 2593cdb5..b346c522 100644 --- a/app/views/common/PageThumbnailView.js +++ b/app/views/common/PageThumbnailView.js @@ -23,8 +23,16 @@ function PageThumbnailView() { this.pageThumbnail.style.visibility = "hidden"; this.bind("click",function (event) { - if (!this.childMenu) return; + if (this.childMenu && this.childMenu._visible) { + this.childMenu.hide(); + this.childMenu._visible = false; + return; + } + if (!this.childMenu) { + this.childMenu = new ChildPageListMenu(this.page); + } this.childMenu.showMenu(this.pageActionButton,"left-inside", "top", 0, 0, true); + this.childMenu._visible = true; event.stopPropagation(); }, this.pageActionButton); } @@ -33,7 +41,7 @@ __extend(BaseTemplatedWidget, PageThumbnailView); PageThumbnailView.prototype.setPage = function (page, childMenu) { if (!page) return; this.page = page; - this.childMenu = childMenu; + // this.childMenu = childMenu; this._updateUI(); }; PageThumbnailView.prototype._updateUI = function () { @@ -41,7 +49,7 @@ PageThumbnailView.prototype._updateUI = function () { if (!this.page.children || this.page.children.length == 0) this.pageActionButton.style.visibility = "hidden"; if (this.page.thumbPath) this.pageThumbnail.src = this.page.thumbPath + "?time=" + (new Date().getTime()); this.pageTitle.innerHTML = this.page.name; - this.node().setAttribute("title", this.page.id); + this.node().setAttribute("title", this.page.name); }; PageThumbnailView.prototype.selectPage = function (active) { diff --git a/app/views/common/PageThumbnailView.xhtml b/app/views/common/PageThumbnailView.xhtml index 372e363f..91504389 100644 --- a/app/views/common/PageThumbnailView.xhtml +++ b/app/views/common/PageThumbnailView.xhtml @@ -41,13 +41,13 @@ align-items: center; } @footer > * { - font-size: 0.85em; + font-size: 1em; } @pageTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-size: 0.8em; + font-size: 0.9em; } @pageTitle[selected="true"] { color: #336699; @@ -60,7 +60,7 @@ border-radius: 50%; height: auto; line-height: 1em; - margin-right: -0.4em; + margin-right: -0.5em; } @footer button i { line-height: 1em; diff --git a/app/views/common/Popup.js b/app/views/common/Popup.js index 2ac3e23b..5a66e4af 100644 --- a/app/views/common/Popup.js +++ b/app/views/common/Popup.js @@ -217,7 +217,8 @@ Popup.prototype._showImpl = function (anchor, hAlign, vAlign, hPadding, vPadding x += w/2; x = Math.max(rect.left + rect.width, x); if (x == 0 && w > screenW) { - this.popupContainer.style.width = screenW + "px"; + x = rect.left + rect.width; + this.popupContainer.style.width = ((screenW -x) * 0.9) + "px"; this.popupContainer.style.overflow = "auto"; } } @@ -238,7 +239,8 @@ Popup.prototype._showImpl = function (anchor, hAlign, vAlign, hPadding, vPadding y = Math.min(rect.top + rect.height, y); y = Math.max(0, y); if (y == 0 && h > screenH) { - this.popupContainer.style.height = screenH + "px"; + y = rect.top + rect.height; + this.popupContainer.style.height = ((screenH - y) * 0.9) + "px"; this.popupContainer.style.overflow = "auto"; } } @@ -293,3 +295,6 @@ Popup.prototype.detach = function () { this.popupContainer.parentNode.removeChild(this.popupContainer); } }; +Popup.hasShowPopup = function () { + return BaseWidget.closables.length; +}; diff --git a/app/views/common/ProgressiveJobDialog.js b/app/views/common/ProgressiveJobDialog.js index 71589912..e0d8c84c 100644 --- a/app/views/common/ProgressiveJobDialog.js +++ b/app/views/common/ProgressiveJobDialog.js @@ -8,6 +8,7 @@ ProgressiveJobDialog.prototype.setup = function (options) { this.options = options || {}; this.starter = this.options.starter; this.title = this.options.title || "Progress"; + this.subTitle = this.options.subTitle || "Please wait while Pencil is excuting job"; var thiz = this; var listener = { diff --git a/app/views/common/PromptDialog.js b/app/views/common/PromptDialog.js index 76fa8125..2200a4ab 100644 --- a/app/views/common/PromptDialog.js +++ b/app/views/common/PromptDialog.js @@ -10,10 +10,22 @@ PromptDialog.prototype.setup = function (options) { } if (options.title) this.title = options.title; if (options.message) this.message.innerHTML = options.message; - if (options.value) this.valueInput.value = options.value; + if (options.value != undefined) { + this.valueInput.value = options.value; + } + + if (typeof(options.value) == "number" || typeof(options.defaultValue) == "number") { + this.valueInput.setAttribute("type", "number"); + this.valueInput.style.width = "6em"; + } + this.callback = options.callback; -}; + window.setTimeout(function () { + this.valueInput.focus(); + this.valueInput.select(); + }.bind(this), 200); +}; PromptDialog.prototype.getDialogActions = function () { var thiz = this; return [ diff --git a/app/views/common/PromptDialog.xhtml b/app/views/common/PromptDialog.xhtml index a88e0a57..e4d45ebe 100644 --- a/app/views/common/PromptDialog.xhtml +++ b/app/views/common/PromptDialog.xhtml @@ -3,6 +3,6 @@
Please enter the value
- +
diff --git a/app/views/common/ToolBar.js b/app/views/common/ToolBar.js index e5b28d0b..6c404414 100644 --- a/app/views/common/ToolBar.js +++ b/app/views/common/ToolBar.js @@ -8,7 +8,12 @@ ToolBar.prototype.setup = function() { if (this.registerCommands) this.registerCommands(); Dom.doOnAllChildRecursively(this.commandContainer, function (n) { if (!n.getAttribute || !n.getAttribute("command")) return; - var command = n.getAttribute("command"); - UICommandManager.installControl(command, n); + var commandKey = n.getAttribute("command"); + UICommandManager.installControl(commandKey, n); + var command = UICommandManager.getCommand(commandKey); + if (command) { + var title = command.label + " " + (command.shortcutLabel || command.shortcut); + n.setAttribute("title", title); + } }); }; diff --git a/app/views/common/UICommandManager.js b/app/views/common/UICommandManager.js index 863fff4f..bdfff62c 100644 --- a/app/views/common/UICommandManager.js +++ b/app/views/common/UICommandManager.js @@ -5,12 +5,12 @@ UICommandManager.commands = []; UICommandManager.map = {}; UICommandManager.keyMap = {}; -UICommandManager.mapKey = function (name, keyCode, pcName, macName) { +UICommandManager.mapKey = function (name, keyCode, pcName, macName, macKeyCode) { var key = { name: name, - keyCode: keyCode, + keyCode: IS_MAC ? (macKeyCode || keyCode) : keyCode, pcName: pcName, - macName: macName || pcName + macName: macName || pcName, }; UICommandManager.keyMap[name] = key; @@ -38,7 +38,7 @@ UICommandManager.mapKey("RIGHT", 39, "Right Arrow"); UICommandManager.mapKey("DOWN", 40, "Down Arrow"); UICommandManager.mapKey("PRINTSCREEN", 44, "Print Screen"); UICommandManager.mapKey("INSERT", 45, "Insert"); -UICommandManager.mapKey("DELETE", 46, "Delete"); +UICommandManager.mapKey("DELETE", 46, "Delete", "Delete", 8); UICommandManager.mapKey("0", 48, "0"); UICommandManager.mapKey("1", 49, "1"); UICommandManager.mapKey("2", 50, "2"); @@ -178,6 +178,7 @@ UICommandManager.installControl = function (commandKey, control) { }, false); }; UICommandManager.invalidateCommand = function (command) { + console.log("invalidateCommand:", command); if (!command.controls) return; var valid = command.isValid ? command.isValid() : !command.disabled; for (var i = 0; i < command.controls.length; i ++) { @@ -193,7 +194,7 @@ UICommandManager.invalidateCommands = function () { } }; UICommandManager.parseShortcut = function (command) { - const RE = /^(Ctrl\+)?(Alt\+)?(Shift\+)?([a-z0-9_]+)$/i; + const RE = /^(Ctrl\+)?(Alt\+)?(Shift\+)?(Cmd\+)?([a-z0-9_]+)$/i; command.parsedShortcut = null; if (!command.shortcut || !command.shortcut.match(RE)) return; @@ -201,18 +202,20 @@ UICommandManager.parseShortcut = function (command) { var shortcut = { ctrl: RegExp.$1 ? true : false, alt: RegExp.$2 ? true : false, - shift: RegExp.$3 ? true : false + shift: RegExp.$3 ? true : false, + command: RegExp.$4 ? true : false }; - var keyName = RegExp.$4.toUpperCase(); + var keyName = RegExp.$5.toUpperCase(); var key = UICommandManager.keyMap[keyName]; if (!key) return; shortcut.key = key; shortcut.displayName = ""; - if (shortcut.ctrl) shortcut.displayName += (IS_MAC ? "⌘" : "Ctrl+"); + if (shortcut.ctrl) shortcut.displayName += (IS_MAC ? (shortcut.command ? "^" : "⌘") : "Ctrl+"); if (shortcut.alt) shortcut.displayName += (IS_MAC ? "⌥" : "Alt+"); if (shortcut.shift) shortcut.displayName += (IS_MAC ? "⇪" : "Shift+"); + if (shortcut.command) shortcut.displayName += "⌘"; shortcut.displayName += IS_MAC ? key.macName : key.pcName; @@ -227,13 +230,11 @@ UICommandManager.isValidFunction = function (event) { return UICommandManager.isApplicable(this, UICommandManager.currentFocusedElement) && (!this._isValid || this._isValid()); }; UICommandManager.handleKeyEvent = function (event) { - var eventCtrlKey = IS_MAC ? event.metaKey : event.ctrlKey; - - if (eventCtrlKey && event.altKey && event.shiftKey && event.keyCode == 80) { + if ((IS_MAC ? event.metaKey : event.ctrlKey) && event.altKey && event.shiftKey && event.keyCode == 80) { Pencil.app.mainWindow.openDevTools(); } - if (Dialog.hasOpenDialog()) return; + if (Dialog.hasOpenDialog() || Popup.hasShowPopup()) return; for (var i = 0; i < UICommandManager.commands.length; i ++) { var command = UICommandManager.commands[i]; @@ -243,10 +244,14 @@ UICommandManager.handleKeyEvent = function (event) { continue; } - if (eventCtrlKey == command.parsedShortcut.ctrl + var eventCmdKey = command.parsedShortcut.command ? event.metaKey : false; + var eventCtrlKey = !command.parsedShortcut.command && IS_MAC ? event.metaKey : event.ctrlKey; + if (eventCmdKey == command.parsedShortcut.command + && eventCtrlKey == command.parsedShortcut.ctrl && event.altKey == command.parsedShortcut.alt && event.shiftKey == command.parsedShortcut.shift && event.keyCode == command.parsedShortcut.key.keyCode) { + command.run(event); event.preventDefault(); return; diff --git a/app/views/editors/AlignEditor.xhtml b/app/views/editors/AlignEditor.xhtml index 20694900..d232d890 100644 --- a/app/views/editors/AlignEditor.xhtml +++ b/app/views/editors/AlignEditor.xhtml @@ -28,12 +28,12 @@ overflow: hidden; text-overflow: ellipsis; } - @horzCombo button { + @horzCombo { border-right: none !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } - @vertCombo button { + @vertCombo { border-top-left-radius: 0px; border-bottom-left-radius: 0px; } diff --git a/app/views/editors/ColorEditor.xhtml b/app/views/editors/ColorEditor.xhtml index 7f02296d..2c42c982 100644 --- a/app/views/editors/ColorEditor.xhtml +++ b/app/views/editors/ColorEditor.xhtml @@ -3,9 +3,9 @@ - - - + + +
diff --git a/app/views/editors/ColorPropertyEditor.js b/app/views/editors/ColorPropertyEditor.js index 715cf8b3..34b8e9bc 100644 --- a/app/views/editors/ColorPropertyEditor.js +++ b/app/views/editors/ColorPropertyEditor.js @@ -1,7 +1,6 @@ function ColorPropertyEditor() { PropertyEditor.call(this); this.bind("p:PopupHidden", function () { - // this.selectorContainer.removePopup(); }, this.selectorContainer); var thiz = this; this.selectorContainer.shouldCloseOnBlur = function(event) { @@ -31,8 +30,19 @@ ColorPropertyEditor.prototype.setup = function () { thiz.onValueChanged(thiz.selector); }, false); + this.selector.addEventListener("p:CloseColorSelector", function (event) { + if (thiz.selectorContainer.isVisible()) { + thiz.selectorContainer.hide(); + return; + } + }, false); + this.colorText.addEventListener("change", function(event) { var val = thiz.colorText.value; + if (val == "") { + thiz.colorText.value = thiz.color.toRGBString(); + return; + } var uppercaseVal = val.toRGBString ? val.toRGBString().toUpperCase() : (val.toUpperCase ? val.toUpperCase() : val); // Translate standard HTML color strings: if (uppercaseVal[0] != "#") { @@ -104,8 +114,8 @@ ColorPropertyEditor.prototype.setValue = function (color) { ColorPropertyEditor.prototype.onValueChanged = function (element) { if (element != this.colorText) { this.colorText.value = this.color.toRGBString(); - this.colorText.style.backgroundColor = this.color.toRGBString(); } + this.colorText.style.backgroundColor = this.color.toRGBString(); if (element) { this.fireChangeEvent(); } diff --git a/app/views/editors/ColorSelector.js b/app/views/editors/ColorSelector.js index 94f23e9c..05e0129d 100644 --- a/app/views/editors/ColorSelector.js +++ b/app/views/editors/ColorSelector.js @@ -20,6 +20,10 @@ function ColorSelector() { // wheel selector event handler this.htmlCodeInput.addEventListener("change", function(event) { var val = thiz.htmlCodeInput.value; + if (val == "") { + thiz.htmlCodeInput.value = thiz.color.toRGBString() || ""; + return; + } var uppercaseVal = val.toRGBString ? val.toRGBString().toUpperCase() : (val.toUpperCase ? val.toUpperCase() : val); // Translate standard HTML color strings: if (uppercaseVal[0] != "#") { @@ -100,7 +104,9 @@ function ColorSelector() { }, false); - this.bright.addEventListener("change", function(event) { + this.bright.addEventListener("input", function(event) { + if (!thiz.bright.value) thiz.bright.value = 0; + var hsv = thiz.color.getHSV(); var a = thiz.color.a; @@ -109,7 +115,9 @@ function ColorSelector() { thiz.onValueChanged(thiz.bright); }, false); - this.hue.addEventListener("change", function(event) { + this.hue.addEventListener("input", function(event) { + if (!thiz.hue.value) thiz.hue.value = 0; + var hsv = thiz.color.getHSV(); var a = thiz.color.a; @@ -117,7 +125,9 @@ function ColorSelector() { thiz.color.a = a; thiz.onValueChanged(thiz.hue); }, false); - this.sat.addEventListener("change", function(event) { + this.sat.addEventListener("input", function(event) { + if (!thiz.sat.value) thiz.sat.value = 0; + var hsv = thiz.color.getHSV(); var a = thiz.color.a; @@ -154,11 +164,8 @@ function ColorSelector() { thiz.color = Color.fromHSV(h, s, value); thiz.color.a = a; thiz.onValueChanged(thiz.wheelImage); + thiz.clearSelectedColor(thiz.recentlyUsedColor); }, false); - // this.clearSatButton.addEventListener("command", function(event) { - // thiz.sat.value = 0; - // thiz._handleHueSatNumberChange(true); - // }, false) if (this.hasAttribute("color")) { this.setColor(Color.fromString(this.getAttribute("color"))); @@ -166,10 +173,6 @@ function ColorSelector() { this.setColor(new Color()); } - // grid selector event handler - // this.gridSelectorContainer.addEventListener("mouseover", function (event) { - // this.hoverCell(event.originalTarget); - // }, false); this.gridSelectorContainer.addEventListener("click", function (event) { var colorCell = Dom.findUpward(event.target, function (n) { return n.hasAttribute("color"); @@ -177,6 +180,7 @@ function ColorSelector() { if (!colorCell) return; thiz.updatingColor = false; thiz.selectColorCell(colorCell); + thiz._emitCloseEvent(); }, false); this.recentlyUsedColor.addEventListener("click", function (event) { @@ -185,6 +189,7 @@ function ColorSelector() { }); if (!colorCell) return; thiz.selectColorCell(colorCell, true); + thiz._emitCloseEvent(); }, false); } __extend(BaseTemplatedWidget, ColorSelector); @@ -268,14 +273,31 @@ ColorSelector.prototype._emitChangeEvent = function () { event.initEvent("ValueChange", false, false); this.dispatchEvent(event); }; +ColorSelector.prototype._emitCloseEvent = function () { + Dom.emitEvent("p:CloseColorSelector", this.node(), {}); +}; ColorSelector.prototype._changHS = function (hue, sat) { this.hue.value = hue; this.sat.value = sat; this._emitChangeEvent(); }; ColorSelector.prototype.setColor = function (color) { + this.selectedCell = null; this.color = color; this.onValueChanged(); + if (!this.selectedCell) { + var uppercaseVal = this.color.toRGBString().toUpperCase(); + Dom.doOnAllChildRecursively(this.recentlyUsedColor, function (n) { + if (n.getAttribute) { + if (n.getAttribute("color") == uppercaseVal) { + n.setAttribute("selected", "true"); + this.selectedCell = n; + } else { + n.removeAttribute("selected"); + } + } + }); + } }; ColorSelector.prototype.setGridSelectorColor = function () { if (!this._initialized) this.initializeGridSelector(); @@ -284,7 +306,7 @@ ColorSelector.prototype.setGridSelectorColor = function () { var thiz = this; Dom.doOnAllChildRecursively(this.gridSelectorContainer, function (n) { - if (thiz.isColorCell(n)) { + if (n.getAttribute) { if (n.getAttribute("color") == uppercaseVal) { n.setAttribute("selected", "true"); thiz.selectedCell = n; @@ -293,10 +315,8 @@ ColorSelector.prototype.setGridSelectorColor = function () { } } }); - }; ColorSelector.prototype.initializeGridSelector = function () { - if (this._initialized) return; this._initialized = true; @@ -310,8 +330,6 @@ ColorSelector.prototype.initializeGridSelector = function () { if (this._timer) clearInterval(this._timer); this._timer = setInterval(function () { var colors = Config.get("gridcolorpicker.recentlyUsedColors"); - //debug("color: " + [colors, thiz._lastColors]); - //debug("color: " + colors); if (colors != thiz._lastUsedColors) { thiz._lastUsedColors = colors; @@ -348,11 +366,7 @@ ColorSelector.prototype.updateRecentlyUsedColors = function () { var colors = this.recentlyUsedColors.join(","); Config.set("gridcolorpicker.recentlyUsedColors", colors); this.updatingColor = false; - Dom.doOnAllChildren(this.recentlyUsedColors, function (n) { - if (thiz.isColorCell(n)) { - n.removeAttribute("selected"); - } - }); + this.clearSelectedColor(this.recentlyUsedColor); }; ColorSelector.prototype.reloadRecentlyUsedColors = function () { var thiz = this; @@ -377,10 +391,12 @@ ColorSelector.prototype.reloadRecentlyUsedColors = function () { e[i].setAttribute("color", color); e[i].setAttribute("style", "background-color: " + color); } - Dom.doOnAllChildren(this.recentlyUsedColors, function (n) { - if (thiz.isColorCell(n)) { - n.removeAttribute("selected"); - } + + this.clearSelectedColor(this.recentlyUsedColor); +}; +ColorSelector.prototype.clearSelectedColor = function (parentNode) { + Dom.doOnAllChildren(parentNode, function (n) { + if (n.removeAttribute) n.removeAttribute("selected"); }); }; ColorSelector.prototype.selectColorCell = function (cell, selectFromRecentlyUsedColors) { @@ -441,5 +457,6 @@ ColorSelector.prototype.onValueChanged = function (source) { this.updateRecentlyUsedColors(); } this.invalidateUI(source); + this.clearSelectedColor(this.recentlyUsedColor); this._emitChangeEvent(); }; diff --git a/app/views/editors/ColorSelector.xhtml b/app/views/editors/ColorSelector.xhtml index 7bc19f12..a41adbf4 100644 --- a/app/views/editors/ColorSelector.xhtml +++ b/app/views/editors/ColorSelector.xhtml @@ -49,10 +49,11 @@ @hue, @sat, @bright { - width: 3em; + width: 3.5em; } @brightnessContainer { padding-top: 1em; + align-items: center; } @brightnessContainer > * + * { margin-left: 0.5em; @@ -218,7 +219,7 @@ - + diff --git a/app/views/editors/ComboManager.js b/app/views/editors/ComboManager.js index 955946b8..a1312371 100644 --- a/app/views/editors/ComboManager.js +++ b/app/views/editors/ComboManager.js @@ -1,14 +1,22 @@ function ComboManager() { BaseTemplatedWidget.call(this); + this.button = this.node(); this.renderer = ComboManager.DEFAULT_RENDERER; this.bind("click", function () { if (this.popup.isVisible()) { + if (thiz.selectingIndex) { + thiz.selectItem(thiz.items[thiz.selectingIndex], true); + return; + } this.popup.close(); return; } this.button.setAttribute("active", true); this.popup.show(this.button, "left-inside", "bottom", 0, 5); }, this.button); + var thiz = this; + this.bind("keydown", this.handleKeyDown, this.button); + this.bind("keypress", this.handleKeyPress, this.button); this.bind("click", this.onItemClick, this.list); this.bind("p:PopupShown", function () { thiz.ensureSelectedItemVisible(); @@ -19,7 +27,6 @@ function ComboManager() { // this.popup.removePopup(); // this.popup.popupContainer.scrollTop = 0; }, this.popup); - var thiz = this; this.popup.shouldCloseOnBlur = function (event) { var found = Dom.findUpward(event.target, function (node) { return node == thiz.button; @@ -47,20 +54,27 @@ ComboManager.prototype.ensureSelectedItemVisible = function() { var node = this.list.childNodes[i]; var data = Dom.findUpwardForData(node, "_data"); if (comparer(this.selectedItem, data)) { - var oT = Dom.getOffsetTop(node); - var oH = node.offsetHeight; - var pT = Dom.getOffsetTop(this.list.parentNode) + 10; - var pH = this.list.parentNode.offsetHeight - 20; - - if (oT < pT) { - this.popup.popupContainer.scrollTop = Math.max(0, this.popup.popupContainer.scrollTop - (pT - oT)); - } else if (oT + oH > pT + pH) { - this.popup.popupContainer.scrollTop = Math.max(0, this.popup.popupContainer.scrollTop + (oT + oH - pT - pH)); - } - break; + node.setAttribute("selected", "true"); + this.scrollTo(i); + this.selectingIndex = i; + } else { + node.removeAttribute("selected"); } } } +ComboManager.prototype.scrollTo = function(index) { + var node = this.list.childNodes[index]; + var oT = Dom.getOffsetTop(node); + var oH = node.offsetHeight; + var pT = Dom.getOffsetTop(this.list.parentNode) + 10; + var pH = this.list.parentNode.offsetHeight - 20; + + if (oT < pT) { + this.popup.popupContainer.scrollTop = Math.max(0, this.popup.popupContainer.scrollTop - (pT - oT)); + } else if (oT + oH > pT + pH) { + this.popup.popupContainer.scrollTop = Math.max(0, this.popup.popupContainer.scrollTop + (oT + oH - pT - pH)); + } +} ComboManager.prototype.setItems = function (items) { var first = null; this.items = items; @@ -126,14 +140,21 @@ ComboManager.prototype.selectItem = function (item, fromUserAction, whenMatched) this.selectedItem = item; if (fromUserAction) { Dom.emitEvent("p:ItemSelected", this.node(), {}); - this.popup.hide(); + if (this.popup.isVisible()) { + this.popup.hide(); + } } for (var i = 0; i < this.list.childNodes.length; i ++) { var c = this.list.childNodes[i]; if (c.setAttribute) { var item = Dom.findUpwardForData(c, "_data"); - c.setAttribute("selected", comparer(item, this.selectedItem) ? "true" : "false"); + var selected = comparer(item, this.selectedItem); + c.setAttribute("selected", selected); + if (selected) { + this.selectingIndex = i; + this.selectedNode = c; + } } } return matched; @@ -149,3 +170,58 @@ ComboManager.prototype.setDisabled = function (disabled) { this.button.removeAttribute("disabled"); } }; +ComboManager.prototype.handleKeyDown = function (event) { + if (event.keyCode == DOM_VK_UP || event.keyCode == DOM_VK_DOWN) { + if (this.selectedNode) { + this.selectedNode.removeAttribute("selected"); + } + if (this.selectingIndex) { + this.list.childNodes[this.selectingIndex].removeAttribute("selected"); + } + if (event.keyCode == DOM_VK_UP) { + this.selectingIndex--; + if (this.selectingIndex < 0) { + this.selectingIndex = this.items.length -1; + } + } else if (event.keyCode == DOM_VK_DOWN){ + this.selectingIndex++; + if (this.selectingIndex > this.items.length -1) { + this.selectingIndex = 0; + } + } + this.list.childNodes[this.selectingIndex].setAttribute("selected", "true"); + this.scrollTo(this.selectingIndex); + } +}; +ComboManager.prototype.handleKeyPress = function (event) { + var keyCode = event.keyCode; + if ( + (keyCode > 47 && keyCode < 58) + || (keyCode > 64 && keyCode < 91) + || (keyCode > 95 && keyCode < 122) + ) { + let now = new Date().getTime(); + let delta = now - (this.lastKeyPressTime || 0); + if (!this.prefix || delta > 1000) { + this.prefix = String.fromCharCode(event.charCode); + } else { + this.prefix += String.fromCharCode(event.charCode); + } + + this.lastKeyPressTime = now; + + var found = false; + for (var i = 0; i < this.list.childNodes.length; i ++) { + var node = this.list.childNodes[i]; + if (!found && node.textContent && node.textContent.trim().toLowerCase().indexOf(this.prefix.trim().toLowerCase()) == 0) { + this.selectingIndex = i; + node.setAttribute("selected", "true"); + this.scrollTo(this.selectingIndex); + found = true; + } else { + node.removeAttribute("selected"); + } + } + + } +}; diff --git a/app/views/editors/ComboManager.xhtml b/app/views/editors/ComboManager.xhtml index 545c5c88..bd352b11 100644 --- a/app/views/editors/ComboManager.xhtml +++ b/app/views/editors/ComboManager.xhtml @@ -1,18 +1,13 @@ - + - - - - -
- + expand_more + + + + + diff --git a/app/views/editors/FontEditor.js b/app/views/editors/FontEditor.js index 2d6c5af9..09401789 100644 --- a/app/views/editors/FontEditor.js +++ b/app/views/editors/FontEditor.js @@ -41,15 +41,29 @@ FontEditor.prototype.setup = function () { }); this.pixelFontSize.addEventListener("click", function(event) { - if (!thiz.font || OnScreenTextEditor.isEditing) return; + if (!thiz.font || OnScreenTextEditor.isEditing || thiz.pixelFontSize.value == "" || thiz.pixelFontSize.value < 5) return; thiz.fireChangeEvent(); }, false); this.pixelFontSize.addEventListener("keyup", function(event) { if (event.keyCode == 13 || event.keyCode == 10) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; + if (!thiz.font || OnScreenTextEditor.isEditing) return; + if (thiz.pixelFontSize.value == "" || thiz.pixelFontSize.value < 5) { + thiz.pixelFontSize.value = 5; + } thiz.fireChangeEvent(); } }, false); + this.pixelFontSize.addEventListener("wheel", function(event) { + if (!thiz.font || OnScreenTextEditor.isEditing || thiz.pixelFontSize.value == "" || thiz.pixelFontSize.value < 5) return; + thiz.fireChangeEvent(); + }); + this.pixelFontSize.addEventListener("change", function(event) { + if (!thiz.font || OnScreenTextEditor.isEditing) return; + if (thiz.pixelFontSize.value == "" || thiz.pixelFontSize.value < 5) { + thiz.pixelFontSize.value = 5; + } + thiz.fireChangeEvent(); + }, false); this.boldButton.addEventListener("click", function(event) { if (!thiz.font || OnScreenTextEditor.isEditing) return; @@ -76,20 +90,6 @@ FontEditor.prototype.setup = function () { thiz.fireChangeEvent(); }, false); - - /* - this.underlineButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.decor = thiz.underlineButton.checked ? "underline" : "none"; - thiz.fireEvent(); - }, false); - - this.strikeButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.strike = thiz.strikeButton.checked ? "strikethrough" : "none"; - thiz.fireEvent(); - }, false);*/ - }; @@ -112,6 +112,7 @@ FontEditor.prototype.setValue = function (font) { // if (this.font.size.match(/^([0-9]+)[^0-9]*$/)) { this.pixelFontSize.value = RegExp.$1; + this.fontSize = RegExp.$1; } if (this.font.weight == "bold") { @@ -133,6 +134,6 @@ FontEditor.prototype.getValue = function () { font.size = this.pixelFontSize.value + "px"; font.weight = (this.boldButton.getAttribute("checked") == "true") ? "bold" : "normal"; font.style = (this.italicButton.getAttribute("checked") == "true") ? "italic" : "normal"; - + this.fontSize = this.pixelFontSize.value; return font; }; diff --git a/app/views/editors/FontEditor.xhtml b/app/views/editors/FontEditor.xhtml index cde7d183..a1d11d05 100644 --- a/app/views/editors/FontEditor.xhtml +++ b/app/views/editors/FontEditor.xhtml @@ -9,15 +9,15 @@ border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; } - @fontCombo button { + @fontCombo { border-top-right-radius: 0px; border-bottom-right-radius: 0px; } @pixelFontSize { - width: 5ex; + width: 3.8em; } - @fontCombo button { - width: 2em; + @fontCombo { + flex-basis: 2em; } @fontCombo .AnonId_buttonDisplay { width: 100%; @@ -26,7 +26,7 @@ } - + diff --git a/app/views/editors/OnMenuEditor.js b/app/views/editors/OnMenuEditor.js index fa6b0c74..3e0200de 100644 --- a/app/views/editors/OnMenuEditor.js +++ b/app/views/editors/OnMenuEditor.js @@ -128,6 +128,10 @@ OnMenuEditor.prototype.generateMenuItems = function () { } linkItem.subItems.push({ label: "Notthing", + type: "Selection", + isChecked: function() { + return targetPageId ? false : true; + }, handleAction: function () { thiz.targetObject.setMetadata("RelatedPage", ""); } diff --git a/app/views/editors/OnScreenTextEditor.js b/app/views/editors/OnScreenTextEditor.js index c9ba03db..ba6e368e 100644 --- a/app/views/editors/OnScreenTextEditor.js +++ b/app/views/editors/OnScreenTextEditor.js @@ -193,7 +193,6 @@ OnScreenTextEditor.prototype.handleTextBlur = function (event) { }, 100); }; OnScreenTextEditor.prototype.handleKeyPress = function (event) { - console.log("event.keyCode == DOM_VK_ESCAPE", event.keyCode, DOM_VK_ESCAPE); if (event.keyCode == DOM_VK_RETURN && !event.shiftKey && !event.accelKey && !event.ctrlKey) { this.commitChange(event); } else if (event.keyCode == DOM_VK_ESCAPE) { diff --git a/app/views/editors/SharedColorEditor.js b/app/views/editors/SharedColorEditor.js index 39e2010a..56ea0137 100644 --- a/app/views/editors/SharedColorEditor.js +++ b/app/views/editors/SharedColorEditor.js @@ -43,6 +43,12 @@ SharedColorEditor.prototype.setup = function () { thiz.color = thiz.selector.getColor(); thiz._applyValue(); }, false); + this.selector.addEventListener("p:CloseColorSelector", function (event) { + if (thiz.selectorContainer.isVisible()) { + thiz.selectorContainer.hide(); + return; + } + }, false); }; diff --git a/app/views/editors/SharedColorEditor.xhtml b/app/views/editors/SharedColorEditor.xhtml index 98d5de35..10d85526 100644 --- a/app/views/editors/SharedColorEditor.xhtml +++ b/app/views/editors/SharedColorEditor.xhtml @@ -20,6 +20,7 @@ box-sizing: border-box; border: solid 2px transparent; + text-shadow: 1px 1px 0px #FFF; } body .SharedColorEditorPopup { z-index: 9999; diff --git a/app/views/editors/SharedFontEditor.js b/app/views/editors/SharedFontEditor.js index 3bb5ebef..1499e39c 100644 --- a/app/views/editors/SharedFontEditor.js +++ b/app/views/editors/SharedFontEditor.js @@ -6,9 +6,6 @@ __extend(BaseTemplatedWidget, SharedFontEditor); SharedFontEditor.PROPERTY_NAME = "textFont"; SharedFontEditor.prototype.setup = function () { - //grab control references - /*this.underlineButton = document.getElementById("edUnderlineButton"); - this.strikeButton = document.getElementById("edStrikeButton");*/ this.fontCombo.setDisabled(true); this.pixelFontSize.disabled = true; this.boldButton.disabled = true; @@ -25,17 +22,28 @@ SharedFontEditor.prototype.setup = function () { }); this.pixelFontSize.addEventListener("click", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; + if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing || thiz.pixelFontSize.value == "") return; thiz.font.size = thiz.pixelFontSize.value + "px"; thiz._applyValue(); }, false); + this.pixelFontSize.addEventListener("wheel", function(event) { + if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing || thiz.pixelFontSize.value == "") return; + thiz.font.size = thiz.pixelFontSize.value + "px"; + thiz._applyValue(); + }); this.pixelFontSize.addEventListener("keyup", function(event) { if (event.keyCode == 13 || event.keyCode == 10) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; + if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing || thiz.pixelFontSize.value == "") return; + thiz.pixelFontSize.value = Math.max(5, parseInt(thiz.pixelFontSize.value, 10)); thiz.font.size = thiz.pixelFontSize.value + "px"; thiz._applyValue(); } }, false); + this.pixelFontSize.addEventListener("change", function(event) { + if (thiz.pixelFontSize.value == "") { + thiz.pixelFontSize.value = 5; + } + }, false); this.boldButton.addEventListener("click", function(event) { if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; @@ -72,19 +80,6 @@ SharedFontEditor.prototype.setup = function () { thiz.beginFormatPainter(); }, false); - /* - this.underlineButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.decor = thiz.underlineButton.checked ? "underline" : "none"; - thiz._applyValue(); - }, false); - - this.strikeButton.addEventListener("command", function(event) { - if (!thiz.target || !thiz.font || OnScreenTextEditor.isEditing) return; - thiz.font.strike = thiz.strikeButton.checked ? "strikethrough" : "none"; - thiz._applyValue(); - }, false);*/ - Pencil.formatPainterButton = this.formatPainterButton; }; SharedFontEditor.prototype.reloadFontItems = function () { @@ -115,7 +110,6 @@ SharedFontEditor.prototype.beginFormatPainter = function () { SharedFontEditor.prototype.isDisabled = function () { return this.disabledEditor; }; - SharedFontEditor.prototype._applyValue = function () { var thiz = this; Pencil.activeCanvas.run(function() { @@ -129,7 +123,7 @@ SharedFontEditor.prototype.attach = function (target) { this.detach(); return; } - // + this.fontCombo.setDisabled(false); this.pixelFontSize.disabled = false; this.boldButton.disabled = false; @@ -137,9 +131,7 @@ SharedFontEditor.prototype.attach = function (target) { var formatPainter = Pencil.activeCanvas && target && (target.constructor == Group || target.constructor == Shape); this.formatPainterButton.disabled = !formatPainter; this.disabledEditor = false; - // /*this.underlineButton.disabled = false; - // this.strikeButton.disabled = false;*/ - // + // //set the value var matched = this.fontCombo.selectItem(this.font); @@ -155,7 +147,7 @@ SharedFontEditor.prototype.attach = function (target) { } } } - // + if (this.font.size.match(/^([0-9]+)[^0-9]*$/)) { this.pixelFontSize.value = RegExp.$1; } @@ -171,9 +163,6 @@ SharedFontEditor.prototype.attach = function (target) { } else { this.italicButton.removeAttribute("checked"); } - - /*this.underlineButton.checked = (this.font.decor == "underline"); - this.strikeButton.checked = (this.font.decor == "strikethrough");*/ }; SharedFontEditor.prototype.detach = function () { this.fontCombo.setDisabled(true); @@ -182,8 +171,6 @@ SharedFontEditor.prototype.detach = function () { this.italicButton.disabled = true; this.formatPainterButton.disabled = true; this.disabledEditor = true; - /*this.underlineButton.disabled = true; - this.strikeButton.disabled = true;*/ this.target = null; this.font = null; diff --git a/app/views/editors/SharedFontEditor.xhtml b/app/views/editors/SharedFontEditor.xhtml index 89017f37..4ee5b3f3 100644 --- a/app/views/editors/SharedFontEditor.xhtml +++ b/app/views/editors/SharedFontEditor.xhtml @@ -1,8 +1,5 @@ - - - - - - - + + + + + diff --git a/app/views/editors/SharedGeomtryEditor.js b/app/views/editors/SharedGeomtryEditor.js index d6dcb7a8..99a95a93 100644 --- a/app/views/editors/SharedGeomtryEditor.js +++ b/app/views/editors/SharedGeomtryEditor.js @@ -19,12 +19,12 @@ SharedGeomtryEditor.prototype.setup = function () { this.container.addEventListener("click", function (event) { thiz.handleCommandEvent(); }, false); - this.container.addEventListener("change", function (event) { + this.container.addEventListener("input", function (event) { thiz.handleCommandEvent(); }, false); this.container.addEventListener("keypress", function (event) { - if (event.keyCode == KeyEvent.DOM_VK_UP || event.keyCode == KeyEvent.DOM_VK_DOWN) { + if (event.keyCode == DOM_VK_UP || event.keyCode == DOM_VK_DOWN) { event.stopPropagation(); } }, false); diff --git a/app/views/editors/SharedGeomtryEditor.xhtml b/app/views/editors/SharedGeomtryEditor.xhtml index ed318849..15e9fd5b 100644 --- a/app/views/editors/SharedGeomtryEditor.xhtml +++ b/app/views/editors/SharedGeomtryEditor.xhtml @@ -1,38 +1,21 @@ - + - - - - : - - - x - - - - + + + + + + + + + - - + +
diff --git a/app/views/editors/SharedPropertyEditor.js b/app/views/editors/SharedPropertyEditor.js index 041a1968..d7e5364c 100644 --- a/app/views/editors/SharedPropertyEditor.js +++ b/app/views/editors/SharedPropertyEditor.js @@ -124,6 +124,7 @@ SharedPropertyEditor.prototype.attach = function (target) { { _name: "div", "class": "Label Property", + "flex": "2", _text: propName + ":" } ] @@ -136,7 +137,7 @@ SharedPropertyEditor.prototype.attach = function (target) { var editorWidget = new constructeur(); editorWrapper.appendChild(editorWidget.node()); - editorWidget.setAttribute("flex", "1"); + editorWidget.setAttribute("flex", "3"); if (editorWidget.setTypeMeta) { editorWidget.setTypeMeta(property.meta); } diff --git a/app/views/editors/SharedPropertyEditor.xhtml b/app/views/editors/SharedPropertyEditor.xhtml index 7a7ae4a9..3969529b 100644 --- a/app/views/editors/SharedPropertyEditor.xhtml +++ b/app/views/editors/SharedPropertyEditor.xhtml @@ -33,9 +33,11 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - width: 6em; font-size: 0.9em; } + @propertyContainer > .Group > .Wrapper > * { + flex-basis: 2em; + } @propertyContainer input[type='text'], @propertyContainer input[type='number'], @@ -48,7 +50,6 @@ } @propertyContainer button { min-width: 1.8em; - border: solid 1px rgba(0, 0, 0, 0.2); } @propertyContainer button > i { font-size: 1.4em; diff --git a/app/views/editors/StrokeEditor.js b/app/views/editors/StrokeEditor.js index 0baeade6..4ca5b52e 100644 --- a/app/views/editors/StrokeEditor.js +++ b/app/views/editors/StrokeEditor.js @@ -64,7 +64,8 @@ StrokeEditor.prototype.setup = function () { this.styleCombo.addEventListener("p:ItemSelected", function (event) { thiz.fireChangeEvent(); }, false); - this.strokeWidth.addEventListener("change", function (event) { + this.strokeWidth.addEventListener("input", function (event) { + if (thiz.strokeWidth.value == "") thiz.strokeWidth.value = 1; thiz.fireChangeEvent(); }, false); @@ -72,10 +73,6 @@ StrokeEditor.prototype.setup = function () { StrokeEditor.prototype.setValue = function (stroke) { this.strokeWidth.value = stroke.w; - // if (stroke.array) { - // this.styleCombo.selectItem(stroke.array); - // } - var item = null; for (var i = 0; i < this.items.length; i++) { if (this.items[i].value == stroke.array) { diff --git a/app/views/editors/StrokeEditor.xhtml b/app/views/editors/StrokeEditor.xhtml index 51c6c5c0..d02f44b5 100644 --- a/app/views/editors/StrokeEditor.xhtml +++ b/app/views/editors/StrokeEditor.xhtml @@ -1,29 +1,20 @@ - + - - - - - - + + diff --git a/app/views/editors/StrokeStyleEditor.xhtml b/app/views/editors/StrokeStyleEditor.xhtml index 79ec07a3..0b68fe7b 100644 --- a/app/views/editors/StrokeStyleEditor.xhtml +++ b/app/views/editors/StrokeStyleEditor.xhtml @@ -13,7 +13,7 @@ @styleCombo { width: 6ex; } - @styleCombo button { + @styleCombo { border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-right: none; @@ -24,6 +24,6 @@ display: block; } - - + + diff --git a/app/views/menus/CanvasMenu.js b/app/views/menus/CanvasMenu.js index 24b37ca9..efb69767 100644 --- a/app/views/menus/CanvasMenu.js +++ b/app/views/menus/CanvasMenu.js @@ -103,7 +103,7 @@ CanvasMenu.prototype.setup = function () { UICommandManager.register({ key: "unGroupCommand", label: "Ungroup", - shortcut: "Ctrl+Alt+G", + shortcut: "Ctrl+Shift+G", isAvailable: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && (Pencil.activeCanvas.currentController instanceof Group); @@ -132,7 +132,7 @@ CanvasMenu.prototype.setup = function () { }); UICommandManager.register({ key: "addSelectedToMyCollectionsCommand", - label: "Add to My Collections", + label: "Add to My Collections...", isAvailable: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && (Pencil.activeCanvas.currentController instanceof Shape || Pencil.activeCanvas.currentController instanceof Group); diff --git a/app/views/menus/ChildPageListMenu.js b/app/views/menus/ChildPageListMenu.js index 2b7a73e1..0736e017 100644 --- a/app/views/menus/ChildPageListMenu.js +++ b/app/views/menus/ChildPageListMenu.js @@ -21,7 +21,8 @@ ChildPageListMenu.prototype.setup = function () { key: key, label: page.name, run: function () { - thiz.onDone(page); + // thiz.onDone(page); + ApplicationPane._instance.activatePage(page); }, }; return items; @@ -33,7 +34,8 @@ ChildPageListMenu.prototype.setup = function () { key: key, label: page.name, run: function () { - thiz.onDone(page); + ApplicationPane._instance.activatePage(page); + // thiz.onDone(page); }, type: "SubMenu", subItems: subItems diff --git a/app/views/menus/MainMenu.js b/app/views/menus/MainMenu.js index 9021f262..889d5afa 100644 --- a/app/views/menus/MainMenu.js +++ b/app/views/menus/MainMenu.js @@ -174,4 +174,15 @@ MainMenu.prototype.setup = function () { dialog.open(); } }); + this.separator(); + this.register({ + key: "exitApplicationCommand", + label: "Exit", + isValid: function () { return true; }, + run: function () { + let remote = require("electron").remote; + let currentWindow = remote.getCurrentWindow(); + currentWindow.close(); + } + }); } diff --git a/app/views/menus/PageMenu.js b/app/views/menus/PageMenu.js index f362ee35..27b84043 100644 --- a/app/views/menus/PageMenu.js +++ b/app/views/menus/PageMenu.js @@ -172,6 +172,7 @@ PageMenu.prototype.setup = function () { }, }); UICommandManager.getCommand("exportPageAsPNGButton").isEnabled = function () {return thiz.page}; + UICommandManager.getCommand("exportPageAsPNGButton").page = thiz.page; this.register(UICommandManager.getCommand("exportPageAsPNGButton")); this.separator(); diff --git a/app/views/toolbars/AlignmentToolbar.js b/app/views/toolbars/AlignmentToolbar.js index ef9ffa0c..a2ed8717 100644 --- a/app/views/toolbars/AlignmentToolbar.js +++ b/app/views/toolbars/AlignmentToolbar.js @@ -7,8 +7,9 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignLeftCommand", watchEvents: "p:TargetChanged", - label: "Align Left", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignLeft; }, + label: "Align left", + shortcut: "L", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignLeft; }, run: function () { Pencil.activeCanvas.currentController.alignLeft(); } @@ -16,8 +17,9 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignCenterCommand", watchEvents: "p:TargetChanged", - label: "Align Center", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignCenter; }, + shortcut: "C", + label: "Align center horizontally", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignCenter; }, run: function () { Pencil.activeCanvas.currentController.alignCenter(); } @@ -25,8 +27,9 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignRightCommand", watchEvents: "p:TargetChanged", - label: "Align Right", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignRight; }, + label: "Align right", + shortcut: "R", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignRight; }, run: function () { Pencil.activeCanvas.currentController.alignRight(); } @@ -34,8 +37,9 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignTopCommand", watchEvents: "p:TargetChanged", - label: "Align Top", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignTop; }, + label: "Align top", + shortcut: "T", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignTop; }, run: function () { Pencil.activeCanvas.currentController.alignTop(); } @@ -44,8 +48,9 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignMiddleCommand", watchEvents: "p:TargetChanged", - label: "Align Middle", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignMiddle; }, + label: "Align middle vertically", + shortcut: "M", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignMiddle; }, run: function () { Pencil.activeCanvas.currentController.alignMiddle(); } @@ -53,11 +58,12 @@ AlignmentToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "alignBottomCommand", watchEvents: "p:TargetChanged", - label: "Align Bottom", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignBottom; }, + label: "Align bottom", + shortcut: "B", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.alignBottom; }, run: function () { Pencil.activeCanvas.currentController.alignBottom(); } }); - + }; diff --git a/app/views/toolbars/AlignmentToolbar.xhtml b/app/views/toolbars/AlignmentToolbar.xhtml index da9dae60..2d0672a3 100644 --- a/app/views/toolbars/AlignmentToolbar.xhtml +++ b/app/views/toolbars/AlignmentToolbar.xhtml @@ -2,11 +2,11 @@ - - - - - - + + + + + + diff --git a/app/views/toolbars/EditToolbar.js b/app/views/toolbars/EditToolbar.js index 8cd4ad72..7640cf3c 100644 --- a/app/views/toolbars/EditToolbar.js +++ b/app/views/toolbars/EditToolbar.js @@ -9,7 +9,8 @@ EditToolbar.prototype.registerCommands = function () { watchEvents: "p:TargetChanged", label: "Cut", icon: "content_cut", - isValid: function () { return Pencil.activeCanvas.currentController; }, + shortcut: "Ctrl+X", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController; }, run: function () { Pencil.activeCanvas.doCopy(); Pencil.activeCanvas.deleteSelected(); @@ -20,16 +21,19 @@ EditToolbar.prototype.registerCommands = function () { watchEvents: "p:TargetChanged", label: "Copy", icon: "content_copy", - isValid: function () { return Pencil.activeCanvas.currentController; }, + shortcut: "Ctrl+C", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController; }, run: function () { Pencil.activeCanvas.doCopy(); } }); UICommandManager.register({ key: "pasteCommand", + watchEvents: "p:CanvasActived", label: "Paste", icon: "content_paste", - isValid: function () { return true; /*FIXME: check for clipboard content*/ }, + shortcut: "Ctrl+V", + isValid: function () { return Pencil.activeCanvas && clipboard.availableFormats() ; /*FIXED: check for clipboard content*/ }, run: function () { Pencil.activeCanvas.doPaste(); } diff --git a/app/views/toolbars/FileToolbar.js b/app/views/toolbars/FileToolbar.js index ec1c5491..23f7b53c 100644 --- a/app/views/toolbars/FileToolbar.js +++ b/app/views/toolbars/FileToolbar.js @@ -44,7 +44,7 @@ FileToolbar.prototype.registerCommands = function () { ApplicationPane._instance.showStartupPane(); }); }, - shortcut: "Ctrl+W" + shortcut: "Ctrl+Shift+W" }); UICommandManager.register({ key: "saveAsDocumentCommand", @@ -83,7 +83,9 @@ FileToolbar.prototype.registerCommands = function () { label: "Export page as PNG...", isValid: function () { return true; }, run: function () { - Pencil.controller.rasterizeCurrentPage(); + if (this.page) { + Pencil.controller.rasterizeCurrentPage(this.page); + } }, shortcut: "Ctrl+E" }); diff --git a/app/views/toolbars/SizeToolbar.js b/app/views/toolbars/SizeToolbar.js index fed954a0..3aea723b 100644 --- a/app/views/toolbars/SizeToolbar.js +++ b/app/views/toolbars/SizeToolbar.js @@ -7,8 +7,9 @@ SizeToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "makeSameWidthCommand", watchEvents: "p:TargetChanged", - label: "Make Same Width", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameWidth; }, + label: "Make same width", + shortcut: "W", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameWidth; }, run: function () { Pencil.activeCanvas.currentController.makeSameWidth(); } @@ -17,8 +18,29 @@ SizeToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "makeSameHeightCommand", watchEvents: "p:TargetChanged", - label: "Make Same Height", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameMinHeight; }, + label: "Make same height", + shortcut: "H", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameHeight; }, + run: function () { + Pencil.activeCanvas.currentController.makeSameHeight(); + } + }); + UICommandManager.register({ + key: "makeSameMinWidthCommand", + watchEvents: "p:TargetChanged", + label: "Make same min width", + shortcut: "Ctrl+W", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameMinWidth; }, + run: function () { + Pencil.activeCanvas.currentController.makeSameMinWidth(); + } + }); + UICommandManager.register({ + key: "makeSameMinHeightCommand", + watchEvents: "p:TargetChanged", + label: "Make same min height", + shortcut: "Ctrl+H", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameMinHeight; }, run: function () { Pencil.activeCanvas.currentController.makeSameMinHeight(); } @@ -26,8 +48,9 @@ SizeToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "makeSameHorizontalSpaceCommand", watchEvents: "p:TargetChanged", - label: "Make Same Horizontal Space", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameHorizontalSpace; }, + label: "Make same horizontal gap", + shortcut: "O", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameHorizontalSpace; }, run: function () { Pencil.activeCanvas.currentController.makeSameHorizontalSpace(); } @@ -35,8 +58,9 @@ SizeToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "makeSameVerticalSpaceCommand", watchEvents: "p:TargetChanged", - label: "Make Same Vertical Space", - isValid: function () { return Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameVerticalSpace; }, + shortcut: "V", + label: "Make same vertical gap", + isValid: function () { return Pencil.activeCanvas && Pencil.activeCanvas.currentController && Pencil.activeCanvas.currentController.makeSameVerticalSpace; }, run: function () { Pencil.activeCanvas.currentController.makeSameVerticalSpace(); } diff --git a/app/views/toolbars/SizeToolbar.xhtml b/app/views/toolbars/SizeToolbar.xhtml index c9ad991f..6ff48d29 100644 --- a/app/views/toolbars/SizeToolbar.xhtml +++ b/app/views/toolbars/SizeToolbar.xhtml @@ -3,10 +3,10 @@ - - - - + + + + diff --git a/app/views/toolbars/ZoomToolbar.js b/app/views/toolbars/ZoomToolbar.js index 8a4104ac..05bb69a9 100644 --- a/app/views/toolbars/ZoomToolbar.js +++ b/app/views/toolbars/ZoomToolbar.js @@ -9,6 +9,9 @@ ZoomToolbar.prototype.registerCommands = function () { label: "Zoom in", icon: "zoom_in", shortcut: "Ctrl+EQUALS", + watchEvents: "p:CanvasActived", + isValid: function () {return Pencil.activeCanvas}, + shortcutLabel: "Ctrl+=", run: function () { Pencil.activeCanvas.zoomTo(Pencil.activeCanvas.zoom * 1.25); } @@ -16,19 +19,40 @@ ZoomToolbar.prototype.registerCommands = function () { UICommandManager.register({ key: "zoomOutCommand", shortcut: "Ctrl+SUBTRACT", + shortcutLabel: "Ctrl+-", label: "Zoom out", icon: "zoom_out", + watchEvents: "p:CanvasActived", + isValid: function () {return Pencil.activeCanvas}, run: function () { Pencil.activeCanvas.zoomTo(Pencil.activeCanvas.zoom / 1.25); } }); UICommandManager.register({ key: "zoom1Command", - shortcut: "Ctrl+1", + shortcut: "Ctrl+0", label: "Actual size", icon: "fullscreen", + watchEvents: "p:CanvasActived", + isValid: function () {return Pencil.activeCanvas}, run: function () { Pencil.activeCanvas.zoomTo(1); } }); + UICommandManager.register({ + key: "toggleScreenCommand", + shortcut: IS_MAC ? "Ctrl+Cmd+F" : "F11", // use different key for MAC intendedly + label: "Toggle fullscreen mode", + run: function () { + ApplicationPane._instance.toggleFullscreen(); + } + }); + UICommandManager.register({ + key: "toggleLeftPaneCommand", + shortcut: "BACK_QUOTE", + label: "Toggle left pane", + run: function () { + ApplicationPane._instance.toggleLeftPane(); + } + }); }; diff --git a/app/views/toolbars/ZoomToolbar.xhtml b/app/views/toolbars/ZoomToolbar.xhtml index 846ba164..b550e000 100644 --- a/app/views/toolbars/ZoomToolbar.xhtml +++ b/app/views/toolbars/ZoomToolbar.xhtml @@ -2,8 +2,8 @@ - - + + diff --git a/app/views/tools/NPatchDialog.js b/app/views/tools/NPatchDialog.js index e0df83c2..81f5550b 100644 --- a/app/views/tools/NPatchDialog.js +++ b/app/views/tools/NPatchDialog.js @@ -270,11 +270,6 @@ Walker.prototype.step = function (alpha) { } }; -function Point(x, y) { - this.x = x; - this.y = y; -} - function test() { var cases = [ ["#off", "#on"], diff --git a/app/views/tools/SettingDialog.js b/app/views/tools/SettingDialog.js index e99aad47..b28d3796 100644 --- a/app/views/tools/SettingDialog.js +++ b/app/views/tools/SettingDialog.js @@ -27,7 +27,7 @@ function SettingDialog() { } }, this.settingTabPane); - this.bind("change", function (event) { + this.bind("input", function (event) { var node = Dom.findUpward(event.target, function (n) { return n.getAttribute && n.getAttribute("configName"); }); @@ -39,61 +39,40 @@ function SettingDialog() { node.value = "5"; } } - if (node.type == "number" || node.type == "text") { - if (configName == "external.editor.bitmap.path") - { - if (node.value == "" ) node.value = "/usr/bin/gimp"; - - } - if (configName == "external.editor.vector.path") { + Config.set(configName, node.value); + this.setPreferenceItems(); + }, this.textboxGridSize); - if (node.value == "" ) node.value = "/usr/bin/inkscape"; + this.bind("change", function (event) { + var node = Dom.findUpward(event.target, function (n) { + return n.getAttribute && n.getAttribute("configName"); + }); + if (!node) return; + var configName = node.getAttribute("configName"); + if (configName == "edit.gridSize") { + if (node.value == "" || parseInt(node.value) == 0) { + node.value = "1"; + } + } + if (configName == "view.undoLevel") { + if (node.value == "") { + node.value = "0"; } + } + if (node.type == "number" || node.type == "text") { + // if (configName == "external.editor.bitmap.path") { + // if (node.value == "" ) node.value = "/usr/bin/gimp"; + // } + // if (configName == "external.editor.vector.path") { + // if (node.value == "" ) node.value = "/usr/bin/inkscape"; + // } + Config.set(configName, node.value); this.setPreferenceItems(); } }, this.settingTabPane); - // this.bind("click", function (event) { - // var checked = this.checkboxEnableGrid.checked; - // if (checked) { - // Dom.removeClass(this.textboxGridSize.parentNode, "Disabled"); - // } else { - // Dom.addClass(this.textboxGridSize.parentNode, "Disabled"); - // } - // }, this.checkboxEnableGrid); - // - // this.bind("click", function (event) { - // var checked = this.enableSnapping.checked; - // this.enableSnappingBackground.disabled = !this.enableSnapping.checked; - // if (checked) { - // Dom.removeClass(this.enableSnappingBackground.parentNode, "Disabled"); - // } else { - // Dom.addClass(this.enableSnappingBackground.parentNode, "Disabled"); - // } - // }, this.enableSnapping); - // - // this.bind("click", function (event) { - // var checked = this.undoEnabled.checked; - // if (checked) { - // Dom.removeClass(this.textboxUndoLevel.parentNode, "Disabled"); - // } else { - // Dom.addClass(this.textboxUndoLevel.parentNode, "Disabled"); - // } - // }, this.undoEnabled); - - // this.bind("click", function (event) { - // var checked = this.checkboxScaleImage.checked; - // if (checked) { - // Dom.removeClass(this.textboxClipartBrowserScaleWidth.parentNode, "Disabled"); - // Dom.removeClass(this.textboxClipartBrowserScaleHeight.parentNode, "Disabled"); - // } else { - // Dom.addClass(this.textboxClipartBrowserScaleWidth.parentNode, "Disabled"); - // Dom.addClass(this.textboxClipartBrowserScaleHeight.parentNode, "Disabled"); - // } - // }, this.checkboxScaleImage); - this.bind("input", function (event) { this.setPreferenceItems(); }, this.preferenceNameInput); diff --git a/appveyor.yml b/appveyor.yml index ea794a5c..971be9fb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.0.0-beta.1+{build} +version: 3.0.0-beta.2+{build} platform: - x64 @@ -16,10 +16,10 @@ init: - git config --global core.autocrlf input install: - - ps: Install-Product node 5 x64 + - ps: Install-Product node 6 x64 - git reset --hard HEAD - npm install npm -g - - npm install electron-builder@3.26.1 + - npm install electron-builder@4.2.6 - npm prune - npm install diff --git a/certs/sca.code2.crt b/certs/sca.code2.crt deleted file mode 100644 index f09c30e7..00000000 --- a/certs/sca.code2.crt +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF2DCCA8CgAwIBAgIQbDvSft08lJ6Vjiips8dXoDANBgkqhkiG9w0BAQsFADB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTUxMjE2MDEwMDA1WhcN -MzAxMjE2MDEwMDA1WjB1MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20g -THRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx -IzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDIgT2JqZWN0IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuRQEWPeyxYYsCDJgrQgmwIF3uWgZ2RUrHRhp -5NoalgWXLmR5Gqk9UTNa0Hdq9AKTQcOOunAbq9h7dG+Y6Ne5qT5odqSJoCKsF9Yp -+Lu4YZ/SB9BmDjBHICtwAh7+cwkccTS14n6prKin8Y46QAZ2ksr3eGzvWAVzfX+D -UOmiVQLjAK6Wp8bCZHvj+FhAlS5Ne7/dggDeSVWnMyPm2k/5YKOTVXExJJaAlYkm -yH1OiC3soTkkGb6aJjGJPHiaiNJ4pjkySX5l2p4DQ7K1/J6ft5Vw9PuqwmYrF0Vi -Gnn38kzB2d9UI9Q+dFmHUbV+cnr+FoGl6CiUDd5ZIF1HMrb8hwIDAQABo4IBWjCC -AVYwDgYDVR0PAQH/BAQDAgEGMBMGA1UdJQQMMAoGCCsGAQUFBwMDMBIGA1UdEwEB -/wQIMAYBAf8CAQAwMgYDVR0fBCswKTAnoCWgI4YhaHR0cDovL2NybC5zdGFydHNz -bC5jb20vc2ZzY2EuY3JsMGYGCCsGAQUFBwEBBFowWDAkBggrBgEFBQcwAYYYaHR0 -cDovL29jc3Auc3RhcnRzc2wuY29tMDAGCCsGAQUFBzAChiRodHRwOi8vYWlhLnN0 -YXJ0c3NsLmNvbS9jZXJ0cy9jYS5jcnQwHQYDVR0OBBYEFD5ik5rXxxnuPo9JEIVV -FSDjlIQcMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQQa7yMD8GA1UdIAQ4 -MDYwNAYEVR0gADAsMCoGCCsGAQUFBwIBFh5odHRwOi8vd3d3LnN0YXJ0c3NsLmNv -bS9wb2xpY3kwDQYJKoZIhvcNAQELBQADggIBAGOlPNWzbSco2Ou6U68wC+pKXRLV -+ZrKcPpMY4zXTVR+RupS54WhJCManab2P1ncPlHTbRMbPjfHnyj0sIdpvwcV49n0 -nizMF3MBxaKJEnBBEfHs9Krgjc4qKjR2nOywlzxJ0M27RthR5XjyjQ1ofHlOisYg -MzcyKyMT7YYpxxoC0wTgAh0DNmE5Q/GKFOaDd3S5gTqrR9AQzGaC3IxCKBFtcwvk -51W98lNRtMbm+oJze5T+dL2wIhyWK58sEIl2paAVfAfWGH3umYL46scLn8BXDFch -N1Jgrg07DqY6gxCqSdubPhVHZInuVagktWmrnS6N9V/vVLz+OaX4Mkas8n1J1RIR -+GV8ZQVmTM49l6L+fpv/h95MWLhQOcXanbIY/2cdNEuz5AkhfvDNTQnLxYEMIyMO -tW2QIwwZdz92vMTU17G9goxXYjSm09yw+iBniH9G/xGz39BV3bwa8ZtKHzDoZ54H -T6JT2AraDhrWTwFXv8Xrvv2cir+k0h5bIWlDtImH7Jm152edb77f5JI8JrPf6jxc -UrhNH4xHxe2kGs8ERA39oYlT0dKQIb0obTN6FOF63hBRFFhGB7NuX2FeFjJsZFCk -oJkpsEauObb7Rh+C02+fnHfoi6ivKwUC9BOsWlI4xn7GMe27niL6k7wpK0L6MTG5 -/6gxwosqaMA1aukw ------END CERTIFICATE----- diff --git a/package.json b/package.json index db519053..1e990d9c 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "Pencil", "devDependencies": { - "electron-builder": "3.26.1", - "electron-prebuilt": "^0.37.5", + "electron-builder": "4.2.6", + "electron-prebuilt": "1.2.2", "rimraf": "^2.5.2" }, "build": { "app-bundle-id": "vn.evolus.pencil", "app-category-type": "public.app-category.graphics-design", - "iconUrl": "https://raw.githubusercontent.com/mbrainiac/pencil/master/build/icon.ico", + "iconUrl": "https://raw.githubusercontent.com/evolus/pencil/master/build/icon.ico", "productName": "Pencil", "osx": { "contents": [ @@ -26,8 +26,8 @@ ] }, "linux": { - "description": "An open-source GUI prototyping tool that's available for ALL platforms.", - "synopsis": "An open-source GUI prototyping tool that's available for ALL platforms.", + "description": "An open-source GUI prototyping tool that is available for ALL platforms.", + "synopsis": "An open-source GUI prototyping tool that is available for ALL platforms.", "maintainer": "Nguyen Tien Dzung ", "vendor": "Evolus", "target": ["deb", "rpm", "tar.gz"], @@ -36,7 +36,7 @@ "win": { "authors": "Evolus", "owners": "Evolus", - "description": "An open-source GUI prototyping tool that's available for ALL platforms.", + "description": "An open-source GUI prototyping tool that is available for ALL platforms.", "copyright": "Copyright © 2008-2016 Evolus. All rights reserved." }, "download": { @@ -46,15 +46,15 @@ "scripts": { "postinstall": "install-app-deps", "install-app-deps": "node ./node_modules/electron-builder/out/install-app-deps.js", - "start": "./node_modules/.bin/electron ./app --disable-gpu", + "start": "./node_modules/.bin/electron ./app", "start:dev": "./node_modules/.bin/electron ./app --enable-dev --disable-gpu", "clean": "rimraf dist", "pack": "build", "dist": "build", "release": "build", - "dist:linux": "./node_modules/.bin/build --platform linux --arch x64", - "dist:win32": "./node_modules/.bin/build --platform win32 --arch x64", - "dist:darwin": "./node_modules/.bin/build --platform darwin" + "dist:linux": "./node_modules/.bin/build --linux --x64", + "dist:win32": "./node_modules/.bin/build --windows --x64", + "dist:darwin": "./node_modules/.bin/build --osx" }, "private": true }