Compare commits

...

1926 Commits

Author SHA1 Message Date
Bane Stojkovic 772e936e65 mockito fix 2026-10-09 09:33:11 +02:00
Bane Stojkovic 094d73da26 cleanup 2026-10-08 21:32:25 +02:00
Bane Stojkovic a4fbd35c77 oled tweak 2026-10-08 21:00:00 +02:00
Bane Stojkovic 02615f5150 netlist and node name improvements 2026-10-08 14:23:36 +02:00
Bane Stojkovic 2a08fbe569 neopixel improvements 2026-10-07 12:58:08 +02:00
Bane Stojkovic 0aca15c59a Update WS2812BRing.java 2026-10-07 11:46:59 +02:00
Bane Stojkovic 30dfac3f7d tft fixes 2026-10-07 11:32:17 +02:00
Bane Stojkovic 61657bea4b Added 1.8" sd 2026-10-07 10:46:43 +02:00
Bane Stojkovic 1404f1773c color selection for bar graph 2026-10-06 22:23:13 +02:00
Bane Stojkovic 5075a566c6 Update variants.xml 2026-10-06 20:55:16 +02:00
Bane Stojkovic fb015416d3 led bar 2026-10-06 20:49:49 +02:00
Bane Stojkovic 6a2270c7b5 Added ability to hide component categories in the component tree and toolbar from the Config menu 2026-10-06 20:19:45 +02:00
Bane Stojkovic 51418d6252 2-digit 0.56 inch 7 segment 2026-10-06 15:25:37 +02:00
Bane Stojkovic 451bca27fd variants 2026-10-06 14:03:57 +02:00
Bane Stojkovic 05d1ae2663 icon 2026-10-06 12:09:47 +02:00
Bane Stojkovic 80555abc56 displays 2026-10-06 11:31:01 +02:00
Bane Stojkovic dc863e18f4 new tft 2026-10-06 08:51:32 +02:00
Bane Stojkovic 2e2ab93abb displays 2026-10-05 15:16:55 +02:00
Bane Stojkovic 25331632c1 displays 2026-10-05 13:33:44 +02:00
Bane Stojkovic 2f59f35f46 neopixel 2026-10-05 11:16:39 +02:00
Bane Stojkovic ad3a3fe46d displays 2026-10-04 22:40:26 +02:00
Bane Stojkovic da5184a226 display enhancement 2026-10-04 20:51:32 +02:00
Bane Stojkovic 4ee3335c18 cleanup 2026-10-04 20:29:56 +02:00
Bane Stojkovic 1853cae35c oled 2026-10-04 12:51:36 +02:00
Bane Stojkovic 3cc61a4506 cleanup 2026-10-03 23:04:30 +02:00
Bane Stojkovic 8693215c9c tft 2026-10-03 22:58:38 +02:00
Bane Stojkovic d4d6da7bd8 labels 2026-10-03 21:12:06 +02:00
Bane Stojkovic d4c462efa6 led bar 2026-10-03 20:03:25 +02:00
Bane Stojkovic 7a680ced46 nokia 2026-10-03 13:23:26 +02:00
Bane Stojkovic 4aeeb3082b Update maker-peripherals.md 2026-10-02 16:16:09 +02:00
Bane Stojkovic a4b2db7b15 tft 2026-10-02 16:11:27 +02:00
Bane Stojkovic a2a39f7e3b tft 2026-10-02 15:26:21 +02:00
Bane Stojkovic f997ed57fb jewel 2026-10-02 14:35:41 +02:00
Bane Stojkovic d31fb76a48 led bar graph 2026-10-02 12:55:22 +02:00
Bane Stojkovic e362430a92 strip 2026-10-02 11:18:57 +02:00
Bane Stojkovic 2347069cf3 led matrix 2026-10-02 11:03:13 +02:00
Bane Stojkovic b6b918dc0c improvements 2026-10-01 23:00:03 +02:00
Bane Stojkovic 3d1333f296 displays 2026-10-01 22:26:32 +02:00
Bane Stojkovic 4062c4d7a9 neopix 2026-10-01 12:32:41 +02:00
Bane Stojkovic e2ea25874e display improvements 2026-09-30 22:21:15 +02:00
Bane Stojkovic 2447135697 displays tweaks 2026-09-30 17:05:19 +02:00
Bane Stojkovic fc934647ad Merge branch 'master' into controllers
Resolved all 17 conflicts in favour of master, which carries the refactored
descendant of this branch's maker board work: shared appearance constants in
AbstractMakerBoard instead of per-board duplicates, POMs at 6.6.0, and the
released 6.6.0 changelog block.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBnQGbrTNYvYEJFxFr9xW5
2026-09-29 13:06:59 +02:00
Bane Stojkovic 2fe6b50ab4 release 2026-09-29 12:37:02 +02:00
Bane Stojkovic fe267a2377 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-09-14 13:04:37 +02:00
Bane Stojkovic 91fd8584f9 Update update.xml 2026-09-14 13:04:07 +02:00
Bane Stojkovic 51698ef8af Improve terminal node naming within building blocks to ensure no duplicates by adding a name of the nested component as a prefix 2026-09-14 13:04:03 +02:00
Bane Stojkovic b9344dfb0a Update README to remove launch special details
Removed promotional offer for the eBook from README.
2026-09-14 12:48:14 +02:00
Bane Stojkovic 69bb77d307 better curvature 2026-09-13 21:27:52 +02:00
Bane Stojkovic 556dedc9a3 double click to instant creation 2026-09-13 21:18:43 +02:00
Bane Stojkovic 823a59d455 stretch between 2026-09-13 21:09:52 +02:00
Bane Stojkovic 3ed51658a2 cleanup 2026-09-11 23:14:37 +02:00
Bane Stojkovic d41aa02674 Added 'Right Angle Wire' and 'Right Angle Line' components that route between two points using only horizontal and vertical runs with rounded corners 2026-09-11 23:14:30 +02:00
Bane Stojkovic 14bdeec281 Update update.xml 2026-09-11 11:38:03 +02:00
Bane Stojkovic 158f0d2647 Update update.xml 2026-09-11 11:35:26 +02:00
Bane Stojkovic 6d5cc3effc Update build-all-profiles.sh 2026-09-11 11:31:05 +02:00
Bane Stojkovic c3d2949dab Update update.xml 2026-09-11 11:28:20 +02:00
Bane Stojkovic b0f1a0bb2c micro cleanup 2026-09-11 11:28:18 +02:00
Bane Stojkovic 27b53e60e3 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-09-11 11:08:43 +02:00
Bane Stojkovic 89ce96b6c8 Controllers (#1068)
* initial

* more components

* fixes

* Update TreePanel.java

* fix boost converter

* Improve wrapping of component names

* Update ULN2003Driver.java

* Update NRF24L01Transceiver.java

* imp

* updates

* improvements

* more components

* arduino

* uno

* icon

* cleanup

* mega

* mega

* improveent

* nano

* esp boards

* esp

* esp32

* esp32

* Update ESP8266NodeMCU.java

* d1

* Update WemosD1Mini.java

* pi

* consolidate esp32

* pi pico updates

* pi zero

* Update RaspberryPiZero.java

* pi pico

* cleanup

* pi improvements

* consolidate pins

* antenna consolidation

* improve solder pads

* teensy

* headers

* teensy fix, test cleanup

* s3

* Update ESP32DevKit.java

* usb standardization

* pico w

* button standardization

* arduino improvements

* Update AbstractMakerBoard.java

* Update RaspberryPiZero.java

* Update RaspberryPi.java

* pi 3

* pi 5 improvements

* Update RaspberryPiZero.java

* fix tests

* esp pinout fix

* Update ESP32DevKit.java

* pin name improvements

* Create tier-1-modern-boards.md

* new versions

* pinouts

* nano improvements

* sanitize node names

* label improvements

* minima fixes

* arduino uno labels

* nano labels

* Update ArduinoNano.java

* mega

* mega

* comment out future stuff

* release prep

* Update RaspberryPiPico.java

* Refactor abstract class

* labeling improvement

* label offset fixes

* Update Teensy.java

* consolidate tests

* micro variants

* Update RaspberryPi.java
2026-09-11 11:08:15 +02:00
Bane Stojkovic 7192651abb Update RaspberryPi.java 2026-09-10 23:47:05 +02:00
Bane Stojkovic 21146022ea micro variants 2026-09-10 11:30:47 +02:00
Bane Stojkovic d30202232c consolidate tests 2026-09-10 11:19:27 +02:00
Bane Stojkovic 48b40b8b43 Update Teensy.java 2026-09-10 09:46:51 +02:00
Bane Stojkovic 04a3ba0fa7 label offset fixes 2026-09-10 09:44:22 +02:00
Bane Stojkovic 3fbcd3eaa9 labeling improvement 2026-09-09 17:03:24 +02:00
Bane Stojkovic de5bfd43f8 Refactor abstract class 2026-09-09 16:33:16 +02:00
Bane Stojkovic b5c6ddde59 Update RaspberryPiPico.java 2026-09-09 16:13:54 +02:00
Bane Stojkovic 511a7f42b4 release prep 2026-09-08 16:06:12 +02:00
Bane Stojkovic 27eb259949 comment out future stuff 2026-09-08 15:54:04 +02:00
Bane Stojkovic a223ad84ce mega 2026-09-08 10:03:29 +02:00
Bane Stojkovic 708faf9016 mega 2026-09-08 09:36:26 +02:00
Bane Stojkovic 8a81df347b Update ArduinoNano.java 2026-09-08 09:27:44 +02:00
Bane Stojkovic 99b1ee0c5d nano labels 2026-09-08 09:09:13 +02:00
Bane Stojkovic 7ed8403c41 arduino uno labels 2026-09-08 08:56:31 +02:00
Bane Stojkovic 9bb9fc91fb minima fixes 2026-09-07 14:01:26 +02:00
Bane Stojkovic 3d6241b17e label improvements 2026-09-07 12:50:12 +02:00
Bane Stojkovic b7c707e68a sanitize node names 2026-09-07 12:30:37 +02:00
Bane Stojkovic 37a5acce32 nano improvements 2026-09-07 12:26:07 +02:00
Bane Stojkovic e2cddf5954 pinouts 2026-09-06 20:57:26 +02:00
Bane Stojkovic 4a4d2c8617 new versions 2026-09-06 20:24:49 +02:00
Bane Stojkovic 28d8441887 Create config-4.1.0.xml 2026-09-04 23:01:28 +02:00
Bane Stojkovic 8080b8d70b config compatibility test 2026-09-04 22:11:17 +02:00
Bane Stojkovic 36ce381ffe Merge branch 'master' into controllers 2026-09-04 16:01:02 +02:00
Bane Stojkovic 001a26839f Update update.xml 2026-09-04 15:33:45 +02:00
Bane Stojkovic 7b168e2e27 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-09-04 15:33:00 +02:00
Bane Stojkovic 047196499a Building blocks (#1072)
* composite block support

* naming

* Added ability to set node name (or names) for some connectivity components

* cleanup

* Include building blocks in the Recently Used category

* Prompt to confirm the overwrite when saving over the existing building blocks; When saving building blocks, present a drop down list with most recently used building blocks

* add alpha to composite

* Update CompositeComponentTest.java

* cleanup

* Update CompositeComponent.java

* cleanup

* Update CompositeComponent.java

* <org.diylc.appframework.update.Change> 					<changeType>IMPROVEMENT</changeType> 					<description>When saving building blocks, present a drop down list with most recently used building blocks for quick selection</description> 				</org.diylc.appframework.update.Change>

* Diode components now label their terminal nodes as 'A' (anode) and 'K' (cathode) instead of '1' and '2'

* Capacitor components now label their terminal nodes as '+' and '-' instead of '1' and '2' when 'Polarized' property is ticked
2026-09-04 15:32:46 +02:00
Bane Stojkovic 6f51c3ca42 agents setup 2026-09-04 15:31:00 +02:00
Bane Stojkovic 79a853ba9f Create tier-1-modern-boards.md 2026-09-03 12:51:23 +02:00
Bane Stojkovic 1184790e96 pin name improvements 2026-09-01 14:51:27 +02:00
Bane Stojkovic f1753fb3ff Update ESP32DevKit.java 2026-09-01 13:17:00 +02:00
Bane Stojkovic 53dc5a1d2e esp pinout fix 2026-09-01 12:49:45 +02:00
Bane Stojkovic ace3af5bd2 fix tests 2026-09-01 09:53:18 +02:00
Bane Stojkovic 4bdcd0e2a9 Update RaspberryPiZero.java 2026-08-31 15:05:34 +02:00
Bane Stojkovic 9e94aaa10c Merge branch 'master' into controllers 2026-08-31 14:32:11 +02:00
Bane Stojkovic 26d6ca48fd Percentage values such as transparency Alpha, image Scale, etc, can have decimal values and not just integers 2026-08-31 14:32:01 +02:00
Bane Stojkovic e456c915e4 pi 5 improvements 2026-08-31 13:03:56 +02:00
Bane Stojkovic 7f0930108d pi 3 2026-08-31 11:48:18 +02:00
Bane Stojkovic 728d9000fc Update RaspberryPi.java 2026-08-28 14:44:29 +02:00
Bane Stojkovic fea2eddd40 Update RaspberryPiZero.java 2026-08-28 13:38:14 +02:00
Bane Stojkovic 7bb7d62cc0 Update AbstractMakerBoard.java 2026-08-28 11:54:49 +02:00
Bane Stojkovic 1636b23e9c arduino improvements 2026-08-28 11:50:43 +02:00
Bane Stojkovic 4e331ad61b button standardization 2026-08-27 16:01:27 +02:00
Bane Stojkovic 5e0377867b pico w 2026-08-27 14:12:34 +02:00
Bane Stojkovic 1a5d9cda8c usb standardization 2026-08-27 12:24:25 +02:00
Bane Stojkovic bb3d81bb71 Update ESP32DevKit.java 2026-08-27 09:40:04 +02:00
Bane Stojkovic 60cabc3a77 s3 2026-08-27 09:33:10 +02:00
Bane Stojkovic 10a56146bf teensy fix, test cleanup 2026-08-26 23:37:10 +02:00
Bane Stojkovic b02345e219 headers 2026-08-26 15:39:34 +02:00
Bane Stojkovic 4f0e75f768 teensy 2026-08-26 13:52:21 +02:00
Bane Stojkovic 808528b279 improve solder pads 2026-08-25 22:31:34 +02:00
Bane Stojkovic e08374fa76 antenna consolidation 2026-08-25 22:25:33 +02:00
Bane Stojkovic e4aa88e4a3 consolidate pins 2026-08-25 21:51:27 +02:00
Bane Stojkovic ef52ced1d8 pi improvements 2026-08-25 21:35:04 +02:00
Bane Stojkovic 8bdd228457 cleanup 2026-08-25 15:47:40 +02:00
Bane Stojkovic b708a986c2 pi pico 2026-08-25 15:31:31 +02:00
Bane Stojkovic 3821e173e7 Update RaspberryPiZero.java 2026-08-25 15:08:43 +02:00
Bane Stojkovic ac8fac0746 pi zero 2026-08-25 15:02:28 +02:00
Bane Stojkovic 34422c501c pi pico updates 2026-08-24 17:54:33 +02:00
Bane Stojkovic e209ecdcb8 Made announcement bubbles and dialogs that contain links clickable 2026-08-24 17:09:35 +02:00
Bane Stojkovic 711313276b Merge branch 'master' into controllers 2026-08-23 22:28:23 +02:00
Bane Stojkovic ac6c38b115 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-08-22 20:22:28 +02:00
Bane Stojkovic cdc635b7da release 2026-08-22 20:22:14 +02:00
Bane Stojkovic 0598cc441c Update README for audio and HAM enthusiasts 2026-08-21 23:26:13 +02:00
Bane Stojkovic f2008d78ff Merge branch 'master' into controllers 2026-08-21 14:27:42 +02:00
Bane Stojkovic e9e3c322b5 consolidate esp32 2026-08-21 14:25:56 +02:00
Bane Stojkovic 18b6bfb1db Added support for stacked guitar pickups 2026-08-21 12:52:31 +02:00
Bane Stojkovic 08c46b22ea pi 2026-08-20 16:46:45 +02:00
Bane Stojkovic 8d506b21c4 Images can randomly disappear when zooming in and scrolling 2026-08-20 14:53:36 +02:00
Bane Stojkovic ead4033267 Update WemosD1Mini.java 2026-08-20 12:32:18 +02:00
Bane Stojkovic bc8f610df9 d1 2026-08-20 12:20:50 +02:00
Bane Stojkovic 935ce977d7 Update ESP8266NodeMCU.java 2026-08-20 10:12:21 +02:00
Bane Stojkovic 12e5992f99 esp32 2026-08-20 09:41:28 +02:00
Bane Stojkovic 1bc0fc0f6e esp32 2026-08-20 09:36:41 +02:00
Bane Stojkovic 89099b79cb esp 2026-08-19 23:29:27 +02:00
Bane Stojkovic 32aa766806 esp boards 2026-08-19 23:22:15 +02:00
Bane Stojkovic d4ba10371d nano 2026-08-19 15:11:31 +02:00
Bane Stojkovic daaac2e81a improveent 2026-08-19 14:24:39 +02:00
Bane Stojkovic 613fffb596 mega 2026-08-19 14:15:14 +02:00
Bane Stojkovic a2e52b5520 mega 2026-08-19 13:55:36 +02:00
Bane Stojkovic 49862245eb cleanup 2026-08-19 11:46:10 +02:00
Bane Stojkovic f54716ee30 icon 2026-08-19 11:35:07 +02:00
Bane Stojkovic 970cc6e5d3 uno 2026-08-19 11:10:34 +02:00
Bane Stojkovic 182edc5d6c arduino 2026-08-19 11:05:01 +02:00
Bane Stojkovic 631ab5135d Merge branch 'master' into controllers 2026-08-18 11:08:58 +02:00
Bane Stojkovic b766c55263 Renamed Mac OS build files to start with a 'mac' prefix instead of 'osx' 2026-08-18 09:26:46 +02:00
Bane Stojkovic 601e715302 more components 2026-08-17 22:58:35 +02:00
Bane Stojkovic 0a76439583 improvements 2026-08-17 10:30:29 +02:00
Bane Stojkovic 09b53a0685 Fix formatting in contribution section of README 2026-08-16 23:47:06 +02:00
Bane Stojkovic c978bc6733 Merge branch 'master' into controllers 2026-08-16 23:39:25 +02:00
Bane Stojkovic 98d9319938 Added 'Node Name Tooltips' feature that can be toggled in the Config menu 2026-08-16 23:39:11 +02:00
Bane Stojkovic 5cc12b5e73 updates 2026-08-16 23:02:38 +02:00
Bane Stojkovic e895cc13c3 imp 2026-08-16 12:27:09 +02:00
Bane Stojkovic 7641d7bb38 Update NRF24L01Transceiver.java 2026-08-15 23:31:54 +02:00
Bane Stojkovic 63ad65152a Revise README for clarity and additional content
Updated README to enhance descriptions and add new images.
2026-08-15 23:23:38 +02:00
Bane Stojkovic a287d23e2b Update ULN2003Driver.java 2026-08-15 22:37:43 +02:00
Bane Stojkovic 46d074dd70 Improve wrapping of component names 2026-08-15 22:37:40 +02:00
Bane Stojkovic 1b978d9341 fix boost converter 2026-08-15 21:23:11 +02:00
Bane Stojkovic 021bf8d7eb Update TreePanel.java 2026-08-15 21:22:56 +02:00
Bane Stojkovic 1afe0433dc fixes 2026-08-15 20:42:00 +02:00
Bane Stojkovic a5da6e9fbc Merge branch 'master' into controllers 2026-08-15 19:41:27 +02:00
Bane Stojkovic 040e959d8d Improved the accuracy of board underside rendering; some of the components were not rendered in the right place or at all 2026-08-15 19:41:13 +02:00
Bane Stojkovic f210434765 more components 2026-08-14 14:20:38 +02:00
Bane Stojkovic bc13f0b015 initial 2026-08-14 12:55:51 +02:00
Bane Stojkovic 657521e7f5 Update update.xml 2026-08-08 14:43:49 +02:00
Bane Stojkovic af4064912b Update update.xml 2026-08-07 11:50:03 +02:00
Bane Stojkovic c34e5a2d38 remove knowledge SQLs 2026-08-07 11:49:56 +02:00
Bane Stojkovic c37a2b8310 Show a progress dialog while waiting for a long-running AI Analysis to complet 2026-08-06 15:44:45 +02:00
Bane Stojkovic 02237c9255 release 2026-08-06 14:51:38 +02:00
Bane Stojkovic ee188475d4 Pot improvements (#1064)
* Update PotentiometerPanel.java

* Update PotentiometerPanel.java

* improve node names for pot

* Update settings.json

* Update GuitarDiagramAnalyzerTests.java
2026-08-06 14:45:55 +02:00
Bane Stojkovic 2e1787f5d0 Update pom.xml 2026-08-02 23:29:26 +02:00
dependabot[bot] b1629680ff Bump com.fasterxml.jackson.core:jackson-databind in /diylc/diylc-core (#1060)
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.1 to 2.18.9.
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.18.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-02 23:28:27 +02:00
dependabot[bot] 769bf1a381 Bump com.fasterxml.jackson.core:jackson-databind in /diylc/diylc-swing (#1061)
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.22.0 to 2.22.1.
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.22.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-02 23:27:24 +02:00
Bane Stojkovic 85a17279b5 Use either username of email to log into DIYLC cloud 2026-08-02 23:15:51 +02:00
Bane Stojkovic f5b9faecd4 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-08-01 21:58:44 +02:00
Bane Stojkovic 769770bd8a Add ebook links 2026-08-01 21:58:39 +02:00
Bane Stojkovic fc103b6c2e Revise README for clarity and feature updates
Updated README to enhance clarity and add new features.
2026-08-01 20:13:05 +02:00
Bane Stojkovic 64ffc3a826 Update PCBTerminalBlock.java 2026-07-26 21:48:15 +02:00
Bane Stojkovic dbbd8a7f5a Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-07-24 11:04:17 +02:00
Bane Stojkovic e89eb1cbdf Update CompareService.java 2026-07-24 11:04:13 +02:00
Bane Stojkovic 0476dbb876 cleanup isPolarized 2026-07-17 16:45:15 +02:00
Bane Stojkovic 1571d78048 Increased width of tree panel to fit all components 2026-07-17 16:38:52 +02:00
Bane Stojkovic d8a2538b35 Improved comparison logic of the 'Compare With..' tool 2026-07-17 16:38:41 +02:00
dependabot[bot] 717892c38e Bump com.fasterxml.jackson.core:jackson-databind in /diylc/diylc-swing (#1057)
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.1 to 2.22.0.
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-version: 2.22.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-30 10:57:09 +02:00
Bane Stojkovic 896b6e5f69 6.1.0 release 2026-06-30 10:08:29 +02:00
Bane Stojkovic 475b829562 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-06-14 22:38:21 +02:00
Bane Stojkovic aeabec7392 Update tests.yml 2026-06-14 22:38:19 +02:00
Bane Stojkovic 2261433bf0 launcher update 2026-06-14 22:30:17 +02:00
Bane Stojkovic e85d618498 java upgrade, 6.0.0 release 2026-06-14 22:03:29 +02:00
Bane Stojkovic 3425fff3a0 Fixed errors while analyzing guitar wiring diagrams caused by treble bleed enhancements 2026-06-14 20:48:12 +02:00
Bane Stojkovic cc09c59fe5 Fixed scaling for 'Image' and 'SVG Image' components; it was showing as undefined 2026-06-14 10:05:15 +02:00
Bane Stojkovic 0219aa5c2a release 2026-06-13 22:39:04 +02:00
Bane Stojkovic 9b3274e30c update 2026-06-13 22:33:33 +02:00
Bane Stojkovic 9c29d2c4d6 minor 2026-06-10 17:19:45 +02:00
Bane Stojkovic 1d7dd87d85 Improved precision of rendering 2026-06-10 17:19:21 +02:00
Bane Stojkovic 9179086bd5 Update TrebleBleed.java 2026-06-10 17:05:44 +02:00
Bane Stojkovic 3fbc7f5bc9 'Schaller Megaswitch' not rendered correctly when rotated for 90 or 270 degrees 2026-06-08 22:35:41 +02:00
Bane Stojkovic 0526ce38f4 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-06-07 23:09:23 +02:00
Bane Stojkovic 880fa1e9e1 Update update.xml 2026-06-07 23:09:21 +02:00
Martin Morrell fb0821bce2 WIP: Add Freeway Blade Switch: 3B3-01, 5B5-01. 5B5-02 (#1042)
* Add Freeway Blade Switch: 3B3-01, 5B5-01. 5B5-02

* Fix labels and connections - reverse them to be correct
2026-06-07 23:08:21 +02:00
Bane Stojkovic 6a590af026 treble bleed enhancements 2026-06-07 23:02:47 +02:00
Bane Stojkovic efa803d7d0 Treble bleed enhancements 2026-06-07 22:37:27 +02:00
Bane Stojkovic f481542d5a Dragging a component from the component tree to the canvas sometimes does not work as expected without clicking on it first and then dragging it 2026-06-05 21:38:25 +02:00
Bane Stojkovic 140c052d39 Update update.xml 2026-06-05 20:40:54 +02:00
Jamie Drinkell 75edc427f7 Add IEC/IEEE schematic symbols for Potentiometer and Fuse (#995)
* Add new IEC and IEEE styles to Fuse symbol

* Add IEC style to potentiometer
For some reason it refuses to redraw on changing, it must be moved?

* Fix redraw on standard selection

* Fix indentation

* Change draw_style to camelCase drawStyle
2026-06-05 20:38:11 +02:00
Bane Stojkovic 717c16e88a Release 5.14.0 2026-06-03 21:55:22 +02:00
Bane Stojkovic ffa8e34497 Added thonk jack 2026-06-03 19:45:06 +02:00
Bane Stojkovic 9de5fe6ebc 'Line' component set to px used to render slightly thicker than 1px, appearing thicker than schematic symbols 2026-06-03 19:44:58 +02:00
Bane Stojkovic 0cdbcd60fe Increase maximum number of switch combination for analysis to 1024 2026-05-05 23:33:50 +02:00
Bane Stojkovic 491d48f0ec enable trimmers and mini pots for analysis 2026-05-05 23:33:08 +02:00
Bane Stojkovic 9f6a0c537a Added 'Potentiometer (Miniature)' component with two variations - right-angled and vertically mounted 2026-05-03 21:18:27 +02:00
Bane Stojkovic e674a1f23f version bump 2026-04-27 22:33:36 +02:00
Bane Stojkovic 9481b7e6a3 splash improvement 2026-04-07 20:50:23 +02:00
Bane Stojkovic 833ef947d5 fix tests 2026-04-07 20:17:22 +02:00
Bane Stojkovic c092b5f56e Ability to blank-out previously populated values for unit-type measures, e.g. resistance, capacitance, dimensions, etc 2026-04-07 20:16:27 +02:00
Bane Stojkovic 5546a66c94 outline drag to false by default 2026-04-07 20:06:02 +02:00
Bane Stojkovic b034c8c761 fix for transparency when dragging 2026-04-06 21:34:58 +02:00
Bane Stojkovic 8318b34967 Fix for null in int editor 2026-04-06 21:18:15 +02:00
Bane Stojkovic 194c8e0606 Improved data model for storing transparency alpha and other properties that are edited using a slider widget; as a result, the editing is more precise and does not randomly change to neighboring values 2026-04-06 21:04:55 +02:00
Bane Stojkovic 124d1ab577 Improved editing experience of integer properties (e.g. number of terminals on a tag strip) by using the spinner text field 2026-04-04 23:14:59 +02:00
Bane Stojkovic 5ce17b4ca2 Improved logic when moving component(s) that have other components stuck with them; in case there are non-sticky control points within the included components, they will be moved along retaining component shape (e.g. wires or curved traces) 2026-04-04 20:54:32 +02:00
Bane Stojkovic 30c6b4ec76 Added air-core inductor variation 2026-04-03 23:40:25 +02:00
Bane Stojkovic 2001a1af7b Added 'Envelope' property to tube symbol components which can be used to display one side of the outer envelope dashed indicating section A or section B of a tube 2026-04-03 21:09:24 +02:00
Bane Stojkovic 27f5c53afc Added more ceramic resistor variants to 'Resistor' component 2026-04-02 20:43:16 +02:00
Bane Stojkovic 10cbbea3d3 Added heat sink resistor 2026-04-02 20:22:25 +02:00
Bane Stojkovic b26a489f3a Remove loadline editor 2026-04-01 22:45:26 +02:00
Bane Stojkovic dab4975347 Added new 'Dial Scale' variations - 'Ticks + Numeric (0/5.5/11)' a'la Friedman and another variation of 'Ticks' with more pronounced 9/12/3 o'clock indices 2026-03-28 20:58:36 +01:00
Bane Stojkovic 5d8555e316 Update ChatbotPane.java 2026-03-26 22:49:38 +01:00
Bane Stojkovic 614652ca97 release 2026-03-26 22:47:14 +01:00
Bane Stojkovic af3887b9ac Clicking on a component type in the left-hand component tree sometimes does not register and does not instantiate the component 2026-03-26 20:33:16 +01:00
Bane Stojkovic 150e03c023 Pressing the 'Esc' key closes selection editor dialog 2026-03-26 19:57:18 +01:00
Bane Stojkovic cd0cb776b0 Right click (or two finger tap on mac) after selecting a component with a regular click opens editor dialog in addition to the context menu 2026-03-26 19:51:56 +01:00
Bane Stojkovic ebd66eea4f minor improvements 2026-02-27 14:13:46 +01:00
Bane Stojkovic 7d24621c18 Cleanup of code that doesn't work for fixing tooltip colors on linux mint (kde bug) 2026-02-22 22:34:10 +01:00
Bane Stojkovic a7442e14e4 Better error handling for AI tools< 2026-02-21 22:36:32 +01:00
Bane Stojkovic 03af702933 Redo unit conversion 2026-02-20 22:31:40 +01:00
Bane Stojkovic 303e59303b Added a new section in the output of 'AI Circuit Analyzer' which provides insights into the operation of the circuit and individual components 2026-02-20 22:12:19 +01:00
Bane Stojkovic 508d1db513 Added 'Auto-Unit Conversion' configuration which automatically converts between metric and imperial units based on the ruler unit preference 2026-02-17 20:44:50 +01:00
Bane Stojkovic c4efe7d20f Update draft-github-release.sh 2026-02-15 22:52:53 +01:00
Bane Stojkovic fccda215fc release 2026-02-15 22:49:47 +01:00
Bane Stojkovic d89061b355 Windows installer prompts for installation folder instead of forcing one 2026-02-15 22:26:27 +01:00
Bane Stojkovic f0c482d2d5 Added ability to export chat history from 'AI Assistant' to a HTML file 2026-02-15 20:40:05 +01:00
Bane Stojkovic f5fedc1a24 Update update.xml 2026-02-14 23:17:06 +01:00
Bane Stojkovic b3a1187c1c Improved rendering of 'Switch (Latching)' symbol to clearly make visual contact between the terminals 2026-02-13 22:26:23 +01:00
Bane Stojkovic 7e79143079 Ensure no duplicate IDs when loading 2026-02-11 16:59:16 +01:00
Bane Stojkovic d976959e95 Using "Duplicate Selection" results in duplicates of component ids, breaking Project Explorer panel and causing other issues downstream 2026-02-11 16:47:08 +01:00
Bane Stojkovic 8b69903893 Consolidate a few keyboard shortcuts for consistency 2026-02-09 23:15:35 +01:00
Bane Stojkovic 391d161c59 Add support for logging all component types to JSON 2026-02-09 16:18:05 +01:00
Bane Stojkovic d970fa10a7 Create component_index.prompt 2026-02-09 16:17:19 +01:00
Bane Stojkovic b6816e6a62 typo 2026-02-09 16:17:15 +01:00
Bane Stojkovic 3272efc8bf Typo fix 2026-02-09 16:14:35 +01:00
Bane Stojkovic 0aed29f072 Remove shapes from BOM 2026-02-06 22:56:08 +01:00
Bane Stojkovic 7e2319746e Bring back calculate length for curved components 2026-02-06 22:55:40 +01:00
Bane Stojkovic 1cf776ace5 Resize dimensions do not show for 'Chassis Panel' component when dragging a corner point 2026-01-30 12:52:00 +01:00
Bane Stojkovic b9da7510a8 5.10 release 2026-01-20 20:37:04 +01:00
Bane Stojkovic 6fde016ed4 All building blocks of the same type get added to the same group 2026-01-20 20:34:32 +01:00
Bane Stojkovic a32ad6b733 fix issue with null objects in groups 2026-01-19 23:22:19 +01:00
Bane Stojkovic be16910767 fix copy paste groups 2026-01-19 23:15:46 +01:00
Bane Stojkovic 457f47782f Added E-C-B BJT pinout to TO-92 transistor package 2026-01-16 22:29:14 +01:00
Bane Stojkovic b69729c14f Trimmer improvements 2026-01-16 20:37:21 +01:00
Clive Hayward a88d8f5e03 Added Box style multi-turn potentiometer component. (#987)
* Added Box style multi-turn potentiometer component.

Implements box style multi-turn trimmer potentiometer (e.g. Bourns PV36W/X) with inline pins for stripboard layouts.

Features:
- 3 inline pins on 0.1" spacing (CCW, Wiper, CW)
- Configurable resistance value and orientation
- Blue body (4.82mm × 9.53mm) with brass adjustment screw
- Screw positioned in lower left corner with horizontal slot
- Label positioned outside body for readability
- Pins centered in body width for all orientations
- Side profile icon showing brass screw and three pins
- Locked pin movement - component moves as single unit

Dimensions based on common box-style multi-turn potentiometers.
Default orientation is vertical (_90) with pins horizontal.

Category: Passive
Instance prefix: VR

* Handles mirroring and rotational transforms.

* Handles mirroring and rotational transforms.
2026-01-16 20:19:21 +01:00
Bane Stojkovic f4223f5773 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2026-01-16 20:08:34 +01:00
Bane Stojkovic 513cc67362 Update update.xml 2026-01-16 20:08:27 +01:00
Martin Morrell d8f2a3b6e0 Add 'M' and 'N' potentiometer taper options (#990) 2026-01-16 20:07:33 +01:00
Bane Stojkovic 7900128d7c Tactile Micro Switch' editor doesn't show up on double click 2026-01-16 20:03:01 +01:00
Bane Stojkovic 1cef0c0977 Explorer group (#992)
* show groups in explorer

* introduce component ids. Refactor how groups are modeled in the Project

* Group naming added

* cleanup

* release
2026-01-10 20:44:52 +01:00
Bane Stojkovic 2383f9ae77 'Potentiometer Panel' can now render numerical lug markers for easier identification 2026-01-06 19:46:14 +01:00
Bane Stojkovic 14ec18dfef Update update.xml 2026-01-06 19:06:10 +01:00
Bane Stojkovic 2f492c8fa8 Ability to resize 'Transformer Core' schematic symbol after it's already placed 2026-01-06 19:06:04 +01:00
Bane Stojkovic 9db43cd2f4 Make the label of schematic symbols (e.g. 'Resistor Symbol') clickable as well 2026-01-06 18:54:08 +01:00
Bane Stojkovic 344c238f73 Fixed the offset of terminals on a DP4T Tele type of 'Lever Switch' to be aligned with the physical switch 2026-01-05 21:30:13 +01:00
Bane Stojkovic 3376aa995a 'Open 1/8" Jack' and 'Open 1/4" Jack' can be rotated 2026-01-05 21:10:10 +01:00
Bane Stojkovic ec75f1b6eb 'Cliff 1/8" Jack' can be rotated 2026-01-05 21:06:22 +01:00
Bane Stojkovic 5f2b20ea41 New lines at the end of the 'Label' text get erroneously rendered as <br> 2026-01-05 20:53:00 +01:00
Bane Stojkovic 9d130c0ff3 Minor cleamup 2026-01-05 20:17:17 +01:00
Martin Morrell 119c41dc86 Add Freeway 3x3-05 (Ultra) Switch (#989) 2026-01-05 20:10:37 +01:00
Bane Stojkovic c5613a6fea 'Auto-Wrap Label' retains line breaks from the input text 2026-01-02 22:16:17 +01:00
Bane Stojkovic 479bd50540 Label adjustment 2026-01-02 21:42:09 +01:00
Bane Stojkovic 502a4b8d39 Tactile switch improvements 2026-01-02 21:06:27 +01:00
Bane Stojkovic 1f85c07453 Configurable 'Tactile Micro Switch' dimensions and added a few most commonly used variants 2026-01-02 10:17:23 +01:00
Bane Stojkovic 53ec1e780e fix: Clicking on 'Tactile Micro Switch' body doesn't register 2026-01-01 22:29:39 +01:00
Bane Stojkovic 2de3def32e Resize tooltip (#986)
* resize tooltip

* Fix blank board area rendering

* Fixes

* translations

* Add length

* Update update.xml
2025-12-31 15:07:22 +01:00
Bane Stojkovic 61b3c63bbf Revert "Introduce unique component instance ID"
This reverts commit 348eb3ac00.
2025-12-31 15:04:18 +01:00
Bane Stojkovic 348eb3ac00 Introduce unique component instance ID 2025-12-31 12:29:48 +01:00
Bane Stojkovic 9972e0ee46 Update .gitignore 2025-12-31 09:59:21 +01:00
Bane Stojkovic de971b707b Update build-all-profiles.sh 2025-12-30 20:09:57 +01:00
Bane Stojkovic 0dcc06f712 Update update.xml 2025-12-30 19:44:05 +01:00
Bane Stojkovic 109b0788a8 5.8.0 release 2025-12-30 14:37:56 +01:00
Bane Stojkovic d190ebe208 Cleanup 2025-12-30 10:44:12 +01:00
Bane Stojkovic fa93af2707 'Rotary Switch (Open)' cannot be selected by clicking on the wafer for 4-pole variations 2025-12-29 22:58:15 +01:00
Bane Stojkovic 6b59966816 Minor chassis panel optimization 2025-12-29 22:39:39 +01:00
Bane Stojkovic b065c9d6fb Reorganized export and print related items in the File menu to reduce clutter 2025-12-29 16:12:36 +01:00
Bane Stojkovic 49d805a60c Improved behavior of mouse cursor during drag operations; this should also fix behavior on some linux machines that show a "forbidden" cursor while dragging 2025-12-29 15:44:59 +01:00
Bane Stojkovic a9a98bf3a4 Language improvements 2025-12-29 14:01:59 +01:00
Bane Stojkovic 840d416282 Honor label color settings for 'Tape Measure' component 2025-12-29 13:40:06 +01:00
Bane Stojkovic dc2cc4c7c8 Do not use composites in outline mode 2025-12-29 13:00:41 +01:00
Bane Stojkovic 3d51d2a38d trace ending default values 2025-12-29 12:59:03 +01:00
Bane Stojkovic 4dfb1ca630 fix default LP Switch behavior for back compatibility 2025-12-29 11:15:59 +01:00
Bane Stojkovic e9c8686960 Added new property in 'LP Switch' that allows having the middle terminals connected (as they were) or disconnected to allow more flexibility 2025-12-29 10:55:45 +01:00
Bane Stojkovic 9be97f5213 fix tests 2025-12-29 10:54:39 +01:00
Bane Stojkovic 721d582dcd Update G2DWrapper.java 2025-12-28 23:09:04 +01:00
Bane Stojkovic 443f76f3f9 Monochromatic mode 2025-12-28 23:07:50 +01:00
Bane Stojkovic 3ad9c49f53 Update update.xml 2025-12-26 23:04:28 +01:00
Bane Stojkovic 61077ed5a4 Added Silkscreen export to PDF/PNG and print capabilities 2025-12-26 23:04:26 +01:00
Bane Stojkovic 1fe3706d0f improve multiwatt icon 2025-12-26 20:24:55 +01:00
Bane Stojkovic 16df8fd173 Added multiwat IC 2025-12-26 19:53:37 +01:00
Bane Stojkovic f7806d4d3c Added trace Ending Style property 2025-12-26 12:28:16 +01:00
Bane Stojkovic 04e44e174e Improve contrast of tooltips on some Linux machines that show white text against yellow ballon 2025-12-26 12:06:31 +01:00
Bane Stojkovic f74fe19b77 Update update.xml 2025-12-26 11:57:46 +01:00
Bane Stojkovic e7487069a5 Application freezes when using underside rendering or mirroring on 'Pin Header' when sized at 1x1 2025-12-26 11:57:43 +01:00
Bane Stojkovic 9c48b80515 Use configuration for scale factor 2025-12-26 11:48:52 +01:00
Bane Stojkovic 814f4296a9 Added configuration for text scale factor in rare cases when system scale factor is not applied correctly 2025-12-25 16:27:47 +01:00
Bane Stojkovic 6fa0e7d56a Improved sensitivity of 'Multimeter Probe' that required pixel-level precision to detect connectivity; improved rendering of the probe in outline mode 2025-12-25 11:36:51 +01:00
Bane Stojkovic 12726338ef Fixed underside rendering and mirroring position issues that affected only SPDT 'Mini Toggle Switch' types 2025-12-25 10:59:31 +01:00
Bane Stojkovic f3a8e3cfb1 release 5.7.9 2025-12-21 22:07:21 +01:00
Bane Stojkovic 1ac8ba8a24 Merge pull request #980 from mm-rnd/Lever_4P3T
Lever 4P3T
2025-12-21 22:03:47 +01:00
Bane Stojkovic 7b5bb3a152 Merge branch 'master' into Lever_4P3T 2025-12-21 22:01:05 +01:00
Martin Morrell ce7753744a Lever 2502N import switch (#981)
* Add 4P3T AxLabs Lever Switch variant

* Add 2502N Lever Switch

* Bridge is now pos1 and neck pos5 as expected

Re-worked acording to the diagram here:
https://guitarpartscenter.eu/en_US/p/ALPHA-SW-2502N-5-Way-Lever-Switch-ADWH/23036
2025-12-21 21:58:20 +01:00
Martin Morrell 3adaa16537 Add 4P3T AxLabs Lever Switch variant 2025-12-20 07:46:36 +00:00
Bane Stojkovic aa4f4c9c66 'Drill Hole' changes color to red when selected 2025-12-19 20:20:07 +01:00
Bane Stojkovic ef01d52905 Update update.xml 2025-12-19 20:10:05 +01:00
Bane Stojkovic 892de712b2 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2025-12-19 20:09:53 +01:00
Martin Morrell 79aa25f14c Update positon names to match switch positions (#977) 2025-12-19 20:07:12 +01:00
Bane Stojkovic 165b61329c Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2025-12-19 20:02:33 +01:00
Bane Stojkovic c251e5ace2 flip S1 position names 2025-12-19 20:02:24 +01:00
Martin Morrell 550e221265 Fix S1 Switch markers (#978) 2025-12-19 20:02:10 +01:00
Martin Morrell 7110897e9d Add 6P5T AxLabs Lever Switch variant (#979) 2025-12-19 19:54:15 +01:00
Bane Stojkovic 74badd8a01 Update DrillHole.java 2025-08-11 22:29:03 +02:00
Bane Stojkovic 95eccffa4a 'Connect to Patreon' option says that it connected account with username 'a b c' but doesn't do anything 2025-08-11 19:25:00 +02:00
Bane Stojkovic 35a190b02f Added 'Drill Hole' component 2025-06-21 22:45:46 +02:00
Bane Stojkovic 92457ae0fb Increase maximum size of the backup folder from 64MB to 1GB for deeper history 2025-06-18 21:35:14 +02:00
Bane Stojkovic 73d3dd1cd4 fix: Alignment issues of some visual elements in the resulting Gerber files, e.g. DIL IC pin designators 2025-06-16 23:33:56 +02:00
Bane Stojkovic cb9cd46261 fix: When a switch position is selected (i.e. set to a value other than None), DIYLC will treat the terminals that are internally connected in that switching logic as connected in analysis tools 2025-06-06 23:52:28 +02:00
Bane Stojkovic 4bd3943345 bigger cloud search window 2025-06-06 00:09:28 +02:00
Bane Stojkovic 30bdc7fc3d disable patreon connect when not logged in 2025-06-05 00:05:17 +02:00
Bane Stojkovic a1d31c1ae2 add join patreon link at the top and randomly show 2025-06-05 00:05:04 +02:00
Bane Stojkovic 90fb3095bd More intuitive user account creation dialog for DIYLC Cloud - showing exact requirements for password and marking optional entries 2025-06-04 23:33:50 +02:00
Bane Stojkovic 0c468369cd Simplify zoom in/out keyboard shortcuts to only plus/minus keys and zero numerical key for zoom reset to 100 2025-06-02 23:02:33 +02:00
Bane Stojkovic f88b0c642a mac build naming. Enable windows arm 2025-05-30 23:47:04 +02:00
Bane Stojkovic 1b8bdbe7ed Reduce logging 2025-05-29 23:45:40 +02:00
Bane Stojkovic 185b5da4d5 Bundle Java JRE with Linux AppImage to avoid having to install it 2025-05-29 23:32:27 +02:00
Bane Stojkovic cd92464467 fix auto-edit 2025-05-26 22:35:18 +02:00
Bane Stojkovic 59e18c6be2 Feature/compare (#929)
* add compare tool

* improvements

* diff improvements

* license

* diff logic and tests fixed

* update license info

* add isPolarized to component interface

* handle comparison of non-polarized components
2025-05-26 14:57:47 +02:00
Bane Stojkovic 05c22078bc Update update.xml 2025-05-21 22:34:52 +02:00
uneasyalliance c1387a015a Merge pull request #927 from uneasyalliance/X_Q_hotkey_fixes
fix for 'x' hotkey preventing 'x' input in dialogs
2025-05-21 22:33:33 +02:00
Bane Stojkovic 7913df0767 improve analysis reports 2025-05-18 11:41:30 +02:00
Bane Stojkovic 48bb11955d improve styling of summarize reports 2025-05-18 11:31:35 +02:00
Bane Stojkovic be43ef559c Improved trace proximity calculation to avoid showing false positives 2025-05-18 11:14:17 +02:00
Bane Stojkovic b757952533 If the internet connection is present, but unstable, the application starts but nothing can be clicked until the connection restores 2025-05-17 21:28:26 +02:00
Bane Stojkovic fe0dadd64b Increased tolerance of sticky points on guitar pickup terminals in order to make it easier for leads to make proper contact and for the circuit analyzer to work 2025-05-16 12:10:35 +02:00
Bane Stojkovic f1d886865d release 2025-05-13 10:15:06 +02:00
Bane Stojkovic 17c8840dfc Merge pull request #925 from bancika/ai-analyzer
Ai analyzer
2025-05-13 10:03:56 +02:00
Bane Stojkovic d9384d8304 release 2025-05-13 10:02:40 +02:00
Bane Stojkovic a69584411e Fixed the issue with embedding image files into DIY projects 2025-05-09 19:53:28 +02:00
Bane Stojkovic e4f7fb40d7 rendering performance optimization 2025-05-08 22:55:52 +02:00
Bane Stojkovic b2dcf354e6 add icon 2025-05-08 22:20:26 +02:00
Bane Stojkovic a6a9cd1bdf Fixed the issue with some components (e.g. DIP IC) jumping when showing underside of a board 2025-05-03 23:13:02 +02:00
Bane Stojkovic a21ef1962c Update update.xml 2025-05-03 22:08:07 +02:00
Bane Stojkovic c90b722fb6 optimize rendering of guitar switches 2025-05-03 22:05:23 +02:00
Bane Stojkovic 3332b727e0 optimize guitar pickup rendering 2025-05-03 21:56:38 +02:00
Bane Stojkovic 24ee6b3a5f optimize drawing of semiconductors 2025-05-03 21:49:01 +02:00
Bane Stojkovic aa98f27de8 Optimize rendering of electro-mechanical components 2025-05-03 21:35:11 +02:00
Bane Stojkovic b4bcc25f66 'Open Jack 1/4"' and 'Potentiometer Panel' now tolerate connections anywhere on the lugs instead of dead center only 2025-04-30 22:34:23 +02:00
Bane Stojkovic 355c9f2b49 netlist fixes 2025-04-25 22:50:07 +02:00
Bane Stojkovic 5c09ebf7f8 knowledge 2025-04-25 22:11:11 +02:00
Bane Stojkovic f7cd33c80f analyzer added 2025-04-24 21:38:04 +02:00
Bane Stojkovic c914749413 Ai improvements 1 (#914)
* improve netlist

* structure improvement

* chatbot enhancements

* chatbot improvements

* charbot enhancements

* Update user_manual.sql

* chatbot enhancements

* release
2025-04-21 20:46:41 +02:00
Bane Stojkovic b42fe2c34f disable chatbot by default 2025-04-15 20:46:45 +02:00
Bane Stojkovic 3d659e4e75 Update update.xml 2025-04-15 18:34:27 +02:00
Bane Stojkovic 7a7e3982f3 Language selection doesn't work on some OSs 2025-04-15 18:21:37 +02:00
Bane Stojkovic 11242dcb10 retain chat history when saving to a new file name 2025-04-14 22:31:56 +02:00
Bane Stojkovic 6a0ee802eb Output current subscription statistics at the end of the chat for transparency 2025-04-14 22:08:02 +02:00
Bane Stojkovic 2e13cc6a49 Confirmation dialog before deleting AI Assistant chat history 2025-04-14 21:31:33 +02:00
Bane Stojkovic aae514afcb 'Connect to Patreon' option doesn't work if the user name contains a space or another non-alphanumerical character 2025-04-14 21:04:32 +02:00
Bane Stojkovic 9dda441375 tier message update 2025-04-12 21:52:01 +02:00
Bane Stojkovic 01c8df99b3 Merge pull request #910 from bancika/feature/chatbot
Feature/chatbot
2025-04-12 21:40:14 +02:00
Bane Stojkovic 88f37d3b74 release 2025-04-12 21:39:30 +02:00
Bane Stojkovic e727cb1d8e add AI knowledge 2025-04-10 21:17:59 +02:00
Bane Stojkovic 97674bac5c add login dialog 2025-04-10 21:17:44 +02:00
Bane Stojkovic 17e8e11731 connect to patreon added 2025-04-09 19:43:05 +02:00
Bane Stojkovic bf80f65690 undo scaling changes 2025-04-08 21:22:00 +02:00
Bane Stojkovic 4e7515185c Update update.xml 2025-04-08 19:31:45 +02:00
Bane Stojkovic 99f8030fac chatbot enhancements 2025-04-07 21:29:57 +02:00
Bane Stojkovic 0c8883529d cloud improvements 2025-04-06 22:51:27 +02:00
Bane Stojkovic e3095035b1 chatbot improvements 2025-04-06 22:26:24 +02:00
Bane Stojkovic 0279a89700 chatbot improvements 2025-04-06 21:51:26 +02:00
Bane Stojkovic f03a0b1417 Use spice netlist for chatbot input 2025-04-05 19:44:02 +02:00
Bane Stojkovic c2e8def10e Update user_manual.sql 2025-04-05 17:16:43 +02:00
Bane Stojkovic 52b4f487b5 chatbot enhancements 2025-04-05 17:08:38 +02:00
Bane Stojkovic a5cc9c1374 Cloud login improvements 2025-04-05 10:36:55 +02:00
Bane Stojkovic d097bcd740 chatbot improvements 2025-04-04 21:49:52 +02:00
Bane Stojkovic acc28c2e54 cleanup 2025-04-04 21:49:35 +02:00
Bane Stojkovic 9cd71879c3 Update ChatbotPresenter.java 2025-04-03 20:19:18 +02:00
Bane Stojkovic 1b82d8c7df chatbot enhancements 2025-04-03 20:10:58 +02:00
Bane Stojkovic aa3ae65a80 Update ChatbotPane.java 2025-04-02 22:54:07 +02:00
Bane Stojkovic 2c0c07f34f Create component_summaries.sql 2025-04-02 22:51:42 +02:00
Bane Stojkovic 1bde8e8784 chatbot enhancements 2025-04-02 22:37:11 +02:00
Bane Stojkovic b81f305cf3 Update ComponentProcessorTest.java 2025-04-02 22:29:03 +02:00
Bane Stojkovic 38b9d5e1c0 Merge branch 'feature/multimeter3' into feature/chatbot 2025-04-02 22:19:32 +02:00
Bane Stojkovic 00c8c23abb Create swing-framework-1.1.jar 2025-04-02 22:19:23 +02:00
Bane Stojkovic 77adf38f01 Create swing-framework-1.1.jar 2025-04-02 22:17:58 +02:00
Bane Stojkovic 49deac2ef3 Merge branch 'feature/multimeter3' into feature/chatbot 2025-04-02 22:17:36 +02:00
Bane Stojkovic 4f048ec15e Merge branch 'master' into feature/multimeter3 2025-04-02 22:17:27 +02:00
Bane Stojkovic f02cf543a0 Create component_types.sql 2025-04-02 22:17:15 +02:00
Bane Stojkovic f69c9459f5 Fixed Windows ZIP package issue with the bundled JRE 2025-04-02 22:14:36 +02:00
Branislav Stojkovic b468564821 knowledge data 2025-04-02 10:54:23 +02:00
Branislav Stojkovic 5bbd7c8ab3 knowledge data 2025-04-02 10:50:31 +02:00
Bane Stojkovic 74946f6bce chatbot enhancements 2025-04-02 00:11:16 +02:00
Bane Stojkovic 3c48e498c2 update color scheme 2025-03-31 23:55:09 +02:00
Bane Stojkovic edd0a16079 chatbot connection 2025-03-31 23:42:25 +02:00
Bane Stojkovic 757ddf3e6d chatbot shell 2025-03-31 23:04:35 +02:00
Bane Stojkovic 58e28a95fd Board underside display does not work if there's a Label or PCB Text component on the board 2025-03-30 23:46:13 +02:00
Bane Stojkovic baaeefdbab Added ability control if the board underside display should render as transparent or not 2025-03-30 13:18:08 +02:00
Bane Stojkovic a5f6299de7 Update pom.xml 2025-03-29 22:56:30 +01:00
Bane Stojkovic 1d36394af0 Added a 'Save' button to all analysis screens which saves results of a circuit analysis to an HTML file 2025-03-29 22:45:06 +01:00
Bane Stojkovic aec12898bf fix tests 2025-03-29 22:30:24 +01:00
Bane Stojkovic b4c1ed74c2 switch fixes 2025-03-29 22:17:21 +01:00
Branislav Stojkovic e17b79a2c4 Applying a variant to a 'Hookup Wire' or 'Curved Trace' makes it lose its shape 2025-03-28 16:26:51 +01:00
Bane Stojkovic 34054a68f1 switch enhancements 2025-03-27 23:48:22 +01:00
Bane Stojkovic 5052e10f0e fix rotation 2025-03-27 23:32:31 +01:00
Bane Stojkovic 8c9a8e71dc show markers for lever switch 2025-03-27 22:55:32 +01:00
Bane Stojkovic 3b2dfb075f show markers for rotary switch 2025-03-27 22:55:22 +01:00
Bane Stojkovic 655df8c9db Copy operation doesn't work when certain component types are selected 2025-03-27 22:44:37 +01:00
Bane Stojkovic 52a8935b1f Merge branch 'master' into feature/multimeter3 2025-03-27 19:30:16 +01:00
Bane Stojkovic e3ff80532d fix windows 2025-03-27 19:25:32 +01:00
Bane Stojkovic 0fb0502dea build updates 2025-03-27 19:19:25 +01:00
Bane Stojkovic b3ad9cc0d9 show markers 2025-03-27 19:18:43 +01:00
Bane Stojkovic 8de5b24809 fix exes 2025-03-27 18:26:52 +01:00
Bane Stojkovic 2ca578b707 update win exes 2025-03-27 18:20:46 +01:00
Bane Stojkovic 8267d17ff7 Update SchallerMegaSwitch.java 2025-03-26 22:07:19 +01:00
Bane Stojkovic 96d7f55e84 Extract 'Analyze' menu, move 'Highlight Connected Areas' feature from 'Config' menu to 'Analyze' menu 2025-03-26 22:07:15 +01:00
Bane Stojkovic a8d266f561 add highlighting for open rotary switch 2025-03-26 20:43:16 +01:00
Bane Stojkovic b57b36141f Update MiniToggleSwitch.java 2025-03-26 18:45:16 +01:00
Bane Stojkovic 0368cc404e Update update.xml 2025-03-26 18:40:57 +01:00
Bane Stojkovic 220b648c56 add mini toggle switch highlighting 2025-03-26 18:39:56 +01:00
Bane Stojkovic 733c293be6 add UIScalingUtil 2025-03-26 18:15:02 +01:00
Bane Stojkovic 77cebc3911 netlist analyzer enhancements 2025-03-26 18:04:47 +01:00
Bane Stojkovic 3a5f4bdb67 build updates 2025-03-26 18:03:06 +01:00
Branislav Stojkovic ed11ec22a6 Merge branch 'master' into feature/multimeter3 2025-03-25 13:18:37 +01:00
Branislav Stojkovic a4bcbcc761 fix gray theme 2025-03-25 12:50:01 +01:00
Branislav Stojkovic 803caa706f fix build 2025-03-25 09:44:37 +01:00
Branislav Stojkovic 27263e9443 fix build 2025-03-25 09:41:52 +01:00
Bane Stojkovic c1812e9b70 fix resource loading 2025-03-24 21:09:19 +01:00
Bane Stojkovic 4811d009b5 fix version printer 2025-03-24 20:55:51 +01:00
Bane Stojkovic b001019c0c Merge pull request #892 from bancika/feature/mirror2
Feature/mirror2
2025-03-24 20:50:45 +01:00
Bane Stojkovic 5ea6193768 release 2025-03-24 20:47:20 +01:00
Bane Stojkovic 3b987e2b16 tools 2025-03-24 20:47:12 +01:00
Bane Stojkovic b7d482cfcf fix tests 2025-03-24 20:47:06 +01:00
Bane Stojkovic 449bce435f fix tests 2025-03-24 12:05:47 +01:00
Bane Stojkovic eafb4b1307 refactor resources 2025-03-24 11:29:18 +01:00
Bane Stojkovic 5e70bbe898 build for linux 2025-03-24 11:25:28 +01:00
Bane Stojkovic cd4694c207 resource optimization 2025-03-24 11:25:12 +01:00
Bane Stojkovic 3440a48dba fix resource loading 2025-03-24 11:11:39 +01:00
Bane Stojkovic b41a073044 Merge branch 'master' into feature/mirror2 2025-03-21 23:00:35 +01:00
Branislav Stojkovic c2fe439826 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2025-03-21 12:18:26 +01:00
Branislav Stojkovic f1af933f6d up to 1gb 2025-03-21 12:18:17 +01:00
dependabot[bot] c4fb3ad305 Bump com.thoughtworks.xstream:xstream from 1.4.19 to 1.4.21 in /diylc (#895)
Bumps [com.thoughtworks.xstream:xstream](https://github.com/x-stream/xstream) from 1.4.19 to 1.4.21.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

---
updated-dependencies:
- dependency-name: com.thoughtworks.xstream:xstream
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 11:59:08 +01:00
dependabot[bot] a011a080f4 Bump junit:junit from 4.7 to 4.13.1 in /diylc (#896)
Bumps [junit:junit](https://github.com/junit-team/junit4) from 4.7 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.7...r4.13.1)

---
updated-dependencies:
- dependency-name: junit:junit
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 11:58:46 +01:00
Branislav Stojkovic aeea503d7e build linux 2025-03-21 11:56:03 +01:00
Branislav Stojkovic 6352dc2f0e build linux 2025-03-21 11:55:51 +01:00
Bane Stojkovic 4474b33c42 Merge branch 'master' into feature/mirror2 2025-03-20 21:50:33 +01:00
Bane Stojkovic e8a4c488e0 Merge branch 'master' into feature/multimeter3 2025-03-20 21:50:16 +01:00
Bane Stojkovic 1da5c6836b fix headless mode 2025-03-20 21:46:11 +01:00
Bane Stojkovic 538c427627 test 2025-03-20 21:40:18 +01:00
Bane Stojkovic 791a6b6bc4 Update tests.yml 2025-03-20 21:39:58 +01:00
Bane Stojkovic 198ba445e0 Update tests.yml 2025-03-20 21:36:41 +01:00
Bane Stojkovic 56cba5bd8c fix tests 2025-03-20 21:33:25 +01:00
Bane Stojkovic 8c03df4c50 Update test.yml 2025-03-20 21:28:46 +01:00
Bane Stojkovic e96c609064 Update test.yml 2025-03-20 21:27:19 +01:00
Bane Stojkovic 73da8fd7ee fix tests 2025-03-20 21:24:31 +01:00
Bane Stojkovic 14565a102a cleanup 2025-03-20 21:20:46 +01:00
Bane Stojkovic fbea6c965c Merge branch 'master' into feature/multimeter3 2025-03-20 21:16:55 +01:00
Bane Stojkovic f512263c2d Update update.xml 2025-03-20 19:58:09 +01:00
Bane Stojkovic 3ef78ec179 Merge branch 'master' into feature/mirror2 2025-03-20 19:56:17 +01:00
Bane Stojkovic 4093641b7e Refactor/maven (#889)
* mavenize

* mavenization

* mavenization

* mavenization

* mavenization

* mavenization

* mavenization

* mavenization

* mavenization

* fix

* app framework update

* fix lib

* lib

* fix mavenized

* fix mavenized

* fix mavenized

* fix mavenized

* fix mavenized

* fix mavenized

* fix mavenized

* fix mavenized

* building for win and linux

* Create run.bat

* fixes for netlist

* cleanup

* unit tests

* unit tests

* configurable high dpi

* performance upgrade

* performance upgrade

* rotate bug

* Omit boards, wires, traces, terminals, etc from Spice netlist output

* splash version update

* optimize libs

* optimize libs

* updates

* mac build maven

* ruler optimization, moved images

* cleanup

* notarization

* test workflow

* build

* Update pom.xml

* Update pom.xml

* Create README.md

* Create test.yml

* maven

* build
2025-03-20 19:44:40 +01:00
Branislav Stojkovic 57594af69d tests 2025-03-19 15:04:54 +01:00
Branislav Stojkovic 42207f3bbf Merge branch 'master' into feature/mirror2 2025-03-19 15:02:15 +01:00
Branislav Stojkovic ccb98d1953 tests 2025-03-19 15:02:03 +01:00
Branislav Stojkovic 5aff6a8c56 Merge branch 'master' into feature/mirror2 2025-03-19 14:57:36 +01:00
Branislav Stojkovic 37bcceac2c test workflow 2025-03-19 14:52:58 +01:00
Branislav Stojkovic 4a35499cf4 test workflow 2025-03-19 14:51:30 +01:00
Branislav Stojkovic 121656bca7 test workflow 2025-03-19 14:49:10 +01:00
Branislav Stojkovic 0c4b433005 test workflow 2025-03-19 14:46:53 +01:00
Branislav Stojkovic c5293da570 test workflow 2025-03-19 14:44:21 +01:00
Bane Stojkovic d545b895d6 Update update.xml 2025-03-18 23:04:24 +01:00
Bane Stojkovic e54cfa502a 'Mini Toggle Switch' ends up misaligned after rotating together with other components 2025-03-18 22:47:58 +01:00
Bane Stojkovic add6bae018 fixes 2025-03-18 22:19:41 +01:00
Bane Stojkovic a5a4a3632f refactor 2025-03-18 22:12:52 +01:00
Bane Stojkovic f6863fb628 cleanup 2025-03-18 22:03:28 +01:00
Bane Stojkovic 9d1479cd82 Update update.xml 2025-03-18 21:59:56 +01:00
Bane Stojkovic 753b8bff8d improve icon rendering 2025-03-18 21:58:54 +01:00
Bane Stojkovic a2686ae7a0 Ctrl+X (Command+X) doesn't work because 'Project Explorer' steals the focus on X key press 2025-03-18 21:09:25 +01:00
Bane Stojkovic a1c27ef1b2 transparency for traces 2025-03-18 20:59:51 +01:00
Bane Stojkovic f79ba92013 Merge branch 'refactor/maven' into feature/mirror2 2025-03-18 20:19:24 +01:00
Bane Stojkovic 6801f9b51b Merge branch 'refactor/maven' into feature/multimeter3 2025-03-18 20:19:08 +01:00
Bane Stojkovic 8d1be10545 cleanup 2025-03-18 20:18:55 +01:00
Bane Stojkovic 4203ffa9ec Merge branch 'refactor/maven' into feature/multimeter3 2025-03-18 20:18:23 +01:00
Bane Stojkovic 774ce9b2db Merge branch 'refactor/maven' into feature/mirror2 2025-03-18 20:16:40 +01:00
Bane Stojkovic 31ee2b93c3 ruler optimization, moved images 2025-03-18 19:56:03 +01:00
Bane Stojkovic f0ed0275cf mac build maven 2025-03-17 23:42:05 +01:00
Bane Stojkovic 90816bebeb Update update.xml 2025-03-17 22:54:23 +01:00
Bane Stojkovic 2835129cd8 Merge branch 'refactor/maven' into feature/mirror2 2025-03-17 22:53:03 +01:00
Bane Stojkovic 8b2f39c165 Merge branch 'refactor/maven' into feature/multimeter3 2025-03-17 22:52:47 +01:00
Bane Stojkovic b3568b3ec9 updates 2025-03-17 22:51:50 +01:00
Bane Stojkovic 2b5674c44a Merge branch 'refactor/maven' of https://github.com/bancika/diy-layout-creator into refactor/maven 2025-03-17 22:34:29 +01:00
Bane Stojkovic 222050d826 optimize libs 2025-03-17 22:34:24 +01:00
Bane Stojkovic 4ba2b3d250 optimize libs 2025-03-17 22:34:07 +01:00
Bane Stojkovic 9e916370ee splash version update 2025-03-17 20:27:20 +01:00
Branislav Stojkovic f06bd0d49c Omit boards, wires, traces, terminals, etc from Spice netlist output 2025-03-17 16:08:02 +01:00
Branislav Stojkovic 521301d7ef rotate bug 2025-03-17 14:45:45 +01:00
Branislav Stojkovic 84dddcecdf Merge branch 'refactor/maven' into feature/multimeter3 2025-03-17 12:15:22 +01:00
Branislav Stojkovic be63f10ef4 Merge branch 'refactor/maven' into feature/mirror2 2025-03-17 12:14:40 +01:00
Branislav Stojkovic 6ef712b3e5 performance upgrade 2025-03-17 12:10:05 +01:00
Branislav Stojkovic 2ead5592d8 performance upgrade 2025-03-17 12:05:26 +01:00
Branislav Stojkovic 44c776194f configurable high dpi 2025-03-17 11:08:51 +01:00
Bane Stojkovic 8ddb685d9d Update README.md 2025-03-17 10:09:02 +01:00
Bane Stojkovic fbf92fbc6e unit tests 2025-03-16 23:55:05 +01:00
Bane Stojkovic fe51620138 unit tests 2025-03-16 23:45:14 +01:00
Bane Stojkovic a86af6384b slide switch highlighting 2025-03-16 23:22:34 +01:00
Bane Stojkovic 896a623c7c refactor 2025-03-16 22:36:24 +01:00
Bane Stojkovic 1c48d7c31f add freeway switch 2025-03-16 22:34:57 +01:00
Bane Stojkovic 3fcc9091a7 Megaswitch highlighting 2025-03-16 20:54:47 +01:00
Bane Stojkovic f925093c80 fixed dynamic loading 2025-03-16 20:37:10 +01:00
Bane Stojkovic 473630a5e8 cleanup 2025-03-15 23:45:15 +01:00
Bane Stojkovic 2c642337b4 palette adjjstment 2025-03-15 23:36:01 +01:00
Bane Stojkovic 9d8555c4b7 switch position display 2025-03-15 23:29:47 +01:00
Branislav Stojkovic 5c745d2d45 mirror 2025-03-14 14:06:14 +01:00
Branislav Stojkovic ccf5d20713 mirror 2025-03-14 11:23:56 +01:00
Branislav Stojkovic 74f43159c4 unit tests 2025-03-13 15:21:46 +01:00
Branislav Stojkovic a0b27de187 fixes for ascii 2025-03-12 16:25:17 +01:00
Branislav Stojkovic 9230d709b4 fixes for ascii 2025-03-12 15:59:22 +01:00
Branislav Stojkovic 823dcc431c fixes for ascii 2025-03-12 15:46:52 +01:00
Branislav Stojkovic ede2a000d4 fixes for ascii 2025-03-12 15:27:23 +01:00
Branislav Stojkovic c65ecc10bf fixes for ascii 2025-03-12 15:23:33 +01:00
Branislav Stojkovic 858cab4ab4 fixes for ascii 2025-03-12 15:05:37 +01:00
Branislav Stojkovic 39ba93ff2c fix mavenized 2025-03-12 11:11:59 +01:00
Bane Stojkovic eadcb8d81e Merge branch 'refactor/maven' into feature/multimeter3 2025-03-11 23:59:49 +01:00
Bane Stojkovic 08ca6cef4e cleanup 2025-03-11 23:59:31 +01:00
Bane Stojkovic 6e919714d3 merged changes 2025-03-11 23:42:56 +01:00
Bane Stojkovic f966f8873a fixes for netlist 2025-03-11 23:18:36 +01:00
Bane Stojkovic eedc370a6e Create run.bat 2025-03-11 20:27:00 +01:00
Bane Stojkovic e6427cbec7 building for win and linux 2025-03-11 20:25:12 +01:00
Branislav Stojkovic aa8ca75d5a fix mavenized 2025-03-11 16:57:11 +01:00
Branislav Stojkovic 9f053f5dfa fix mavenized 2025-03-11 15:14:59 +01:00
Branislav Stojkovic 05d056700d fix mavenized 2025-03-11 15:04:10 +01:00
Branislav Stojkovic fce99fcdc0 Merge branch 'refactor/maven' of https://github.com/bancika/diy-layout-creator into refactor/maven 2025-03-11 15:03:56 +01:00
Branislav Stojkovic 83b1e02086 fix mavenized 2025-03-11 15:03:46 +01:00
Branislav Stojkovic ee11b5ffe4 fix mavenized 2025-03-11 15:03:09 +01:00
Branislav Stojkovic 344e85e6f7 fix mavenized 2025-03-11 12:59:08 +01:00
Branislav Stojkovic e088b5e8c9 fix mavenized 2025-03-11 12:18:00 +01:00
Branislav Stojkovic 0417947289 fix mavenized 2025-03-11 10:37:21 +01:00
Bane Stojkovic fcfecd33cd lib 2025-03-11 10:08:27 +01:00
Bane Stojkovic 54ba75f306 fix lib 2025-03-11 09:29:01 +01:00
Bane Stojkovic ad43994d8f Merge branch 'refactor/maven' of https://github.com/bancika/diy-layout-creator into refactor/maven 2025-03-11 09:20:06 +01:00
Bane Stojkovic 76071e8c1e app framework update 2025-03-11 09:20:04 +01:00
Bane Stojkovic 29dc9b97b7 fix 2025-03-10 22:17:06 +01:00
Branislav Stojkovic bc428fad89 mavenization 2025-03-10 16:42:35 +01:00
Branislav Stojkovic a0e8f7411c mavenization 2025-03-10 16:30:36 +01:00
Branislav Stojkovic 16af862119 mavenization 2025-03-10 16:27:25 +01:00
Branislav Stojkovic f580aa65ee mavenization 2025-03-10 16:24:53 +01:00
Branislav Stojkovic dac2f8554a mavenization 2025-03-10 16:12:55 +01:00
Branislav Stojkovic 2caa91eb2e mavenization 2025-03-10 15:32:45 +01:00
Branislav Stojkovic 038e2bcbb4 mavenization 2025-03-10 15:30:18 +01:00
Branislav Stojkovic 6e347fd7d0 mavenization 2025-03-10 15:21:43 +01:00
Branislav Stojkovic f820c23093 mavenize 2025-03-10 13:03:51 +01:00
Bane Stojkovic ad9a575dc6 Update install.iss (#888)
* Update install.iss

* Update update.xml
2025-03-10 10:44:12 +01:00
Bane Stojkovic def979adf8 Update update.xml 2025-03-09 21:26:31 +01:00
Bane Stojkovic bd172ec0fd Update .gitignore 2025-03-09 21:23:40 +01:00
Bane Stojkovic b8a2e3a727 Moving selected components with a mouse doesn't register file modification action and doesn't enable Undo action 2025-03-09 21:21:09 +01:00
Bane Stojkovic 7c7799ae37 release 5.0.0 2025-03-09 12:22:42 +01:00
Bane Stojkovic 7de1e7644d release 5.0.0 2025-03-08 22:53:38 +01:00
Bane Stojkovic cbbd6ad88f Fixed the issue with opening DIY files on Mac OS - updated the logic to use java.desktop 2025-03-08 22:42:22 +01:00
Bane Stojkovic 8f8c096dfb Fixed alignment issues of round elements (e.g. solder pads and holes) in exported Gerber files 2025-03-08 22:20:14 +01:00
Bane Stojkovic 53019ac600 fixes 2025-03-07 23:26:23 +01:00
Bane Stojkovic 8c82bef903 fix appimage 2025-03-07 23:08:57 +01:00
Bane Stojkovic dd6dd7daf8 fix appimage 2025-03-07 23:06:12 +01:00
Bane Stojkovic 5f20c1cd6e 4.41.1 patch 2025-03-07 20:45:03 +01:00
Branislav Stojkovic e7e9e889e1 appimage 2025-03-07 16:47:34 +01:00
Bane Stojkovic d460d0b1db Update appimage.xml 2025-03-07 15:58:02 +01:00
Bane Stojkovic b44ea41a1e Update diylc.sh 2025-03-07 15:26:11 +01:00
Bane Stojkovic 9199bd9655 Update diylc.sh (#886)
* Update diylc.sh

* Update appimage.xml (#887)
2025-03-07 15:18:23 +01:00
Bane Stojkovic 67728e60d6 Update update.xml 2025-03-07 12:51:17 +01:00
Bane Stojkovic 9006e9bbc5 Update GerberLayer.java
remove mirroring
2025-03-07 12:49:06 +01:00
Bane Stojkovic b657a4d53f Feature/gerber (#881)
* gerber initial implementation

* added icon

* refactor actions

* add ground fill for gerber

* reorganize export actions

* fix gerber export of pcb text

* handle negative pcb text

* improve positioning of pcb text

* add board outline for gerber

* add support for other pad shapes

* handle 0 hole size

* added solder mask layer

* refactor gerber support to simplify components

* added silk screen support, some refactor

* libs

* fix mirroring

* outline support

* simplify layers

* Fix board alignment

* handle circular pads

* handle empty string

* update

* fixes

* add text to silk

* fix text tracing

* cleanup

* fix layer id

* optimize continuity calculations

* Solder pad - pth vs npth

* gerber fixes

* netlist improvement

* Update update.xml

* Pasting a building block sometimes messes up the z-order of components

* Pasting a building block sometimes switches selection to previously added components and canvas moves to the wrong position

* 'Highlight Continuity Areas' sometimes renders stale areas when clicked

* beta build

* fix builds

* appimage

* appimage

* appimage

* fix building from downloaded jre

* disable fractional metrics

* appimage

* Create build.zip

* bat for setup

* fix for high DPI monitors

* fixes

* scaling

* appimage

* 4.41 release

* cleanup

* Update org.eclipse.core.resources.prefs
2025-03-07 10:57:31 +01:00
Bane Stojkovic 0b1e282731 Update README.md 2025-02-24 09:20:27 +01:00
Bane Stojkovic 716dc40f53 fix build 2025-02-21 20:57:26 +01:00
Branislav Stojkovic 05b15a7297 jre zip 2025-02-21 16:58:03 +01:00
Branislav Stojkovic aa6a413be1 update jre 17 2025-02-21 09:51:50 +01:00
Bane Stojkovic 23f58d7bac release 4.40.0 2025-02-20 20:16:46 +01:00
Bane Stojkovic 52aa79b8b4 shortcut fix 2025-02-20 20:02:03 +01:00
Branislav Stojkovic 4c7d282b69 Revert "add sonar"
This reverts commit bef7b2b831.
2025-02-20 16:30:06 +01:00
Branislav Stojkovic 6d272a6507 Revert "add sonar"
This reverts commit 241cfd234b.
2025-02-20 16:30:02 +01:00
Branislav Stojkovic 241cfd234b add sonar 2025-02-20 16:23:12 +01:00
Branislav Stojkovic bef7b2b831 add sonar 2025-02-20 16:21:08 +01:00
Branislav Stojkovic 3a625a7105 fix keyboard zoom 2025-02-20 13:58:08 +01:00
Branislav Stojkovic fb37ab6eea fix keyboard zoom 2025-02-20 13:38:56 +01:00
Bane Stojkovic f2ef393fd7 Bug/mac click issue (#879)
* attempt to fix bug

* fix

* update

* update
2025-02-20 09:57:55 +01:00
Branislav Stojkovic 8a88e72dee fix arm config 2025-02-20 09:49:15 +01:00
Bane Stojkovic d72f76d836 4.40 beta 2025-02-15 10:09:42 +01:00
Bane Stojkovic d996847b6d Feature/freeway (#876)
* freeway initial

* freeway improvements

* handle circuits with one path

* freeway improvements
2025-02-15 09:54:55 +01:00
Bane Stojkovic cd2f6fe417 Loading files that contain lines with end arrows sometimes produces errors in the log and lines not to be loaded 2025-02-13 20:15:30 +01:00
Bane Stojkovic 6c62484b48 Update FUNDING.yml 2025-02-12 10:08:01 +01:00
Bane Stojkovic 44dd21ad43 Update FUNDING.yml 2025-02-12 09:47:25 +01:00
Bane Stojkovic 04f6b778bc Update FUNDING.yml 2025-02-12 09:46:33 +01:00
Bane Stojkovic d58e251b97 Create FUNDING.yml 2025-02-12 09:42:10 +01:00
Bane Stojkovic 8d9234d3f6 Show Label text in 'Project Explorer' in addition to the name 2025-02-10 22:23:19 +01:00
Bane Stojkovic a7d08d8cd4 Update README.md 2025-02-10 12:45:28 +01:00
Bane Stojkovic 10d76da592 Update README.md 2025-02-10 12:44:55 +01:00
Bane Stojkovic 35519da907 Update README.md 2025-02-10 12:44:30 +01:00
Bane Stojkovic bd73320738 Update README.md 2025-02-10 12:43:51 +01:00
Bane Stojkovic 6a15c7ec0d Update README.md 2025-02-10 12:33:11 +01:00
Bane Stojkovic 48ae7201a5 Update README.md 2025-02-10 12:32:35 +01:00
Bane Stojkovic 144c3628ae Update README.md 2025-02-10 12:20:51 +01:00
Bane Stojkovic 3f448c1537 'Proto Board 780 Holes' now aligns with the grid 2025-02-09 22:23:19 +01:00
Bane Stojkovic 9d0d458fac Fixed null pointer exceptions when trying to add components to the layout in some cases 2025-02-09 22:04:22 +01:00
Bane Stojkovic 40851b4a62 naming 2025-02-09 21:51:49 +01:00
Bane Stojkovic 88ded5eb0d Ability to change pitch and appearance of PCB Terminal Block component 2025-02-09 21:50:20 +01:00
Bane Stojkovic 1fd7643993 'Save As' displays the current file name by default 2025-02-09 18:36:16 +01:00
Bane Stojkovic dff96fd647 Added headless mode for direct render to file without the GUI 2025-02-09 17:45:01 +01:00
Bane Stojkovic 0ca4df3161 Allow guitar wiring analyzer when some of the switching configuration do not produce output 2025-02-09 16:22:34 +01:00
Bane Stojkovic e0aa7d99ee Ability to set explicit dimensions of basic shapes - rectangles and ellipses 2025-02-09 16:10:30 +01:00
Bane Stojkovic 6ad5a5361c update.xml 2025-02-09 15:56:48 +01:00
Lukasz Tekieli 713bca84af Add 4PDT On/On/On (#854)
Adds 4PDT On/On/On Type 1 and Type 2 switches.
Type 2 models for example the DiMarzio EP1111.
2025-02-09 15:53:21 +01:00
Bane Stojkovic 3bc3f13bfb update.xml 2025-02-09 15:51:47 +01:00
Bane Stojkovic 75ea0a4e6d update.xml 2025-02-09 15:49:04 +01:00
Bane Stojkovic 0ddf096bd2 Merge branch 'undo' 2025-02-09 15:48:49 +01:00
Bane Stojkovic ac6be61379 Feature/paralel serial (#871)
* Parallel/serial

* chore: fix parallel

* chore: tree

* graph improvements

* fix html render

* treble bleed detection
2025-02-09 15:47:55 +01:00
Bane Stojkovic 3874da705a increase undo stack size 2025-02-09 15:47:18 +01:00
php4fan 8173f1a975 Allow one-switch DIP switches (#860)
I wonder if this alone will fix #859. Haven't tested
2025-02-09 15:45:19 +01:00
Branislav Stojkovic cafb1a2915 chore: temurin update 2025-01-26 17:35:05 +01:00
Bane Stojkovic 37dc1c66a2 release 4.39 2025-01-25 21:20:03 +01:00
Bane Stojkovic 8b32fa0579 release 4.39 2025-01-25 21:18:35 +01:00
Bane Stojkovic c9d3f669a3 release 4.39 2025-01-25 21:04:31 +01:00
Bane Stojkovic 992d62e0d0 Choosing "Print" option from the menu starts printing immediately before choosing printing preferences 2025-01-16 15:43:24 +01:00
Branislav Stojkovic 4d575b27a7 chore: move jre 2024-12-26 12:49:16 +01:00
Bane Stojkovic 08701c1632 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2024-12-25 20:24:28 +01:00
Bane Stojkovic c8a09d0d10 Update build.xml 2024-12-25 20:24:15 +01:00
Branislav Stojkovic 435043cb48 update icon 2024-12-25 16:29:13 +01:00
Branislav Stojkovic caa4bbb0c8 chore: mac build 2024-12-25 10:03:20 +01:00
Branislav Stojkovic 159986dba1 rename 2024-12-24 23:35:55 +01:00
Branislav Stojkovic 7d853a6df6 update build 2024-12-24 23:31:11 +01:00
Branislav Stojkovic 7cf3fe436a update mac jre to 17 and switch openGL to metal 2024-12-24 23:29:06 +01:00
Branislav Stojkovic 25abcbfd27 chore: sync 2024-12-24 22:45:25 +01:00
Bane Stojkovic 3884f26a18 release 4.38 2024-12-23 09:39:39 +01:00
Bane Stojkovic 1c6dfb609c cleanup 2024-12-22 21:58:30 +01:00
Bane Stojkovic 61ec91116c Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2024-12-22 21:57:34 +01:00
Bane Stojkovic 0e4d653c51 mac ARM jre bundle 2024-12-22 20:38:29 +01:00
Jamie Drinkell 9968fb8283 BuzzerSymbol label fix (#833)
* Add IEC option

* Add Buzzer Schematic Symbol

* Add Buzzer Component

* Buzzer Symbols Cleanup

Remove unused libraries, Datasheet stuff etc.

* ResistorSymbol Cleanup

* Fix BuzzerSymbol width for label issues
2024-12-16 16:25:45 +01:00
Bane Stojkovic 7e04c18b14 fix: Toroidal Inductor hangs the application if it doesn't have inductance value set 2024-09-20 22:10:56 +02:00
Jamie Drinkell 8b414b8fda Resistor IEC type, Buzzer Schematic Symbol and Buzzer Component (#827)
* Add IEC option

* Add Buzzer Schematic Symbol

* Add Buzzer Component

* Buzzer Symbols Cleanup

Remove unused libraries, Datasheet stuff etc.

* ResistorSymbol Cleanup
2024-09-20 21:23:57 +02:00
Benjamin van der Burgh b2afe2e2c5 Add G-I-O transistor pinout (#790)
Co-authored-by: Ben van der Burgh <ben@metabolic.nl>
2024-09-20 21:11:03 +02:00
Bane Stojkovic b1b3dd5564 Fixed run.sh application starter for Linux and Apple OSX with M1/M2 processors when using Java 17 or newer 2023-07-05 15:58:47 +02:00
Bane Stojkovic 7a4b77767d When editing Label components, default focus to the text editor 2023-05-19 16:31:44 +02:00
Bane Stojkovic 1417aaed0b Unable to move selected components if one of them is close to being reduced to a point 2023-05-07 17:30:00 +02:00
Bane Stojkovic 243b13c37c Release 4.37.0 2023-04-27 09:17:59 +02:00
Bane Stojkovic 4660467df5 Proto board updates 2023-04-27 09:17:44 +02:00
Bane Stojkovic 73a12bc107 Update ProtoBoard780.java 2023-04-26 17:32:55 +02:00
Bane Stojkovic ece6015a7f Ability to rotate (almost) all components using keyboard shortcuts and 'Transform Selection' menu 2023-04-26 17:32:50 +02:00
Bane Stojkovic 1cbdf505fe Update ProtoBoard780.java 2023-04-22 18:01:45 +02:00
Bane Stojkovic f0c1970784 Proto board 780 draft 2023-04-14 08:24:55 +02:00
Bane Stojkovic 14944a3e38 Release 4.36 2023-03-30 10:02:06 +02:00
Bane Stojkovic 48fe5f496b Fix fuse symbol 2023-03-29 09:38:27 +02:00
Bane Stojkovic 57a7932675 Improve backup file date format 2023-03-28 16:54:00 +02:00
Bane Stojkovic e0d2964e12 When backing up the configuration file, append the current timestamp at the end instead of a '~' 2023-03-28 16:35:40 +02:00
Bane Stojkovic c3f9208ab7 Fix issue deserializing building blocks 2023-03-28 16:12:33 +02:00
Bane Stojkovic 3a5e6f553d Fix issue with null value in inductor causing exceptions 2023-03-28 16:12:19 +02:00
Bane Stojkovic 24c8afd620 Configurable max switch combination count for circuit analysis (using org.diylc.maxSwitchCombinations argument) 2023-03-28 16:11:57 +02:00
Bane Stojkovic 4710d1b484 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2023-03-26 13:48:59 +02:00
Bane Stojkovic 2ce7677672 Title Block added as one of factory building blocks (was missing in 4.35 by mistake) 2023-03-26 13:48:58 +02:00
Bane Stojkovic 04a22436d2 Lever switch orientation not loaded correctly from files created prior to version 4.35 2023-03-26 13:48:26 +02:00
Bane Stojkovic 0ef3bc4adb Update ISSUE_TEMPLATE.md 2023-01-16 13:33:57 +01:00
Bane Stojkovic 887be7338f Release 4.35 2022-12-23 18:20:53 +01:00
Bane Stojkovic 72f61b978a REname audio transformer component 2022-12-23 16:00:26 +01:00
Bane Stojkovic 4c38075dc7 Lib update 2022-12-23 12:07:35 +01:00
Bane Stojkovic 8211976044 Trace cut doesn't affect continuity of vero board traces 2022-12-23 08:24:43 +01:00
Bane Stojkovic 22e9bbaa20 Fix netlist regression issue for IC 2022-12-20 23:43:23 +01:00
Bane Stojkovic 0fcf7e1fd4 Enhance jack icon 2022-12-20 23:42:57 +01:00
Bane Stojkovic 04302866e9 Jack icon improvement 2022-12-16 16:21:23 +01:00
Bane Stojkovic 9bcc56f228 Added '1/8&quot; Cliff Jack' component - stereo and mono 2022-12-15 23:25:49 +01:00
Bane Stojkovic d7903bc3bb REname icon file 2022-12-14 23:13:06 +01:00
Bane Stojkovic 8178c72fbe New file icons for Mac OS 2022-12-14 23:10:32 +01:00
Bane Stojkovic ab53f7e85f 'Renumber On Paste' feature now applies to variants as well 2022-12-14 22:49:57 +01:00
Bane Stojkovic 7a186d0d49 Show wire gauge in the bom and project explorer 2022-12-14 22:15:40 +01:00
Bane Stojkovic d5d0ec56cf Double click in the project explorer to edit selected component 2022-12-14 22:15:07 +01:00
Bane Stojkovic b45ee77472 Upon starting or opening a project, the ruler is slightly misaligned with the project boundaries 2022-12-14 19:13:51 +01:00
Bane Stojkovic 796c825f02 Title Block added as one of factory building blocks 2022-12-14 18:31:28 +01:00
Bane Stojkovic 063cfde769 Diode symbol doesn't appear in the BOM 2022-12-14 12:29:45 +01:00
Bane Stojkovic b89a851513 Show jack type in the BOM 2022-12-13 18:39:16 +01:00
Bane Stojkovic b6f3020072 DIL IC pin labels don't match between the rendered values and values in the netlist 2022-12-12 23:35:02 +01:00
Bane Stojkovic f4f4ba7458 Ability to use up/down arrow keys in the project explorer to select components 2022-12-12 22:44:14 +01:00
Bane Stojkovic f181109ac7 Better component value render in explorer 2022-12-12 21:57:17 +01:00
Bane Stojkovic c7d5fe3cf4 Handle array value string representation 2022-12-12 01:17:53 +01:00
Bane Stojkovic e9414613a4 Don't show label value in bom and other places 2022-12-12 01:17:36 +01:00
Bane Stojkovic 54da44e0d0 Show component values in the project explorer 2022-12-12 01:17:17 +01:00
Bane Stojkovic 92f9c0c89a Added 'PCB Terminal Block' component 2022-12-12 01:03:07 +01:00
Bane Stojkovic 16d718ffc5 Added 'Solder Lug' component 2022-12-11 00:20:43 +01:00
Bane Stojkovic 03df6158e2 Use scroll buttons in 'Tabbed Toolbar' instead of arranging tabs into multiple lines when the screen is not large enough to show them all 2022-12-10 23:19:21 +01:00
Bane Stojkovic 895de4e7f2 Improved find tool usability, make the screen pan to the selected components 2022-12-09 23:13:55 +01:00
Bane Stojkovic 655f5253f6 Escape comma in BOM CSV files to avoid component names being split into separate columns 2022-12-09 22:46:44 +01:00
Bane Stojkovic 693315ec96 Release 4.34 2022-12-09 14:24:32 +01:00
Bane Stojkovic 7f49727966 Revert projectFileManager 2022-12-09 11:17:52 +01:00
Bane Stojkovic 15110214ea Fix toggle switch serialization of name 2022-12-09 11:17:37 +01:00
Bane Stojkovic 3dc0f0d01b Cleanup 2022-12-08 23:11:50 +01:00
Bane Stojkovic 82d4b9ebfc Cleanup 2022-12-08 23:00:05 +01:00
Bane Stojkovic bc0fc4d3b9 Show layer in project explorer 2022-12-08 22:32:49 +01:00
Bane Stojkovic c5a095cad9 Back compatibility fix for toggle switch 2022-12-08 22:32:34 +01:00
Bane Stojkovic be996d6494 Allow drag and drop reordering in project explorer 2022-12-07 23:43:05 +01:00
Bane Stojkovic a9c4f2807f Added Project Explorer 2022-12-06 22:53:45 +01:00
Bane Stojkovic 2ad35e0ac0 Make deprecated center field as transient 2022-12-04 23:30:03 +01:00
Bane Stojkovic 6dafbe1215 Update MiniToggleSwitch.java 2022-12-04 23:28:49 +01:00
Bane Stojkovic 1ba5f1525b Keyboard shortcuts for toggling layer visibility using Ctrl + 1 through Ctrl + 5 2022-11-30 22:51:07 +01:00
Bane Stojkovic 72a00087c3 Optimized memory usage when having many Hookup Wire components 2022-11-27 13:36:34 +01:00
Bane Stojkovic 0c53c8918a Improved conductivity tracking of Terminal Strip 2022-11-27 13:00:34 +01:00
Bane Stojkovic 45b9532e66 Potentiometer bodies are no longer considered as conductive surfaces to avoid unwanted shorts 2022-11-26 11:20:00 +01:00
Bane Stojkovic 0e5dad5412 Sync tests 2022-11-24 22:28:19 +01:00
Bane Stojkovic d0f6c78b5b >Font settings (e.g. bold) sometimes bleed into a different components 2022-11-24 16:37:10 +01:00
Bane Stojkovic 58f73e7c24 Update RegressionTestRunner.java 2022-11-24 09:15:53 +01:00
Bane Stojkovic a7bdac4d52 Remove toggle interaction with pot back 2022-11-23 23:59:13 +01:00
Bane Stojkovic a9036e7b19 Update ContinuityGraph.java 2022-11-23 23:17:56 +01:00
Bane Stojkovic b0ee56b0cc Apply z-order to highlight connected areas feature 2022-11-23 23:16:59 +01:00
Bane Stojkovic 0957f3bc8f Update update.xml 2022-11-23 23:00:43 +01:00
Bane Stojkovic d3d98b3058 Circuit analysis algorithm that supports netlist extraction, 'Highlight connected Areas' and 'Guitar Wiring Analyzer' features improved to take PCB trace layer and component z-order into account for better accuracy 2022-11-23 22:50:01 +01:00
Bane Stojkovic ec5e1ae233 Revert "Rollback Include layer id in continuity areas"
This reverts commit 0f2e581a02.
2022-11-22 18:15:53 +01:00
Bane Stojkovic 0f2e581a02 Rollback Include layer id in continuity areas 2022-11-22 18:10:03 +01:00
Bane Stojkovic aaa24ad56a Fix unit tests 2022-11-20 22:54:25 +01:00
Bane Stojkovic 50588a759d Variants of boards having explicit sizing mode fail when trying to add to a project 2022-11-20 22:51:55 +01:00
Bane Stojkovic 19e9d1692a Reorganize diylc-swing dir 2022-11-20 22:34:58 +01:00
Bane Stojkovic be91987759 Add IzPack 2022-11-20 21:51:43 +01:00
Bane Stojkovic 03ab0f1d95 Do not apply any user-default property values when creating a standard datasheet model (e.g. a capacitor) 2022-11-19 12:28:53 +01:00
Bane Stojkovic a4529c38a2 Release 4.33 2022-11-16 23:55:02 +01:00
Bane Stojkovic de04bd7ec1 Release 4.33 2022-11-16 23:53:00 +01:00
Bane Stojkovic e7fcebcf96 Fixed an issue that would cause capacitors to fail when creating, editing, moving or deleting 2022-11-16 22:44:36 +01:00
Bane Stojkovic cf791ac259 Update getAnnouncements.php 2022-11-15 23:52:47 +01:00
Bane Stojkovic efeed5d49a set OS name as HTTP agent 2022-11-15 23:52:06 +01:00
Bane Stojkovic 07f7382e56 Naming sync 2022-11-15 22:57:47 +01:00
Bane Stojkovic 0535df6880 New radial electrolytics 2022-11-15 22:51:06 +01:00
Bane Stojkovic 8d54c8666a Radial film cap improvements - new shape, more models 2022-11-15 22:50:53 +01:00
Bane Stojkovic 6e382a8375 Remove extra property from radial caps 2022-11-15 22:49:34 +01:00
Bane Stojkovic 76965ffa23 Added standard models in the drop down menu of the component toolbar 2022-11-15 22:48:54 +01:00
Bane Stojkovic b5087a4d77 Fix flatpak 2022-11-11 20:37:12 +01:00
Bane Stojkovic 6d1b513421 Release 4.23.0 2022-11-11 20:22:21 +01:00
Bane Stojkovic 6918872b65 Update update.xml 2022-11-10 23:23:59 +01:00
Bane Stojkovic f3e8509ff3 Batch model values to avoid too long menus 2022-11-10 23:23:53 +01:00
Bane Stojkovic d4bb4b94b9 new wima added 2022-11-10 21:12:19 +01:00
Bane Stojkovic 70294769f1 reorder mica caps 2022-11-10 20:41:37 +01:00
Bane Stojkovic be138f34fc More Wima caps, renamed mica 2022-11-10 20:39:21 +01:00
Bane Stojkovic 52b56374a9 Dale resistors 2022-11-08 00:17:31 +01:00
Bane Stojkovic 904d1a6203 Mica update 2022-11-08 00:03:12 +01:00
Bane Stojkovic bdfd130fb7 Added 'Tubular Beveled' shape option to Resistor component and added Dale CCF55 and CCF60 variants 2022-11-08 00:02:57 +01:00
Bane Stojkovic 5cc652331e Added JJ electrolytics 2022-11-07 15:27:44 +01:00
Bane Stojkovic dbc2ef4fbf Added radial mica component 2022-11-07 15:27:36 +01:00
Bane Stojkovic b435c51bde Added solen fast and WIMAs 2022-11-07 00:23:39 +01:00
Bane Stojkovic c8e507a159 Added Illinois TTA 2022-11-06 18:24:17 +01:00
Bane Stojkovic e369266d49 Update gold color 2022-11-06 18:06:27 +01:00
Bane Stojkovic 6f3b737405 Added Nichicon KZ 2022-11-06 16:48:07 +01:00
Bane Stojkovic dc3eeb3ff9 Added 225P and Nichicon FG 2022-11-06 16:38:34 +01:00
Bane Stojkovic c297459ff2 Apply datasheet model to existing components 2022-11-06 15:29:11 +01:00
Bane Stojkovic 9d9de0bb4d Datasheet rework, more data added 2022-11-05 21:11:29 +01:00
Bane Stojkovic 69895fdc3f Rework datasheet 2022-11-04 23:42:45 +01:00
Bane Stojkovic a9f0c9b82c Datasheet functionality added 2022-11-04 18:01:52 +01:00
Bane Stojkovic bee06d489d Log cleanup 2022-11-01 16:44:24 +01:00
Bane Stojkovic 0778def541 Release 4.31.0 2022-10-31 22:08:12 +01:00
Bane Stojkovic 86acda3f46 Added switch (latching) symbol 2022-10-30 23:04:54 +01:00
Bane Stojkovic 5d6b77f259 Add JRE Zulu 2022-10-30 22:08:04 +01:00
Bane Stojkovic 20d957357f Track arc shapes 2022-10-30 22:07:14 +01:00
Bane Stojkovic f54e73d166 Increased opacity of locked components 2022-10-30 13:33:45 +01:00
Bane Stojkovic c843f54248 Create SwitchLatchingSymbol.java 2022-10-30 13:33:30 +01:00
Bane Stojkovic 36abdc1381 Keep track of variant creation time and update when needed 2022-10-30 13:33:18 +01:00
Bane Stojkovic 79e3ba9fdd Update CommonNode.java 2022-10-30 10:12:16 +01:00
Bane Stojkovic d75653c424 Ground symbol enhancements 2022-10-30 10:12:10 +01:00
Bane Stojkovic e3d2ad82c9 Sync pin color on chips 2022-10-30 10:12:00 +01:00
Bane Stojkovic 4d88fb36cb Update regression files 2022-10-30 10:10:25 +01:00
Bane Stojkovic 717e20ead3 Printed projects are sometimes missing parts of components or text 2022-10-26 22:53:31 +02:00
Bane Stojkovic 1323e9e7c8 Add common node shape 2022-10-26 11:21:12 +02:00
Bane Stojkovic 4ee9bced0e Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2022-10-25 23:06:55 +02:00
Bane Stojkovic 573adc23ba Added "Common Node" component that ties all nodes with the same label together, e.g. B+, V+, GND, etc 2022-10-25 23:06:52 +02:00
Bane Stojkovic 544c5323d5 "Snap to Components" features now works when creating new components as well as when moving existing ones 2022-10-24 09:38:09 +02:00
Tim Savage 01a14d490d Create .gitattributes (#733)
Ensure .sh files always us LF
2022-10-23 22:29:51 +02:00
Bane Stojkovic 37b1d1dbd9 Cleanup code, refactor presenter 2022-10-23 22:09:49 +02:00
Bane Stojkovic 55c91faaf7 Fix the test 2022-10-23 08:10:57 +02:00
Bane Stojkovic 7c81b7f8d2 Release 4.30.1 2022-10-23 07:29:28 +02:00
Bane Stojkovic 18c7b9207b Release 4.30.1 2022-10-23 07:27:24 +02:00
Bane Stojkovic acda3b69f6 Release 4.30.0 2022-10-22 22:44:51 +02:00
Bane Stojkovic cf315c5f79 Redo regression test input files 2022-10-22 22:36:54 +02:00
Bane Stojkovic 93e0395ac5 Limit switch combinations for netlists 2022-10-22 22:30:54 +02:00
Bane Stojkovic c30c8da267 Add rotary switches 2022-10-22 18:44:49 +02:00
Bane Stojkovic 6100309b3b Update TubeSocket.java 2022-10-21 23:21:33 +02:00
Bane Stojkovic 24995d7c3f Refactor netlist calculation 2022-10-20 18:36:39 +02:00
Bane Stojkovic 770eb87a74 Standardize dark phenolic color 2022-10-11 16:00:09 +02:00
Bane Stojkovic 1ecafb7811 Add rotary switch timing 2022-10-11 15:33:46 +02:00
Bane Stojkovic 8829165e36 Take phenolic color down to main component class 2022-10-09 22:05:55 +02:00
Bane Stojkovic 7d597c5ca2 Refactor switch tests to separate classes 2022-10-09 22:04:44 +02:00
Bane Stojkovic f9759b8cc4 Added rotary switch (sealed) 2022-10-09 22:04:19 +02:00
Bane Stojkovic 0d40e53e06 Fix primitive array comparison 2022-10-09 21:25:38 +02:00
Bane Stojkovic 2447780585 Lever switch refactor 2022-10-09 21:25:20 +02:00
Bane Stojkovic fa0d3699ce Fix humbucker internal link name 2022-10-09 19:03:03 +02:00
Bane Stojkovic 7878c1fc71 Ability to rotate 'Lever Switch' and 'Schaller Megaswitch' by any angle 2022-10-08 20:41:47 +02:00
Bane Stojkovic 50d4c1dec1 Ability to rotate all guitar/bass pickups through the 'Transform Selection' feature or keyboard shortcut 2022-10-08 13:05:34 +02:00
Bane Stojkovic ebbc25a92d Fix 6-way switch wiring 2022-10-06 19:38:09 +02:00
Bane Stojkovic da0ce8970d Added unit tests for new switches 2022-10-06 19:24:06 +02:00
Bane Stojkovic 064b4d31ee Added 'DP4T (6-Position Oak Grigsby)' as a new type of Lever Switch component 2022-10-06 17:00:21 +02:00
Bane Stojkovic acd8f70cc5 Added 'S1 Switch' component that can be combined with potentiometer component or used on its own 2022-10-06 12:44:28 +02:00
Bane Stojkovic e8e370d3d3 Release 4.29 2022-10-04 14:09:30 +02:00
Bane Stojkovic 3bf9e09a9f Merge 2022-10-04 13:59:30 +02:00
Jamie Drinkell d3cd8c5e86 New Components: Bulb, Stingray PKP + Correction: Battery Symbol (#724)
* Change Icon Lead Colour

Icon lead colour changed to black to match other components.

* Add BulbSchematicSymbol

Add Bulb / Pilot Light / Lamp schematic symbol.

* Add StingrayBassPickup

Stingray Bass Pickup Option.
2022-10-04 13:51:47 +02:00
Bane Stojkovic 25222cbb19 Added import style strat switch 2022-10-04 13:45:00 +02:00
Bane Stojkovic 40e1935e3f Added Schaller Megaswitch, standardized colors of FR4 2022-10-04 13:44:48 +02:00
Bane Stojkovic ad8c624efb v4.28 release 2022-09-25 14:06:24 +02:00
Bane Stojkovic 741b9bc624 Jumbo 4-pin socket added 2022-09-25 14:06:17 +02:00
Bane Stojkovic 3b12788eff Angle editor added 2022-09-25 14:06:08 +02:00
Bane Stojkovic d2adb49ccf Sync PHP API files 2022-09-21 15:41:39 +02:00
Bane Stojkovic f422e0fdf9 Minor fix in labels 2022-08-28 15:18:59 +02:00
Bane Stojkovic 0d8d456e98 Release 4.27 2022-08-28 15:15:47 +02:00
Bane Stojkovic af4c22c856 4.27 release 2022-08-28 10:07:46 +02:00
Jamie Drinkell 9e3f1793fd Add CurrentSourceSymbol + VoltageSymbol corrections (#723)
* Improved readability

Tabs and spaces changed for better readability. No functional changes.

* Correct labelling of "Source Type" property

More readability improvements as well as property change.

* Add CurrentSourceSymbol

A schematic symbol for current sources with two alternate drawing styles
2022-08-28 09:54:36 +02:00
Bane Stojkovic c6ae5af997 Update com.diy_fever.DIYLayoutCreator.metainfo.xml 2022-08-27 18:15:30 +02:00
Bane Stojkovic a1c4747b6d Release 4.26 2022-08-27 18:13:34 +02:00
Bane Stojkovic f2dc63e7e6 Added two DPDT ON/ON/ON variations to 'Mini Toggle Switch' component 2022-08-27 18:10:49 +02:00
Bane Stojkovic f5498714b0 Cleanup imports 2022-08-27 16:39:44 +02:00
Jamie Drinkell 66e668a2b2 Add VoltageSourceSymbol (#722)
Symbol for a voltage source schematic component, with options for AC or DC.
2022-08-27 16:35:05 +02:00
Bane Stojkovic 95f86f9056 Merge branch 'master' of https://github.com/bancika/diy-layout-creator 2022-07-31 15:50:54 +02:00
Bane Stojkovic 8074f6e49c Load recent files in background thread 2022-07-31 15:50:52 +02:00
Bane Stojkovic 5b9e2ff387 Disable hardware acceleration 2022-07-31 15:50:29 +02:00
pushfoo 1d542c5c96 Fix typo in opening paragraph of readme (#710)
replace typo 'buidt` with `built`
2022-07-13 13:44:19 +02:00
Bane Stojkovic 969c7ebdc1 The app crashes if there's a component that is reduced to 0 pixels with 'Cache Boost' enabled 2022-07-13 12:04:59 +02:00
Bane Stojkovic 746d6c06e7 Update com.diy_fever.DIYLayoutCreator.metainfo.xml 2022-07-09 09:43:58 +02:00
Bane Stojkovic 9fde2e7bb3 Release 4.25 2022-07-09 09:41:54 +02:00
Bane Stojkovic ad29d2d077 Update update.xml 2022-07-05 09:37:17 +02:00
Bane Stojkovic 43d58ae4a6 Update run.sh 2022-07-05 09:36:08 +02:00
Bane Stojkovic 80f006f6b5 Fix run.sh to Unix line breaks 2022-07-05 09:33:48 +02:00
Bane Stojkovic a08c8a4484 Cleanup cache when a component is deleted from the project 2022-07-05 09:26:45 +02:00
Bane Stojkovic 8d385ef812 Limit memory usage to avoid out of memory errors when 'Cache Boost' feature is enabled 2022-07-05 00:59:30 +02:00
Bane Stojkovic bcc1a2cb3a Changed resistor orange band color to more intense orange 2022-07-04 19:38:57 +02:00
Bane Stojkovic f568ba6fac Added BJT BCE pinout to transistor components 2022-06-13 19:32:44 +02:00
Bane Stojkovic 9bf5b57663 Status bar shows a wrong number of selected components 2022-06-10 09:58:00 +02:00
Bane Stojkovic 29c2240920 Release 4.24 2022-06-05 10:46:44 +02:00
Bane Stojkovic 22086e05a7 Auto garbage collector 2022-06-05 10:38:46 +02:00
Bane Stojkovic 3842e65fb9 Update dict file 2022-05-09 09:52:36 +02:00
Bane Stojkovic b59afed4fd Fixed a bug that causes the background of exported images and PDFs to be very light gray instead of pure white 2022-05-09 09:48:47 +02:00
Bane Stojkovic df1e1334e0 Release 4.23.0 2022-04-23 20:21:28 +02:00
Bane Stojkovic 3cb3f11c58 Release 4.23.0 2022-04-23 20:18:11 +02:00
Bane Stojkovic 5605becb98 Add logging 2022-04-23 20:13:42 +02:00
Bane Stojkovic c24187eeb6 Slide switch added 2022-04-23 20:13:19 +02:00
Bane Stojkovic d50acb4911 Improve speed of rendering of the grid 2022-03-18 20:55:40 +01:00
Bane Stojkovic bf89b07cea Fix blocks, add tests, fix bounding box calc of some components 2022-03-18 09:23:03 +01:00
Bane Stojkovic d513cb2667 Fixed the issue with 'Add Flexible Leads' functionality placing the flexible leads wrong on leaded components (e.g. resistors, capacitors...) 2022-03-07 19:21:58 +01:00
Bane Stojkovic b646d90179 More test files 2022-03-05 14:29:43 +01:00
Bane Stojkovic 3dcc4a1638 Added more regression files 2022-03-04 09:31:18 +01:00
Bane Stojkovic f5df5ba9eb Fixed backwards compatibility issue with older files failing to open because of an issue with 'Tape Measure' component serialization 2022-03-04 09:14:35 +01:00
Bane Stojkovic 7210ac1533 Fixed display issue with Trace layer showing up as Wiring in the menu 2022-03-04 09:14:22 +01:00
Bane Stojkovic a3acc07014 Change report name format 2022-03-03 17:04:40 +01:00
Bane Stojkovic bcbac424ed Release 4.22.0 2022-03-03 16:57:45 +01:00
Bane Stojkovic dbfb768dc3 Create report for each regression run 2022-03-03 16:40:50 +01:00
Bane Stojkovic e6c1313312 Add regression data 2022-03-03 09:47:52 +01:00
Bane Stojkovic 53bff5ef13 Change Twisted Leads to render consistently 2022-03-03 09:42:48 +01:00
Bane Stojkovic d376ec9278 Visual regression testing 2022-03-03 09:42:31 +01:00
Bane Stojkovic 2cbaaa4a7d Added regression test suite that validates each release candidate version against a barrage of different DIY files 2022-03-02 18:52:52 +01:00
Bane Stojkovic 5539195778 Fix component prefix for SMD Resistor 2022-03-02 17:02:15 +01:00
Bane Stojkovic a576f140ad Fix component prefix for SMD Resistor 2022-03-02 17:01:07 +01:00
Bane Stojkovic c665397bda Fixed backwards compatibility issue with older files failing to open because of an issue with 'Mini Toggle Switch' component serialization 2022-03-02 17:00:51 +01:00
Bane Stojkovic 1ce7646fb5 Upgrade OSX application package built-in Java JRE to version 1.8.0_321-b07 2022-03-02 09:32:51 +01:00
Bane Stojkovic d0ae14d33e Separate WIRING layer (containing Hookup Wire and Twisted Wire at the moment) from TRACE layer and render it above the COMPONENT layer by default 2022-03-01 17:12:37 +01:00
Bane Stojkovic 94963afb75 Remove unneeded editors for overriden classes 2022-02-28 00:10:59 +01:00
Bane Stojkovic 3d7d6f60fc Release 4.21.4 2022-02-27 23:51:40 +01:00
Bane Stojkovic 0dcfe8a08a Fixed stereo phono jack rendering when rotated 2022-02-27 15:37:17 +01:00
Bane Stojkovic a147345756 Improve scroll precision 2022-02-27 15:36:56 +01:00
Bane Stojkovic a038de3d31 Fix config location 2022-02-22 16:03:31 +01:00
Bane Stojkovic 738dd800af Upcoming (#691)
* Added 1/8" jack

* Release 4.20

* Merge traces and wires into "Wiring" layer

* Add shabang to run.sh

* Added gray theme

* Prevent the donation label from wrapping into several lines

* Use Backspace key to delete selection in Mac OS

* Upgrade xstream to fix java 16 compatibility

* Add exec to run.sh

* Added regulator pinouts to transistor body components

* Release 4.21.1

* Fix linux run.sh, added more java-opens
2022-02-21 23:23:56 +01:00
Bane Stojkovic 30dc7ce36b Upcoming (#688)
* Added 1/8" jack

* Release 4.20

* Merge traces and wires into "Wiring" layer

* Add shabang to run.sh

* Added gray theme

* Prevent the donation label from wrapping into several lines

* Use Backspace key to delete selection in Mac OS

* Upgrade xstream to fix java 16 compatibility

* Add exec to run.sh

* Added regulator pinouts to transistor body components

* Release 4.21.1
2022-02-19 18:28:47 +01:00
Bane Stojkovic d245a6305f Upcoming (#686)
* Added 1/8" jack

* Release 4.20

* Merge traces and wires into "Wiring" layer

* Add shabang to run.sh

* Added gray theme

* Prevent the donation label from wrapping into several lines

* Use Backspace key to delete selection in Mac OS

* Upgrade xstream to fix java 16 compatibility

* Add exec to run.sh
2022-02-16 23:41:47 +01:00
Bane Stojkovic feaa48fed5 Upcoming (#669)
* Added 1/8" jack

* Release 4.20
2021-09-12 19:24:30 +02:00
Bane Stojkovic 437ec07d2d Fix release 2021-08-22 00:05:04 +02:00
Bane Stojkovic 06cb3913ae Next (#663)
* flatpak file updated

* add sha generator

* fix mail

* remove mail

* Mini Toggle Switch - lugs do not get rotated when changing orientation;
rotate from the context menu doesn't work

* Added 'SVG Image' component

* Fixed the issue with Perf Board, Vero Board and TriPad Board sometimes
rendering an extra row with pads when there's no space for them

* release 4.18

* Keep grouped components together when pasting

* Added 'Dial Scale' component for designing device face-plates

* dial scale updates

* dial scale tweaks

* release

* release

* release

* release
2021-08-21 23:19:57 +02:00
Bane Stojkovic 878d048040 Next (#656)
* flatpak file updated

* add sha generator

* fix mail

* remove mail

* Mini Toggle Switch - lugs do not get rotated when changing orientation;
rotate from the context menu doesn't work

* Added 'SVG Image' component

* Fixed the issue with Perf Board, Vero Board and TriPad Board sometimes
rendering an extra row with pads when there's no space for them

* release 4.18
2021-07-11 15:05:11 +02:00
Bane Stojkovic ad8d719eeb Merge pull request #632 from bancika/next
Next
2021-02-14 17:50:52 +01:00
bancika bf31204c45 release 4.17 2021-02-14 17:49:42 +01:00
bancika 8275226942 eurorack stripboard added 2021-02-14 17:23:01 +01:00
bancika e03e1516e0 action bar - add tooltip with keyboard shortcuts 2021-02-09 20:33:14 +01:00
bancika d2f9ef5ac2 Allow multi-line text in label components 2021-02-08 22:55:40 +01:00
bancika 22f0950fcf splash update 2021-02-07 19:05:31 +01:00
bancika 9617449de8 Fixed a major memory leak when using Undo functionality 2021-02-07 19:04:49 +01:00
bancika c7a68d6542 doc fix 2021-02-04 22:37:06 +01:00
bancika a7a2d24e16 doc fix 2021-02-04 22:35:39 +01:00
bancika b22fa6291c splash improvement 2021-01-19 08:45:38 +01:00
bancika 666b940176 splash improvement 2021-01-18 23:13:22 +01:00
bancika 9872d2547d splash improvement 2021-01-18 23:12:32 +01:00
bancika b1902fd086 splash improvement 2021-01-18 23:09:33 +01:00
bancika 2649254a49 tweak flatpak meta 2021-01-18 20:34:34 +01:00
bancika 650a60bdb4 add IDEA support 2021-01-18 12:27:08 +01:00
bancika bfc61f5513 add IDEA support 2021-01-17 18:32:28 +01:00
Bane Stojkovic 2c81782f62 Merge pull request #623 from bancika/next
Next
2021-01-17 17:38:14 +01:00
bancika 986d92ec53 release 4.16.0 2021-01-17 17:36:15 +01:00
bancika 9af055e4ca Color chooser dialog defaults to the existing color value being edited 2021-01-17 09:58:09 +01:00
bancika 61202675b8 Single click to expand and collapse categories in the component tree 2021-01-17 09:44:06 +01:00
bancika 1aabe42573 undo a small change 2021-01-17 09:33:46 +01:00
bancika fa56fd79cf When editing component colors, honor the specified 'alpha' value
specified on each color individually in addition to the component-level
alpha property
2021-01-17 00:09:21 +01:00
bancika bcb1b3c082 Merge branch 'master' into next 2021-01-13 17:57:33 +01:00
bancika 50fc7c1261 minor change 2021-01-13 17:56:48 +01:00
Bane Stojkovic 7b64a2c8d0 Merge pull request #620 from nbenitez/flatpak_packaging
Add .desktop and metainfo files for flatpak packaging
2021-01-11 15:56:12 +01:00
Nelson Benítez León aff0ec8ecf Add .desktop and metainfo files for flatpak packaging 2021-01-09 17:00:48 -04:00
bancika d716a4c986 Improved Dark theme look 2021-01-09 10:05:33 +01:00
bancika 751f6493cd Auto-Wrap Label crashes the application if it's shrunken into zero-lengt 2021-01-09 10:05:10 +01:00
bancika 5835d18a21 better log 2021-01-07 22:01:04 +01:00
bancika d095a664fc removed extra logging 2021-01-04 22:44:22 +01:00
bancika f094480b64 Merge branch 'master' into next 2021-01-04 22:38:46 +01:00
bancika 67bbac196a Improved code robustness 2021-01-04 22:37:52 +01:00
Bane Stojkovic 3b3e05f4e9 Merge pull request #617 from bancika/next
Next
2021-01-04 09:56:30 +01:00
bancika 5415c29ee0 fix for mac toolbar 2021-01-04 09:56:09 +01:00
bancika 536188dc92 fix 2021-01-03 23:55:21 +01:00
Bane Stojkovic cccca4a203 Merge pull request #616 from bancika/next
Next
2021-01-03 23:51:33 +01:00
bancika 889d76c3ee release 2021-01-03 23:51:14 +01:00
bancika 4f1fb85886 Fixed the issue that prevented old DIYLC v1 and v2 files to be opened 2021-01-03 09:23:59 +01:00
bancika 458b853830 netlist parse improvements 2021-01-03 09:19:58 +01:00
bancika 1737df8047 add info box in the import dialog 2021-01-03 00:21:05 +01:00
bancika 75758e0250 Added 'File' -> 'Import Netlist' option that can import components from
a Tango PCB file
2021-01-03 00:03:44 +01:00
bancika 4144956a09 add popup to building blocks in the toolbar 2021-01-01 19:25:10 +01:00
bancika 607f963ba7 Toolbar drop down menu now contains options for managing favorites,
keyboard shortcuts and selecting all components of type
2021-01-01 09:29:09 +01:00
bancika a2b06c0a0d toolbar improvements 2020-12-31 19:36:59 +01:00
bancika 8e7c815d2b Fixed some issues with exporting and importing building blocks and
variants
2020-12-31 13:06:31 +01:00
bancika e7b096f5c1 brazilian translation update 2020-12-30 17:10:46 +01:00
bancika db42e3ed9b When editing component properties, group Length and Width properties
together
2020-12-30 10:01:04 +01:00
bancika 8b90c9295b portugese brazilian added 2020-12-29 23:18:24 +01:00
bancika 92cb86103b Rotating 'Neutrik Jack' produces rendering issues 2020-12-29 23:18:03 +01:00
Bane Stojkovic 911d85cfd0 Merge pull request #612 from bancika/next
Next
2020-12-28 22:09:18 +01:00
bancika 66359d3c01 release 2020-12-28 22:08:54 +01:00
bancika 373fde0d6f Migrate application data (config, logs, backups) directory from
'$USER_HOME/.diylc' to '$USER_HOME/diylc' to avoid it being hidden on
some OSs
2020-12-28 19:05:38 +01:00
bancika b348513d0c macOS: logging does not produce files on Mac OS Sierra
macOS: splash screen hangs for several minutes on some machines
2020-12-27 21:23:25 +01:00
Bane Stojkovic a3edd3bcf1 Merge pull request #606 from bancika/next
Next
2020-12-20 19:34:33 +01:00
bancika 3fda739703 release 2020-12-20 19:34:04 +01:00
bancika 3988940446 simplified the code 2020-12-20 14:07:11 +01:00
bancika 3e5978beb7 Added 'Check Trace Proximity' functionality under File -> Analyze menu
that checks if there are any traces or pads that are too close to each
other
2020-12-20 12:48:12 +01:00
bancika 26fa95670e Analyze fonts in the background to identify ones that are causing
slowness when editing 'Label' components and skip font preview for them
to optimize performance
2020-12-19 18:14:53 +01:00
bancika a4de01dfb0 Added 'Neutrik Jack' component based on Neutrik NMJx series 2020-12-18 22:20:11 +01:00
bancika 278ec5cd84 Improved performance of the application when using dashed and dotted
style for 'Hookup Wire' component
2020-12-16 23:45:18 +01:00
bancika d3655e3f69 replace URLClasSLoader with agent 2020-12-15 17:23:32 +01:00
Bane Stojkovic 6b84228284 Update README.md 2020-12-14 10:29:48 +01:00
bancika e86f754768 'Tactile Micro-Switch' component added 2020-12-13 21:50:58 +01:00
bancika 6fce948506 translations 2020-12-13 20:44:06 +01:00
bancika 2a063c84cd Added 'Font Size Override' property to most components that display text
to allow control over font size
2020-12-13 20:42:26 +01:00
Bane Stojkovic 4f0f45315e Merge pull request #604 from bancika/next
Next
2020-12-13 17:22:41 +01:00
bancika 695710f34f release 2020-12-13 17:21:53 +01:00
bancika 6c00be0b87 Rotating and mirroring boards that display coordinates also changes
coordinate origin
2020-12-13 16:03:42 +01:00
bancika 52750121e3 fix macOs language selection 2020-12-13 14:29:14 +01:00
bancika 9dada76406 Added a button in the action toolbar to toggle between snap modes (none,
grid, component)
2020-12-13 11:12:45 +01:00
bancika cad1160ce7 Dragging components from the component tree to the canvas stops working
once the component type is selected in the tree
2020-12-12 22:50:52 +01:00
bancika e52873fc50 Fixed issues when creating leaded components using drag and drop with
'Snap to Grid' option switched on using a metric grid spacing (e.g. 1mm)
2020-12-12 22:40:21 +01:00
bancika 7dd63ba2d8 snap rigid components back to the grid 2020-12-12 11:39:01 +01:00
bancika a1e43be273 protoboard transformer added 2020-12-12 11:24:13 +01:00
bancika 3d1a7a5748 Apply context menu rotation to Breadboard components 2020-12-12 07:58:50 +01:00
bancika f1b7d39ad4 tag strip rotate/mirror 2020-12-12 00:21:25 +01:00
bancika b6b50d376d When rotating Vero and Tri-Pad boards, change the orientation of strips
to match the rotation angle
2020-12-11 23:51:32 +01:00
bancika a03dd74c80 fix update.xml 2020-12-11 21:07:42 +01:00
bancika e4bdb820d4 In cases when there's already a component in the selection that is
reduced to nothing, allow moving the selection
2020-12-11 21:06:23 +01:00
bancika f386d79a26 Do not allow for components like traces, jumpers and wires to be reduced
to nothing by dragging connected components
2020-12-11 21:00:11 +01:00
bancika b3ce9db691 Merge branch 'master' into next 2020-12-11 13:55:12 +01:00
bancika 011a06ec75 meta zoom and two finger click fixes for mac 2020-12-11 13:54:19 +01:00
bancika a1072973d2 smd transformation 2020-12-11 13:53:07 +01:00
bancika 59620a6692 trimmer transformation 2020-12-11 13:52:22 +01:00
bancika 77ab989334 pinch zooming for mac 2020-12-09 21:30:08 +01:00
Bane Stojkovic d58542a2f9 Merge pull request #603 from HaraldRau/patch-1
Update Deutsch.txt
2020-12-09 14:48:46 +01:00
Harald Rau 9f71a77edc Update Deutsch.txt
Hello,
I've shortened my desire for coffee a little. Maybe that solves the problem?
2020-12-09 13:11:25 +01:00
Bane Stojkovic 4450f249ea Merge pull request #600 from bancika/next
Next
2020-12-06 22:18:00 +01:00
bancika caf9b3b5d5 release 2020-12-06 22:17:27 +01:00
bancika dfdb490e64 Merge branch 'master' into next 2020-12-06 10:32:29 +01:00
bancika 91dd539b3b sync libs 2020-12-06 10:30:25 +01:00
bancika 257563974b Added ability to rotate images 2020-12-06 10:30:12 +01:00
bancika 0b3bc7a879 reorganize cloud thumbnail code 2020-12-06 10:14:01 +01:00
bancika 68dd3e08b4 Project Cloud: replace project file doesn't do what it's supposed to 2020-12-05 21:43:29 +01:00
bancika ff02e779e1 add jre and gitignore 2020-12-02 22:15:49 +01:00
bancika 364cb30db0 windows - include JRE with the installation 2020-12-02 17:27:49 +01:00
bancika b96b694e87 add action bar to mac os as a separate component 2020-12-01 15:40:42 +01:00
Bane Stojkovic 49790e0015 Merge pull request #597 from bancika/next
reorganize IconLoader to avoid namespace clash, fix for Sierra OSX
2020-11-19 18:00:42 +01:00
bancika 9294c24684 reorganize IconLoader to avoid namespace clash, fix for Sierra OSX 2020-11-19 18:00:12 +01:00
Bane Stojkovic 93abda7966 Merge pull request #596 from bancika/next
v.4.10.0 release
2020-11-19 17:18:38 +01:00
bancika f39392f737 4.10.0 release 2020-11-19 17:17:34 +01:00
bancika 0b72abb8b4 embed JRE for OSX build 2020-11-19 17:09:02 +01:00
bancika 7a5a6a469d add meta for zoom shortcuts 2020-09-18 21:24:04 +02:00
bancika 9372858596 serialize config using the same XStream as for the project 2020-09-18 17:48:31 +02:00
bancika 5638d560a4 Favorites on building blocks show up as "null" 2020-09-18 17:05:49 +02:00
Bane Stojkovic a680a5b802 Merge pull request #581 from bancika/next
fixed serialization issues
2020-09-18 15:58:45 +02:00
bancika 0fa15650c3 fixed serialization issues 2020-09-18 15:58:18 +02:00
Bane Stojkovic e128c4cae4 Merge pull request #579 from bancika/next
Next
2020-09-18 09:51:08 +02:00
bancika d55d83c7c3 release 2020-09-18 09:50:37 +02:00
bancika eb3915495d fixes 2020-09-17 22:38:28 +02:00
bancika bb768c0b07 remove old code 2020-09-17 17:52:17 +02:00
bancika 4f2e1db6d7 reorganized Searchable Tree, new custom model 2020-09-17 17:35:17 +02:00
bancika d5b6a29fdd Added "Phono Jack" schematic symbol 2020-09-17 12:17:52 +02:00
bancika bb0669439e more loging at start 2020-09-17 10:07:43 +02:00
bancika 98e009ecb9 cleanup 2020-09-17 10:07:30 +02:00
bancika 12364e908a Switched from iText to OrsonPDF library for PDF creation 2020-09-16 17:26:56 +02:00
bancika f2caf0c9fc log config at start 2020-09-16 10:21:21 +02:00
bancika 57a0425723 Ctrl+0 to reset to 100% 2020-09-16 09:30:49 +02:00
bancika b1b3d2ef9c add keyboard shortcuts for zoom 2020-09-16 09:28:08 +02:00
bancika 632dff3e2c Allow rotate and mirror actions on Pin Header component 2020-09-15 18:10:04 +02:00
bancika d0ab585ba0 Keep explicit dimensions in sync with control point location 2020-09-15 17:53:33 +02:00
bancika 59cc4084fc improve snap to grid when multiple joint points are selected 2020-09-15 10:41:40 +02:00
bancika 00769efb56 Merge branch 'next' of git://github.com/bancika/diy-layout-creator.git into next 2020-09-14 11:06:35 +02:00
bancika a17c478e0b fix the dot rendering 2020-09-14 11:06:26 +02:00
Branislav Stojkovic 0aaaea2bfa fixes for double points 2020-09-11 15:20:17 +02:00
bancika 8c63184740 fix the issue with saving variant location 2020-09-10 21:47:28 +02:00
bancika cbe22df372 fix integer rounding 2020-09-10 17:23:18 +02:00
bancika 97027d1774 rounding issue for leaded components 2020-09-10 17:00:46 +02:00
bancika 11fb16b674 Shorten donation label when window is smaller 2020-09-10 16:52:27 +02:00
bancika 82f37a5225 Big update - replace Point with Point2D in most places to increase
accuracy
2020-09-10 12:21:48 +02:00
bancika f79fb73cb2 fix typo 2020-09-07 15:09:57 +02:00
bancika 3ab85b4fb1 On MacOS the app registers to open .DIY file 2020-09-07 09:36:55 +02:00
bancika 5164501228 patch for mac-specific file handler 2020-09-07 08:47:50 +02:00
Bane Stojkovic 94d713182e Merge pull request #575 from htor/fix-macos-openwith
fix file extension and file opening for macos
2020-09-07 08:35:35 +02:00
Herman Torjussen 5f664dcc5d use open file event for opening files on macos 2020-09-07 00:44:28 +02:00
Herman Torjussen b02fe56ba9 register custom file extension for macos build 2020-09-06 22:33:33 +02:00
Bane Stojkovic 430779ba8d Merge pull request #573 from bancika/next
Next
2020-09-04 10:01:43 +02:00
bancika 70ca45513e release 4.8.0 2020-09-04 09:54:10 +02:00
bancika d7ea8f3738 "Highlight Continuity Area" mode improvements 2020-09-02 09:58:33 +02:00
bancika 5591724a67 Make file writes more resilient to crashes to avoid loss of data 2020-09-02 08:48:02 +02:00
bancika 7628eefd6d track usage and sessions started 2020-08-17 12:21:40 +02:00
bancika 972635b679 correct bad theme entry with default value 2020-06-02 14:06:21 +02:00
bancika 25d9ff302f Program won't start with some older configuration files due to different
format of themes
2020-06-01 11:55:29 +02:00
bancika 951bb1247d added German translation
improved Dutch
2020-05-18 12:38:15 +02:00
bancika a5fe794b14 Improved Dutch translation 2020-05-12 17:01:15 +02:00
bancika aec5348b83 "Outline Mode" produces rendering issues when "Cache Boost" feature is
enabled
2020-05-12 17:01:12 +02:00
Bane Stojkovic a03806c776 Merge pull request #539 from bancika/next
Next
2020-05-11 19:08:34 +02:00
bancika 113cb69ae4 release 2020-05-11 19:08:00 +02:00
bancika 5572645081 added italiant translation
sort languages alphabetically
2020-05-11 16:40:59 +02:00
bancika 42589a5ed3 spanish update 2020-05-10 09:30:51 +02:00
bancika 7fc87ca235 espanol 2020-05-08 10:43:35 +02:00
bancika e825814929 Added "Crystal Oscillator" component 2020-05-07 11:55:21 +02:00
bancika aeca976c4e add missing stuff in the dict 2020-05-07 11:10:05 +02:00
bancika ffe4d83e3d update.xml 2020-05-06 09:05:29 +02:00
bancika f4aa60263c fix regression issue with serialization 2020-05-05 21:11:18 +02:00
bancika e7c220c307 fix humbucker coil terminals 2020-05-05 18:56:55 +02:00
bancika 106cb55ff0 translate loadline editor 2020-05-03 22:35:52 +02:00
bancika adcbfbc679 Apply translation to the context menu 2020-05-03 20:13:36 +02:00
bancika 71e32a9296 Dismissing the closing confirmation dialog using the "X" button should
behave the same as selecting "Cancel"
2020-05-03 11:49:11 +02:00
bancika 8e0974cfb2 fix win build 2020-05-03 09:48:02 +02:00
bancika 07ba8f14f7 Merge branch 'master' of git://github.com/bancika/diy-layout-creator.git 2020-05-03 09:29:14 +02:00
bancika 477839e111 4.6.0 release 2020-05-03 09:27:46 +02:00
Branislav Stojkovic d291fcd373 reorg loadline 2020-05-01 21:09:29 +02:00
Branislav Stojkovic 308a0346a9 loadline work 2020-05-01 18:56:28 +02:00
Branislav Stojkovic 1c591bb9f5 lang 2020-05-01 17:12:43 +02:00
Branislav Stojkovic 73da32b306 log config 2020-05-01 10:29:40 +02:00
Branislav Stojkovic 3c26a0c8da Do not show control points of locked components while dragging other
components
2020-04-30 17:51:30 +02:00
Branislav Stojkovic d4519ac5a9 Added "Sizing Mode" to Image component that allows stretching the image
freely using two control points
2020-04-30 17:48:49 +02:00
Branislav Stojkovic 437657a79c move pending langs 2020-04-30 17:08:38 +02:00
Branislav Stojkovic bac4e5f01d fix language details 2020-04-30 16:50:13 +02:00
Branislav Stojkovic 5cf4f5a27a Loadline work 2020-04-29 20:55:18 +02:00
Branislav Stojkovic 2dfd925462 new french translation 2020-04-27 15:44:39 +02:00
Branislav Stojkovic 1d770b475f Merge branch 'lang' into next 2020-04-27 15:33:57 +02:00
bancika 3c7b77df3e loadline 2020-04-26 20:16:20 +02:00
bancika 48aef2cd7e translate 2020-04-26 16:07:31 +02:00
bancika 749118ce02 translate 2020-04-26 08:55:36 +02:00
bancika 436741d59b translate 2020-04-26 08:55:24 +02:00
bancika 2549affc1f fix lang loading 2020-04-24 15:05:45 +02:00
bancika e4a9155239 include languages for osx distribution 2020-04-24 14:49:25 +02:00
bancika 990620ab75 include languages for OSX distribution 2020-04-24 14:49:10 +02:00
bancika f8a2ac9013 Merge branch 'next' into lang
Conflicts:
	diylc/diylc-library/lib/diylc-core.jar
	diylc/diylc-swing/lib/diylc-core.jar
	diylc/diylc-swing/library/main.jar
2020-04-24 13:23:26 +02:00
bancika 1031c4b61f lib 2020-04-24 11:16:14 +02:00
bancika 49bc9cb8cc Include themes and fonts in OSX app package. Standardize loading
resource files
2020-04-24 11:12:51 +02:00
bancika ce3ec4a5af lang 2020-04-24 10:04:36 +02:00
bancika bdf93b75e2 Some boards (e.g. Breadboard) stop working at certain orientations 2020-04-24 09:26:15 +02:00
bancika 4ee7a13f71 translation 2020-04-24 09:25:12 +02:00
bancika 5cb2e7dd2b libs 2020-04-23 18:58:46 +02:00
bancika f408ce15b5 Prevent "Radial Film Capacitor" from switching to standing mode when end
points are too close
2020-04-23 18:58:36 +02:00
bancika 3223202869 translate 2020-04-23 18:54:54 +02:00
bancika 25542d2384 fix typo 2020-04-23 16:13:14 +02:00
bancika f834098363 translations 2020-04-23 16:06:20 +02:00
bancika 7ef36bedfe cleanup warnings 2020-04-23 12:15:45 +02:00
bancika 6f62d2280a map new pinouts for spice nodes 2020-04-23 12:15:38 +02:00
bancika 1e5c945804 translate more 2020-04-23 12:10:07 +02:00
bancika 606715398a added flags 2020-04-23 11:53:44 +02:00
bancika 2ffc40baea languages 2020-04-23 11:24:08 +02:00
bancika dddeba1fae languages 2020-04-23 10:46:53 +02:00
bancika f92a80e260 translation 2020-04-23 10:20:56 +02:00
bancika 0d556b66e8 language selection UI 2020-04-22 23:52:37 +02:00
bancika fda3b22db8 to UTF-8 2020-04-22 23:39:54 +02:00
bancika 5921b387c4 multi-language support 2020-04-22 23:38:18 +02:00
bancika c63b26b660 Component leads on resistors, capacitors, etc disappear when they are
very short
2020-04-22 08:44:09 +02:00
Bane Stojkovic c2b44905fc Update README.md 2020-04-20 23:21:24 +02:00
bancika 2d34b2cf8a added version reader 2020-04-20 19:09:43 +02:00
bancika 2086ecf2ca added ant task for uploading update.xml file to ftp 2020-04-20 16:02:45 +02:00
bancika 96d2b9501a 4.5.0 build 2020-04-20 15:12:57 +02:00
bancika 01458c52c1 libs 2020-04-20 15:10:33 +02:00
bancika 80071a2ac2 4.5.0 release 2020-04-20 15:10:26 +02:00
bancika 83a56df6a9 move classes around 2020-04-20 15:05:35 +02:00
bancika c92dc9176b move classes around 2020-04-20 15:00:22 +02:00
bancika b7b9933d72 Added support for rotating and mirroring potentiometer symbol and
transistor symbols
2020-04-20 14:50:15 +02:00
bancika 61f62b7186 Fixed grid alignment issues with ruler marks when both the ruler and
grid is in metric units
2020-04-19 21:58:28 +02:00
bancika f8b88755e4 Added mirrored pin display options for "DIL IC" 2020-04-19 20:08:01 +02:00
bancika 3c72fc5168 test update 2020-04-19 19:32:59 +02:00
bancika 7df07c2bd1 Added ability to lock and unlock individual components from the context
menu
2020-04-19 19:32:50 +02:00
bancika 7754922711 initial commit for regression testing 2020-04-19 16:50:25 +02:00
bancika ac606bb472 add more transistor pinouts 2020-04-18 18:27:25 +02:00
bancika 6c77dd5102 add support for guitar pickup leads 2020-04-18 18:21:15 +02:00
bancika 01e1ed3f6c honor default lead properties, like point count 2020-04-18 14:32:42 +02:00
bancika e8031a6cb4 more flexible leads support 2020-04-18 13:24:36 +02:00
bancika 3ef9586764 "Add Flexible Leads" action added in the context menu that replaces
straight leads of leaded components with flexible leads and adds leds to
some components that do not have them
2020-04-18 10:27:26 +02:00
bancika f0219fce0b add flexible leads to some components through the menu 2020-04-18 10:26:14 +02:00
bancika f41a028236 Standardize how folded transistors are displayed - updated TO-92 and
TO-1 packages
2020-04-18 10:19:33 +02:00
bancika 297c8d58c1 Standardize how folded transistors are displayed - updated TO-92 and
TO-1 packages
2020-04-18 10:18:55 +02:00
bancika 098c0a9baf Added "Rotary Selector Switch" component 2020-04-17 20:22:09 +02:00
bancika bf025ee990 release 4.4.0 2020-04-16 08:40:33 +02:00
bancika cce1fe6c9c Transistor would disappear when "Folded" is selected 2020-04-15 21:36:33 +02:00
bancika 874c9dea83 fix submini tube orientation 2020-04-15 20:35:27 +02:00
bancika e78c6148c7 Added "Sub-Mini" tube 2020-04-15 19:53:10 +02:00
bancika a18a226020 Added optional outer foil marking for all film capacitors 2020-04-15 14:12:24 +02:00
bancika 6a630aa498 increase analyzer dialog size 2020-04-15 13:33:55 +02:00
bancika 553a14c5d2 remove (beta) from analyzers 2020-04-15 13:33:36 +02:00
bancika 853033aa14 removed extra name field 2020-04-15 13:32:33 +02:00
bancika 06da2c565d add unit test for LP switch 2020-04-15 13:32:07 +02:00
bancika 3ae44ca040 "Trace Cut" can now be placed horizontally or vertically when "Cut
Between Lines" is selected
2020-04-15 10:01:15 +02:00
bancika edefb8f7e3 change abel 2020-04-14 15:21:24 +02:00
bancika 60c540be6a protect null 2020-04-14 13:41:33 +02:00
bancika a6cba04fa5 change donate item 2020-04-14 12:41:05 +02:00
bancika b416d4c8d4 enhance search 2020-04-14 10:49:20 +02:00
bancika af2f55905e fix trace cut border 2020-04-14 10:20:58 +02:00
bancika 83d8e8b325 Added "Access User Files" in the Help menu that takes you to logs,
backup and config file location
2020-04-14 10:08:11 +02:00
bancika 73bc4b2776 handle no results 2020-04-13 15:41:08 +02:00
bancika f299106430 revert border color changes 2020-04-13 15:29:01 +02:00
bancika 9963b7b3d3 null check 2020-04-13 15:07:10 +02:00
bancika d720f73887 Added "Find" functionality that locates and selects component(s)
matching the search text
2020-04-13 14:54:59 +02:00
bancika 8d188f0038 change main window title format 2020-04-13 10:36:55 +02:00
bancika 2889d51387 added display pinout 2020-04-12 23:57:07 +02:00
bancika 30c29ab452 Added "Duo-Diode" tube symbol 2020-04-12 19:43:41 +02:00
bancika c390e68e50 change com.apple.macos.useScreenMenuBar 2020-04-12 18:41:53 +02:00
bancika 2a9c433a18 Added "Tag Strip" component for point-to-point layouts
Removed border property from boards
2020-04-12 18:40:08 +02:00
bancika 1ffe70b66a protect splash screen code 2020-04-12 11:09:00 +02:00
bancika 64920a2c07 reorg area calc code 2020-04-11 17:20:06 +02:00
bancika a0611fa727 fix cache for proto board and breadboard 2020-04-11 17:19:16 +02:00
bancika b8e64334bb fix Highlight Connected Areas 2020-04-11 11:30:33 +02:00
bancika af7e11d3c6 Merge branch 'master' of git://github.com/bancika/diy-layout-creator.git 2020-04-10 16:22:42 +02:00
bancika 6a07e916ed fix update.xml 2020-04-10 16:16:42 +02:00
Bane Stojkovic 4bd462589d Update README.md 2020-04-10 11:21:36 +02:00
bancika b1929e538b Prevent the app from closing while running background operations, like
saving and exporting files
2020-04-10 10:53:25 +02:00
bancika c2007f62b1 add unit tests 2020-04-09 23:45:16 +02:00
bancika 6c3185c3ad Prevent the app from closing when a running task is detected
removed extra line
2020-04-09 23:44:58 +02:00
bancika fe687a99df libs 2020-04-09 21:14:40 +02:00
bancika e067440a49 fix the export 2020-04-09 21:14:35 +02:00
bancika 4d075037c7 change update url to http://diy-fever.com/diylc/api/v1/update.xml 2020-04-09 18:23:17 +02:00
bancika 47eb02fc5d libs 2020-04-09 18:14:45 +02:00
bancika 4b2ee03f09 fixed rel date 2020-04-09 18:14:39 +02:00
Bane Stojkovic f4efe3b924 Merge pull request #516 from bancika/caching
Caching
2020-04-09 17:59:11 +02:00
bancika f103f2970b With multiple components selected, if one of them is a single-point
component (pad, eyelet, etc), starting a drag operation on that
components results in losing the selection on the others
2020-04-09 16:59:34 +02:00
bancika 56f637b5e2 Faster auto-scroll while dragging a component outside the visible
portion of the canvas
2020-04-09 12:10:39 +02:00
bancika ae1aa7bde6 introduce another clip rect for the cache 2020-04-09 10:52:08 +02:00
bancika 9676a21b76 Improved performance math calculations used to model "Twisted Wires" 2020-04-08 15:53:33 +02:00
bancika fd8640ba3d give the cache a chance to prepare all the components in multiple
threads
2020-04-08 13:32:46 +02:00
bancika ae7f2625ed Older files that contain "Open Jack 1/4" components sometimes open with
the jacks rotated the wrong way
2020-04-08 11:41:02 +02:00
bancika a665bfcf42 add caching to guitar pickups 2020-04-08 11:34:32 +02:00
bancika dd06c5b7df add caching support to more component types 2020-04-08 10:48:18 +02:00
bancika 6db4423bbf undo test change 2020-04-06 22:32:36 +02:00
bancika 7559aea5aa Merge branch 'master' into caching
Conflicts:
	diylc/diylc-swing/library/main.jar
2020-04-06 22:26:32 +02:00
bancika d15f4a0a90 optimize shape tracking 2020-04-06 22:26:05 +02:00
bancika dcfebda6fd libs 2020-04-06 21:47:19 +02:00
bancika e29bdf5f62 generalize caching 2020-04-06 21:47:07 +02:00
bancika 7b3326a5cd move caching config 2020-04-06 12:04:27 +02:00
bancika 9e0caafee7 sort render stats by total time 2020-04-06 11:59:35 +02:00
bancika 4cf840b32a log render time stats periodically 2020-04-06 11:40:18 +02:00
bancika 3933c4c1b3 add config for caching 2020-04-06 11:13:15 +02:00
bancika 3222a1afa4 jars 2020-04-06 11:05:39 +02:00
bancika 652bb4514d caching changes 2020-04-06 11:05:31 +02:00
bancika 861fa87232 Merge branch 'master' into caching
Conflicts:
	diylc/diylc-library/lib/diylc-core.jar
	diylc/diylc-swing/lib/diylc-core.jar
	diylc/diylc-swing/library/main.jar
2020-04-05 18:31:23 +02:00
bancika fa63a11848 release 2020-04-05 16:28:50 +02:00
bancika ebe548aa3f 4.2.0 release 2020-04-05 16:25:24 +02:00
bancika 8fd38c968a caching, initial push 2020-04-05 16:20:58 +02:00
bancika c1b41121de repaint when turning Highlight feature on and off 2020-04-05 10:11:01 +02:00
bancika 30f9b2a643 Improved performance of "Highlight Connected Areas" feature, especially
with bigger projects
2020-04-05 00:50:27 +02:00
bancika da3290b405 Added TO-126 transistor package 2020-04-04 21:03:39 +02:00
bancika 0e95d4883a Added "Duodecar B12C" tube socket type 2020-04-04 18:52:10 +02:00
bancika 571391f27c clear warning 2020-04-04 18:16:49 +02:00
bancika 42305cd629 minor change 2020-04-04 18:08:38 +02:00
bancika d870acec6d changed donate to html 2020-04-04 17:11:03 +02:00
bancika 4d5f70a81b added donate link at the top 2020-04-04 17:06:04 +02:00
bancika 52d71e2404 Exposed the most commonly used configuration items in the top-right
toolbar for faster access
2020-04-04 16:48:58 +02:00
bancika 8cbdae162e Fix the issue with tube symbol mirroring 2020-04-04 13:33:08 +02:00
bancika 99212d2b9c Fix the issue tube socket pins that can be dragged independently from
the socket
2020-04-04 13:22:36 +02:00
bancika bfc6721974 add default building blocks functionality 2020-04-04 11:58:03 +02:00
bancika d9ca1346f0 Fix the issue with theme configuration that causes some components to
fail to render
2020-04-03 23:27:08 +02:00
bancika 720acb75a8 Added "Ruler Inch Subdivision" config option that allows inch rulers to
be subdivided either using base of 2 (1/4", 1/8, 1/16) or base of 10
(1/10)
2020-04-03 14:18:30 +02:00
bancika 416b8503de fix release date 2020-04-03 14:02:13 +02:00
bancika 928470d48b buildFX added, not functional yet 2020-04-03 11:10:11 +02:00
bancika e3781bb094 4.1.0 release build 2020-04-03 11:10:00 +02:00
bancika 9e315fb5ac Merge branch 'master' of git://github.com/bancika/diy-layout-creator.git 2020-04-02 23:19:33 +02:00
bancika f3fc5eff29 omit legaci field when saving 2020-04-02 23:18:56 +02:00
bancika da7ddf845b Cannot edit "Hookup Wire" properties when opening existing files 2020-04-02 21:18:36 +02:00
bancika 6db50fd7c6 proto board updates 2020-04-02 21:17:04 +02:00
Bane Stojkovic bb88fe1e97 Update README.md 2020-04-02 16:12:30 +02:00
Bane Stojkovic 3577e4c595 Update README.md 2020-04-02 16:10:37 +02:00
bancika 16887f2a3a fix Ohm rendering issue 2020-04-02 15:07:51 +02:00
bancika 52c9f00f3c added shrouded option and color editing for pin header 2020-04-02 00:22:29 +02:00
bancika aa70df6d9b Added "Pin Header" component 2020-04-01 20:53:46 +02:00
bancika 015f5d2f02 remove the usage of Integer(int) constructors because it's deprecated 2020-04-01 11:48:48 +02:00
bancika 8f43377a5c delete extra files from snap folder 2020-04-01 00:44:13 +02:00
bancika 41a7b750da add diylc.sh 2020-04-01 00:43:53 +02:00
bancika 9f528b3218 Merge branch 'master' of git://github.com/bancika/diy-layout-creator.git 2020-04-01 00:32:16 +02:00
bancika 8eb20b610d add diylc.desktop 2020-04-01 00:32:07 +02:00
Bane Stojkovic c7d799f178 Update snapcraft.yaml 2020-04-01 00:25:35 +02:00
Bane Stojkovic 1409b344a8 Update snapcraft.yaml 2020-04-01 00:21:13 +02:00
bancika 1f08fd4562 add license info and comment 2020-03-31 16:29:43 +02:00
bancika 4414ecf774 remove dependency to sun.awt.image.IntegerComponentRaster 2020-03-31 15:43:49 +02:00
bancika d84ceaac8f Add includeantruntime="false" to javac tasks to avoid compiler warnings 2020-03-31 13:06:05 +02:00
bancika dc2172e98f add laser pointer icon for later use 2020-03-31 12:59:54 +02:00
bancika d62ce646ed remove dependency from ToolkitImage in Image comonentent 2020-03-31 12:59:38 +02:00
bancika 276ad57521 remove dependency to ParameterizedTypeImpl class 2020-03-31 12:40:04 +02:00
bancika a385d467a4 Moved "Tape Measure" to "Misc" category 2020-03-31 10:57:24 +02:00
bancika a301109047 Added ability to delete default component variants 2020-03-31 10:50:03 +02:00
bancika a4e448af31 improve "expand selection" logic 2020-03-31 09:43:12 +02:00
bancika 09e96a03a3 Better "Expand Selection" logic. Works well with conductive components
like traces and wires and regular components like resistors and
capacitors
2020-03-31 00:58:42 +02:00
bancika f88f9ef25c proto board icon 2020-03-30 19:53:07 +02:00
bancika 1768dbabfc added proto board 2020-03-30 13:56:52 +02:00
bancika a37b1e49e3 Add ability to merge disjoint continuity areas 2020-03-30 13:56:42 +02:00
bancika 21fa33c74a add IzPack builder 2020-03-30 10:49:35 +02:00
bancika 8abfabf1f4 tentative fix 2020-03-30 10:47:32 +02:00
bancika 6416f69305 attempt to fix the deadlock on openjdk while setting up screen size 2020-03-30 10:24:31 +02:00
bancika 7d46f49788 Humbucker doesn't render second coil poles properly in certain scenarios 2020-03-27 20:02:39 +01:00
bancika 5809c721d7 Added "Dot Spacing" property in project settings that shows dots on
every N-th grid line intersection
2020-03-27 18:49:30 +01:00
bancika f11bb639b9 Issues with circuit analysis introduced in version 4.0.1. Wires and
jumpers are made non-conductive by mistake.
2020-03-27 17:30:55 +01:00
bancika fd079f44be 4P5T and DP5T guitar switches were not properly configured for internal
pin connections
2020-03-27 17:18:27 +01:00
bancika 55ab31f8e2 invalidate continuity area on move/edit 2020-03-27 11:35:31 +01:00
bancika 32eb3a366a When deleting trace cuts from a vero board, highlight connected areas
would still render the area from before the cut was deleted
2020-03-27 10:20:58 +01:00
bancika 0f0739c978 Issues with connectivity check with some components (e.g. Jumper) where
the middle of the component was considered as a connected point
2020-03-27 10:08:22 +01:00
Bane Stojkovic 47072a3b3e Merge pull request #499 from bancika/diylc4_x
DIYLC 4.0.1 big merge
2020-03-26 18:50:28 +01:00
bancika 382a304793 release 4.0.1 2020-03-26 18:38:01 +01:00
bancika 9838fc924c fix update.xml 2020-03-26 18:22:58 +01:00
bancika 8364d05a94 Added ability to set board size explicitly by typing in dimensions,
instead of dragging two control points
2020-03-26 18:02:16 +01:00
bancika a500ccb165 Added orientation parameter to "Ground Simbol" to allow rotation 2020-03-26 11:36:19 +01:00
bancika 8a6d98e496 fix the scale factor of meter unit 2020-03-26 01:18:31 +01:00
bancika d27530d7e6 update settings 2020-03-26 01:12:23 +01:00
bancika 759df0ac8f Added read-only "Length" property to curved components (i.e. "Hookup
Wire") that calculates total length of the curve
2020-03-26 01:12:00 +01:00
bancika 88d4d021ff add to update.xml 2020-03-26 00:36:51 +01:00
bancika 99743d12ea fix the issue with movable label appearing at (0,0) 2020-03-26 00:34:04 +01:00
bancika 275009b315 netlist - skip control points that are not representing nodes 2020-03-26 00:32:14 +01:00
bancika ec0d2a686c Added "Renumber On Paste" option in the "Config" menu 2020-03-25 20:55:06 +01:00
bancika e429f65ed2 Threads on 1/4" Closed Jack were not rendered at all 2020-03-25 20:06:51 +01:00
bancika 7c87ab075d filter out properties returning Object type, these appeared in Java 8 2020-03-25 17:21:33 +01:00
bancika 7e6f4e5727 fix update.xml file
add protection in Presenter
2020-03-25 16:34:24 +01:00
bancika 804ac2a82a Added ability to collapse and expand the component tree panel to the
left edge of the screen
2020-03-25 16:31:43 +01:00
bancika 4718ba6592 update file icons
scroll the main pane to center after starting
2020-03-25 00:16:19 +01:00
bancika 77a6f4d3b4 new file icon for windows added 2020-03-24 19:09:31 +01:00
bancika b27b89b900 new icon 2020-03-24 16:11:13 +01:00
bancika 4821d6f370 new icon 2020-03-24 16:10:51 +01:00
bancika 6d04ac8e3d new smaller format icons 2020-03-24 12:13:59 +01:00
bancika 88ec95d4fa added icon for snap
renamed snap to objects
2020-03-23 23:25:18 +01:00
bancika a6b7debfd7 Added "Snap To Objects" feature that snaps control points to control
points of the nearest components
2020-03-23 23:04:02 +01:00
bancika 257c7bc3bf "Auto-Create Pads" doesn't work for ICs and similar non-stretchable
components
2020-03-23 19:41:24 +01:00
Bane Stojkovic ba7b85a7a6 Delete ant.yml 2020-03-23 17:22:20 +01:00
Bane Stojkovic 3b32182961 Create ant.yml 2020-03-23 17:15:37 +01:00
bancika 25c86ad4e9 yet another icon 2020-03-23 16:56:16 +01:00
bancika 5b0fc2f232 yet another icon 2020-03-23 13:18:29 +01:00
bancika c12623c523 yet another icon version 2020-03-23 12:29:42 +01:00
bancika fd6039a2fe New Mac OS app icon 2020-03-23 10:34:31 +01:00
bancika edce9835d0 minor change 2020-03-23 00:01:02 +01:00
bancika 015677c567 Added "Tape Measure" component 2020-03-23 00:00:29 +01:00
bancika 4da2539324 Hide the 3rd control point for components that do not need it (Trace,
Jumper, Line)
2020-03-22 19:40:31 +01:00
bancika 12f58e60f9 Start the window maximized to help with issues on OSX 2020-03-22 12:29:26 +01:00
bancika 8f0c0adcb4 Add null protection for announcements 2020-03-22 12:14:01 +01:00
bancika bff1b670d5 rework splash screen 2020-03-22 12:13:43 +01:00
bancika e93a82f9fd reorganize resource files 2020-03-22 00:38:19 +01:00
bancika bc7df76c3e deleted extra files, added version info 2020-03-22 00:09:41 +01:00
bancika 7477c606f4 mac build fixes
move update and variants file to core project and integrate into Jar
2020-03-21 23:58:43 +01:00
bancika 85a37a2fd7 build update 2020-03-21 20:22:27 +03:00
bancika 9106d3f63a mac build 2020-03-21 20:17:42 +03:00
bancika 339f4a44ef new icon 2020-03-21 18:15:04 +01:00
bancika 769dc8e543 update mac build 2020-03-21 17:40:06 +01:00
bancika 5f8e5e5ed2 add icon for mac 2020-03-21 12:12:52 +01:00
admin 71f5bcd1f7 java 8 and mac build 2020-03-21 12:18:55 +03:00
Branislav Stojkovic bb3b37f23b patched osx component loading issue, investigate further 2019-03-25 08:21:20 +01:00
Branislav Stojkovic fcea5975a8 change backup folder name 2019-03-24 21:38:27 +01:00
Branislav Stojkovic 2294ac45a2 copy loaded file as-is to backup folder 2019-03-24 21:37:37 +01:00
Branislav Stojkovic 5598f22b2f Added "Auto-Wrap Label" component
extracted string rendering function into a separate class
2019-03-24 08:34:28 +01:00
Branislav Stojkovic 812b7adb28 remove newPoints and reuse points for backward compatibility 2019-03-23 22:44:09 +01:00
Branislav Stojkovic 9fd5a8fe96 redo relaxed validation 2019-03-23 19:11:06 +01:00
Branislav Stojkovic 0b8952e354 relax validation of control point collision while dragging 2019-03-23 18:54:44 +01:00
Branislav Stojkovic 5c47ff1ef0 added ability to include or exclude switches from netlist analyzer 2019-03-23 18:05:28 +01:00
Branislav Stojkovic b85b93404b Added mini toolbar in the top-right corner of the screen with transform
actions exposed for quick access
2019-03-22 23:37:59 +01:00
Branislav Stojkovic b46f46aa99 When pasting a group of components that contain at least one "PCB Text"
instance, some of the other components get rendered mirrored while
position the pasted components
2019-03-22 22:29:05 +01:00
Branislav Stojkovic 48266d3b27 fix the 3rd control point when copy-pasting 2019-03-22 21:04:54 +01:00
Branislav Stojkovic eb6cc76f02 make autosave params configurable 2019-03-22 20:58:27 +01:00
Branislav Stojkovic a5d512ca37 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-03-22 16:39:23 +01:00
Branislav Stojkovic 1d038b5f8c better log 2019-03-22 16:39:08 +01:00
Branislav Stojkovic 9366f9c602 Auto-save plugin now works by periodically creating project backups in
user\.diylc\autoSave directory and maintains file history, keeping the
last X versions of the file. Maximum size for all backups is
configurable and pre-set to 64MB
2019-03-22 16:38:01 +01:00
bancika 23b4fcae02 Update README.md 2019-03-22 10:34:55 +01:00
Branislav Stojkovic 14a994e68f Improve "Expand Selection" feature to use the same algorithm as netlists
for better precision<
2019-03-22 00:47:28 +01:00
Branislav Stojkovic 894ff1a2cb Assign new name for pasted component if the project already contains
components under that name
2019-03-20 22:35:28 +01:00
Branislav Stojkovic 78dcd27e1d Some schematic symbols (transistors, potentiometer...) get into bad
state when rotated and flipped at the same time
2019-03-20 20:06:38 +01:00
Branislav Stojkovic 714db98afa deleted old file
fixed pin rendering on some components
2019-03-20 19:27:46 +01:00
Branislav Stojkovic 2faa2c6d61 reorganized "stretchable" property into more granular control at the
point level

added controlable label to pot symbol and transistor symbols
2019-03-20 19:21:31 +01:00
Branislav Stojkovic 3c45336afe rename a function 2019-03-19 21:26:03 +01:00
Branislav Stojkovic a0601cc83d better default label position on schematic symbols 2019-03-19 19:03:21 +01:00
Branislav Stojkovic 9925d58347 keep label oriantation the same between the two modes 2019-03-18 22:57:30 +01:00
Branislav Stojkovic 6c241b3180 added third control point to leaded components to set label position 2019-03-18 22:49:27 +01:00
Branislav Stojkovic 838adc9a51 reorganize netlist code, comment out unused functions 2019-03-14 22:36:43 +01:00
Branislav Stojkovic 41d2b73cca Merge switch configurations that yield with the same effective wiring
for "Analyze Guitar Wirings" module, for more compact report
2019-03-14 22:26:49 +01:00
Branislav Stojkovic 8d3789a0b0 update file 2019-03-14 11:19:15 +01:00
Branislav Stojkovic 95f65dcdf1 scan library folder for more jars 2019-03-14 11:14:32 +01:00
Branislav Stojkovic 3d0f9554b0 Honor all possible combinations of "DIP Switch" positions when creating
a netlist
2019-03-14 10:32:51 +01:00
Branislav Stojkovic 0c21e013b4 improve node display for single point componenets 2019-03-14 10:03:04 +01:00
Branislav Stojkovic f8e24b0937 Improve performance of netlist calculations 2019-03-14 00:08:39 +01:00
Branislav Stojkovic 37d5ce18fc Z-order of components sometimes gets wrong when importing a DIY file
into another file
2019-03-13 21:24:55 +01:00
Branislav Stojkovic e9a2785344 Honor "Terminal Strip" connectivity when creating a netlist 2019-03-13 20:54:24 +01:00
Branislav Stojkovic 4de3b6d97c Output SPICE node names in the "Nxxx" format
join all nodes connected to GND together
2019-03-13 19:23:35 +01:00
Branislav Stojkovic 92a2bb9809 fix "Ground Symbol" jumping 2019-03-10 22:58:36 +01:00
Branislav Stojkovic 440b953531 fix orientation parsing 2019-03-10 22:53:01 +01:00
Branislav Stojkovic 1bc11e09ab release 2019-03-10 22:36:09 +01:00
Branislav Stojkovic f20b896184 release 2019-03-10 22:32:34 +01:00
Branislav Stojkovic 49d93b42a4 update.xml 2019-03-10 17:51:21 +01:00
Branislav Stojkovic b279510e5c Detect when a file is created with a newer version of DIYLC and show a
warning

Force correct prefix for transistors in spice
2019-03-10 09:03:22 +01:00
Branislav Stojkovic a83cda9ecd custom XStream converters for more compact files 2019-03-09 21:45:34 +01:00
Branislav Stojkovic f63b422a8c Cleaner XML format for .DIY files with less cross-references
pinout update
2019-03-09 20:15:36 +01:00
Branislav Stojkovic 7af919b303 move section handling to base component interface
do analysis in background thread
2019-03-09 18:01:42 +01:00
Branislav Stojkovic 1c1ec2fcf5 refactor transistor packages with a base class, add pinouts 2019-03-09 17:24:34 +01:00
Branislav Stojkovic 8ccdd84a6f add support to map DIYLC pin indices to spice 2019-03-09 16:47:18 +01:00
Branislav Stojkovic 54ff518438 basic implementation of spice exporter 2019-03-09 14:46:00 +01:00
Branislav Stojkovic c893b37fdf don't show favorites for categories 2019-03-09 11:27:15 +01:00
Branislav Stojkovic 81e259bb62 fix the sorting for favorites 2019-03-09 11:24:44 +01:00
Branislav Stojkovic d5aac6b265 When in "Highlight Connected Area" mode, the status bar shows useful
information making it harder to forget what the mode does
2019-03-09 11:19:32 +01:00
Branislav Stojkovic d544797047 Ability to tag components and building blocks as favorites 2019-03-09 10:42:39 +01:00
Branislav Stojkovic 8ed2c0c9a5 "Mini Toggle Switch" doesn't reset body size after changing terminal
spacing
2019-03-08 18:36:37 +01:00
Branislav Stojkovic 2d1cf515d6 "Highlight Connected Areas" doesn't follow multiple chained wires and
jumpers
2019-03-06 00:15:53 +01:00
Branislav Stojkovic 2553ffbba7 z-order of building blocks 2019-03-04 10:34:53 +01:00
Branislav Stojkovic 04418f8101 fix update file 2019-03-02 21:02:24 +01:00
Branislav Stojkovic c548a35939 3.55 release 2019-03-02 20:59:38 +01:00
Branislav Stojkovic 777f4aa3fd protect PropertyWrapper writeTo call 2019-03-02 15:55:24 +01:00
Branislav Stojkovic c0c226c580 improve tree analysis 2019-03-02 12:48:10 +01:00
Branislav Stojkovic 40d234d1c4 <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
					<description>Increase the range of zoom slider for images to
500%</description>
				</org.diylc.appframework.update.Change>
2019-03-02 12:32:42 +01:00
Branislav Stojkovic bc0d759d39 detect volume and tone pots 2019-03-02 12:31:02 +01:00
Branislav Stojkovic b3497cdca8 Fix lever switch rotation issue
Render pickup name instead of model

Netlist algorithm would sometimes create overlapping groups of nodes
which are supposed to be merged
2019-03-02 09:11:00 +01:00
Branislav Stojkovic cc0f698c8b detect humbucking or split mode 2019-03-01 20:49:07 +01:00
Branislav Stojkovic b0123db3e7 Fixed bug with "Highlight Continuity Areas" that makes random components
conductive
2019-03-01 09:51:55 +01:00
Branislav Stojkovic c9a32cc390 better handling for cold start without logs folder 2019-02-28 23:40:29 +01:00
Branislav Stojkovic 46d9e1f82a improve pickup label rendering 2019-02-28 23:34:02 +01:00
Branislav Stojkovic 9596d6ca8e "Analyze Guitar Wiring" can figure out if wiring is hum-cancelling and
in or out of phase for each position
2019-02-28 22:26:12 +01:00
Branislav Stojkovic 65315ed559 fix connectivity 2019-02-28 21:26:41 +01:00
Branislav Stojkovic 57bce6b8e5 Added 4-position Tele switch type to the "Lever Switch" component 2019-02-28 21:25:21 +01:00
Branislav Stojkovic 403d0ea433 Added two or four terminal hookup to bass pickups types 2019-02-28 19:11:02 +01:00
Branislav Stojkovic 595cfb3ed1 Increase the range of zoom slider for images to 500% 2019-02-28 17:36:04 +01:00
Branislav Stojkovic 2c689c584d Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-02-27 19:23:09 +01:00
Branislav Stojkovic 84eaa1bf29 reuse awg calcs 2019-02-27 19:20:37 +01:00
Branislav Stojkovic 20e01762b8 Show wire diameter in mm and in next to AWG gauge 2019-02-27 19:16:44 +01:00
Branislav Stojkovic 08aec6fa9b startup fix 2019-02-26 23:27:32 +01:00
bancika f51d19b39a Update README.md 2019-02-26 16:47:41 +01:00
Branislav Stojkovic 8bfb3ade55 fix array comparison for byte[] 2019-02-26 16:20:40 +01:00
bancika 3847813351 Update README.md 2019-02-26 15:38:31 +01:00
Branislav Stojkovic 67761b1027 error handling for analyzer 2019-02-26 10:25:20 +01:00
Branislav Stojkovic 7cca8f86b2 build 3.54 2019-02-26 10:10:42 +01:00
Branislav Stojkovic 39976ec3d6 tests 2019-02-25 15:28:10 +01:00
Branislav Stojkovic a155aef596 fix bom test 2019-02-25 11:10:36 +01:00
Branislav Stojkovic b24bfafb39 add unit tests for netlist 2019-02-25 11:05:15 +01:00
Branislav Stojkovic 31ce46f147 minor image update 2019-02-24 14:49:35 +01:00
Branislav Stojkovic ce43a5d2e6 Improve performance of "Image" component and greatly reduce file size
when images are present
2019-02-24 14:32:30 +01:00
Branislav Stojkovic 0d007e5737 tree construction improvement 2019-02-24 13:15:30 +01:00
Branislav Stojkovic c0dac1a1db generate connectivity tree 2019-02-23 17:40:15 +01:00
Branislav Stojkovic ec7244042d wiring analysis improvements 2019-02-17 09:31:42 +01:00
Branislav Stojkovic 88275e95e2 wiring analysys, ground work 2019-02-17 01:37:37 +01:00
Branislav Stojkovic add8566d4f netlist summarizer infrastructure added 2019-02-17 00:13:22 +01:00
Branislav Stojkovic c5495ad14f Version 3.53 would not start unless there was an older version running
on the same machine before
2019-02-16 23:04:38 +01:00
Branislav Stojkovic 94f1c68c7b pickup improvements 2019-02-16 22:14:08 +01:00
Branislav Stojkovic 3e67515f69 improved netlist display
minor component updates
2019-02-16 20:12:44 +01:00
Branislav Stojkovic 2091b8a03d add terminal labels to pickups 2019-02-16 18:41:22 +01:00
Branislav Stojkovic 235acf538f Added ability to mark common lugs on all "Lever Switch" types with a
different color

add switch logic to lever switch
2019-02-16 17:04:09 +01:00
Branislav Stojkovic 45404aaabd add center-off switch types 2019-02-16 16:05:15 +01:00
Branislav Stojkovic 2727276a09 minor rendering improvement for LP switch 2019-02-16 12:27:11 +01:00
Branislav Stojkovic cb6aa83269 better netlist html format 2019-02-16 12:15:52 +01:00
Branislav Stojkovic 39daa9e61f LP switch updates 2019-02-16 12:12:08 +01:00
Branislav Stojkovic 8313a62324 added netlist menu item and dialog 2019-02-16 12:11:54 +01:00
Branislav Stojkovic c1d718a0f9 add netlist support to LP switch 2019-02-16 11:46:47 +01:00
Branislav Stojkovic 6e5174750f rename graph-related stuff into netlists 2019-02-16 09:40:55 +01:00
Branislav Stojkovic 1cfb30f35e pickup graph improvements 2019-02-16 09:14:49 +01:00
Branislav Stojkovic ddfc615a6a graph improvmeents 2019-02-15 23:39:54 +01:00
Branislav Stojkovic f53ad8c206 Allow a file to be loaded if it references a missing component property,
but show a warning.
2019-02-15 23:23:12 +01:00
Branislav Stojkovic 20645fed13 fix switched jack point location
proper node names
2019-02-15 22:52:36 +01:00
Branislav Stojkovic d3c2e20359 new app-framework 2019-02-15 21:48:26 +01:00
Branislav Stojkovic 46f693addf ground work for graph analysis 2019-02-15 20:25:57 +01:00
Branislav Stojkovic 008ee8564b another build 2019-02-09 19:19:11 +01:00
Branislav Stojkovic b234015a32 build 2019-02-09 19:06:56 +01:00
Branislav Stojkovic bb69d8dd04 upgrade variants to new format on start
fix for variant export
2019-02-09 18:55:34 +01:00
Branislav Stojkovic b02eaf928d sort blocks and variants alphabetically 2019-02-09 17:53:38 +01:00
Branislav Stojkovic 2c4ff547fe spell 2019-02-09 17:45:56 +01:00
Branislav Stojkovic ca78cd030b add check list dialogs when exporting blocks and variants 2019-02-09 17:44:15 +01:00
Tim Savage 51a12d61e1 Allow the origin of co-ordinates on boards to be specified (#428)
* Added support to specific co-ordinate origin.

Added the Coordinate origin property to the AbstractBoard class,
this allows the user to specify the corner (TopLeft, TopRight,
BottomLeft, BottomRight) cordinates should increment from.

Updated rendering to reflect this change.

* Use the coordinate origin setter method

To safely handle the case when a project produced with an earlier
verison of the application is loaded and the coordinate origin attribute
is set to NULL.
2019-02-09 15:53:11 +01:00
Branislav Stojkovic 661e5e2403 jack variants 2019-02-09 12:48:37 +01:00
Branislav Stojkovic ae8d015a78 ground work for air-core inductors 2019-02-09 12:46:11 +01:00
Branislav Stojkovic 59096d69ed Do not allow zero for size and spacing properties that could lead to
crashes or unexpected behavior
2019-02-09 10:20:11 +01:00
Branislav Stojkovic 66e1227182 fix eyelet and turret not setting their own stroke 2019-02-09 10:09:48 +01:00
Branislav Stojkovic 19bdf41655 fix shortcuts 2019-02-09 10:02:32 +01:00
Branislav Stojkovic 0acca63ccd prettier variant and block display 2019-02-09 09:47:13 +01:00
Branislav Stojkovic 6d2e876381 Better rendering of TO-3 transformer package 2019-02-08 23:42:09 +01:00
Branislav Stojkovic 13f13191c4 Add switched type to "Open 1/4" Jack" component 2019-02-08 23:01:00 +01:00
Branislav Stojkovic 86500cb4a0 import/export variants and building blocks 2019-02-08 22:44:26 +01:00
Branislav Stojkovic f7e5421f18 flip rca pins 2019-02-08 17:25:40 +01:00
Branislav Stojkovic c7bc8360ba RCA Jack" added 2019-02-08 14:40:33 +01:00
Branislav Stojkovic d91527a91c improve coordinates 2019-02-08 11:26:57 +01:00
Branislav Stojkovic 9e760ba655 shade extra space 2019-02-08 11:24:22 +01:00
Branislav Stojkovic 9a2585d23f refine zero location 2019-02-08 11:23:02 +01:00
Branislav Stojkovic 83723dd416 align rulers with extra space 2019-02-08 11:09:24 +01:00
Branislav Stojkovic 7597143b1b "Select All" menu option from the component tree context menu doesn't
work
2019-02-08 10:29:23 +01:00
Branislav Stojkovic 0cb4377830 Show mouse position in the status bar 2019-02-08 09:56:48 +01:00
Branislav Stojkovic fbf2569a7e ground work for graph analysis 2019-02-08 09:21:32 +01:00
Branislav Stojkovic 290406609b ground work for potentiometer views 2019-02-08 09:20:11 +01:00
Branislav Stojkovic 417c389b0a Components do not load if the installation directory name contains a
special character, like '!'
2019-02-07 00:07:58 +01:00
Branislav Stojkovic 1af44eadfc fix zooming 2019-02-06 23:26:33 +01:00
Branislav Stojkovic 364010ae63 new variants for tubes 2019-02-06 00:12:53 +01:00
Branislav Stojkovic 7fb78237fb invoke later to make sure that scrolling to center is done properly 2019-02-05 17:48:16 +01:00
Branislav Stojkovic c120bc10ed Better rendering of guitar pickups when dragging and in outline mode 2019-02-05 17:23:44 +01:00
Branislav Stojkovic 9c81ad0eec show warning message when config file is bad 2019-02-05 16:54:21 +01:00
Branislav Stojkovic bb564248d9 fix selection bounds
increase extra area
2019-02-05 14:54:39 +01:00
Branislav Stojkovic 3deb988a06 allow extra space around the layout
introduced ability to render just the visible part of the layout for
better performance
2019-02-05 12:04:16 +01:00
Branislav Stojkovic ae3e698d9e track shaped components while dragging 2019-02-05 12:01:55 +01:00
Branislav Stojkovic 2735d7e343 optimize tube area tracking 2019-02-05 00:34:56 +01:00
Branislav Stojkovic f4cc0ca360 tube socket extract constants 2019-02-04 18:48:40 +01:00
Branislav Stojkovic 99b7dbb6f3 editable label color for tubes 2019-02-04 15:15:12 +01:00
Branislav Stojkovic e3ca5244fe libs 2019-02-03 19:55:05 +01:00
Branislav Stojkovic a0b78a5e3d better pin rendering 2019-02-03 19:45:29 +01:00
Branislav Stojkovic 81b299865c improve drag&drop 2019-02-03 19:37:38 +01:00
Branislav Stojkovic 3027753225 backup config file on error 2019-02-03 11:47:05 +01:00
Branislav Stojkovic 13997ee757 v3.52 release 2019-02-03 11:33:17 +01:00
Branislav Stojkovic 8c09fe72e6 optimize performance when rendering stripes 2019-02-03 10:40:55 +01:00
Branislav Stojkovic 6e9169242a dnd improvements 2019-02-03 09:58:19 +01:00
Branislav Stojkovic 91389ef09b cancel d&d when dropped back to the tree 2019-02-03 00:54:53 +01:00
Branislav Stojkovic 921b503057 add striped option for twisted pair 2019-02-02 23:24:06 +01:00
Branislav Stojkovic efceedc924 Added confirmation dialog before deleting a building block
Fix the exception on block delete
2019-02-02 21:31:38 +01:00
Branislav Stojkovic cad26211b3 add comments 2019-02-02 21:13:04 +01:00
Branislav Stojkovic 36259bc83b tighter twists 2019-02-02 20:49:04 +01:00
Branislav Stojkovic 024ede48a8 fix path decomposition 2019-02-02 20:46:12 +01:00
Branislav Stojkovic b44c3bad62 twisted leads added 2019-02-02 20:41:25 +01:00
Branislav Stojkovic 0741f4334b add null protection 2019-02-02 12:47:50 +01:00
Branislav Stojkovic 46f20a75ec better status bar text when dragging a component from the tree 2019-02-02 12:44:59 +01:00
Branislav Stojkovic 34ea20eedd Ability to drag components directly from the tree to the canvas for
faster process
2019-02-02 12:18:37 +01:00
Branislav Stojkovic 08a0e451e7 "Fuse Symbol" added 2019-02-01 22:54:47 +01:00
Branislav Stojkovic 53eb70e693 improve precision of exported files 2019-01-31 13:43:18 +01:00
Branislav Stojkovic 1b8a72d24a "PCB Text" components are not included in trace mask exports 2019-01-28 13:00:35 +01:00
Branislav Stojkovic 04840bac7b Update dialog doesn't show up when clicked on the light bulb icon in the
status bar
2019-01-28 11:49:06 +01:00
Branislav Stojkovic 0a97b53f60 3.51 release 2019-01-28 11:40:38 +01:00
Branislav Stojkovic 4d3f2968c1 Lead alignment sometimes gets rendered off by 1px for resistor and
capacitor schematic symbol
2019-01-28 11:32:34 +01:00
Branislav Stojkovic d5f3457c43 Jumper color switches to red on its own 2019-01-28 10:59:34 +01:00
Branislav Stojkovic 0c76b93db0 Reverted Ohm symbol changes that made it render wrong on some systems 2019-01-26 15:40:55 +01:00
Branislav Stojkovic 197f9ca216 Better selection rendering for a few components, mostly
electro-mechanical
2019-01-23 23:20:14 +01:00
Branislav Stojkovic c8af6dbbb2 fix release date 2019-01-23 11:28:59 +01:00
Branislav Stojkovic 0a444f5ee7 3.50 release 2019-01-23 10:57:23 +01:00
Branislav Stojkovic f0172f9adc 3.50 release 2019-01-23 10:56:59 +01:00
Branislav Stojkovic 5c9754baf4 Do not render various jack components as completely transparent while
dragging
2019-01-23 10:53:00 +01:00
Branislav Stojkovic ef5bde9091 Since 3.49, some capacitor variants have disappeared. The fix brings
them back
2019-01-23 10:51:51 +01:00
Branislav Stojkovic a4efb57452 added pilot lamp holder 2019-01-21 10:29:47 +01:00
Branislav Stojkovic 58aa0ab5be track board area while dragging 2019-01-20 10:47:27 +01:00
Branislav Stojkovic 32b2713732 board coordinate improvements 2019-01-20 10:30:19 +01:00
Branislav Stojkovic cb21392d1e more accurate pin spacing calc for radial components 2019-01-19 10:02:48 +01:00
Branislav Stojkovic 149cdbca48 added radial and toroidal inductor 2019-01-19 00:58:51 +01:00
Branislav Stojkovic 73e4d6fc93 log version at start 2019-01-19 00:53:20 +01:00
Branislav Stojkovic 08bc4f5170 apply hw acceleration preferences on start 2019-01-18 23:38:33 +01:00
Branislav Stojkovic 813baee504 fix: straight traces are rendered 1px thinner than curved traces of the
same thickness
2019-01-18 20:49:51 +01:00
Branislav Stojkovic 74e524e98c fix version loader 2019-01-18 12:55:34 +01:00
Branislav Stojkovic a8f5155acd better board coordinate placement 2019-01-18 11:00:54 +01:00
Branislav Stojkovic dd06195035 fix recent versions 2019-01-18 10:26:10 +01:00
Branislav Stojkovic 19ea23895b show recent updates, added to status bar and help menu 2019-01-18 09:58:35 +01:00
Branislav Stojkovic 61444db46d Ability to flip letters and numbers for board coordinates 2019-01-17 23:47:03 +01:00
Branislav Stojkovic 54e991891d transformer icon improvement 2019-01-17 22:24:51 +01:00
Branislav Stojkovic ba735dd350 added audio transformer 2019-01-17 22:21:30 +01:00
Branislav Stojkovic 6b1913fd5b better cursors for scroll 2019-01-17 16:26:33 +01:00
Branislav Stojkovic c6f6aa9186 improve enclosure variants 2019-01-17 15:30:42 +01:00
Branislav Stojkovic ef51c44e54 improve mouse scroll 2019-01-17 14:50:13 +01:00
Branislav Stojkovic 5dc911776c Configurable hw acceleration 2019-01-17 11:08:17 +01:00
Branislav Stojkovic 9757e81500 Chrome-style cursors for mouse scrolling with arrows showing the exact
scrolling direction
2019-01-17 10:45:31 +01:00
Branislav Stojkovic 46f8506c39 Added few pedal enclosure variants 2019-01-17 00:29:43 +01:00
Branislav Stojkovic f1ccfa86c0 Fixed the issue with Ohm symbol rendering with some fonts and changed
default project font back to "Square721 BT"
2019-01-17 00:01:51 +01:00
Branislav Stojkovic 5b2a9c0e43 Better color band rendering on resistors and smarter label positioning 2019-01-16 23:55:52 +01:00
Branislav Stojkovic 81a6cf282b move mouse scroll logic to RulerScrollPane 2019-01-15 23:57:25 +01:00
Branislav Stojkovic 984edc196b Middle mouse click activates mouse movement scroll mode, similar to web
browsers
2019-01-15 23:37:56 +01:00
Branislav Stojkovic e5fff0b538 mini recto update 2019-01-15 23:13:13 +01:00
Branislav Stojkovic 26c3c488e0 br3 improvements 2019-01-15 23:05:03 +01:00
Branislav Stojkovic 62bb6aac05 BR3 rectifier improvement 2019-01-15 22:57:54 +01:00
Branislav Stojkovic 1a1e8ae56f photo diode minor improvement 2019-01-15 22:53:10 +01:00
Branislav Stojkovic 7a8e25ab39 Ability to flip polarity of IC symbol 2019-01-15 22:43:20 +01:00
Branislav Stojkovic 7b47a747bf added BR-3 rectifier 2019-01-15 19:24:15 +01:00
Branislav Stojkovic c4b66f5995 added bridge rectifier 2019-01-15 00:55:07 +01:00
Branislav Stojkovic 97cc9ca6c8 sil ic alpha rendering 2019-01-14 21:18:17 +01:00
Branislav Stojkovic 252b9ef560 remove fuse param for IEC 2019-01-14 21:16:22 +01:00
Branislav Stojkovic 77d038cef9 Use transparency instead of rendering pins on top of transistor body 2019-01-14 21:11:12 +01:00
Branislav Stojkovic 6ce5d305f1 consolidate component names 2019-01-14 21:03:53 +01:00
Branislav Stojkovic 2d0eb136fe "Fuse Holder" added 2019-01-14 13:40:34 +01:00
Branislav Stojkovic 4c03d9f658 new fonts
cleaner lead rendering
3D shading for leaded components
2019-01-14 00:25:20 +01:00
Branislav Stojkovic c5c4d6c04e hardware acceleration enabled for canvas and ruler 2019-01-14 00:12:13 +01:00
Branislav Stojkovic c7f468a0bc Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-01-13 21:38:50 +01:00
Branislav Stojkovic 41b670616c Changed default project font again to "Lucida Console" because
"Square721 BT" doesn't render Ohm symbol properly
2019-01-13 21:38:42 +01:00
bancika f62de41a95 Merge pull request #400 from cjwatson/patch-1
Fix snapcraft.yaml indentation
2019-01-13 19:32:24 +01:00
Colin Watson e6bdedfaea Fix snapcraft.yaml indentation
The previous version of the file didn't parse as valid YAML.
2019-01-13 18:28:21 +00:00
Branislav Stojkovic e2e33a1b13 fix update file 2019-01-13 18:26:05 +01:00
Branislav Stojkovic 2266dadcba Added optional arrow to the "Line" component together with configurable
thickness
2019-01-13 18:24:04 +01:00
Branislav Stojkovic 149f05f20c spell fix 2019-01-13 12:04:26 +01:00
Branislav Stojkovic 539b3c68de 3.48 release 2019-01-13 12:01:36 +01:00
Branislav Stojkovic 185eb9d1d3 added IEC socket 2019-01-13 11:59:20 +01:00
Branislav Stojkovic 9525505865 dip updated 2019-01-12 13:33:45 +01:00
Branislav Stojkovic a91e8dd062 "DIP Switch" added 2019-01-12 13:31:28 +01:00
Branislav Stojkovic 5ce3d6d4b3 consolidate case for property labels 2019-01-12 10:46:50 +01:00
Branislav Stojkovic facf816458 Do not allow negative values for properties indicating a size 2019-01-12 10:21:55 +01:00
Branislav Stojkovic afadc5e171 "Logic Gate (symbol)" added with 8 main gate types 2019-01-11 23:45:00 +01:00
Branislav Stojkovic a91eb15837 separate splash into a separate class 2019-01-11 20:39:12 +01:00
Branislav Stojkovic cd74e417a9 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-01-11 20:11:22 +01:00
Branislav Stojkovic 7ca6eb0e2f Some actions do not register with Undo/Redo mechanism: project font,
layer settings, group/ungroup.
2019-01-11 20:10:25 +01:00
bancika 78600f1c24 Update snapcraft.yaml 2019-01-11 15:38:33 +01:00
bancika 7aa6f31e67 Update snapcraft.yaml 2019-01-11 15:37:58 +01:00
bancika e91dc72424 Create diylc.desktop 2019-01-11 15:36:32 +01:00
bancika f9e2c1f1fa Create diylc.sh 2019-01-11 15:35:44 +01:00
bancika bc49daf1be Update snapcraft.yaml 2019-01-11 15:35:11 +01:00
bancika dc07d2732b Update snapcraft.yaml 2019-01-11 15:33:07 +01:00
Branislav Stojkovic 2f76bb8446 Filtertron pickup type added within "Humbucker Pickup" as well as screw
pole pieces for all humbucker types

renamed Schematic category
2019-01-11 00:48:58 +01:00
Branislav Stojkovic cc286f9c41 default ctor 2019-01-10 23:31:26 +01:00
Branislav Stojkovic 42ca1926e1 fix 3-legged symbols 2019-01-10 19:53:34 +01:00
Branislav Stojkovic 007a52f0b5 When loaded from an existing file "Potentiometer Symbol" doesn't retain
the specified orientation
2019-01-10 19:47:22 +01:00
Branislav Stojkovic 7caadec1ec Added "Label Orientation" property to leaded components that can be used
to force labels to be rendered horizontally instead of following
component placement direction
2019-01-10 18:44:23 +01:00
Branislav Stojkovic 0f3f2a350b tantalum cap improvements 2019-01-10 18:22:14 +01:00
Branislav Stojkovic bfe044f3f6 add tantalum cap 2019-01-10 18:06:57 +01:00
Branislav Stojkovic 4eda278bc0 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-01-10 11:27:29 +01:00
Branislav Stojkovic 3379987a74 Project font gets reverted to "Square721 BT" on Undo 2019-01-10 11:26:34 +01:00
bancika c6b2cba3aa Update ISSUE_TEMPLATE.md 2019-01-09 16:43:53 +01:00
Branislav Stojkovic a6538947d0 Render capacitor polarity markings properly when zommed in 2019-01-09 16:09:07 +01:00
Branislav Stojkovic 54e97b9adc no poles for humbuckers 2019-01-09 16:00:21 +01:00
Branislav Stojkovic 4ebd1deed4 Ability to have "Single-coil Pickup" with no poles, similar to Lace
Sensors
2019-01-09 15:55:56 +01:00
Branislav Stojkovic af2195798f Render resistor color bands properly when zommed in 2019-01-09 15:52:30 +01:00
Branislav Stojkovic c7a04075f4 "P-Bass Pickup" added 2019-01-09 15:41:32 +01:00
Branislav Stojkovic ebf988eaba "Jazz Bass Pickup" added 2019-01-09 14:23:15 +01:00
Branislav Stojkovic 0cd9f97e70 re-arranged 2019-01-09 11:20:13 +01:00
Branislav Stojkovic 40d9b296da another spell 2019-01-09 11:19:14 +01:00
Branislav Stojkovic 3f8dee89bb spell fix 2019-01-09 11:18:49 +01:00
Branislav Stojkovic 82d265e457 release 2019-01-09 11:16:20 +01:00
Branislav Stojkovic 6aa63d3a7b Changed default font to "Square721 BT" that looks more techincal and is
packaged with the app
2019-01-09 11:08:09 +01:00
Branislav Stojkovic fdc76c80cf change default font for labels 2019-01-09 10:59:56 +01:00
Branislav Stojkovic a574eac4e6 add default fonts 2019-01-09 10:55:07 +01:00
Branislav Stojkovic beb6c4857d improve multi-section cap
add more variants
2019-01-09 10:41:38 +01:00
Branislav Stojkovic 8e5b4b0ecc sort variants alphabetically 2019-01-09 10:39:55 +01:00
Branislav Stojkovic a92c6de926 2w metal oxide resistor variant 2019-01-08 16:55:34 +01:00
Branislav Stojkovic e38f4121b9 added resistor variants 2019-01-08 16:26:58 +01:00
Branislav Stojkovic bd40ad7dda component renamed 2019-01-07 23:59:45 +01:00
Branislav Stojkovic 767df37286 Right-click rotate while placing components on the canvas now applies to
tube sockets as wel
2019-01-07 23:55:51 +01:00
Branislav Stojkovic fc33be65ab rename template->variant in the code 2019-01-07 23:51:22 +01:00
Branislav Stojkovic a4639d3f1a keep defaults for variants separate 2019-01-07 23:39:36 +01:00
Branislav Stojkovic 405f8367df Covered humbucker pickup throwing errors when rotated 2019-01-07 23:39:15 +01:00
Branislav Stojkovic dbf3a1e64d add "variants.xml" to builds 2019-01-07 11:39:04 +01:00
Branislav Stojkovic 82d5c4436e add a parameter to automatically store variants to variants.xml 2019-01-07 11:37:27 +01:00
Branislav Stojkovic e541026656 Made it possible for DIYLC to come with predefined component variants in
addition to user-specific variants
2019-01-07 10:50:59 +01:00
Branislav Stojkovic 8be8c23213 Added visual indicator to the component tree showing how many variants,
if any, exist for a component

Rename multi-section cap class
2019-01-07 10:35:55 +01:00
Branislav Stojkovic 54b0519f09 cap can improvements 2019-01-06 15:12:30 +01:00
Branislav Stojkovic 41a2f3ed78 include themes for windows 2019-01-06 14:23:04 +01:00
Branislav Stojkovic 8dd1b74f96 multi-section can caps 2019-01-06 14:16:50 +01:00
Branislav Stojkovic b9613fa72d add support for multi-line text drawing 2019-01-06 14:16:03 +01:00
Branislav Stojkovic 295504d7d9 measure array editor support 2019-01-03 17:21:54 +01:00
Branislav Stojkovic ea00c503ee Fix "Mouse Wheel Zoom" feature that got broken in 3.46.1 2019-01-01 20:46:07 +01:00
Branislav Stojkovic 162980da67 one more ctrl/command place 2018-12-26 22:32:25 +01:00
Branislav Stojkovic f2cd0f2a56 Revert unintentional change for MacOs for "command" and "control" keys
for zooming and selection
2018-12-26 22:28:21 +01:00
Branislav Stojkovic d38d2f9b1b doc 2018-12-26 12:16:18 +01:00
Branislav Stojkovic 22e59d991c release 2018-12-26 12:13:16 +01:00
Branislav Stojkovic 1ffd9b50a8 Oval solder pads 2018-12-25 23:56:25 +01:00
Branislav Stojkovic 1268f83f5e Rotate commands now apply to "Label" and "PCB Text" components 2018-12-25 23:47:44 +01:00
Branislav Stojkovic ce0ac2460c Ctrl + click doesn't add components to the selection in MacOS 2018-12-25 23:40:05 +01:00
Branislav Stojkovic e9615d4d64 don't group pasted components
fix: click twice on a building block makes components jump to top-left
various minor updates
2018-12-25 16:49:18 +01:00
Branislav Stojkovic 48a6857738 Better error handing in V2 file importer 2018-12-25 12:26:17 +01:00
Branislav Stojkovic b489adf7c7 Vastly improve performance of selection aree calculations, especially
with bigger layouts
2018-12-25 11:41:09 +01:00
Branislav Stojkovic 1cfe2ee99a release 2018-12-25 10:26:01 +01:00
Branislav Stojkovic 9888d5f4c8 release 3.45.0 2018-12-25 10:11:12 +01:00
Branislav Stojkovic ac1c68c7c1 "Recent Files" causes the whole menu to be rendered at two places under
MacOS
2018-12-24 22:54:35 +01:00
Branislav Stojkovic 4a3304a20e Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2018-12-24 22:44:59 +01:00
Branislav Stojkovic f8a9171e12 doc 2018-12-24 22:44:49 +01:00
bancika 79abef597b Update ISSUE_TEMPLATE.md 2018-12-24 14:38:00 +01:00
bancika 5593804a6f Update ISSUE_TEMPLATE.md 2018-12-24 14:37:46 +01:00
bancika abb6fabf39 Update ISSUE_TEMPLATE.md 2018-12-24 14:37:15 +01:00
bancika 1566fc07b4 Create ISSUE_TEMPLATE.md 2018-12-24 14:35:58 +01:00
Branislav Stojkovic b0e986b4f9 Changed the way fonts are initialized, hoping to reduce a chance of
dialogs hanging
2018-12-24 09:18:15 +01:00
Branislav Stojkovic fb0dc31b98 comment 2018-12-24 00:43:57 +01:00
Branislav Stojkovic 1188a2e3c6 Reverted undesired change for four-point curved traces and wires which
made them slightly more curved than before
2018-12-24 00:40:10 +01:00
Branislav Stojkovic 56a97f28b9 null area better log 2018-12-23 13:25:37 +01:00
Branislav Stojkovic 1c36acf6db Fixed selection issues on right click in OSX 2018-12-22 14:45:07 +01:00
Branislav Stojkovic f07fd9c5e6 version file 2018-12-21 20:45:10 +01:00
Branislav Stojkovic 27a24b45b3 fix OSX build error 2018-12-21 20:37:51 +01:00
Branislav Stojkovic c567342aaa libs 2018-12-19 09:38:25 +01:00
Branislav Stojkovic d9b7dda449 fix update file 2018-12-18 19:26:12 +01:00
Branislav Stojkovic 99f2482b39 Center visible area to the selection when using mouse wheel to zoom in
and out
2018-12-18 19:18:39 +01:00
Branislav Stojkovic aadc9e394d All file export actions (PNG, PDF, BOM...) take the current file name as
a default
2018-12-18 18:55:59 +01:00
Branislav Stojkovic 3fec176fc1 Added few chassis-related components under "Electromechanical" category
fixed thin line style when zoomed in
2018-12-18 18:38:39 +01:00
Branislav Stojkovic 680397b44f Change mouse cursor when in "Highlight Connected Areas" mode to avoid
confusion
2018-12-18 10:20:40 +01:00
Branislav Stojkovic f94691bb0e Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2018-12-18 00:20:43 +01:00
Branislav Stojkovic e1c30b93ec added dashed/dotted lines
added 5 and 7-point curves
2018-12-18 00:20:33 +01:00
bancika ec2a85f8d8 Update README.md 2018-12-17 14:14:45 +01:00
bancika a6e4edcb61 Update README.md 2018-12-17 14:13:35 +01:00
bancika 8559843f2d Update README.md 2018-12-17 14:13:03 +01:00
bancika c58b27b5a2 Update README.md 2018-12-17 14:10:54 +01:00
bancika 95687438f9 Update README.md 2018-12-17 14:10:02 +01:00
bancika 14de8ea270 Update README.md 2018-12-17 14:09:34 +01:00
Branislav Stojkovic ce64cb46e7 adding turret 2018-12-17 14:01:24 +01:00
Branislav Stojkovic 97babd38cc improve hint dialog 2018-12-17 00:45:23 +01:00
Branislav Stojkovic d8b7e99044 add usage tips 2018-12-17 00:18:14 +01:00
Branislav Stojkovic 2bf7de07f3 update.xml fix 2018-12-16 19:09:00 +01:00
Branislav Stojkovic fd75174d6d update file 2018-12-16 17:52:53 +01:00
Branislav Stojkovic 1cbb1b8200 show announcements for the whole day 2018-12-16 17:49:15 +01:00
Branislav Stojkovic 6c61b5219f enhance continuity highlight functionality
expand to more components
2018-12-16 17:33:37 +01:00
Branislav Stojkovic 7575ae29d9 go back to java 6 compatible code 2018-12-16 11:02:20 +01:00
Branislav Stojkovic 745901131e File chooser dialogs don't append file extension if folder path has a
dot character in it
2018-12-16 10:44:41 +01:00
Branislav Stojkovic 53b58ef35a Fixed BOM export to Excel 2018-12-16 10:36:42 +01:00
Branislav Stojkovic 2cc916c8c1 improve continuity highlighting
massively simplified outline tracing
2018-12-16 01:47:30 +01:00
Branislav Stojkovic 58a4ff987f Highlight connected areas through copper traces, leads, jumpers, etc... 2018-12-16 00:52:15 +01:00
Branislav Stojkovic d506feac27 code tidy 2018-12-15 19:57:19 +01:00
Branislav Stojkovic 4aeaa25d1a Components in the tree sometimes stop responding until deselected and
selected again
2018-12-15 19:47:21 +01:00
Branislav Stojkovic b9cf1b4aa8 trimmer label updated 2018-12-15 19:30:12 +01:00
Branislav Stojkovic ec7f195a2e another trimmer type 2018-12-15 19:27:41 +01:00
Branislav Stojkovic 1b7f24bae4 Two new trimmer potentiometer types 2018-12-15 19:19:05 +01:00
Branislav Stojkovic 3939d2c5a7 Preserve z-order of components when copy-pasting 2018-12-15 18:35:51 +01:00
Branislav Stojkovic 2ee81093a0 shift for horizontal scroll
fixed issue with size calculation when zoomed
2018-12-15 18:23:56 +01:00
Branislav Stojkovic ed6792800b fix cut line disappearing 2018-12-14 10:01:07 +01:00
Branislav Stojkovic bc5fc23f38 version update 2018-12-11 22:07:32 +01:00
Branislav Stojkovic 36f8674417 fix building blocks
auto-delete older logs
2018-12-11 22:06:13 +01:00
Branislav Stojkovic 153b374191 version date fix 2018-12-11 17:52:35 +01:00
Branislav Stojkovic f573930ddf v3.41.0 release 2018-12-11 17:49:26 +01:00
bancika d6ac3c4018 "cut line" added 2018-12-11 17:05:04 +01:00
bancika e9afbaecdb Merge pull request #378 from heuermh/apply-gpl-license
Apply GPL version 3 license
2018-12-04 10:17:17 +01:00
Michael L Heuer c761677bed Update readme per GPL version 3 license. 2018-12-03 12:11:18 -06:00
Michael L Heuer f188f239b5 Add GPL version 3 license text to About dialog. 2018-12-03 12:07:28 -06:00
Michael L Heuer 3c458b9f16 Add GPL version 3 license header to source files. 2018-12-03 11:51:25 -06:00
Michael L Heuer 5a269afd2f Add GPL version 3 license. 2018-12-03 11:16:55 -06:00
bancika 43b232ad45 Merge pull request #358 from wahajenius/drawing_fixes
Drawing fixes
2018-08-11 17:04:52 +02:00
Willem Alexander Hajenius e4b155b12f Leads are now flush to component body; fixed drawing bug in lead shading due to mismatching rounding 2018-08-11 16:30:04 +02:00
Willem Alexander Hajenius cf7692fa9a Excluded IntelliJ project files 2018-08-11 16:00:58 +02:00
bancika bff46cf6d5 Merge pull request #354 from N9XYP/master
update symbol shape
2018-05-27 22:10:31 +02:00
Michael 58a615b548 update symbol shape
updating the symbol shape and fixing a naming error from previously wrong file upload
2018-05-26 21:45:08 -05:00
bancika 870199398c Merge pull request #353 from N9XYP/master
Photo Diode
2018-05-25 22:49:13 +02:00
N9XYP c946e34144 Update for typo
Typo
2018-05-25 15:37:51 -05:00
N9XYP 7ccad5bf08 Add files via upload
Photo Diode schematic symbol
2018-05-25 15:26:39 -05:00
Branislav Stojkovic 6821718b8d jarbundler update 2018-02-19 11:26:27 +01:00
Branislav Stojkovic e6a56e8157 Merge branch 'master' of
https://github.com/bancika/diy-layout-creator.git

Conflicts:
	diylc/diylc-swing/lib/diylc-core.jar
	diylc/diylc-swing/library/main.jar
2018-02-13 11:44:16 +01:00
Branislav Stojkovic 71afe72f37 java 8 migration 2018-02-13 11:32:48 +01:00
bancika f9d22b3d6f Merge pull request #328 from AXington/master
Add Fender mustang style switch
2017-09-23 15:15:12 +02:00
Andrew Thomas 53e6b4014c remvoe accidentally added file 2017-09-01 20:16:06 -04:00
Andrew Thomas c05b1a2131 revert accidental changes 2017-09-01 20:14:40 -04:00
Andrew Thomas f6d6b9a370 add mustang DP3T switch 2017-09-01 20:11:46 -04:00
bancika 6c2bb797ad Left mouse click on a component in the component tree sometimes has no
effect
2017-05-16 14:01:31 +02:00
bancika ddd634c825 Better label position on resistors 2017-05-16 12:56:20 +02:00
bancika 1bcb630619 fixed copy-paste error in dialog for bring to front 2017-05-12 15:36:47 +02:00
bancika a75c9830e5 Increased padding between schematic symbols and their labels 2017-05-10 16:23:02 +02:00
bancika 0e04d168e7 auto-save improvement 2017-05-10 16:12:46 +02:00
bancika d1a7227f4c right click rectangle selection 2017-05-10 15:25:43 +02:00
bancika a8665271b0 3.40 release 2017-05-08 14:44:49 +02:00
bancika f7c19c4483 improve axial electrolytic 2017-05-08 12:09:50 +02:00
Branislav Stojkovic df1331811c window size 2017-05-08 11:56:41 +02:00
Branislav Stojkovic aa5b81d0e5 fix radial cap import from v2 2017-05-08 11:45:32 +02:00
Branislav Stojkovic 38aa6bf660 Import files created in DIYLC v2 2017-05-08 11:42:16 +02:00
Branislav Stojkovic c2be767df1 cap image 2017-05-07 22:59:42 +02:00
Branislav Stojkovic 9ba7b66d05 Changed border color oemory bar in bottom-right corner not to be red
under OSX
2017-05-07 21:14:14 +02:00
Branislav Stojkovic 48b8e10795 splash update 2017-05-07 20:01:53 +02:00
Branislav Stojkovic 2d0fbf40a8 can cap added 2017-05-07 09:56:12 +02:00
Branislav Stojkovic ebe680fb8b doc 2017-05-07 09:01:42 +02:00
Branislav Stojkovic 0c806022f2 Better axial electrolytic rendering. Changed default color of all
electrolytic capacitors
2017-05-07 09:00:09 +02:00
Branislav Stojkovic 9b0eac7617 improve duplication 2017-05-06 16:10:45 +02:00
Branislav Stojkovic d84f7dadf5 Duplicate selection option in Edit menu and popup menu (Ctrl+D) 2017-05-06 13:56:54 +02:00
Branislav Stojkovic c7d8e8e0f0 splash for OSX 2017-05-06 12:32:57 +02:00
Branislav Stojkovic 08882a5167 Merge branch 'master' of
https://github.com/bancika/diy-layout-creator.git

Conflicts:
	diylc/diylc-library/lib/diylc-core.jar
	diylc/diylc-swing/lib/diylc-core.jar
2017-05-06 12:19:42 +02:00
Branislav Stojkovic b745ae8e15 new splash screen 2017-05-06 12:11:07 +02:00
bancika 2a72c8380c Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-05-05 12:03:08 +02:00
bancika cc008568a0 Editable toggle switch color 2017-05-05 11:59:56 +02:00
bancika c5b5465bab Create README.md 2017-05-05 11:42:20 +02:00
bancika 0a7e5c7dc7 add donate button in the installer 2017-05-05 11:32:12 +02:00
bancika d62221b796 Update README.md 2017-05-03 19:34:37 +02:00
bancika 3e0a698d32 Update README.md 2017-05-03 19:34:07 +02:00
bancika c37b0f3071 Ability to change PCB board shape from rectangular to oval 2017-04-27 17:15:38 +02:00
bancika 0fcd523d6b DIL IC label improvements 2017-04-27 13:56:24 +02:00
bancika ccf6e7bb7e improve bring to front/back 2017-04-27 13:17:14 +02:00
bancika d211ea6ffc Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-27 12:48:16 +02:00
bancika a5bd532e47 force components to go to front or back 2017-04-27 12:05:34 +02:00
bancika ddfb64f1a4 do not block the UI at startup 2017-04-27 11:40:18 +02:00
bancika 5198c9e2b5 Update README.md 2017-04-26 20:06:57 +02:00
bancika b39f685a90 Update README.md 2017-04-26 19:56:09 +02:00
bancika b2501ccba1 Tilde to repeat last added component 2017-04-26 16:30:02 +02:00
bancika 3f4b0475bc pot icon improvement 2017-04-26 15:42:45 +02:00
bancika f43cd8d90a Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-26 14:03:46 +02:00
bancika 66bdd41b29 Potentiometers can show an optional shaft, can have either solder lugs
or PCB pins and rendering includes the wafer
2017-04-26 14:03:36 +02:00
bancika c84fc3a200 Update README.md 2017-04-26 10:55:00 +02:00
bancika 1f44d63865 release 2017-04-26 10:52:44 +02:00
bancika c4b329744e moved log location
v39 release
2017-04-25 12:37:25 +02:00
bancika dda588b28f Use balloon to show announcements and update notifications 2017-04-25 12:09:10 +02:00
bancika 283232630c added font box padding 2017-04-24 13:35:11 +02:00
bancika cd5d5011c6 added nudge
fixed ctrl/meta handling
2017-04-24 12:59:56 +02:00
bancika 217c0b1b67 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-24 10:49:13 +02:00
bancika 4f0018d655 fix resistor changing shape 2017-04-24 10:48:24 +02:00
bancika 5ac8379693 Update README.md 2017-04-23 15:25:59 +02:00
bancika 72d0ab0d94 Update README.md 2017-04-23 15:24:08 +02:00
bancika 3e05634713 Update README.md 2017-04-23 15:22:56 +02:00
bancika 87e0997377 doc 2017-04-21 17:21:47 +02:00
bancika d1b29ec228 standardize ctrl to command on mac 2017-04-21 17:19:17 +02:00
bancika aad6cef831 tree tweak 2017-04-21 17:16:10 +02:00
bancika 2bd78110a7 assign keyboard shortcuts to components 2017-04-21 17:04:11 +02:00
bancika 6458dfd39b Use Mac "command" key for menu shortcuts under OSX 2017-04-21 13:29:42 +02:00
bancika e342ed1c2c Show and hide each individual layer 2017-04-21 11:55:40 +02:00
bancika f6ad118044 improve precision of copper traces 2017-04-21 10:49:36 +02:00
bancika 5dc090828c Show selection size in both inches and centimeters 2017-04-20 16:19:22 +02:00
bancika f1611bbf0f Solder Pad size shouldn't be rounded up or down to the nearest integer
to allow better precision
2017-04-20 15:43:14 +02:00
bancika d65609b3d2 fix IC pin alignment issue 2017-04-20 15:25:17 +02:00
bancika b3d63e9f22 show selection bounds on rulers 2017-04-20 14:12:00 +02:00
bancika dc8612a167 release 3.38 2017-04-20 11:33:25 +02:00
bancika 1fbd3c1dae change recent file count to 10 2017-04-20 11:09:04 +02:00
bancika fba2ecc384 Added 'Recent Files' 2017-04-20 11:07:08 +02:00
bancika 3048127024 Tooltip doesn't cover buttons in the right side of the status bar 2017-04-19 18:16:16 +02:00
bancika 017afda5a4 Ability to edit color of copper trace, curved trace and solder pad at
the same time
2017-04-19 15:32:13 +02:00
bancika 54bcd99d17 unicode characters in JAR file paths 2017-04-19 14:03:55 +02:00
bancika 7ba7afe680 libs 2017-04-19 13:37:12 +02:00
bancika d9cffc1a34 added doc icon 2017-04-19 13:34:17 +02:00
bancika 781a8389d0 added windows installer
moved config file location
2017-04-19 13:26:00 +02:00
bancika 32e273df6e Do not allow creating zero-length components 2017-04-19 10:36:06 +02:00
bancika cbd58a1dd8 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-18 17:43:32 +02:00
bancika beb574c38f change project font 2017-04-18 17:41:36 +02:00
bancika 8e05394203 Update README.md 2017-04-13 11:25:29 +02:00
bancika e2c0723a23 Update README.md 2017-04-13 11:25:13 +02:00
bancika 7973549819 Update README.md 2017-04-13 11:24:35 +02:00
bancika 8e6f7a07e5 Solder pads can be sent behind copper traces to allow creating white
border around traces on top of a ground plane
2017-04-12 17:09:12 +02:00
bancika aadeac3f34 zoom scroll improvement 2017-04-12 14:33:14 +02:00
bancika 422545ffe2 Zooming tracks mouse cursor position 2017-04-11 17:49:39 +02:00
bancika 649caea538 Hookup wire can be sent to back behind boards 2017-04-10 16:02:27 +02:00
bancika e7260a24e4 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-10 13:37:19 +02:00
bancika 08e1a371b7 rel 3.37 2017-04-10 13:37:00 +02:00
bancika 105f38e97f Update README.md 2017-04-10 13:33:50 +02:00
bancika ff1d26b75b release 3.37 2017-04-10 13:24:58 +02:00
bancika 43bc49303c Thumbnail sometimes gets very small when uploading a project to the
cloud
2017-04-10 12:28:54 +02:00
bancika 5c7143b1a0 rotate breadboard 2017-04-07 17:52:07 +02:00
bancika 900fea58a1 Ability to change resistor shape (tubular or standard "dog bone") 2017-04-07 13:54:05 +02:00
bancika 3f8582df78 Added more control over Breadboard size and appearance 2017-04-07 13:50:54 +02:00
bancika bbcc196e9f Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-01-26 16:31:27 +01:00
bancika 3423f00c15 Ability to change resistor shape (tubular or standard "dog bone") 2017-01-26 16:31:08 +01:00
bancika 42fe174a69 Update README.md 2017-01-26 12:59:31 +01:00
bancika c1c87a2454 prepare the release 2017-01-26 12:31:40 +01:00
bancika d35566cdf5 color editor improvement 2017-01-25 13:13:36 +01:00
bancika c2aa863c2a Ability to type in hex value in color editor 2017-01-25 13:02:04 +01:00
bancika aa1a327ac1 pickup improvements 2017-01-25 12:19:11 +01:00
bancika b7a1ef6664 darker/lighter logic
single coil improvement
2017-01-25 11:48:07 +01:00
bancika fc7fd2aed8 single coil improvement 2017-01-25 11:24:47 +01:00
bancika 2c4aba1557 Select single coil pickup pole pieces (rods or rails) and pole piece
color
2017-01-24 12:04:16 +01:00
bancika 703ec78974 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-01-17 18:08:41 +01:00
bancika fc36f9d632 Component type gets selected while expanding folders in component tree 2017-01-17 18:08:29 +01:00
bancika 44797477ba Improved resistor rendering to look more realistic 2017-01-17 15:43:42 +01:00
bancika a739e2c51b Renamed "template" to "variant" 2017-01-16 16:10:17 +01:00
bancika 1160286bc7 Rename eclipse-java-google-style.xml to diylc/eclipse-java-google-style.xml 2017-01-14 01:54:30 +01:00
bancika e4cf9d5fda trimmer display improvement 2017-01-12 17:39:10 +01:00
bancika 58bf48d8ac building blocks improvement 2017-01-12 17:30:29 +01:00
bancika 57a9577016 improve building blocks 2017-01-12 17:02:51 +01:00
bancika 7c26b7aa94 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-01-12 15:51:27 +01:00
bancika 0555d4b86e building blocks 2017-01-12 15:50:54 +01:00
bancika c59597d8f0 Delete Project History.md 2017-01-11 16:11:50 +01:00
bancika 0286894338 Rename Project History to Project History.md 2017-01-11 16:10:44 +01:00
bancika ec06e03641 Create Project History 2017-01-11 16:10:29 +01:00
bancika 5f466110ad Update README.md 2017-01-11 16:10:06 +01:00
bancika 579eaccf50 Update README.md 2017-01-11 16:08:18 +01:00
bancika a86ff5c6e4 Update README.md 2017-01-11 16:06:48 +01:00
bancika c64c9fb5b2 change tube color 2017-01-11 15:57:15 +01:00
bancika c945dc89ad Ability to rotate tube sockets for arbitrary angle 2017-01-11 15:33:41 +01:00
bancika a9f177b980 jack transformer 2017-01-11 13:58:35 +01:00
bancika b85bd09778 show/hide rulers and grid 2017-01-11 12:31:18 +01:00
bancika 62cc726070 added transformers
don't apply template points
2017-01-11 11:48:32 +01:00
bancika 959c5be424 added more transformers 2017-01-10 14:20:53 +01:00
bancika 5daa7c7bc9 transformers for to92, dilIC and pot. 2017-01-09 12:50:43 +01:00
bancika 43262cea6a Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-01-06 15:25:27 +01:00
bancika af39da27aa refactor component transformation 2017-01-06 15:24:55 +01:00
bancika 06b56e57ad Update README.md 2017-01-05 18:41:07 +01:00
bancika 545df1b1fa Update README.md 2017-01-05 16:16:19 +01:00
bancika 8a3f017468 Cannot type "q" letter in any of the boxes around the app 2017-01-05 16:10:52 +01:00
bancika 980055d4c0 added default templates 2017-01-05 12:36:04 +01:00
bancika 53f09e6143 default focus on text when editing JLabel 2017-01-05 10:35:20 +01:00
bancika 23d702eeb5 rename actions for renumbering 2017-01-04 17:08:03 +01:00
bancika 3a419c0959 consolidated menus 2017-01-04 16:53:38 +01:00
bancika 97e44fba1e Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-01-04 15:34:16 +01:00
bancika ac93a97e85 added mirror 2017-01-04 15:24:10 +01:00
bancika 34bc347140 Update README.md 2016-12-30 12:13:13 +01:00
bancika e8b1258f09 release 2016-12-30 11:26:28 +01:00
bancika caa92e973d open jack improvement 2016-12-30 10:49:42 +01:00
bancika 95c8ee3bf6 consolidate component names 2016-12-30 10:19:56 +01:00
Branislav Stojkovic 0af2d068ea improve colors 2016-12-29 21:43:54 +01:00
Branislav Stojkovic f12402e024 improve colors 2016-12-29 21:41:36 +01:00
Branislav Stojkovic 6ec5c165f5 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-12-29 21:34:51 +01:00
Branislav Stojkovic 686754faa0 changed colors 2016-12-29 21:34:42 +01:00
bancika 2f97b39f18 Update README.md 2016-12-29 21:27:37 +01:00
Branislav Stojkovic 0e62f97ed7 tree improvement 2016-12-29 21:24:06 +01:00
Branislav Stojkovic ea210d816d improve line zoom 2016-12-29 21:18:27 +01:00
bancika c200a2ffbf improve jack 2016-12-29 18:12:45 +01:00
bancika 10905a7f0a cleanup 2016-12-29 18:07:18 +01:00
bancika fad005cccf added open jack 2016-12-29 18:06:54 +01:00
bancika 7bb1a86f48 pickup improvement 2016-12-29 14:03:33 +01:00
bancika a3f8910268 improve pickups 2016-12-29 13:58:05 +01:00
bancika 1bf2825f80 moved rounded path 2016-12-29 13:22:29 +01:00
bancika ab64e8bb14 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-12-29 13:11:49 +01:00
bancika c1ed488b7c pickup improvements 2016-12-29 13:11:38 +01:00
bancika 00c9744c40 added rounded path
added tele pickup
2016-12-29 13:00:45 +01:00
bancika f73e8197ce Update README.md 2016-12-28 23:24:03 +01:00
bancika d953c75b33 pickup change 2016-12-28 17:18:27 +01:00
bancika 191e82caf3 improved single coil look 2016-12-28 17:16:11 +01:00
bancika 8b0af57c35 tree improvements
perfboard improvements
trace cut improvements
2016-12-28 13:58:32 +01:00
bancika 7a5de6bad0 UTF-8 encoding for configs 2016-12-28 12:45:09 +01:00
bancika 2a0da6e794 folded both P90 under the same component 2016-12-28 10:13:05 +01:00
bancika 38b057888f tree improvements
LP switch added
2016-12-27 17:08:16 +01:00
bancika b14b7afd39 P-90 dogear icon fixed 2016-12-27 12:40:30 +01:00
bancika fb6b1464a3 tree improvements 2016-12-27 12:19:58 +01:00
bancika 328cf0e9b7 improved tree 2016-12-26 17:46:35 +01:00
bancika ebb6a57ee8 added searchable component tree 2016-12-26 17:29:42 +01:00
bancika 62893ffb7c Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-12-26 12:32:57 +01:00
bancika 0e1db4ddb1 added P90 pickups, mini humbuckers, fixed links 2016-12-26 12:32:46 +01:00
bancika 699762707a Update README.md 2016-12-24 16:25:37 +01:00
bancika efc92dfc71 Update README.md 2016-12-24 16:23:42 +01:00
bancika 321995a704 Update README.md 2016-12-24 14:06:40 +01:00
bancika d1ff654fc6 release 2016-12-23 15:32:03 +01:00
bancika 842d056fd7 undo relay - was already there (doh!) 2016-12-23 15:26:01 +01:00
bancika 58a794e8a7 cleanup relay 2016-12-23 13:22:24 +01:00
bancika 3fbec7fb13 Subminiature DIL relay added 2016-12-23 13:12:40 +01:00
bancika 81194fbcab Glass diode component added 2016-12-22 15:51:06 +01:00
bancika f79498bc22 transistor and potentiometer symbols can be rotated 2016-12-22 15:21:01 +01:00
bancika a32105e156 backward compatible fix 2016-12-21 17:16:49 +01:00
bancika 65a6e30986 improve pentode symbol. remove unused code 2016-12-21 16:09:45 +01:00
bancika 2eeb05e7af Tube symbols can be rotated 2016-12-21 15:58:57 +01:00
bancika ef07d109cf added text editor next to slider 2016-12-21 15:23:22 +01:00
bancika d27b049110 show SMD labels 2016-12-06 18:04:54 +01:00
bancika ba9924cc99 improved zoom 2016-12-06 15:24:42 +01:00
bancika 5a57c58563 added SMD capacitor and resistor 2016-12-06 12:20:51 +01:00
bancika 66e29aa275 added terminal strip 2016-12-05 17:44:56 +01:00
bancika 9d465b3156 added battery symbol 2016-12-05 13:17:35 +01:00
bancika 127ea2b84c Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-11-18 13:11:09 +01:00
bancika db1950621e server code 2016-11-18 13:10:56 +01:00
bancika b134c8f2d9 update server code 2016-11-18 13:10:35 +01:00
Branislav Stojkovic fc9988f682 release 2016-11-12 21:10:35 +01:00
Branislav Stojkovic f259604274 release 2016-11-12 20:58:39 +01:00
Branislav Stojkovic 32053fb2a8 fix paging issue 2016-11-12 18:53:33 +01:00
Branislav Stojkovic 97d7d51fae preparing for the release of 3.32 2016-11-12 18:35:31 +01:00
bancika 327a30215e improve icons 2016-11-08 17:52:27 +01:00
bancika 9c0784d59f improve conversion 2016-11-08 13:13:55 +01:00
bancika f63b6e5c0d improve V1 parsing 2016-11-08 11:33:19 +01:00
bancika 606d6a50be work on transformer symbols 2016-11-07 12:51:14 +01:00
bancika 6abea34d56 don't show templates at startup by default 2016-11-07 10:14:58 +01:00
Branislav Stojkovic 744e6a2576 refactor editably property
add transformer coil and core
2016-11-06 23:42:48 +01:00
Branislav Stojkovic dff7860002 update text 2016-11-04 11:32:50 +01:00
Branislav Stojkovic 0ac2c5bd9d flip potentiometer symbol horizontally 2016-11-04 11:21:30 +01:00
Branislav Stojkovic adfedf11ce improve trimmer and V1 import for trimmer and wire 2016-11-04 10:10:01 +01:00
bancika 8fc5fe4c18 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-11-02 11:39:48 +01:00
bancika 02b2c036ba add libs to repository so the app can run 2016-11-02 11:39:40 +01:00
bancika 9ac8f9d966 Update README.md 2016-11-02 11:23:00 +01:00
Branislav Stojkovic ad6e45da23 code cleanup
V1 file import - added support for more component types
minor improvements
2016-11-02 01:04:52 +01:00
bancika 94c8512c11 code cleanup 2016-11-01 16:43:24 +01:00
Branislav Stojkovic 3776955d7b change messages 2016-10-31 22:04:06 +01:00
Branislav Stojkovic 5981f96916 edit cloud project 2016-10-31 22:00:02 +01:00
bancika ad5bdbe22d manage cloud uploads 2016-10-31 17:53:56 +01:00
bancika fc717870f1 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-31 13:16:06 +01:00
bancika f9a32ebce3 simplified auto-create logic
cloud management work
2016-10-31 13:11:53 +01:00
bancika 271b38c51c Update README.md 2016-10-31 11:41:22 +01:00
Branislav Stojkovic a74f00a5fd simplify code 2016-10-30 12:30:30 +01:00
Branislav Stojkovic 98087d8889 upload manager work 2016-10-30 12:26:45 +01:00
Branislav Stojkovic 1849eec874 optimize the code 2016-10-30 10:29:50 +01:00
Branislav Stojkovic 85cb01b0d5 add support for update/delete project
move some code to background threads
2016-10-30 10:18:41 +01:00
Branislav Stojkovic f6e5078028 move some code to framework lib 2016-10-30 09:11:20 +01:00
Branislav Stojkovic 22b06e2a3b improve auto-generated keywords 2016-10-30 08:04:39 +01:00
Branislav Stojkovic 5e00e3128b keyword auto-generation 2016-10-30 01:04:26 +02:00
Branislav Stojkovic 5de31dd7bb auto-create component framework improvement 2016-10-30 00:31:09 +02:00
Branislav Stojkovic 06e2342d36 add doc
component tag reorg
2016-10-29 20:27:49 +02:00
Branislav Stojkovic 287157016f upgrade swing-framework for dialog improvement 2016-10-29 12:43:33 +02:00
bancika 5f020414a0 fix the link in About 2016-10-28 16:52:56 +02:00
bancika 1eeed9174a refactor old version parsing
remove dependency from core to library
validate SolderPad size
2016-10-28 13:24:25 +02:00
bancika abb9c5ce6f bugfix: trimmer display should not be static
code cleanup
2016-10-28 12:03:45 +02:00
bancika 6312e251f6 code cleanup 2016-10-28 12:02:50 +02:00
bancika 2131f9fe44 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-28 11:49:53 +02:00
bancika 997afc0e84 code cleanup 2016-10-28 11:48:41 +02:00
bancika eff81b718d Update README.md 2016-10-28 11:27:03 +02:00
bancika 76cb664d5d Update README.md 2016-10-28 11:26:42 +02:00
bancika 5a998c9dc0 Update README.md 2016-10-28 11:11:55 +02:00
bancika dfc14c26f9 update lib 2016-10-28 10:48:39 +02:00
bancika fccd4b481a Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-28 10:48:05 +02:00
bancika 5d5aa05f08 update back-end code 2016-10-28 10:47:55 +02:00
bancika dc42dd8bd4 Update README.md 2016-10-28 10:32:24 +02:00
bancika c24d186476 Update README.md 2016-10-28 09:56:17 +02:00
bancika c68d91997f Update README.md 2016-10-28 09:49:51 +02:00
Branislav Stojkovic f571992692 renamed lib 2016-10-28 00:44:03 +02:00
Branislav Stojkovic 21815584ac announcement fix 2016-10-28 00:37:06 +02:00
Branislav Stojkovic ad4716cd79 switched compiler to janino 2016-10-28 00:34:13 +02:00
Branislav Stojkovic e67c879472 fix minor issues 2016-10-27 20:24:58 +02:00
bancika 6977d97332 send comments functionality 2016-10-27 17:53:10 +02:00
bancika d1279ccc9a added comment support 2016-10-27 13:07:23 +02:00
bancika 0da4375857 view/download/comment count 2016-10-27 12:39:11 +02:00
bancika 3e695a37f0 view and download counter added 2016-10-27 10:51:18 +02:00
Branislav Stojkovic 377d8c4ed5 added to the top 2016-10-26 23:00:29 +02:00
Branislav Stojkovic e48b94c91b minor improvements 2016-10-26 21:32:25 +02:00
bancika 8c85e7351c add announcements 2016-10-26 18:04:52 +02:00
bancika d510483f31 improve search looks 2016-10-26 13:10:56 +02:00
bancika 54e9797566 search paging improvement 2016-10-26 12:04:04 +02:00
Branislav Stojkovic 5ffb223a0d code improvement 2016-10-26 08:26:24 +02:00
bancika f65b43b578 lazy loading 2016-10-25 18:16:21 +02:00
bancika 727d46e8d3 remove dashboard for now 2016-10-25 17:05:06 +02:00
bancika 04016ff879 change main window title 2016-10-25 12:06:49 +02:00
bancika 2105391c89 improve search results 2016-10-25 12:00:04 +02:00
Branislav Stojkovic 71c0bacf9c resize 2016-10-25 09:00:04 +02:00
Branislav Stojkovic af5080b422 label change 2016-10-25 08:58:36 +02:00
Branislav Stojkovic 70edab78a4 renamed cloud 2016-10-25 08:37:17 +02:00
Branislav Stojkovic 47eaf46bb4 minor change 2016-10-24 21:30:54 +02:00
Branislav Stojkovic 5ea18aa018 label change 2016-10-24 21:28:33 +02:00
Branislav Stojkovic ac4ec9c390 use volatile image to optimize 2016-10-24 21:26:28 +02:00
bancika 04a0d6bea9 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-24 17:56:24 +02:00
bancika be334165ba search rework 2016-10-24 17:56:13 +02:00
bancika 13f7116552 Update README.md 2016-10-24 16:43:10 +02:00
bancika b529adefcb Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-24 16:18:04 +02:00
bancika 3afd1add40 added bitchin' cloud animation 2016-10-24 16:17:56 +02:00
bancika 6a232fee94 Add files via upload
eclipse coding standard used in the project
2016-10-24 12:18:54 +02:00
bancika a9df82cbab cloud search work 2016-10-24 11:55:40 +02:00
bancika a197bbc21a fix build 2016-10-24 10:13:00 +02:00
Branislav Stojkovic 0610229157 move folders 2016-10-23 17:29:23 +02:00
Branislav Stojkovic 5ec0616a1e change format to ggl 2016-10-23 17:17:46 +02:00
Branislav Stojkovic 81a0ff1d44 download and open files from the cloud 2016-10-23 17:06:28 +02:00
Branislav Stojkovic 3c4b4adfb4 cloud browser - show search results 2016-10-23 11:40:02 +02:00
Branislav Stojkovic 545e483397 work on cloud browser 2016-10-23 09:56:45 +02:00
Branislav Stojkovic 309973e37f add cloud browser frame 2016-10-22 23:13:54 +02:00
Branislav Stojkovic 71534e065b create user functionality 2016-10-22 20:58:53 +02:00
Branislav Stojkovic ff019542f8 cloud user management 2016-10-22 19:12:34 +02:00
Branislav Stojkovic a7a99cc4ec git ignore 2016-10-22 15:11:30 +02:00
Branislav Stojkovic 5b5b75142f cloud work - user management 2016-10-22 15:09:10 +02:00
Branislav Stojkovic d8b915f8a5 improve auto save/restore logic 2016-10-22 15:07:23 +02:00
Branislav Stojkovic 83e7c0b077 add back end PHP code to the repository 2016-10-22 12:45:49 +02:00
Branislav Stojkovic 4738a23fc6 minor code improvement 2016-10-22 12:43:20 +02:00
Branislav Stojkovic 7c6bd1804b project upload is functional! 2016-10-22 12:31:32 +02:00
Branislav Stojkovic f949fa5087 cloud work 2016-10-22 02:27:12 +02:00
Branislav Stojkovic 700a09ed86 code improvement 2016-10-22 01:49:11 +02:00
Branislav Stojkovic 1b3d6fb2fc cloud work 2016-10-22 01:41:45 +02:00
bancika 3446505c27 changed lib name 2016-10-21 18:25:15 +02:00
bancika 34c2c736ad update http-proxy 2016-10-21 18:20:07 +02:00
bancika c75711642a cloud work 2016-10-21 18:02:10 +02:00
bancika eef4988177 refactor drop down button to avoid 3 libs
service API
2016-10-21 17:08:27 +02:00
bancika 05207700fe renamed interface 2016-10-21 13:24:19 +02:00
bancika 0c75ab2b5a remove MySql references
switch to DIYLC php-based service
2016-10-21 12:35:35 +02:00
bancika 8850616584 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2016-10-20 12:26:36 +02:00
Branislav Stojkovic e6b782ee64 delete extra projects 2016-10-19 23:14:37 +02:00
bancika 3003ca4ed2 Update README.md 2016-10-07 13:19:01 +02:00
bancika d2b6584ef0 osx zip file access fixed 2016-05-12 18:08:38 +02:00
bancika 1ac18b3819 Update README.md 2016-05-11 16:55:37 +02:00
bancika 3d69e259be Update README.md 2016-05-11 16:52:58 +02:00
bancika 021bac8f83 Update README.md 2016-05-11 16:51:50 +02:00
5076 changed files with 1631008 additions and 52416 deletions
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.7.jar"/>
<classpathentry kind="lib" path="lib/iText-2.1.7.jar"/>
<classpathentry kind="lib" path="lib/cloning-1.5.jar"/>
<classpathentry kind="lib" path="lib/objenesis-1.1.jar"/>
<classpathentry kind="lib" path="lib/jettison-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-3.5-FINAL-20090928.jar"/>
<classpathentry kind="lib" path="library/main.jar"/>
<classpathentry kind="lib" path="lib/bancika-gui-framework.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -1 +0,0 @@
/bin/
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DIYLC</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
File diff suppressed because one or more lines are too long
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<stringAttribute key="bad_container_name" value="\DIYLC\r"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/DIYLC/src/org/diylc/DIYLCStarter.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;Library&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;DIYLC&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DIYLC"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx512m"/>
</launchConfiguration>
@@ -1,78 +0,0 @@
<project name="diylc" basedir="." default="jar">
<property name="src.dir" value="src" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="build.dir" value="${basedir}/build" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="report.dir" value="${build.dir}/junitreport" />
<property name="main.class" value="org.diylc.DIYLCStarter" />
<property name="classes.dir" value="${build.dir}/temp/${ant.project.name}/classes" />
<property name="test.classes.dir" value="${build.dir}/temp/${ant.project.name}/test.classes" />
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!--change src dir-->
<target name="compile">
<mkdir dir="${classes.dir}" />
<echo>Compile with JDK ${java.runtime.version}</echo>
<javac encoding="8859_1" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="class.path" />
</target>
<target name="resource.copy">
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="lib.copy">
<copy todir="${jar.dir}/lib" overwrite="true">
<fileset dir="${basedir}/lib">
<exclude name="**/*dll" />
</fileset>
</copy>
<copy todir="${jar.dir}/library" overwrite="true">
<fileset dir="${basedir}/library">
<exclude name="**/*dll" />
</fileset>
</copy>
<copy todir="${jar.dir}" overwrite="true">
<fileset dir="${basedir}/lib/" includes="**/*.dll" />
</copy>
</target>
<path id="class.path">
<fileset dir="${basedir}">
<include name="lib/**/*.jar" />
<include name="library/**/*.jar" />
</fileset>
</path>
<manifestclasspath jarfile="${ant.project.name}.jar" property="manifest.class.path">
<classpath refid="class.path" />
</manifestclasspath>
<target name="jar" depends="clean, lib.copy, resource.copy, compile">
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${manifest.class.path}" />
</manifest>
</jar>
</target>
<target name="javadoc">
<javadoc access="public" author="true" classpathref="class.path" destdir="doc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" splitindex="true" use="true" version="true">
<fileset dir="${src.dir}">
<exclude name="**\.svn\**" />
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
</project>
@@ -1,2 +0,0 @@
#org.diylc.utils.Constants.CANVAS_COLOR=#005D96
#org.diylc.utils.Constants.GRID_COLOR=#FFFFFF
@@ -1,86 +0,0 @@
<map>
<entry>
<string>default.org.diylc.components.passive.TrimmerPotentiometer:Type</string>
<org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType>FLAT_LARGE</org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType>
</entry>
<entry>
<string>lastPath</string>
<string>C:\Documents and Settings\Branislav Stojkovic\My Documents\Downloads</string>
</entry>
<entry>
<string>abnormalExit</string>
<boolean>false</boolean>
</entry>
<entry>
<string>stickyPoints</string>
<boolean>true</boolean>
</entry>
<entry>
<string>theme</string>
<org.diylc.core.Theme>
<name>Light</name>
<bgColor>
<red>255</red>
<green>255</green>
<blue>255</blue>
<alpha>255</alpha>
</bgColor>
<gridColor>
<red>240</red>
<green>240</green>
<blue>240</blue>
<alpha>240</alpha>
</gridColor>
<outlineColor>
<red>0</red>
<green>0</green>
<blue>0</blue>
<alpha>255</alpha>
</outlineColor>
</org.diylc.core.Theme>
</entry>
<entry>
<string>antiAliasing</string>
<boolean>true</boolean>
</entry>
<entry>
<string>snapToGrid</string>
<boolean>true</boolean>
</entry>
<entry>
<string>hiQualityRender</string>
<boolean>false</boolean>
</entry>
<entry>
<string>outline</string>
<boolean>true</boolean>
</entry>
<entry>
<string>exportGrid</string>
<boolean>true</boolean>
</entry>
<entry>
<string>autoEdit</string>
<boolean>false</boolean>
</entry>
<entry>
<string>wheelZoom</string>
<boolean>false</boolean>
</entry>
<entry>
<string>default.org.diylc.components.misc.Label:Font Bold</string>
<boolean>false</boolean>
</entry>
<entry>
<string>autoCreatePads</string>
<boolean>true</boolean>
</entry>
<entry>
<string>continuousCreation</string>
<boolean>true</boolean>
</entry>
<entry>
<string>showTemplatesAtStartup</string>
<boolean>false</boolean>
</entry>
</map>
@@ -1,76 +0,0 @@
package org.diylc;
import java.io.FileInputStream;
import java.net.URL;
import java.util.Properties;
import javax.swing.UIManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.diylc.presenter.Presenter;
import org.diylc.swing.gui.MainFrame;
import org.diylc.swing.gui.TemplateDialog;
import com.diyfever.gui.miscutils.ConfigurationManager;
import com.diyfever.gui.miscutils.PropertyInjector;
/**
* Main class that runs DIYLC.
*
* @author Branislav Stojkovic
*
* @see Presenter
* @see MainFrame
*/
public class DIYLCStarter {
private static final Logger LOG = Logger.getLogger(Presenter.class);
/**
* @param args
*/
public static void main(String[] args) {
URL url = DIYLCStarter.class.getResource("log4j.properties");
Properties properties = new Properties();
try {
properties.load(url.openStream());
PropertyConfigurator.configure(properties);
} catch (Exception e) {
LOG.error("Could not initialize log4j configuration", e);
}
LOG.debug("Java version: " + System.getProperty("java.runtime.version") + " by " + System.getProperty("java.vm.vendor"));
LOG.info("Starting DIYLC with working directory " + System.getProperty("user.dir"));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
LOG.error("Could not set Look&Feel", e);
}
MainFrame mainFrame = new MainFrame();
mainFrame.setLocationRelativeTo(null);
mainFrame.setVisible(true);
boolean showTemplates = ConfigurationManager.getInstance().readBoolean(
TemplateDialog.SHOW_TEMPLATES_KEY, true);
if (showTemplates) {
TemplateDialog templateDialog = new TemplateDialog(mainFrame, mainFrame.getPresenter());
if (!templateDialog.getFiles().isEmpty()) {
templateDialog.setVisible(true);
}
}
url = DIYLCStarter.class.getResource("/config.properties");
properties = new Properties();
try {
LOG.info("Injecting default properties.");
properties.load(new FileInputStream("config.properties"));
PropertyInjector.injectProperties(properties);
} catch (Exception e) {
LOG.error("Could not read config.properties file", e);
}
}
}
@@ -1,7 +0,0 @@
package org.diylc.common;
public class BadPositionException extends Exception {
private static final long serialVersionUID = 1L;
}
@@ -1,88 +0,0 @@
package org.diylc.common;
import javax.swing.Icon;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
/**
* Entity class used to describe a component type.
*
* @author Branislav Stojkovic
*
* @see IDIYComponent
*/
public class ComponentType {
private String name;
private String description;
private CreationMethod creationMethod;
private String category;
private String namePrefix;
private String author;
private Icon icon;
private Class<? extends IDIYComponent<?>> instanceClass;
private double zOrder;
private boolean stretchable;
public ComponentType(String name, String description, CreationMethod creationMethod,
String category, String namePrefix, String author, Icon icon,
Class<? extends IDIYComponent<?>> instanceClass, double zOrder, boolean stretchable) {
super();
this.name = name;
this.description = description;
this.creationMethod = creationMethod;
this.category = category;
this.namePrefix = namePrefix;
this.author = author;
this.icon = icon;
this.instanceClass = instanceClass;
this.zOrder = zOrder;
this.stretchable = stretchable;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public CreationMethod getCreationMethod() {
return creationMethod;
}
public String getCategory() {
return category;
}
public String getNamePrefix() {
return namePrefix;
}
public String getAuthor() {
return author;
}
public Icon getIcon() {
return icon;
}
public Class<? extends IDIYComponent<?>> getInstanceClass() {
return instanceClass;
}
public double getZOrder() {
return zOrder;
}
public boolean isStretchable() {
return stretchable;
}
@Override
public String toString() {
return name;
}
}
@@ -1,11 +0,0 @@
package org.diylc.common;
public enum Display {
NAME, VALUE;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -1,40 +0,0 @@
package org.diylc.common;
import java.awt.Graphics;
/**
* Enumerates all options that can be used when drawing a project.
*
* @see IPlugInPort#draw(java.awt.Graphics2D, java.util.Set, IComponentFiler)
*
* @author Branislav Stojkovic
*/
public enum DrawOption {
/**
* Selection rectangle will be drawn when needed and selected components may
* be rendered differently.
*/
SELECTION,
/**
* Selected zoom level will be applied to scale the {@link Graphics} before
* drawing.
*/
ZOOM,
/**
* Grid lines are drawn.
*/
GRID,
/**
* Control points are drawn.
*/
CONTROL_POINTS,
/**
* Anti-aliasing is used when drawing.
*/
ANTIALIASING,
/**
* Draw components in outline mode.
*/
OUTLINE_MODE;
}
@@ -1,83 +0,0 @@
package org.diylc.common;
import java.awt.Rectangle;
import java.awt.geom.Point2D;
import org.diylc.core.Project;
/**
* Enumerates all possible events between {@link IPlugInPort} and
* {@link IPlugIn}. Some events overlap so be careful which ones you subscribe
* for and how you process them.
*
* @author Branislav Stojkovic
*/
public enum EventType {
/**
* Called when zoom level changes. Typically only one parameter of type
* {@link Double} is passed with new zoom level.
*/
ZOOM_CHANGED,
/**
* Called when a new project is loaded. New {@link Project} is the first
* parameter. Boolean flag is the second parameter and it's true when new
* project is loaded, false when the same project has been either reloaded
* or loaded with undo/redo operations.
*/
PROJECT_LOADED,
/**
* Called when either current file name or modified flag are changed. The
* first parameter is the current file name, the second one is a boolean
* modified flag.
*/
FILE_STATUS_CHANGED,
/**
* Called when selection rectangle is changed. Object of type
* {@link Rectangle} is the only parameter and it contains the new selection
* rectangle.
*/
SELECTION_RECT_CHANGED,
/**
* Called when component selection is changed. New
* {@link ComponentSelection} is attached as a parameter.
*/
SELECTION_CHANGED,
/**
* Called when selection size changes, together with a {@link Point2D}
* object containing selection size (x = width, y = height). Size is
* expressed in the default measure (cm for metric, inches for imperial).
*/
REPAINT,
/**
* Called when new component slot has been changed. The only parameter is
* {@link ComponentType} and may be null.
*/
SLOT_CHANGED,
/**
* Called when the current project has been modified. Two instances of
* {@link Project} are passed as parameters, one before and one after the
* change. The third parameter is a string containing change description.
*/
PROJECT_MODIFIED,
/**
* Called when control points under the cursor are changed. A single
* parameter is passed, an instance of
* <code>Map<IDIYComponent<?>, Set<Integer>></code> containing all the
* components and indices of their control points that are under the cursor.
*/
AVAILABLE_CTRL_POINTS_CHANGED,
/**
* Called when mouse cursor is moved. Point object is passed, containing the
* current cursor location (not taking zoom into account).
*/
MOUSE_MOVED,
/**
* Called when a layer status is changed. The first parameter is a set of indices of locked layers. All layers not included are considered unlocked.
*/
LAYER_STATE_CHANGED,
/**
* Called to update the status message. New status message is passed as a first parameter.
*/
STATUS_MESSAGE_CHANGED;
}
@@ -1,6 +0,0 @@
package org.diylc.common;
public enum GridType {
LINES, CROSSHAIR, DOT, NONE;
}
@@ -1,8 +0,0 @@
package org.diylc.common;
import org.diylc.core.IDIYComponent;
public interface IComponentFiler {
boolean testComponent(IDIYComponent<?> component);
}
@@ -1,19 +0,0 @@
package org.diylc.common;
import com.diyfever.gui.simplemq.IMessageListener;
/**
* Interface for plug-ins.
*
* @author Branislav Stojkovic
*/
public interface IPlugIn extends IMessageListener<EventType> {
/**
* Method that connects the plug-in with {@link IPlugInPort}. Called by the
* application when plug-in is installed.
*
* @param plugInPort
*/
void connect(IPlugInPort plugInPort);
}
@@ -1,375 +0,0 @@
package org.diylc.common;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Point2D;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.Theme;
import org.diylc.swing.plugins.edit.ComponentTransferable;
import com.diyfever.gui.simplemq.IMessageListener;
import com.diyfever.gui.simplemq.MessageDispatcher;
import com.diyfever.gui.update.VersionNumber;
/**
* Interface for communication between plug-ins and the application. Plug-ins
* may acquire information or make changes through this interface. Application
* events are dispatched to plug-ins through {@link MessageDispatcher}
*
* @author Branislav Stojkovic
*
* @see IPlugIn
* @see MessageDispatcher
* @see IMessageListener
* @see EventType
*/
public interface IPlugInPort {
public static final String ANTI_ALIASING_KEY = "antiAliasing";
public static final String HI_QUALITY_RENDER_KEY = "hiQualityRender";
public static final String EXPORT_GRID_KEY = "exportGrid";
public static final String STICKY_POINTS_KEY = "stickyPoints";
public static final String METRIC_KEY = "metric";
public static final String SNAP_TO_GRID_KEY = "snapToGrid";
public static final String AUTO_PADS_KEY = "autoCreatePads";
public static final String CONTINUOUS_CREATION_KEY = "continuousCreation";
public static final String AUTO_EDIT_KEY = "autoEdit";
public static final String ABNORMAL_EXIT_KEY = "abnormalExit";
public static final String WHEEL_ZOOM_KEY = "wheelZoom";
public static final String OUTLINE_KEY = "outline";
public static final String THEME_KEY = "theme";
public static final String RECENT_COMPONENTS_KEY = "recentComponents";
/**
* Returns size of the canvas that takes project dimensions into account as
* well as zoom level. Each dimension is calculated as the product of the
* actual size and the number of pixels per unit. If <code>useZoom</code> is
* set to true, the result is scaled by zoom factor.
*
* @param useZoom
*
* @return canvas dimensions
*/
Dimension getCanvasDimensions(boolean useZoom);
/**
* Returns an instance of {@link Cursor} that should be used at the
* specified location.
*
* Note: point coordinates are scaled for zoom factor.
*
* @param point
* @return cursor
*/
Cursor getCursorAt(Point point);
/**
* Returns an instance of currently loaded project.
*
* @return
*/
Project getCurrentProject();
/**
* Loads specified {@link Project}.
*
* @param project
* @param freshStart
*/
void loadProject(Project project, boolean freshStart);
/**
* Creates a new project.
*/
void createNewProject();
/**
* Loads a project from the specified file.
*
* @param fileName
*/
void loadProjectFromFile(String fileName);
/**
* Saves the current project into the specified file.
*
* @param fileName
* @param isBackup
*/
void saveProjectToFile(String fileName, boolean isBackup);
/**
* @return the current file name.
*/
String getCurrentFileName();
/**
* @return true if the current project is modified.
*/
boolean isProjectModified();
/**
* Shows a user dialog if there are changes to confirm that it's safe to
* proceed.
*
* @return true, if file actions (new, open, close) can be taken
*/
boolean allowFileAction();
/**
* Returns all available {@link ComponentType}s classified by category.
* Result is a {@link Map} between category name to a {@link List} of all
* {@link ComponentType}s that share that category name.
*
* @return
*/
Map<String, List<ComponentType>> getComponentTypes();
/**
* Draws project on the provided {@link Graphics2D}. If the provided filter
* is not null, it will be used to filter the components that are shown.
*
* @param g2d
* @param drawOptions
* specific drawing options
* @param filter
*/
void draw(Graphics2D g2d, Set<DrawOption> drawOptions, IComponentFiler filter);
Double[] getAvailableZoomLevels();
/**
* Returns current zoom level where <code>zoomLevel = 1.0d</code> means
* 100%.
*
* @return current zoom level
*/
double getZoomLevel();
/**
* Changes current zoom level where <code>zoomLevel = 1.0d</code> means 100%
*
* @param zoomLevel
* new zoom leve
*/
void setZoomLevel(double zoomLevel);
/**
* Notifies the presenter that mouse is clicked.
*
* Note: point coordinates are display based, i.e. scaled for zoom factor.
*
* @param point
* @param ctrlDown
* @param shiftDown
* @param altDown
* @param clickCount
*/
void mouseClicked(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown,
int clickCount);
/**
* Notifies the presenter that mouse is moved.
*
* Note: point coordinates are display based, i.e. scaled for zoom factor.
*
* @param point
* @param ctrlDown
* @param shiftDown
* @param altDown
*/
void mouseMoved(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown);
/**
* Returns the current {@link ComponentTransferable}.
*
* @return
*/
List<IDIYComponent<?>> getSelectedComponents();
/**
* Updates the selection with the specified list of component. Also, updates
* control point map with all components that are stuck to the newly
* selected components.
*
* @param newSelection
*/
void updateSelection(List<IDIYComponent<?>> newSelection);
/**
* Selects all components in the project.
*/
void selectAll();
/**
* Notification that drag has been started from the specified point.
*
* Note: point coordinates are scaled for zoom factor.
*
* @param point
* @param ctrlDown
* @param shiftDown
* @param altDown
*/
void dragStarted(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown);
/**
* Checks if it's possible to drop over the specified point.
*
* Note: point coordinates are scaled for zoom factor.
*
* @param point
* @return
*/
boolean dragOver(Point point);
/**
* Notification that drag has been ended in the specified point.
*
* Note: point coordinates are scaled for zoom factor.
*
* @param point
*/
void dragEnded(Point point);
/**
* Returns current version number.
*
* @return
*/
VersionNumber getCurrentVersionNumber();
/**
* Adds a list of components to the project.
*
* @param components
*/
void pasteComponents(List<IDIYComponent<?>> components);
/**
* Deletes all the selected components from the project.
*/
void deleteSelectedComponents();
/**
* Sets default value for the specified property name for currently selected
* component types.
*
* @param propertyName
* display name for property
* @param value
* new default value, must not be null
*/
void setSelectionDefaultPropertyValue(String propertyName, Object value);
/**
* Sets default value for the specified property name for projects.
*
* @param propertyName
* display name for property
* @param value
* new default value, must not be null
*/
void setProjectDefaultPropertyValue(String propertyName, Object value);
/**
* @return a list of properties that are mutual for all the selected
* components. Resulting list may be empty if selected components do
* not have mutual properties or can be null if the selection is
* empty.
*/
List<PropertyWrapper> getMutualSelectionProperties();
void editSelection();
/**
* @return a list of editable properties of the current project.
*/
List<PropertyWrapper> getProjectProperties();
/**
* Applies specified properties to the current project.
*
* @param properties
*/
void applyPropertiesToProject(List<PropertyWrapper> properties);
/**
* Sets the new component slot. Specified component type will be used to
* instantiate new component.
*/
void setNewComponentTypeSlot(ComponentType componentType);
/**
* Changes default size notation, true for metric, false for imperial.
*
* @param isMetric
*/
void setMetric(boolean isMetric);
/**
* Groups all selected components.
*/
void groupSelectedComponents();
/**
* Ungroups all selected components.
*/
void ungroupSelectedComponents();
/**
* Locks or unlocks the specified layer. All components within +- 0.5 range
* will be affected by the change as well.
*
* @param layerZOrder
* @param locked
*/
void setLayerLocked(int layerZOrder, boolean locked);
/**
* @return selection size expressed in either inches or centimeters, based
* on the user preference.
*/
Point2D calculateSelectionDimension();
/**
* Sends each of the selected components one step back.
*/
void sendSelectionToBack();
/**
* Brings each of the selected components one step to front.
*/
void bringSelectionToFront();
/**
* Causes the display to refresh.
*/
void refresh();
/**
* @return currently selected theme.
*/
Theme getSelectedTheme();
/**
* Changes the current theme.
*
* @param theme
*/
void setSelectedTheme(Theme theme);
/**
* Renumbers all the selected components.
*
* @param xAxisFirst
*/
void renumberSelectedComponents(boolean xAxisFirst);
}
@@ -1,34 +0,0 @@
package org.diylc.common;
/**
* Abstract layer between the app and platform worker thread implementation.
*
* @author Branislav Stojkovic
*
* @param <T>
*/
public interface ITask<T> {
/**
* Runs in background thread.
*
* @return
* @throws Exception
*/
T doInBackground() throws Exception;
/**
* Called if background thread fails.
*
* @param e
*/
void failed(Exception e);
/**
* Called if background thread is executed correctly, the result is passed
* as a parameter.
*
* @param result
*/
void complete(T result);
}
@@ -1,11 +0,0 @@
package org.diylc.common;
public enum LabelPosition {
ABOVE, BELOW;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -1,39 +0,0 @@
package org.diylc.common;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Stroke;
import java.util.HashMap;
import java.util.Map;
/**
* Repository for object that may be reused, such as {@link Stroke} or
* {@link AlphaComposite}.
*
* @author Branislav Stojkovic
*/
public class ObjectCache {
private static ObjectCache instance;
public static ObjectCache getInstance() {
if (instance == null) {
instance = new ObjectCache();
}
return instance;
}
private ObjectCache() {
}
private Map<Integer, Stroke> basicStrokeMap = new HashMap<Integer, Stroke>();
public Stroke fetchBasicStroke(int width) {
if (basicStrokeMap.containsKey(width)) {
return basicStrokeMap.get(width);
}
Stroke stroke = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
basicStrokeMap.put(width, stroke);
return stroke;
}
}
@@ -1,15 +0,0 @@
package org.diylc.common;
public enum Orientation {
DEFAULT, _90, _180, _270;
@Override
public String toString() {
if (this == DEFAULT) {
return "Default";
} else {
return name().replace("_", "") + " degrees clockwise";
}
}
}
@@ -1,11 +0,0 @@
package org.diylc.common;
public enum OrientationHV {
VERTICAL, HORIZONTAL;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -1,156 +0,0 @@
package org.diylc.common;
import java.lang.reflect.InvocationTargetException;
import org.diylc.core.IPropertyValidator;
/**
* Entity class for editable properties extracted from component objects.
* Represents a single editable property together with it's current value.
*
* @author Branislav Stojkovic
*/
public class PropertyWrapper implements Cloneable {
private String name;
private Class<?> type;
private Object value;
private String setter;
private String getter;
private boolean defaultable;
private IPropertyValidator validator;
private boolean unique = true;
private boolean changed = false;
public PropertyWrapper(String name, Class<?> type, String getter, String setter,
boolean defaultable, IPropertyValidator validator) {
super();
this.name = name;
this.type = type;
this.getter = getter;
this.setter = setter;
this.defaultable = defaultable;
this.validator = validator;
}
public void readFrom(Object object) throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException, SecurityException, NoSuchMethodException {
this.value = object.getClass().getMethod(getter).invoke(object);
}
// public void readUniqueFrom(IDIYComponent component)
// throws IllegalArgumentException, IllegalAccessException,
// InvocationTargetException {
// Object newValue = getter.invoke(component);
// if (!newValue.equals(value)) {
// this.value = null;
// }
// }
public void writeTo(Object object) throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException, SecurityException, NoSuchMethodException {
object.getClass().getMethod(setter, type).invoke(object, this.value);
}
public String getName() {
return name;
}
public Class<?> getType() {
return type;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public boolean isDefaultable() {
return defaultable;
}
public IPropertyValidator getValidator() {
return validator;
}
public boolean isUnique() {
return unique;
}
public void setUnique(boolean unique) {
this.unique = unique;
}
public boolean isChanged() {
return changed;
}
public void setChanged(boolean changed) {
this.changed = changed;
}
// @Override
// public Object clone() throws CloneNotSupportedException {
// // Try to invoke clone method on value if possible.
// try {
// Method cloneMethod = value.getClass().getMethod("clone");
// return new Property(name, type, cloneMethod.invoke(value));
// } catch (Exception e) {
// }
// return new Property(name, type, value);
// }
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (defaultable ? 1231 : 1237);
result = prime * result + ((getter == null) ? 0 : getter.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((setter == null) ? 0 : setter.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PropertyWrapper other = (PropertyWrapper) obj;
if (defaultable != other.defaultable)
return false;
if (getter == null) {
if (other.getter != null)
return false;
} else if (!getter.equals(other.getter))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (setter == null) {
if (other.setter != null)
return false;
} else if (!setter.equals(other.setter))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
return true;
}
@Override
public String toString() {
return name + " = " + value;
}
}
@@ -1,14 +0,0 @@
package org.diylc.common;
public enum ResistorColorCode {
NONE, _4_BAND, _5_BAND;
@Override
public String toString() {
if (name().startsWith("_")) {
return name().substring(1).replace("_", " ").toLowerCase();
}
return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
}
}
@@ -1,73 +0,0 @@
package org.diylc.components;
import java.awt.Color;
import java.awt.Font;
import java.awt.Shape;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.EditableProperty;
/**
* Abstract implementation of {@link IDIYComponent} that contains component name
* and toString.
*
* @author Branislav Stojkovic
*
* @param <T>
*/
public abstract class AbstractComponent<T> implements IDIYComponent<T> {
private static final long serialVersionUID = 1L;
protected String name = "";
public static Color SELECTION_COLOR = Color.red;
public static Color LABEL_COLOR = Color.black;
public static Color LABEL_COLOR_SELECTED = Color.red;
public static Font LABEL_FONT = new Font("Tahoma", Font.PLAIN, 14);
@EditableProperty(defaultable = false)
@Override
public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public boolean canControlPointOverlap(int index) {
return false;
}
@Override
public String toString() {
return name;
}
/**
* Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is
* even.
*
* @param x
* @return
*/
protected int getClosestOdd(double x) {
return ((int) x / 2) * 2 + 1;
}
/**
* @param clip
* @return true if none of the control points lie in the clip rectangle.
*/
protected boolean checkPointsClipped(Shape clip) {
for (int i = 0; i < getControlPointCount(); i++) {
if (clip.contains(getControlPoint(i))) {
return false;
}
}
return true;
}
}
@@ -1,249 +0,0 @@
package org.diylc.components;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.CubicCurve2D;
import org.diylc.common.ObjectCache;
import org.diylc.core.ComponentState;
import org.diylc.core.IDrawingObserver;
import org.diylc.core.Project;
import org.diylc.core.VisibilityPolicy;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComponent<T> {
private static final long serialVersionUID = 1L;
public static Color GUIDELINE_COLOR = Color.blue;
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
protected Point[] controlPoints = new Point[] {
new Point(0, 0),
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0),
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), (int) (DEFAULT_SIZE
.convertToPixels())),
new Point((int) DEFAULT_SIZE.convertToPixels(), (int) DEFAULT_SIZE.convertToPixels()) };
protected Color color = getDefaultColor();
protected PointCount pointCount = PointCount.FOUR;
/**
* Draws the specified curve onto graphics.
*
* @param curve
* @param g2d
* @param componentState
* @param theme
*/
protected abstract void drawCurve(CubicCurve2D curve, Graphics2D g2d,
ComponentState componentState);
/**
* @return default color.
*/
protected abstract Color getDefaultColor();
@Override
public void drawIcon(Graphics2D g2d, int width, int height) {
g2d.setColor(getDefaultColor().darker());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(3));
CubicCurve2D curve = new CubicCurve2D.Double(1, height - 1, width / 4, height / 3,
3 * width / 4, 2 * height / 3, width - 1, 1);
g2d.draw(curve);
g2d.setColor(getDefaultColor());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.draw(curve);
}
@Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
Project project, IDrawingObserver drawingObserver) {
if (checkPointsClipped(g2d.getClip())) {
return;
}
if (componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING) {
// Do not track guidelines.
drawingObserver.stopTracking();
g2d.setStroke(Constants.DASHED_STROKE);
g2d.setColor(GUIDELINE_COLOR);
g2d.drawLine(controlPoints[0].x, controlPoints[0].y, controlPoints[1].x,
controlPoints[1].y);
g2d.drawLine(controlPoints[1].x, controlPoints[1].y, controlPoints[2].x,
controlPoints[2].y);
g2d.drawLine(controlPoints[2].x, controlPoints[2].y, controlPoints[3].x,
controlPoints[3].y);
drawingObserver.startTracking();
}
CubicCurve2D curve = new CubicCurve2D.Double(controlPoints[0].x, controlPoints[0].y,
controlPoints[1].x, controlPoints[1].y, controlPoints[2].x, controlPoints[2].y,
controlPoints[3].x, controlPoints[3].y);
Composite oldComposite = g2d.getComposite();
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha
/ MAX_ALPHA));
}
// g2d.setColor(color.darker());
// g2d.setStroke(new BasicStroke(thickness));
// g2d.draw(path);
// g2d.setColor(color);
// g2d.setStroke(new BasicStroke(thickness - 2));
// g2d.draw(path);
drawCurve(curve, g2d, componentState);
g2d.setComposite(oldComposite);
}
@EditableProperty(name = "Point Count")
public PointCount getPointCount() {
if (pointCount == null) {
pointCount = PointCount.FOUR;
}
return pointCount;
}
public void setPointCount(PointCount pointCount) {
this.pointCount = pointCount;
// Reset control points.
for (int i = 0; i < getControlPointCount(); i++) {
setControlPoint(getControlPoint(i), i);
}
}
@Override
public int getControlPointCount() {
switch (getPointCount()) {
case TWO:
return 2;
case THREE:
return 3;
case FOUR:
return 4;
}
return 0;
}
@Override
public boolean isControlPointSticky(int index) {
return index == 0 || index == getControlPointCount() - 1;
}
@Override
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
return VisibilityPolicy.WHEN_SELECTED;
}
@Override
public boolean canControlPointOverlap(int index) {
// Only shape control points may overlap.
switch (getPointCount()) {
case TWO:
return false;
case THREE:
return index == 1;
case FOUR:
return index == 1 || index == 2;
}
return false;
}
@Override
public Point getControlPoint(int index) {
if (index == 0) {
return controlPoints[0];
}
switch (getPointCount()) {
case TWO:
switch (index) {
case 1:
return controlPoints[3];
}
case THREE:
switch (index) {
case 1:
return controlPoints[1];
case 2:
return controlPoints[3];
}
case FOUR:
switch (index) {
case 1:
return controlPoints[1];
case 2:
return controlPoints[2];
case 3:
return controlPoints[3];
}
}
return controlPoints[index];
}
@Override
public void setControlPoint(Point point, int index) {
if (index == 0) {
controlPoints[0].setLocation(point);
} else {
switch (getPointCount()) {
case TWO:
switch (index) {
case 1:
Point center = new Point((point.x + controlPoints[0].x) / 2,
(point.y + controlPoints[0].y) / 2);
controlPoints[1].setLocation(center);
controlPoints[2].setLocation(center);
controlPoints[3].setLocation(point);
break;
}
break;
case THREE:
switch (index) {
case 1:
controlPoints[1].setLocation(point);
controlPoints[2].setLocation(point);
break;
case 2:
controlPoints[3].setLocation(point);
break;
}
break;
case FOUR:
switch (index) {
case 1:
controlPoints[1].setLocation(point);
break;
case 2:
controlPoints[2].setLocation(point);
break;
case 3:
controlPoints[3].setLocation(point);
break;
}
break;
}
}
}
@EditableProperty
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
enum PointCount {
TWO, THREE, FOUR;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
}
@@ -1,336 +0,0 @@
package org.diylc.components;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import org.diylc.common.Display;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
import org.diylc.core.ComponentState;
import org.diylc.core.IDrawingObserver;
import org.diylc.core.Project;
import org.diylc.core.Theme;
import org.diylc.core.VisibilityPolicy;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
import com.diyfever.gui.miscutils.ConfigurationManager;
/**
* Base class for all leaded components such as resistors or capacitors. Has two
* control points and draws leads between them. Also, it positions and draws the
* shape of the component as specified by a child class.
*
* @author Branislav Stojkovic
*/
public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComponent<T> {
private static final long serialVersionUID = 1L;
public static Color LEAD_COLOR = Color.decode("#236B8E");
public static Size LEAD_THICKNESS = new Size(0.6d, SizeUnit.mm);
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
protected Size length;
protected Size width;
protected Point[] points = new Point[] {
new Point((int) (-DEFAULT_SIZE.convertToPixels() / 2), 0),
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0) };
protected Color bodyColor = Color.white;
protected Color borderColor = Color.black;
protected Color labelColor = LABEL_COLOR;
protected Display display = Display.VALUE;
protected AbstractLeadedComponent() {
super();
try {
this.length = getDefaultLength().clone();
this.width = getDefaultWidth().clone();
} catch (CloneNotSupportedException e) {
// This should never happen because Size supports cloning.
} catch (NullPointerException e) {
// This will happen if components do not have any shape.
}
}
@Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
Project project, IDrawingObserver drawingObserver) {
double distance = points[0].distance(points[1]);
Shape shape = getBodyShape();
// If there's no body, just draw the line connecting the ending points.
if (shape == null) {
drawLead(g2d, componentState);
} else if (supportsStandingMode()
&& length.convertToPixels() > points[0].distance(points[1])) {
// When ending points are too close draw the component in standing
// mode.
int width = getClosestOdd(this.width.convertToPixels());
Shape body = new Ellipse2D.Double(points[0].x - width / 2, points[0].y - width / 2,
width, width);
Composite oldComposite = g2d.getComposite();
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha
/ MAX_ALPHA));
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : bodyColor);
g2d.fill(body);
g2d.setComposite(oldComposite);
Color finalBorderColor;
if (outlineMode) {
Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
finalBorderColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : theme
.getOutlineColor();
} else {
finalBorderColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: borderColor;
}
g2d.setColor(finalBorderColor);
g2d.draw(body);
if (!outlineMode) {
drawLead(g2d, componentState);
}
} else {
// Normal mode with component body in the center and two lead parts.
Rectangle shapeRect = shape.getBounds();
Double theta = Math.atan2(points[1].y - points[0].y, points[1].x - points[0].x);
// Transform graphics to draw the body in the right place and at the
// right angle.
AffineTransform oldTransform = g2d.getTransform();
g2d.translate((points[0].x + points[1].x - shapeRect.width) / 2, (points[0].y
+ points[1].y - shapeRect.height) / 2);
g2d.rotate(theta, shapeRect.width / 2, shapeRect.height / 2);
// Draw body.
Composite oldComposite = g2d.getComposite();
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha
/ MAX_ALPHA));
}
if (bodyColor != null) {
if (bodyColor != null) {
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : bodyColor);
g2d.fill(shape);
}
}
decorateComponentBody(g2d, outlineMode);
g2d.setComposite(oldComposite);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
Color finalBorderColor;
if (outlineMode) {
Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
finalBorderColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : theme
.getOutlineColor();
} else {
finalBorderColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: borderColor;
}
g2d.setColor(finalBorderColor);
g2d.draw(shape);
// Draw label.
g2d.setFont(LABEL_FONT);
Color finalLabelColor;
if (outlineMode) {
Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
finalLabelColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? LABEL_COLOR_SELECTED : theme
.getOutlineColor();
} else {
finalLabelColor = componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? LABEL_COLOR_SELECTED
: labelColor;
}
g2d.setColor(finalLabelColor);
FontMetrics fontMetrics = g2d.getFontMetrics();
String label = display == Display.NAME ? getName() : getValue().toString();
// Adjust label angle if needed to make sure that it's readable.
if ((theta >= Math.PI / 2 && theta <= Math.PI)
|| (theta < -Math.PI / 2 && theta > -Math.PI)) {
g2d.rotate(Math.PI, shapeRect.width / 2, shapeRect.height / 2);
}
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
g2d.drawString(label, (int) (shapeRect.width - textRect.getWidth()) / 2,
calculateLabelYCoordinate(shapeRect, textRect, fontMetrics));
// Go back to the original transformation to draw leads.
if (!outlineMode) {
g2d.setTransform(oldTransform);
int leadThickness = getClosestOdd(getLeadThickness());
double leadLength = (distance - shapeRect.width) / 2 - leadThickness / 2;
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness));
Color leadColor = shouldShadeLeads() ? getLeadColor(componentState).darker()
: getLeadColor(componentState);
g2d.setColor(leadColor);
int endX = (int) (points[0].x + Math.cos(theta) * leadLength);
int endY = (int) Math.round(points[0].y + Math.sin(theta) * leadLength);
g2d.drawLine(points[0].x, points[0].y, endX, endY);
endX = (int) (points[1].x + Math.cos(theta - Math.PI) * leadLength);
endY = (int) Math.round(points[1].y + Math.sin(theta - Math.PI) * leadLength);
g2d.drawLine(points[1].x, points[1].y, endX, endY);
if (shouldShadeLeads()) {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness - 2));
leadColor = getLeadColor(componentState);
g2d.setColor(leadColor);
g2d.drawLine(points[0].x, points[0].y, (int) (points[0].x + Math.cos(theta)
* leadLength), (int) (points[0].y + Math.sin(theta) * leadLength));
g2d.drawLine(points[1].x, points[1].y, (int) (points[1].x + Math.cos(theta
- Math.PI)
* leadLength), (int) (points[1].y + Math.sin(theta - Math.PI)
* leadLength));
}
}
}
}
private void drawLead(Graphics2D g2d, ComponentState componentState) {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(getLeadThickness()));
Color leadColor = shouldShadeLeads() ? getLeadColor(componentState).darker()
: getLeadColor(componentState);
g2d.setColor(leadColor);
g2d.drawLine(points[0].x, points[0].y, points[1].x, points[1].y);
if (shouldShadeLeads()) {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(getLeadThickness() - 2));
leadColor = getLeadColor(componentState);
g2d.setColor(leadColor);
g2d.drawLine(points[0].x, points[0].y, points[1].x, points[1].y);
}
}
protected void decorateComponentBody(Graphics2D g2d, boolean outlineMode) {
// Do nothing.
}
protected int calculateLabelYCoordinate(Rectangle2D shapeRect, Rectangle2D textRect,
FontMetrics fontMetrics) {
return (int) (shapeRect.getHeight() - textRect.getHeight()) / 2 + fontMetrics.getAscent();
}
protected boolean shouldShadeLeads() {
return true;
}
protected boolean supportsStandingMode() {
return false;
}
/**
* @return default component length.
*/
protected abstract Size getDefaultLength();
/**
* Returns default component width.
*
* @return
*/
protected abstract Size getDefaultWidth();
/**
* @return shape that represents component body. Shape should not be
* transformed and should be referenced to (0, 0).
*/
protected abstract Shape getBodyShape();
/**
* @return default lead thickness. Override this method to change it.
*/
protected int getLeadThickness() {
return (int) LEAD_THICKNESS.convertToPixels();
}
/**
* @return default lead color. Override this method to change it.
*/
protected Color getLeadColor(ComponentState componentState) {
return componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : LEAD_COLOR;
}
@Override
public int getControlPointCount() {
return points.length;
}
@Override
public Point getControlPoint(int index) {
return (Point) points[index];
}
@Override
public boolean isControlPointSticky(int index) {
return true;
}
@Override
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
return VisibilityPolicy.ALWAYS;
}
@Override
public void setControlPoint(Point point, int index) {
points[index].setLocation(point);
}
@EditableProperty(name = "Color")
public Color getBodyColor() {
return bodyColor;
}
public void setBodyColor(Color bodyColor) {
this.bodyColor = bodyColor;
}
@EditableProperty(name = "Border")
public Color getBorderColor() {
return borderColor;
}
public void setBorderColor(Color borderColor) {
this.borderColor = borderColor;
}
@EditableProperty(name = "Length", defaultable = true)
public Size getLength() {
return length;
}
public void setLength(Size length) {
this.length = length;
}
@EditableProperty(name = "Width", defaultable = true)
public Size getWidth() {
return width;
}
public void setWidth(Size width) {
this.width = width;
}
@EditableProperty
public Display getDisplay() {
return display;
}
public void setDisplay(Display display) {
this.display = display;
}
}
@@ -1,72 +0,0 @@
package org.diylc.components;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.geom.Rectangle2D;
import org.diylc.common.LabelPosition;
import org.diylc.core.ComponentState;
import org.diylc.core.annotations.EditableProperty;
public abstract class AbstractSchematicLeadedSymbol<T> extends AbstractLeadedComponent<T> {
private static final long serialVersionUID = 1L;
public static Color COLOR = Color.blue;
public static Color LEAD_COLOR = Color.black;
protected LabelPosition labelPosition = LabelPosition.ABOVE;
public AbstractSchematicLeadedSymbol() {
super();
// We don't want to fill the body, so use null.
this.bodyColor = null;
this.borderColor = COLOR;
}
@Override
public Color getBodyColor() {
return super.getBodyColor();
}
@Override
protected boolean shouldShadeLeads() {
return false;
}
@Override
protected int getLeadThickness() {
return 1;
}
@Override
protected int calculateLabelYCoordinate(Rectangle2D shapeRect, Rectangle2D textRect,
FontMetrics fontMetrics) {
if (labelPosition == LabelPosition.ABOVE) {
return -1;
} else {
return (int) (shapeRect.getHeight() + textRect.getHeight() - 1);
}
}
@EditableProperty(name = "Label position")
public LabelPosition getLabelPosition() {
return labelPosition;
}
@Override
@EditableProperty(name = "Color")
public Color getBorderColor() {
return super.getBorderColor();
}
public void setLabelPosition(LabelPosition labelPosition) {
this.labelPosition = labelPosition;
}
@Override
protected Color getLeadColor(ComponentState componentState) {
return componentState == ComponentState.SELECTED
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : LEAD_COLOR;
}
}
@@ -1,21 +0,0 @@
package org.diylc.components;
import org.diylc.core.annotations.EditableProperty;
public abstract class AbstractTransparentComponent<T> extends AbstractComponent<T> {
private static final long serialVersionUID = 1L;
public static byte MAX_ALPHA = 127;
protected byte alpha = MAX_ALPHA;
@EditableProperty
public Byte getAlpha() {
return alpha;
}
public void setAlpha(Byte alpha) {
this.alpha = alpha;
}
}
@@ -1,13 +0,0 @@
package org.diylc.core;
/**
* Validator that allows all values.
*
* @author Branislav Stojkovic
*/
public class AllowAllValidator implements IPropertyValidator {
@Override
public void validate(Object value) throws ValidationException {
}
}
@@ -1,11 +0,0 @@
package org.diylc.core;
/**
* Enumerates all possible states that a component can be in.
*
* @author Branislav Stojkovic
*/
public enum ComponentState {
NORMAL, SELECTED, LOCKED, DRAGGING
}
@@ -1,6 +0,0 @@
package org.diylc.core;
public enum CreationMethod {
SINGLE_CLICK, POINT_BY_POINT;
}
@@ -1,122 +0,0 @@
package org.diylc.core;
import java.awt.Graphics2D;
import java.awt.Point;
import java.io.Serializable;
import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty;
/**
* Interface for component instance. Implementation classes of this interface
* will be instantiated by the application when component is added to the
* canvas. <br>
* <br>
* <b>Implementing classes should meet the following: </b>
* <ul>
* <li>Must have an empty constructor.</li>
* <li>Class should be annotated with {@link ComponentDescriptor}.</li>
* <li>Getters for properties editable by users should be annotated with
* {@link EditableProperty}.</li>
* <li>Component configuration should be stored int <code>public static</code>
* fields so they can be set through config file.</li>
* </ul>
*
* @author Branislav Stojkovic
*
* @param <T>
* type of component values, e.g. Resistance for resistors or String
* for transistors.
*/
public interface IDIYComponent<T> extends Serializable {
public static final int CHASSIS = 1;
public static final int BOARD = 2;
public static final int TRACE = 3;
public static final int COMPONENT = 4;
public static final int TEXT = 5;
/**
* @return component instance name.
*/
String getName();
/**
* Updates component instance name.
*
* @param name
*/
void setName(String name);
/**
* @return component value.
*/
T getValue();
/**
* Updates component value.
*
* @param value
*/
void setValue(T value);
/**
* @return number of control points for this component instance. May vary
* between two instances of the same type, e.g. DIL IC with 8 and 16
* pins will have 8 or 16 pins although they are of the same type.
*/
int getControlPointCount();
/**
* @param index
* @return control point at the specified index.
*/
Point getControlPoint(int index);
/**
* Updates the control point at the specified index.
*
* @param point
* @param index
*/
void setControlPoint(Point point, int index);
/**
* @param index
* @return true, if the specified control point may stick to control points
* of other components.
*/
boolean isControlPointSticky(int index);
/**
* @param index
* @return true, if the specified control point may overlap with other
* control points <b>of the same component</b>. The other control
* point must be able to overlap too.
*/
boolean canControlPointOverlap(int index);
VisibilityPolicy getControlPointVisibilityPolicy(int index);
/**
* Draws the component onto the {@link Graphics2D}.
*
* @param g2d
* @param componentState
* @param outlineMode
* @param project
* @param drawingObserver
*/
void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
IDrawingObserver drawingObserver);
/**
* Draws icon representation of the component. This should not depend on
* component state, i.e. it should be treated as a static method.
*
* @param g2d
* @param width
* @param height
*/
void drawIcon(Graphics2D g2d, int width, int height);
}
@@ -1,15 +0,0 @@
package org.diylc.core;
/**
* Interface for tracking component drawing process. Components may use it to
* stop or restart tracking. Anything drawn while tracking is stopped will not
* be added to the mouse hot-spot area.
*
* @author Branislav Stojkovic
*/
public interface IDrawingObserver {
void stopTracking();
void startTracking();
}
@@ -1,16 +0,0 @@
package org.diylc.core;
/**
* Interface for validating property value changes.
*
* @author Branislav Stojkovic
*/
public interface IPropertyValidator {
/**
* @param value
* @throws ValidationException
* if validation fails. Message will contain the reason.
*/
void validate(Object value) throws ValidationException;
}
@@ -1,38 +0,0 @@
package org.diylc.core;
import java.util.List;
import java.util.Set;
import org.diylc.common.PropertyWrapper;
/**
* Base interface for the main GUI component.
*
* @author Branislav Stojkovic
*/
public interface IView {
public static final int ERROR_MESSAGE = 0;
public static final int INFORMATION_MESSAGE = 1;
public static final int WARNING_MESSAGE = 2;
public static final int QUESTION_MESSAGE = 3;
public static final int PLAIN_MESSAGE = -1;
public static final int DEFAULT_OPTION = -1;
public static final int YES_NO_OPTION = 0;
public static final int YES_NO_CANCEL_OPTION = 1;
public static final int OK_CANCEL_OPTION = 2;
public static final int YES_OPTION = 0;
public static final int NO_OPTION = 1;
public static final int CANCEL_OPTION = 2;
public static final int OK_OPTION = 0;
public static final String CHECK_BOX_MENU_ITEM = "org.diylc.checkBoxMenuItem";
public static final String RADIO_BUTTON_GROUP_KEY = "org.diylc.radioButtonGroup";
void showMessage(String message, String title, int messageType);
int showConfirmDialog(String message, String title, int optionType, int messageType);
boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties);
}
@@ -1,225 +0,0 @@
package org.diylc.core;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.annotations.PositiveMeasureValidator;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import com.diyfever.gui.update.VersionNumber;
/**
* Entity class that defines a project. Contains project properties and a
* collection of components.This class is serialized to file. Some filed getters
* are tagged with {@link EditableProperty} to enable for user to edit them.
*
* @author Branislav Stojkovic
*/
public class Project implements Serializable {
private static final long serialVersionUID = 1L;
public static String DEFAULT_TITLE = "New Project";
public static Size DEFAULT_WIDTH = new Size(29d, SizeUnit.cm);
public static Size DEFAULT_HEIGHT = new Size(21d, SizeUnit.cm);
public static Size DEFAULT_GRID_SPACING = new Size(0.1d, SizeUnit.in);
private VersionNumber fileVersion;
private String title;
private String author;
private String description;
private Size width;
private Size height;
private Size gridSpacing;
private List<IDIYComponent<?>> components;
private Set<Set<IDIYComponent<?>>> groups;
private Set<Integer> lockedLayers;
public Project() {
components = new ArrayList<IDIYComponent<?>>();
groups = new HashSet<Set<IDIYComponent<?>>>();
lockedLayers = new HashSet<Integer>();
title = DEFAULT_TITLE;
author = System.getProperty("user.name");
width = DEFAULT_WIDTH;
height = DEFAULT_HEIGHT;
gridSpacing = DEFAULT_GRID_SPACING;
}
@EditableProperty(defaultable = false)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@EditableProperty
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
@EditableProperty(defaultable = false)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@EditableProperty
public Size getWidth() {
return width;
}
public void setWidth(Size width) {
this.width = width;
}
@EditableProperty
public Size getHeight() {
return height;
}
public void setHeight(Size height) {
this.height = height;
}
@EditableProperty(name = "Grid spacing", validatorClass = SpacingValidator.class)
public Size getGridSpacing() {
return gridSpacing;
}
public void setGridSpacing(Size gridSpacing) {
this.gridSpacing = gridSpacing;
}
/**
* List of components sorted by z-order ascending.
*
* @return
*/
public List<IDIYComponent<?>> getComponents() {
return components;
}
/**
* Set of grouped components.
*
* @return
*/
public Set<Set<IDIYComponent<?>>> getGroups() {
return groups;
}
public Set<Integer> getLockedLayers() {
return lockedLayers;
}
public VersionNumber getFileVersion() {
return fileVersion;
}
public void setFileVersion(VersionNumber fileVersion) {
this.fileVersion = fileVersion;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((author == null) ? 0 : author.hashCode());
result = prime * result + ((components == null) ? 0 : components.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((height == null) ? 0 : height.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((width == null) ? 0 : width.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Project other = (Project) obj;
if (author == null) {
if (other.author != null)
return false;
} else if (!author.equals(other.author))
return false;
if (components == null) {
if (other.components != null)
return false;
} else if (!components.equals(other.components))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (height == null) {
if (other.height != null)
return false;
} else if (!height.equals(other.height))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (width == null) {
if (other.width != null)
return false;
} else if (!width.equals(other.width))
return false;
return true;
}
@Override
public String toString() {
return title;
}
public static class SpacingValidator extends PositiveMeasureValidator {
@Override
public void validate(Object value) throws ValidationException {
super.validate(value);
Size size = (Size) value;
if (size.compareTo(new Size(1d, SizeUnit.mm)) < 0) {
throw new ValidationException("must be greater than 1mm");
}
if (size.compareTo(new Size(1d, SizeUnit.in)) > 0) {
throw new ValidationException("must be less than 1in");
}
}
}
// @Override
// public Project clone() throws CloneNotSupportedException {
// List<IDIYComponent> clonedComponents = new
// ArrayList<IDIYComponent>();
// for (IDIYComponent component : components) {
// clonedComponents.add(component.clone());
// }
// Project project = new Project(title, author, description,
// width.clone(), height.clone(), clonedComponents);
// return project;
// }
}
@@ -1,86 +0,0 @@
package org.diylc.core;
import java.awt.Color;
import java.io.Serializable;
public class Theme implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private Color bgColor;
private Color gridColor;
private Color outlineColor;
public Theme(String name, Color bgColor, Color gridColor, Color outlineColor) {
super();
this.name = name;
this.bgColor = bgColor;
this.gridColor = gridColor;
this.outlineColor = outlineColor;
}
public String getName() {
return name;
}
public Color getBgColor() {
return bgColor;
}
public Color getGridColor() {
return gridColor;
}
public Color getOutlineColor() {
return outlineColor;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((bgColor == null) ? 0 : bgColor.hashCode());
result = prime * result + ((gridColor == null) ? 0 : gridColor.hashCode());
result = prime * result + ((outlineColor == null) ? 0 : outlineColor.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Theme other = (Theme) obj;
if (bgColor == null) {
if (other.bgColor != null)
return false;
} else if (!bgColor.equals(other.bgColor))
return false;
if (gridColor == null) {
if (other.gridColor != null)
return false;
} else if (!gridColor.equals(other.gridColor))
return false;
if (outlineColor == null) {
if (other.outlineColor != null)
return false;
} else if (!outlineColor.equals(other.outlineColor))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
@Override
public String toString() {
return name;
}
}
@@ -1,11 +0,0 @@
package org.diylc.core;
public class ValidationException extends Exception {
private static final long serialVersionUID = 1L;
public ValidationException(String message) {
super(message);
}
}
@@ -1,22 +0,0 @@
package org.diylc.core;
/**
* Enumerates control point visibility policies.
*
* @author Branislav Stojkovic
*/
public enum VisibilityPolicy {
/**
* Control point should be rendered all the time.
*/
ALWAYS,
/**
* Control point should be rendered only when the component is selected.
*/
WHEN_SELECTED,
/**
* Control point should not be rendered regardless of component selection.
*/
NEVER;
}
@@ -1,62 +0,0 @@
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
/**
* Annotation for {@link IDIYComponent} implementation. Describes component
* properties.
*
* @author Branislav Stojkovic
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface ComponentDescriptor {
/**
* @return component type name.
*/
String name();
/**
* @return component type description.
*/
String description();
/**
* @return method that should be used to create a component. If
* <code>CreationMethod.POINT_BY_POINT</code> is used, user will
* have to select ending points before the component is created.
*/
CreationMethod creationMethod() default CreationMethod.SINGLE_CLICK;
/**
* @return component category, e.g. "Passive", "Semiconductors", etc.
*/
String category();
/**
* @return component author name.
*/
String author();
/**
* @return prefix that will be used to generate component instance names,
* e.g. "R" for resistors or "Q" for transistors.
*/
String instanceNamePrefix();
/**
* @return Z-order of the component.
*/
double zOrder();
/**
* @return when false, moving one control point will cause all the others to
* move together with it.
*/
boolean stretchable() default true;
}
@@ -1,42 +0,0 @@
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.diylc.core.AllowAllValidator;
import org.diylc.core.IPropertyValidator;
/**
* Used to annotate editable component property. Editable property XYZ must have
* both getter and setter named <code>getXYZ</code> and <code>setXYZ</code>
* respectively and this annotation must be placed on the getter method.
*
* @author Branislav Stojkovic
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface EditableProperty {
/**
* Returns property name. If left blank property name will be extracted from
* the getter name, e.g. getter <code>getXYZ</code> will induce property
* name <code>XYZ</code>. <br>
* Default value is blank.
*
* @return
*/
String name() default "";
/**
* If true, application may set default value for this property. <br>
* Default value is true.
*
* @return
*/
boolean defaultable() default true;
/**
* Class of validator to use to
* @return
*/
Class<? extends IPropertyValidator> validatorClass() default AllowAllValidator.class;
}
@@ -1,20 +0,0 @@
package org.diylc.core.annotations;
import org.diylc.core.IPropertyValidator;
import org.diylc.core.ValidationException;
import org.diylc.core.measures.AbstractMeasure;
public class PositiveMeasureValidator implements IPropertyValidator {
@Override
public void validate(Object value) throws ValidationException {
if (value instanceof AbstractMeasure) {
AbstractMeasure measure = (AbstractMeasure) value;
if (measure.getValue() < 0) {
throw new ValidationException("must be greater than zero.");
}
} else {
throw new ValidationException("wrong data type, measure expected.");
}
}
}
@@ -1,81 +0,0 @@
package org.diylc.core.measures;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.Format;
public class AbstractMeasure<T extends Enum<? extends Unit>> implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
protected static final Format format = new DecimalFormat("0.####");
protected Double value;
protected T unit;
public AbstractMeasure() {
}
public AbstractMeasure(Double value, T unit) {
super();
this.value = value;
this.unit = unit;
}
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
public T getUnit() {
return unit;
}
public void setUnit(T multiplier) {
this.unit = multiplier;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((unit == null) ? 0 : unit.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AbstractMeasure<?> other = (AbstractMeasure<?>) obj;
if (unit == null) {
if (other.unit != null)
return false;
} else if (!unit.equals(other.unit))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
@Override
public String toString() {
return format.format(value) + " " + unit;
}
}
@@ -1,31 +0,0 @@
package org.diylc.core.measures;
public class Capacitance extends AbstractMeasure<CapacitanceUnit> {
private static final long serialVersionUID = 1L;
public Capacitance() {
super();
// TODO Auto-generated constructor stub
}
public Capacitance(Double value, CapacitanceUnit unit) {
super(value, unit);
// TODO Auto-generated constructor stub
}
@Override
public Capacitance clone() throws CloneNotSupportedException {
return new Capacitance(value, unit);
}
public static Capacitance parseCapacitance(String value) {
for (CapacitanceUnit unit : CapacitanceUnit.values()) {
if (value.toLowerCase().endsWith(unit.toString().toLowerCase())) {
value = value.substring(0, value.length() - unit.toString().length() - 1).trim();
return new Capacitance(Double.parseDouble(value), unit);
}
}
throw new IllegalArgumentException("Could not parse capacitance: " + value);
}
}
@@ -1,24 +0,0 @@
package org.diylc.core.measures;
public enum CapacitanceUnit implements Unit {
pF(1, "pF"), nF(1e3, "nF"), uF(1e6, "uF"), mF(1e9, "mF"), F(1e12, "F");
double factor;
String display;
private CapacitanceUnit(double factor, String display) {
this.factor = factor;
this.display = display;
}
@Override
public double getFactor() {
return factor;
}
@Override
public String toString() {
return display;
}
}
@@ -1,31 +0,0 @@
package org.diylc.core.measures;
public class Inductance extends AbstractMeasure<InductanceUnit> {
private static final long serialVersionUID = 1L;
public Inductance() {
super();
// TODO Auto-generated constructor stub
}
public Inductance(Double value, InductanceUnit unit) {
super(value, unit);
// TODO Auto-generated constructor stub
}
@Override
public Inductance clone() throws CloneNotSupportedException {
return new Inductance(value, unit);
}
public static Inductance parseCapacitance(String value) {
for (InductanceUnit unit : InductanceUnit.values()) {
if (value.toLowerCase().endsWith(unit.toString().toLowerCase())) {
value = value.substring(0, value.length() - unit.toString().length() - 1).trim();
return new Inductance(Double.parseDouble(value), unit);
}
}
throw new IllegalArgumentException("Could not parse inductance: " + value);
}
}
@@ -1,24 +0,0 @@
package org.diylc.core.measures;
public enum InductanceUnit implements Unit {
pH(1, "pH"), nH(1e3, "nH"), uH(1e6, "\u03bcH"), mH(1e9, "mH"), H(1e12, "H");
double factor;
String display;
private InductanceUnit(double factor, String display) {
this.factor = factor;
this.display = display;
}
@Override
public double getFactor() {
return factor;
}
@Override
public String toString() {
return display;
}
}
@@ -1,78 +0,0 @@
package org.diylc.core.measures;
import java.awt.Color;
import org.diylc.common.ResistorColorCode;
public class Resistance extends AbstractMeasure<ResistanceUnit> {
private static final long serialVersionUID = 1L;
private static final Color[] COLOR_DIGITS = new Color[] { Color.black, Color.decode("#8B4513"),
Color.red, Color.orange, Color.yellow, Color.decode("#76EE00"), Color.blue,
Color.decode("#91219E"), Color.lightGray, Color.white };
private static final Color[] COLOR_MULTIPLIER = new Color[] { Color.lightGray.brighter(),
Color.decode("#FFB90F"), Color.black, Color.decode("#8B4513"), Color.red, Color.orange,
Color.yellow, Color.decode("#76EE00"), Color.blue };
public Resistance() {
super();
// TODO Auto-generated constructor stub
}
public Resistance(Double value, ResistanceUnit multiplier) {
super(value, multiplier);
// TODO Auto-generated constructor stub
}
@Override
public Resistance clone() throws CloneNotSupportedException {
return new Resistance(value, unit);
}
public Color[] getColorCode(ResistorColorCode resistorColorCode) {
Color[] bands;
double base = getValue() * getUnit().getFactor();
int multiplier = 0;
while (base > (resistorColorCode == ResistorColorCode._4_BAND ? 99 : 999)) {
multiplier += 1;
base /= 10;
}
while (base < (resistorColorCode == ResistorColorCode._4_BAND ? 10 : 100)) {
multiplier -= 1;
base *= 10;
}
if (multiplier > 6 || multiplier < -2) {
// Out of range.
return new Color[] {};
}
switch (resistorColorCode) {
case _4_BAND:
bands = new Color[3];
bands[0] = COLOR_DIGITS[(int) (base / 10)];
bands[1] = COLOR_DIGITS[(int) (base % 10)];
bands[2] = COLOR_MULTIPLIER[multiplier + 2];
break;
case _5_BAND:
bands = new Color[4];
bands[0] = COLOR_DIGITS[(int) (base / 100)];
bands[1] = COLOR_DIGITS[(int) (base / 10 % 10)];
bands[2] = COLOR_DIGITS[(int) (base % 10)];
bands[3] = COLOR_MULTIPLIER[multiplier + 2];
break;
default:
bands = new Color[] {};
}
return bands;
}
public static Resistance parseResistance(String value) {
for (ResistanceUnit unit : ResistanceUnit.values()) {
if (value.toLowerCase().endsWith(unit.toString().toLowerCase())) {
value = value.substring(0, value.length() - unit.toString().length() - 1).trim();
return new Resistance(Double.parseDouble(value), unit);
}
}
throw new IllegalArgumentException("Could not parse resistance: " + value);
}
}
@@ -1,24 +0,0 @@
package org.diylc.core.measures;
public enum ResistanceUnit implements Unit {
R(1, "\u03a9"), K(1e3, "K"), M(1e6, "M");
double factor;
String display;
private ResistanceUnit(double factor, String display) {
this.factor = factor;
this.display = display;
}
@Override
public double getFactor() {
return factor;
}
@Override
public String toString() {
return display;
}
}
@@ -1,47 +0,0 @@
package org.diylc.core.measures;
import org.diylc.utils.Constants;
public class Size extends AbstractMeasure<SizeUnit> implements Comparable<Size> {
private static final long serialVersionUID = 1L;
public Size() {
super();
// TODO Auto-generated constructor stub
}
public Size(Double value, SizeUnit unit) {
super(value, unit);
// TODO Auto-generated constructor stub
}
public double convertToPixels() {
// double factor = getUnit().getFactor() / SizeUnit.in.getFactor();
// int grids = (int) (factor * getValue() * Constants.GRIDS_PER_INCH);
// double remainder = (factor * getValue() * Constants.GRIDS_PER_INCH) - grids;
// return (int) Math.round(Constants.PIXELS_PER_INCH / Constants.GRIDS_PER_INCH
// * (grids + remainder));
return getValue() * getUnit().getFactor() / SizeUnit.in.getFactor() * Constants.PIXELS_PER_INCH;
}
@Override
public Size clone() throws CloneNotSupportedException {
return new Size(value, unit);
}
public static Size parseSize(String value) {
for (SizeUnit unit : SizeUnit.values()) {
if (value.toLowerCase().endsWith(unit.toString().toLowerCase())) {
value = value.substring(0, value.length() - unit.toString().length() - 1).trim();
return new Size(Double.parseDouble(value), unit);
}
}
throw new IllegalArgumentException("Could not parse size: " + value);
}
@Override
public int compareTo(Size o) {
return new Double(value * unit.getFactor()).compareTo(o.getValue() * o.getUnit().getFactor());
}
}
@@ -1,17 +0,0 @@
package org.diylc.core.measures;
public enum SizeUnit implements Unit {
mm(1d), cm(10d), m(1e4d), in(25.4d), ft(25.4d * 12), yd(9144d);
double factor;
private SizeUnit(double factor) {
this.factor = factor;
}
@Override
public double getFactor() {
return factor;
}
}
@@ -1,6 +0,0 @@
package org.diylc.core.measures;
public interface Unit {
double getFactor();
}
@@ -1,61 +0,0 @@
package org.diylc.images;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
* Loads image resources as Icons.
*
* @author Branislav Stojkovic
*/
public enum IconLoader {
Delete("delete.png"), Add("add.png"), FolderOut("folder_out.png"), Garbage("garbage.png"), DiskBlue(
"disk_blue.png"), SaveAs("save_as.png"), Exit("exit.png"), DocumentPlainYellow(
"document_plain_yellow.png"), PhotoScenery("photo_scenery.png"), LightBulbOn(
"lightbulb_on.png"), LightBulbOff("lightbulb_off.png"), NotebookAdd("notebook_add.png"), FormGreen(
"form_green.png"), Gears("gears.png"), About("about.png"), WindowColors(
"window_colors.png"), WindowGear("window_gear.png"), NavigateCheck("navigate_check.png"), Undo(
"undo.png"), Error("error.png"), Warning("warning.png"), ZoomSmall("zoom_small.png"), MoveSmall(
"move_small.png"), Print("print.png"), PDF("pdf.png"), Excel("excel.png"), CSV(
"csv.png"), HTML("html.png"), Image("image.png"), Cut("cut.png"), Copy("copy.png"), Paste(
"paste.png"), Selection("selection.png"), BOM("bom.png"), BlackBoard("blackboard.png"), IdCard(
"id_card.png"), IdCardAdd("id_card_add.png"), Chest("chest.png"), Upload("upload.png"), Wrench(
"wrench.png"), Group("group.png"), Ungroup("ungroup.png"), TraceMask("trace_mask.png"), Faq(
"faq.png"), Component("component.png"), Plugin("plugin.png"), Manual("manual.png"), Donate(
"donate.png"), Bug("bug.png"), IconLarge("icon_large.png"), IconMedium(
"icon_medium.png"), IconSmall("icon_small.png"), DocumentEdit("document_edit.png"), EditComponent(
"edit_component.png"), Size("size.png"), Front("front.png"), Back("back.png"), Pens(
"pens.png"), Sort("sort.png");
protected String name;
private IconLoader(String name) {
this.name = name;
}
public Icon getIcon() {
java.net.URL imgURL = getClass().getResource(name);
if (imgURL != null) {
return new ImageIcon(imgURL, name);
} else {
System.err.println("Couldn't find file: " + name);
return null;
}
}
public Image getImage() {
BufferedImage img = null;
try {
img = ImageIO.read(getClass().getResourceAsStream(name));
} catch (IOException e) {
System.err.println("Couldn't find file: " + name);
}
return img;
}
}
@@ -1,9 +0,0 @@
log4j.rootLogger = DEBUG, fileout, stdout
log4j.appender.fileout = com.diyfever.gui.miscutils.NewLogForEachRunFileAppender
log4j.appender.fileout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
log4j.appender.fileout.layout = org.apache.log4j.PatternLayout
log4j.appender.fileout.File = log/log.log
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
@@ -1,25 +0,0 @@
package org.diylc.presenter;
import java.awt.Point;
import org.diylc.core.measures.Size;
public class CalcUtils {
/**
* Rounds the number to the closest grid line.
*
* @param x
* @return
*/
public static int roundToGrid(int x, Size gridSpacing) {
double grid = gridSpacing.convertToPixels();
return (int) (Math.round(1f * x / grid) * grid);
}
public static void snapPointToGrid(Point point, Size gridSpacing) {
int x = roundToGrid(point.x, gridSpacing);
int y = roundToGrid(point.y, gridSpacing);
point.setLocation(x, y);
}
}
@@ -1,88 +0,0 @@
package org.diylc.presenter;
import java.util.Comparator;
import org.diylc.common.ComponentType;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IDIYComponent;
public class ComparatorFactory {
private static ComparatorFactory instance;
private Comparator<IDIYComponent<?>> componentNameComparator;
private Comparator<ComponentType> componentTypeComparator;
private Comparator<PropertyWrapper> propertyNameComparator;
private Comparator<IDIYComponent<?>> componentZOrderComparator;
public static ComparatorFactory getInstance() {
if (instance == null) {
instance = new ComparatorFactory();
}
return instance;
}
public Comparator<IDIYComponent<?>> getComponentNameComparator() {
if (componentNameComparator == null) {
componentNameComparator = new Comparator<IDIYComponent<?>>() {
@Override
public int compare(IDIYComponent<?> o1, IDIYComponent<?> o2) {
String name1 = o1.getName();
String name2 = o2.getName();
if (name1 == null || name2 == null) {
return 0;
}
return name1.compareToIgnoreCase(name2);
}
};
}
return componentNameComparator;
}
public Comparator<ComponentType> getComponentTypeComparator() {
if (componentTypeComparator == null) {
componentTypeComparator = new Comparator<ComponentType>() {
@Override
public int compare(ComponentType o1, ComponentType o2) {
return o1.getName().compareToIgnoreCase(o2.getName());
}
};
}
return componentTypeComparator;
}
public Comparator<PropertyWrapper> getPropertyNameComparator() {
if (propertyNameComparator == null) {
propertyNameComparator = new Comparator<PropertyWrapper>() {
@Override
public int compare(PropertyWrapper o1, PropertyWrapper o2) {
return o1.getName().compareToIgnoreCase(o2.getName());
}
};
}
return propertyNameComparator;
}
public Comparator<IDIYComponent<?>> getComponentZOrderComparator() {
if (componentZOrderComparator == null) {
componentZOrderComparator = new Comparator<IDIYComponent<?>>() {
@Override
public int compare(IDIYComponent<?> o1, IDIYComponent<?> o2) {
ComponentType type1 = ComponentProcessor.getInstance()
.extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) o1.getClass());
ComponentType type2 = ComponentProcessor.getInstance()
.extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) o2.getClass());
return new Double(type1.getZOrder()).compareTo(type2.getZOrder());
}
};
}
return componentZOrderComparator;
}
}
@@ -1,225 +0,0 @@
package org.diylc.presenter;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.apache.log4j.Logger;
import org.diylc.common.ComponentType;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
import org.diylc.core.IPropertyValidator;
import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty;
import com.rits.cloning.Cloner;
/**
* Utility class with component processing methods.
*
* @author Branislav Stojkovic
*/
public class ComponentProcessor {
private static final Logger LOG = Logger.getLogger(ComponentProcessor.class);
private static ComponentProcessor instance;
private Map<String, List<PropertyWrapper>> propertyCache;
private Map<String, IPropertyValidator> propertyValidatorCache;
private Map<String, ComponentType> componentTypeMap;
private Cloner cloner;
public static ComponentProcessor getInstance() {
if (instance == null) {
instance = new ComponentProcessor();
}
return instance;
}
private ComponentProcessor() {
super();
this.cloner = new Cloner();
this.propertyCache = new HashMap<String, List<PropertyWrapper>>();
this.componentTypeMap = new HashMap<String, ComponentType>();
this.propertyValidatorCache = new HashMap<String, IPropertyValidator>();
}
public ComponentType extractComponentTypeFrom(Class<? extends IDIYComponent<?>> clazz) {
if (componentTypeMap.containsKey(clazz.getName())) {
return componentTypeMap.get(clazz.getName());
}
String name;
String description;
CreationMethod creationMethod;
String category;
String namePrefix;
String author;
Icon icon;
double zOrder;
boolean stretchable;
if (clazz.isAnnotationPresent(ComponentDescriptor.class)) {
ComponentDescriptor annotation = clazz.getAnnotation(ComponentDescriptor.class);
name = annotation.name();
description = annotation.description();
creationMethod = annotation.creationMethod();
category = annotation.category();
namePrefix = annotation.instanceNamePrefix();
author = annotation.author();
zOrder = annotation.zOrder();
stretchable = annotation.stretchable();
} else {
name = clazz.getSimpleName();
description = "";
creationMethod = CreationMethod.SINGLE_CLICK;
category = "Uncategorized";
namePrefix = "Unknown";
author = "Unknown";
zOrder = IDIYComponent.COMPONENT;
stretchable = true;
}
icon = null;
// Draw component icon.
try {
IDIYComponent<?> componentInstance = (IDIYComponent<?>) clazz.newInstance();
Image image = new BufferedImage(Presenter.ICON_SIZE, Presenter.ICON_SIZE,
java.awt.image.BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = (Graphics2D) image.getGraphics();
g2d
.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
componentInstance.drawIcon(g2d, Presenter.ICON_SIZE, Presenter.ICON_SIZE);
icon = new ImageIcon(image);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
ComponentType componentType = new ComponentType(name, description, creationMethod,
category, namePrefix, author, icon, clazz, zOrder, stretchable);
componentTypeMap.put(clazz.getName(), componentType);
return componentType;
}
/**
* Extracts all editable properties from the component class.
*
* @param clazz
* @return
*/
public List<PropertyWrapper> extractProperties(Class<?> clazz) {
if (propertyCache.containsKey(clazz.getName())) {
return cloner.deepClone(propertyCache.get(clazz.getName()));
}
List<PropertyWrapper> properties = new ArrayList<PropertyWrapper>();
for (Method method : clazz.getMethods()) {
if (method.getName().startsWith("get")) {
try {
if (method.isAnnotationPresent(EditableProperty.class)
&& !method.isAnnotationPresent(Deprecated.class)) {
EditableProperty annotation = method.getAnnotation(EditableProperty.class);
String name;
if (annotation.name().equals("")) {
name = method.getName().substring(3);
} else {
name = annotation.name();
}
IPropertyValidator validator = getPropertyValidator(annotation
.validatorClass());
Method setter = clazz.getMethod("set" + method.getName().substring(3),
method.getReturnType());
PropertyWrapper property = new PropertyWrapper(name,
method.getReturnType(), method.getName(), setter.getName(),
annotation.defaultable(), validator);
properties.add(property);
}
} catch (NoSuchMethodException e) {
LOG.debug("No matching setter found for \"" + method.getName()
+ "\". Skipping...");
}
}
}
propertyCache.put(clazz.getName(), properties);
return cloner.deepClone(properties);
}
/**
* Returns properties that have the same value for all the selected
* components.
*
* @param selectedComponents
* @return
*/
public List<PropertyWrapper> getMutualSelectionProperties(
List<IDIYComponent<?>> selectedComponents) throws Exception {
if (selectedComponents.isEmpty()) {
return null;
}
List<PropertyWrapper> properties = new ArrayList<PropertyWrapper>();
IDIYComponent<?> firstComponent = selectedComponents.get(0);
properties.addAll(extractProperties(firstComponent.getClass()));
// Initialize values
for (PropertyWrapper property : properties) {
property.readFrom(firstComponent);
}
for (int i = 1; i < selectedComponents.size(); i++) {
IDIYComponent<?> component = selectedComponents.get(i);
List<PropertyWrapper> newProperties = extractProperties(component.getClass());
for (PropertyWrapper property : newProperties) {
property.readFrom(component);
}
properties.retainAll(newProperties);
// Try to find matching properties in old and new lists and see if
// their values match.
for (PropertyWrapper oldProperty : properties) {
if (newProperties.contains(oldProperty)) {
PropertyWrapper newProperty = newProperties.get(newProperties
.indexOf(oldProperty));
if ((newProperty.getValue() != null && newProperty.getValue() == null)
|| !newProperty.getValue().equals(oldProperty.getValue())) {
// Values don't match, so the property is not unique valued.
oldProperty.setUnique(false);
}
}
}
// for (PropertyWrapper property : properties) {
// try {
// property.readUniqueFrom(component);
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
}
Collections.sort(properties, ComparatorFactory.getInstance().getPropertyNameComparator());
return properties;
}
private IPropertyValidator getPropertyValidator(Class<? extends IPropertyValidator> clazz) {
if (propertyValidatorCache.containsKey(clazz.getName())) {
return propertyValidatorCache.get(clazz.getName());
}
IPropertyValidator validator;
try {
validator = clazz.newInstance();
} catch (Exception e) {
LOG.error("Could not instantiate validator for " + clazz.getName(), e);
return null;
}
propertyValidatorCache.put(clazz.getName(), validator);
return validator;
}
}
@@ -1,23 +0,0 @@
package org.diylc.presenter;
import org.diylc.common.ComponentType;
import org.diylc.common.IComponentFiler;
import org.diylc.core.IDIYComponent;
public class ComponentZOrderFiler implements IComponentFiler {
private int zOrder;
public ComponentZOrderFiler(int zOrder) {
super();
this.zOrder = zOrder;
}
@SuppressWarnings("unchecked")
@Override
public boolean testComponent(IDIYComponent<?> component) {
ComponentType componentType = ComponentProcessor.getInstance().extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) component.getClass());
return Math.round(componentType.getZOrder()) == zOrder;
}
}
@@ -1,396 +0,0 @@
package org.diylc.presenter;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.Area;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.diylc.common.DrawOption;
import org.diylc.common.EventType;
import org.diylc.common.GridType;
import org.diylc.common.IComponentFiler;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
import org.diylc.core.ComponentState;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.Theme;
import org.diylc.core.VisibilityPolicy;
import org.diylc.utils.Constants;
import com.diyfever.gui.miscutils.ConfigurationManager;
import com.diyfever.gui.simplemq.MessageDispatcher;
/**
* Utility that deals with painting {@link Project} on the {@link Graphics2D}
* and keeps areas taken by each drawn component.
*
* @author Branislav Stojkovic
*/
public class DrawingManager {
private static final Logger LOG = Logger.getLogger(DrawingManager.class);
public static int CONTROL_POINT_SIZE = 7;
public static final String ZOOM_KEY = "zoom";
public static String DEBUG_COMPONENT_AREAS = "org.diylc.debugComponentAreas";
public static Color CONTROL_POINT_COLOR = Color.blue;
public static Color SELECTED_CONTROL_POINT_COLOR = Color.green;
private Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
// Keeps Area object of each drawn component.
private Map<IDIYComponent<?>, Area> componentAreaMap;
// Maps components to the last state they are drawn in. Also, used to
// determine which components are invalidated when they are not in the map.
private Map<IDIYComponent<?>, ComponentState> lastDrawnStateMap;
private Composite slotComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f);
private Composite lockedComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f);
private List<IDIYComponent<?>> failedComponents = new ArrayList<IDIYComponent<?>>();
private double zoomLevel = 1d;// ConfigurationManager.getInstance().readDouble(ZOOM_KEY,
// 1d);
private MessageDispatcher<EventType> messageDispatcher;
private boolean debugComponentAreas;
public DrawingManager(MessageDispatcher<EventType> messageDispatcher) {
super();
this.messageDispatcher = messageDispatcher;
componentAreaMap = new HashMap<IDIYComponent<?>, Area>();
lastDrawnStateMap = new HashMap<IDIYComponent<?>, ComponentState>();
String debugComponentAreasStr = System.getProperty(DEBUG_COMPONENT_AREAS);
debugComponentAreas = debugComponentAreasStr != null
&& debugComponentAreasStr.equalsIgnoreCase("true");
}
/**
* Paints the project onto the canvas and returns the list of components
* that failed to draw.
*
* @param g2d
* @param project
* @param drawOptions
* @param filter
* @param selectionRect
* @param selectedComponents
* @param lockedComponents
* @param groupedComponents
* @param controlPointSlot
* @param componentSlot
* @param dragInProgress
* @return
*/
public List<IDIYComponent<?>> drawProject(Graphics2D g2d, Project project,
Set<DrawOption> drawOptions, IComponentFiler filter, Rectangle selectionRect,
List<IDIYComponent<?>> selectedComponents, Set<IDIYComponent<?>> lockedComponents,
Set<IDIYComponent<?>> groupedComponents, List<Point> controlPointSlot,
IDIYComponent<?> componentSlot, boolean dragInProgress) {
failedComponents.clear();
if (project == null) {
return failedComponents;
}
G2DWrapper g2dWrapper = new G2DWrapper(g2d);
if (drawOptions.contains(DrawOption.ANTIALIASING)) {
g2d
.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
} else {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
if (ConfigurationManager.getInstance()
.readBoolean(IPlugInPort.HI_QUALITY_RENDER_KEY, false)) {
g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
} else {
g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_SPEED);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
}
double zoom = 1d;
if (drawOptions.contains(DrawOption.ZOOM)) {
zoom = zoomLevel;
} else {
zoom = 1 / Constants.PIXEL_SIZE;
}
// AffineTransform initialTx = g2d.getTransform();
Dimension d = getCanvasDimensions(project, zoom, true);
g2dWrapper.setColor(theme.getBgColor());
g2dWrapper.fillRect(0, 0, d.width, d.height);
g2d.clip(new Rectangle(new Point(0, 0), d));
GridType gridType = GridType.LINES;
if (drawOptions.contains(DrawOption.GRID) && gridType != GridType.NONE) {
double zoomStep = project.getGridSpacing().convertToPixels() * zoom;
if (gridType == GridType.CROSSHAIR) {
g2d.setStroke(new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,
10f, new float[] { (float) zoomStep / 2, (float) zoomStep / 2 },
(float) zoomStep / 4));
} else if (gridType == GridType.DOT) {
g2d.setStroke(new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,
10f, new float[] { 1f, (float) zoomStep - 1 }, 0f));
}
g2dWrapper.setColor(theme.getGridColor());
for (double i = zoomStep; i < d.width; i += zoomStep) {
g2dWrapper.drawLine((int) i, 0, (int) i, d.height - 1);
}
for (double j = zoomStep; j < d.height; j += zoomStep) {
g2dWrapper.drawLine(0, (int) j, d.width - 1, (int) j);
}
}
if (Math.abs(1.0 - zoom) > 1e-4) {
g2dWrapper.scale(zoom, zoom);
}
// Composite mainComposite = g2d.getComposite();
// Composite alphaComposite =
// AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);
// g2dWrapper.resetTx();
// componentAreaMap.clear();
for (IDIYComponent<?> component : project.getComponents()) {
// Do not draw the component if it's filtered out.
if (filter != null && !filter.testComponent(component)) {
continue;
}
ComponentState state = ComponentState.NORMAL;
if (drawOptions.contains(DrawOption.SELECTION)
&& selectedComponents.contains(component)) {
if (dragInProgress) {
state = ComponentState.DRAGGING;
} else {
state = ComponentState.SELECTED;
}
}
// Do not track the area if component is not invalidated and was
// drawn in the same state.
boolean trackArea = lastDrawnStateMap.get(component) != state;
g2dWrapper.startedDrawingComponent();
if (!trackArea) {
g2dWrapper.stopTracking();
}
// Draw locked components in a new composite.
if (lockedComponents.contains(component)) {
g2d.setComposite(lockedComposite);
}
// Draw the component through the g2dWrapper.
try {
component.draw(g2dWrapper, state, drawOptions.contains(DrawOption.OUTLINE_MODE),
project, g2dWrapper);
} catch (Exception e) {
LOG.error("Error drawing " + component.getName(), e);
failedComponents.add(component);
}
Area area = g2dWrapper.finishedDrawingComponent();
if (trackArea && area != null && !area.isEmpty()) {
componentAreaMap.put(component, area);
lastDrawnStateMap.put(component, state);
}
}
// Draw control points.
if (drawOptions.contains(DrawOption.CONTROL_POINTS)) {
// Draw unselected points first to make sure they are below.
if (dragInProgress || drawOptions.contains(DrawOption.OUTLINE_MODE)) {
for (IDIYComponent<?> component : project.getComponents()) {
for (int i = 0; i < component.getControlPointCount(); i++) {
VisibilityPolicy visibilityPolicy = component
.getControlPointVisibilityPolicy(i);
if ((groupedComponents.contains(component)
&& (visibilityPolicy == VisibilityPolicy.ALWAYS || (selectedComponents
.contains(component) && visibilityPolicy == VisibilityPolicy.WHEN_SELECTED)) || (!groupedComponents
.contains(component)
&& !selectedComponents.contains(component) && component
.getControlPointVisibilityPolicy(i) == VisibilityPolicy.ALWAYS))) {
g2dWrapper.setColor(CONTROL_POINT_COLOR);
Point controlPoint = component.getControlPoint(i);
int pointSize = CONTROL_POINT_SIZE - 2;
g2dWrapper.fillOval(controlPoint.x - pointSize / 2, controlPoint.y
- pointSize / 2, pointSize, pointSize);
}
}
}
}
// Then draw the selected ones.
for (IDIYComponent<?> component : selectedComponents) {
for (int i = 0; i < component.getControlPointCount(); i++) {
if (!groupedComponents.contains(component)
&& (component.getControlPointVisibilityPolicy(i) == VisibilityPolicy.WHEN_SELECTED || component
.getControlPointVisibilityPolicy(i) == VisibilityPolicy.ALWAYS)) {
Point controlPoint = component.getControlPoint(i);
int pointSize = CONTROL_POINT_SIZE;
g2dWrapper.setColor(SELECTED_CONTROL_POINT_COLOR.darker());
g2dWrapper.fillOval(controlPoint.x - pointSize / 2, controlPoint.y
- pointSize / 2, pointSize, pointSize);
g2dWrapper.setColor(SELECTED_CONTROL_POINT_COLOR);
g2dWrapper.fillOval(controlPoint.x - CONTROL_POINT_SIZE / 2 + 1,
controlPoint.y - CONTROL_POINT_SIZE / 2 + 1,
CONTROL_POINT_SIZE - 2, CONTROL_POINT_SIZE - 2);
}
}
}
}
// Draw component slot in a separate composite.
if (componentSlot != null) {
g2dWrapper.startedDrawingComponent();
g2dWrapper.setComposite(slotComposite);
try {
componentSlot.draw(g2dWrapper, ComponentState.NORMAL, drawOptions
.contains(DrawOption.OUTLINE_MODE), project, g2dWrapper);
} catch (Exception e) {
LOG.error("Error drawing " + componentSlot.getName(), e);
failedComponents.add(componentSlot);
}
g2dWrapper.finishedDrawingComponent();
}
// Draw control points of the component in the slot.
if (controlPointSlot != null) {
for (Point point : controlPointSlot) {
if (point != null) {
g2dWrapper.setColor(SELECTED_CONTROL_POINT_COLOR.darker());
g2dWrapper.fillOval(point.x - CONTROL_POINT_SIZE / 2, point.y
- CONTROL_POINT_SIZE / 2, CONTROL_POINT_SIZE, CONTROL_POINT_SIZE);
g2dWrapper.setColor(SELECTED_CONTROL_POINT_COLOR);
g2dWrapper.fillOval(point.x - CONTROL_POINT_SIZE / 2 + 1, point.y
- CONTROL_POINT_SIZE / 2 + 1, CONTROL_POINT_SIZE - 2,
CONTROL_POINT_SIZE - 2);
}
}
}
// Go back to the original transformation and zoom in to draw the
// selection rectangle and other similar elements.
// g2d.setTransform(initialTx);
// if ((drawOptions.contains(DrawOption.ZOOM)) && (Math.abs(1.0 -
// zoomLevel) > 1e-4)) {
// g2d.scale(zoomLevel, zoomLevel);
// }
// At the end draw selection rectangle if needed.
if (drawOptions.contains(DrawOption.SELECTION) && (selectionRect != null)) {
g2d.setColor(Color.white);
g2d.draw(selectionRect);
g2d.setColor(Color.black);
g2d.setStroke(Constants.DASHED_STROKE);
g2d.draw(selectionRect);
}
// Draw component area for test
if (debugComponentAreas) {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.setColor(Color.red);
for (Area area : componentAreaMap.values()) {
g2d.draw(area);
}
}
return failedComponents;
}
public double getZoomLevel() {
return zoomLevel;
}
public void setZoomLevel(double zoomLevel) {
this.zoomLevel = zoomLevel;
fireZoomChanged();
// ConfigurationManager.getInstance().writeValue(ZOOM_KEY, zoomLevel);
}
public void invalidateComponent(IDIYComponent<?> component) {
componentAreaMap.remove(component);
lastDrawnStateMap.remove(component);
}
public Area getComponentArea(IDIYComponent<?> component) {
return componentAreaMap.get(component);
}
public void clearComponentAreaMap() {
componentAreaMap.clear();
}
public List<IDIYComponent<?>> findComponentsAt(Point point, Project project) {
List<IDIYComponent<?>> components = new ArrayList<IDIYComponent<?>>();
for (int i = 0; i < project.getComponents().size(); i++) {
Area area = componentAreaMap.get(project.getComponents().get(i));
if (area != null && area.contains(point)) {
components.add(project.getComponents().get(i));
}
}
return components;
}
public Dimension getCanvasDimensions(Project project, Double zoomLevel, boolean useZoom) {
double width = project.getWidth().convertToPixels();
double height = project.getHeight().convertToPixels();
if (useZoom) {
width *= zoomLevel;
height *= zoomLevel;
} else {
width /= Constants.PIXEL_SIZE;
height /= Constants.PIXEL_SIZE;
}
return new Dimension((int) width, (int) height);
}
public void fireZoomChanged() {
messageDispatcher.dispatchMessage(EventType.ZOOM_CHANGED, zoomLevel);
messageDispatcher.dispatchMessage(EventType.REPAINT);
}
public Theme getTheme() {
return theme;
}
public void setTheme(Theme theme) {
this.theme = theme;
ConfigurationManager.getInstance().writeValue(IPlugInPort.THEME_KEY, theme);
messageDispatcher.dispatchMessage(EventType.REPAINT);
}
}
@@ -1,673 +0,0 @@
package org.diylc.presenter;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Paint;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.RenderingHints.Key;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
import java.awt.geom.Arc2D;
import java.awt.geom.Area;
import java.awt.geom.CubicCurve2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.QuadCurve2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
import java.awt.image.ImageObserver;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
import java.util.Map;
import org.diylc.core.IDrawingObserver;
/**
* {@link Graphics2D} wrapper that keeps track of all drawing actions and
* creates an {@link Area} that corresponds to drawn objects. Before each
* component is drawn, {@link #startedDrawingComponent()} should be called.
* After the component is drawn, area may be retrieved using
* {@link #finishedDrawingComponent()}. Graphics configuration (color, font,
* etc) is reset between each two components.
*
* @author Branislav Stojkovic
*/
class G2DWrapper extends Graphics2D implements IDrawingObserver {
public static int LINE_SENSITIVITY_MARGIN = 2;
public static int CURVE_SENSITIVITY = 6;
private boolean drawingComponent = false;
private boolean trackingAllowed = true;
private Graphics2D canvasGraphics;
private Stroke originalStroke;
private Color originalColor;
private Composite originalComposite;
private AffineTransform originalTx;
private Font originalFont;
private AffineTransform currentTx;
private Area currentArea;
private Shape lastShape;
/**
* Creates a wrapper around specified {@link Graphics2D} object.
*
* @param canvasGraphics
*/
public G2DWrapper(Graphics2D canvasGraphics) {
super();
this.canvasGraphics = canvasGraphics;
currentArea = new Area();
currentTx = new AffineTransform();
}
/**
* Clears out the current area and caches canvas settings.
*/
public void startedDrawingComponent() {
drawingComponent = true;
currentArea = new Area();
originalStroke = canvasGraphics.getStroke();
originalColor = canvasGraphics.getColor();
originalTx = canvasGraphics.getTransform();
originalComposite = canvasGraphics.getComposite();
originalFont = canvasGraphics.getFont();
currentTx = new AffineTransform();
lastShape = null;
startTracking();
}
/**
* Reverts {@link Graphics2D} settings and returns area drawn by component
* in the meantime.
*
* @return
*/
public Area finishedDrawingComponent() {
drawingComponent = false;
canvasGraphics.setStroke(originalStroke);
canvasGraphics.setColor(originalColor);
canvasGraphics.setTransform(originalTx);
canvasGraphics.setComposite(originalComposite);
canvasGraphics.setFont(originalFont);
return currentArea;
}
@Override
public void startTracking() {
this.trackingAllowed = true;
}
@Override
public void stopTracking() {
this.trackingAllowed = false;
}
/**
* Appends shape interior to the current component area.
*
* @param s
*/
private void appendShape(Shape s) {
if (!drawingComponent || !trackingAllowed) {
return;
}
Rectangle2D bounds = s.getBounds2D();
// Only cache the shape if it's not 1D.
if (bounds.getWidth() > 1 && bounds.getHeight() > 1) {
Area area = new Area(s);
area.transform(currentTx);
currentArea.add(area);
lastShape = s;
}
}
/**
* Appends shape outline to the current component area.
*
* @param s
*/
private void appendShapeOutline(Shape s) {
// Do not add shape outline if the same shape has been filled recently.
if (!drawingComponent || !trackingAllowed || s.equals(lastShape)) {
return;
}
lastShape = s;
PathIterator pathIterator = s.getPathIterator(null);
double thickness;
if (getStroke() instanceof BasicStroke) {
thickness = ((BasicStroke) getStroke()).getLineWidth() + 2 * LINE_SENSITIVITY_MARGIN;
} else {
thickness = 2 * LINE_SENSITIVITY_MARGIN;
}
Point2D prevPoint = null;
while (!pathIterator.isDone()) {
double[] coord = new double[6];
int type = pathIterator.currentSegment(coord);
switch (type) {
case PathIterator.SEG_MOVETO:
prevPoint = new Point2D.Double(coord[0], coord[1]);
break;
case PathIterator.SEG_LINETO:
// Represent straight line with a rectangle.
Point2D nextPoint = new Point2D.Double(coord[0], coord[1]);
Double theta = Math.atan2(nextPoint.getY() - prevPoint.getY(), nextPoint.getX()
- prevPoint.getX());
double width = Math.sqrt(Math.pow(nextPoint.getX() - prevPoint.getX(), 2)
+ Math.pow(nextPoint.getY() - prevPoint.getY(), 2));
double midX = (prevPoint.getX() + nextPoint.getX()) / 2;
double midY = (prevPoint.getY() + nextPoint.getY()) / 2;
Rectangle2D rect = new Rectangle2D.Double(midX - width / 2, midY - thickness / 2,
width, thickness);
Area area = new Area(rect);
area.transform(AffineTransform.getRotateInstance(theta, midX, midY));
// area.transform(currentTx);
appendShape(area);
// Set the prev point to line end
prevPoint = nextPoint;
break;
case PathIterator.SEG_CUBICTO:
CubicCurve2D cubicCurve = new CubicCurve2D.Double(prevPoint.getX(), prevPoint
.getY(), coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]);
addCubicCurveArea(cubicCurve);
prevPoint = new Point2D.Double(coord[4], coord[5]);
break;
case PathIterator.SEG_QUADTO:
QuadCurve2D quadCurve = new QuadCurve2D.Double(prevPoint.getX(), prevPoint.getY(),
coord[0], coord[1], coord[2], coord[3]);
addQuadCurveArea(quadCurve);
prevPoint = new Point2D.Double(coord[3], coord[3]);
break;
}
pathIterator.next();
}
}
/**
* Adds a cubic curve to the component area. It uses subdivision to
* approximate the curve with a series of straight lines.
*
* @param curve
*/
private void addCubicCurveArea(CubicCurve2D curve) {
// When end points are close enough, approximate the curve with a
// straight line.
if (curve.getFlatness() < CURVE_SENSITIVITY) {
appendShapeOutline(new Line2D.Double(curve.getP1(), curve.getP2()));
} else {
CubicCurve2D leftSubcurve = new CubicCurve2D.Double();
CubicCurve2D rightSubcurve = new CubicCurve2D.Double();
curve.subdivide(leftSubcurve, rightSubcurve);
addCubicCurveArea(leftSubcurve);
addCubicCurveArea(rightSubcurve);
}
}
/**
* Adds a quad curve to the component area. It uses subdivision to
* approximate the curve with a series of straight lines.
*
* @param curve
*/
private void addQuadCurveArea(QuadCurve2D curve) {
// When end points are close enough, approximate the curve with a
// straight line.
if (curve.getFlatness() < CURVE_SENSITIVITY) {
appendShapeOutline(new Line2D.Double(curve.getP1(), curve.getP2()));
} else {
QuadCurve2D leftSubcurve = new QuadCurve2D.Double();
QuadCurve2D rightSubcurve = new QuadCurve2D.Double();
curve.subdivide(leftSubcurve, rightSubcurve);
addQuadCurveArea(leftSubcurve);
addQuadCurveArea(rightSubcurve);
}
}
@Override
public void addRenderingHints(Map<?, ?> hints) {
canvasGraphics.addRenderingHints(hints);
}
@Override
public void clip(Shape s) {
canvasGraphics.clip(s);
}
@Override
public void draw(Shape s) {
canvasGraphics.draw(s);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(s);
}
}
@Override
public void drawGlyphVector(GlyphVector g, float x, float y) {
canvasGraphics.drawGlyphVector(g, x, y);
}
@Override
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
// FIXME: process map
return canvasGraphics.drawImage(img, xform, obs);
}
@Override
public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
canvasGraphics.drawImage(img, op, x, y);
// FIXME: process map
}
@Override
public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
canvasGraphics.drawRenderableImage(img, xform);
// FIXME: process map
}
@Override
public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
canvasGraphics.drawRenderedImage(img, xform);
// FIXME: process map
}
@Override
public void drawString(String str, int x, int y) {
canvasGraphics.drawString(str, x, y);
if (drawingComponent && trackingAllowed) {
FontMetrics fontMetrics = canvasGraphics.getFontMetrics();
Rectangle2D rect = fontMetrics.getStringBounds(str, canvasGraphics);
appendShape(new Rectangle2D.Double(rect.getX() + x, rect.getY() + y, rect.getWidth(),
rect.getHeight()));
}
}
@Override
public void drawString(String str, float x, float y) {
canvasGraphics.drawString(str, x, y);
if (drawingComponent && trackingAllowed) {
FontMetrics fontMetrics = canvasGraphics.getFontMetrics();
Rectangle2D rect = fontMetrics.getStringBounds(str, canvasGraphics);
appendShape(new Rectangle2D.Double(rect.getX() + x, rect.getY() + y, rect.getWidth(),
rect.getHeight()));
}
}
@Override
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
canvasGraphics.drawString(iterator, x, y);
// FIXME: process map
}
@Override
public void drawString(AttributedCharacterIterator iterator, float x, float y) {
canvasGraphics.drawString(iterator, x, y);
// FIXME: process map
}
@Override
public void fill(Shape s) {
canvasGraphics.fill(s);
appendShape(s);
}
@Override
public Color getBackground() {
return canvasGraphics.getBackground();
}
@Override
public Composite getComposite() {
return canvasGraphics.getComposite();
}
@Override
public GraphicsConfiguration getDeviceConfiguration() {
return canvasGraphics.getDeviceConfiguration();
}
@Override
public FontRenderContext getFontRenderContext() {
return canvasGraphics.getFontRenderContext();
}
@Override
public Paint getPaint() {
return canvasGraphics.getPaint();
}
@Override
public Object getRenderingHint(Key hintKey) {
return canvasGraphics.getRenderingHint(hintKey);
}
@Override
public RenderingHints getRenderingHints() {
return canvasGraphics.getRenderingHints();
}
@Override
public Stroke getStroke() {
return canvasGraphics.getStroke();
}
@Override
public AffineTransform getTransform() {
return canvasGraphics.getTransform();
}
@Override
public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
return canvasGraphics.hit(rect, s, onStroke);
}
@Override
public void rotate(double theta) {
canvasGraphics.rotate(theta);
currentTx.rotate(theta);
}
@Override
public void rotate(double theta, double x, double y) {
canvasGraphics.rotate(theta, x, y);
currentTx.rotate(theta, x, y);
}
@Override
public void scale(double sx, double sy) {
canvasGraphics.scale(sx, sy);
currentTx.scale(sx, sy);
}
@Override
public void setBackground(Color color) {
canvasGraphics.setBackground(color);
// FIXME: fix map
}
@Override
public void setComposite(Composite comp) {
canvasGraphics.setComposite(comp);
// FIXME: check this.
}
@Override
public void setPaint(Paint paint) {
canvasGraphics.setPaint(paint);
// FIXME: check this
}
@Override
public void setRenderingHint(Key hintKey, Object hintValue) {
canvasGraphics.setRenderingHint(hintKey, hintValue);
// FIXME: check this
}
@Override
public void setRenderingHints(Map<?, ?> hints) {
canvasGraphics.setRenderingHints(hints);
// FIXME: check this
}
@Override
public void setStroke(Stroke s) {
canvasGraphics.setStroke(s);
}
@Override
public void setTransform(AffineTransform Tx) {
canvasGraphics.setTransform(Tx);
currentTx = Tx;
}
@Override
public void shear(double shx, double shy) {
canvasGraphics.shear(shx, shy);
currentTx.shear(shx, shy);
}
@Override
public void transform(AffineTransform Tx) {
canvasGraphics.transform(Tx);
currentTx.concatenate(Tx);
}
@Override
public void translate(int x, int y) {
canvasGraphics.translate(x, y);
currentTx.translate(x, y);
}
@Override
public void translate(double tx, double ty) {
canvasGraphics.translate(tx, ty);
currentTx.translate(tx, ty);
}
@Override
public void clearRect(int x, int y, int width, int height) {
canvasGraphics.clearRect(x, y, width, height);
}
@Override
public void clipRect(int x, int y, int width, int height) {
canvasGraphics.clipRect(x, y, width, height);
}
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
canvasGraphics.copyArea(x, y, width, height, dx, dy);
}
@Override
public Graphics create() {
return canvasGraphics.create();
}
@Override
public void dispose() {
canvasGraphics.dispose();
}
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
canvasGraphics.drawArc(x, y, width, height, startAngle, arcAngle);
}
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
boolean result = canvasGraphics.drawImage(img, x, y, observer);
appendShape(new Rectangle2D.Double(x, y, img.getWidth(observer), img.getHeight(observer)));
return result;
}
@Override
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
// FIXME: map
return canvasGraphics.drawImage(img, x, y, bgcolor, observer);
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
// FIXME: map
return canvasGraphics.drawImage(img, x, y, width, height, observer);
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor,
ImageObserver observer) {
// FIXME: map
return canvasGraphics.drawImage(img, x, y, width, height, bgcolor, observer);
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
int sx2, int sy2, ImageObserver observer) {
// FIXME: map
return canvasGraphics.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
int sx2, int sy2, Color bgcolor, ImageObserver observer) {
// FIXME: map
return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer);
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
canvasGraphics.drawLine(x1, y1, x2, y2);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(new Line2D.Double(x1, y1, x2, y2));
}
}
@Override
public void drawOval(int x, int y, int width, int height) {
canvasGraphics.drawOval(x, y, width, height);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(new Ellipse2D.Double(x, y, width, height));
}
}
@Override
public void drawPolygon(int[] points, int[] points2, int points3) {
canvasGraphics.drawPolygon(points, points2, points3);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(new Polygon(points, points2, points3));
}
}
@Override
public void drawPolyline(int[] points, int[] points2, int points3) {
canvasGraphics.drawPolyline(points, points2, points3);
}
@Override
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
canvasGraphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight));
}
}
@Override
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
canvasGraphics.fillArc(x, y, width, height, startAngle, arcAngle);
if (drawingComponent && trackingAllowed) {
appendShape(new Arc2D.Double(x, y, width, height, startAngle, arcAngle, Arc2D.PIE));
}
}
@Override
public void fillOval(int x, int y, int width, int height) {
canvasGraphics.fillOval(x, y, width, height);
if (drawingComponent && trackingAllowed) {
appendShape(new Ellipse2D.Double(x, y, width, height));
}
}
@Override
public void fillPolygon(int[] points, int[] points2, int points3) {
canvasGraphics.fillPolygon(points, points2, points3);
if (drawingComponent && trackingAllowed) {
appendShape(new Polygon(points, points2, points3));
}
}
@Override
public void drawRect(int x, int y, int width, int height) {
canvasGraphics.drawRect(x, y, width, height);
if (drawingComponent && trackingAllowed) {
appendShapeOutline(new Rectangle(x, y, width, height));
}
}
@Override
public void fillRect(int x, int y, int width, int height) {
canvasGraphics.fillRect(x, y, width, height);
if (drawingComponent && trackingAllowed) {
appendShape(new Rectangle(x, y, width, height));
}
}
@Override
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
canvasGraphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
if (drawingComponent && trackingAllowed) {
appendShape(new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight));
}
}
@Override
public Shape getClip() {
return canvasGraphics.getClip();
}
@Override
public Rectangle getClipBounds() {
return canvasGraphics.getClipBounds();
}
@Override
public Color getColor() {
return canvasGraphics.getColor();
}
@Override
public Font getFont() {
return canvasGraphics.getFont();
}
@Override
public FontMetrics getFontMetrics(Font f) {
return canvasGraphics.getFontMetrics(f);
}
@Override
public void setClip(Shape clip) {
canvasGraphics.setClip(clip);
}
@Override
public void setClip(int x, int y, int width, int height) {
canvasGraphics.setClip(x, y, width, height);
}
@Override
public void setColor(Color c) {
canvasGraphics.setColor(c);
}
@Override
public void setFont(Font font) {
canvasGraphics.setFont(font);
}
@Override
public void setPaintMode() {
canvasGraphics.setPaintMode();
}
@Override
public void setXORMode(Color c1) {
canvasGraphics.setXORMode(c1);
}
}
@@ -1,219 +0,0 @@
package org.diylc.presenter;
import java.awt.Point;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.diylc.common.ComponentType;
import org.diylc.common.IPlugInPort;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.measures.Size;
import com.diyfever.gui.miscutils.ConfigurationManager;
import com.rits.cloning.Cloner;
/**
* Manages component instantiation.
*
* @author Branislav Stojkovic
*/
public class InstantiationManager {
private static final Logger LOG = Logger.getLogger(InstantiationManager.class);
private static final int MAX_RECENT_COMPONENTS = 16;
private Cloner cloner;
private ComponentType componentTypeSlot;
private IDIYComponent<?> componentSlot;
private Point firstControlPoint;
private Point potentialControlPoint;
public InstantiationManager() {
cloner = new Cloner();
}
public ComponentType getComponentTypeSlot() {
return componentTypeSlot;
}
public IDIYComponent<?> getComponentSlot() {
return componentSlot;
}
public Point getFirstControlPoint() {
return firstControlPoint;
}
public Point getPotentialControlPoint() {
return potentialControlPoint;
}
public void setComponentTypeSlot(ComponentType componentTypeSlot, Project currentProject)
throws Exception {
this.componentTypeSlot = componentTypeSlot;
if (componentTypeSlot == null) {
this.componentSlot = null;
} else {
switch (componentTypeSlot.getCreationMethod()) {
case POINT_BY_POINT:
this.componentSlot = null;
break;
case SINGLE_CLICK:
this.componentSlot = instantiateComponent(componentTypeSlot, new Point(0, 0),
currentProject);
break;
}
}
this.firstControlPoint = null;
this.potentialControlPoint = null;
}
public void instatiatePointByPoint(Point scaledPoint, Project currentProject) throws Exception {
firstControlPoint = scaledPoint;
componentSlot = instantiateComponent(componentTypeSlot, firstControlPoint, currentProject);
// Set the other control point to the same location, we'll
// move it later when mouse moves.
componentSlot.setControlPoint(firstControlPoint, 0);
componentSlot.setControlPoint(firstControlPoint, 1);
}
/**
* Updates component in the slot with the new second control point.
*
* @param scaledPoint
* @return true, if any change is made
*/
public boolean updatePointByPoint(Point scaledPoint) {
boolean changeMade = !scaledPoint.equals(potentialControlPoint);
potentialControlPoint = scaledPoint;
if (componentSlot != null) {
componentSlot.setControlPoint(scaledPoint, 1);
}
return changeMade;
}
public boolean updateSingleClick(Point scaledPoint, boolean snapToGrid, Size gridSpacing) {
if (potentialControlPoint == null) {
potentialControlPoint = new Point(0, 0);
}
int dx = scaledPoint.x - potentialControlPoint.x;
int dy = scaledPoint.y - potentialControlPoint.y;
if (snapToGrid) {
dx = CalcUtils.roundToGrid(dx, gridSpacing);
dy = CalcUtils.roundToGrid(dy, gridSpacing);
}
// Only repaint if there's an actual change.
if (dx == 0 && dy == 0) {
return false;
}
potentialControlPoint.translate(dx, dy);
if (componentSlot == null) {
LOG.error("Component slot should not be null!");
} else {
Point p = new Point();
for (int i = 0; i < componentSlot.getControlPointCount(); i++) {
p.setLocation(componentSlot.getControlPoint(i));
p.translate(dx, dy);
componentSlot.setControlPoint(p, i);
}
}
return true;
}
@SuppressWarnings("unchecked")
public IDIYComponent<?> instantiateComponent(ComponentType componentType, Point point,
Project currentProject) throws Exception {
LOG.info("Instatiating component of type: " + componentType.getInstanceClass().getName());
// Instantiate the component.
IDIYComponent<?> component = componentType.getInstanceClass().newInstance();
component.setName(createUniqueName(componentType, currentProject));
// Translate them to the desired location.
if (point != null) {
for (int j = 0; j < component.getControlPointCount(); j++) {
Point controlPoint = new Point(component.getControlPoint(j));
controlPoint.translate(point.x, point.y);
// snapPointToGrid(controlPoint);
component.setControlPoint(controlPoint, j);
}
}
fillWithDefaultProperties(component);
// Write to recent components
List<String> recentComponentTypes = (List<String>) ConfigurationManager.getInstance()
.readObject(IPlugInPort.RECENT_COMPONENTS_KEY, new ArrayList<ComponentType>());
String className = componentType.getInstanceClass().getName();
if (recentComponentTypes.size() == 0 || !recentComponentTypes.get(0).equals(className)) {
// Remove if it's already somewhere in the list.
recentComponentTypes.remove(className);
// Add to the end of the list.
recentComponentTypes.add(0, className);
// Trim the list if necessary.
if (recentComponentTypes.size() > MAX_RECENT_COMPONENTS) {
recentComponentTypes.remove(recentComponentTypes.size() - 1);
}
ConfigurationManager.getInstance().writeValue(IPlugInPort.RECENT_COMPONENTS_KEY,
recentComponentTypes);
}
return component;
}
public String createUniqueName(ComponentType componentType, Project currentProject) {
int i = 0;
boolean exists = true;
while (exists) {
i++;
String name = componentType.getNamePrefix() + i;
exists = false;
for (IDIYComponent<?> c : currentProject.getComponents()) {
if (c.getName().equals(name)) {
exists = true;
break;
}
}
}
return componentType.getNamePrefix() + i;
}
/**
* Finds any properties that have default values and injects default values.
* Typically it should be used for {@link IDIYComponent} and {@link Project}
* objects.
*
* @param object
* @throws IllegalArgumentException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws NoSuchMethodException
* @throws SecurityException
*/
public void fillWithDefaultProperties(Object object) throws IllegalArgumentException,
IllegalAccessException, InvocationTargetException, SecurityException,
NoSuchMethodException {
// Extract properties.
List<PropertyWrapper> properties = ComponentProcessor.getInstance().extractProperties(
object.getClass());
// Override with default values if available.
for (PropertyWrapper property : properties) {
Object defaultValue = ConfigurationManager.getInstance().readObject(
Presenter.DEFAULTS_KEY_PREFIX + object.getClass().getName() + ":"
+ property.getName(), null);
if (defaultValue != null) {
property.setValue(cloner.deepClone(defaultValue));
property.writeTo(object);
}
}
}
}
@@ -1,41 +0,0 @@
package org.diylc.presenter;
import java.awt.Point;
import org.diylc.utils.Constants;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
/**
* Serializes {@link Point} objects by converting coordinates from pixels to
* inches, thus avoiding the resolution to affect point placement.
*
* @author Branislav Stojkovic
*/
public class PointConverter implements Converter {
@Override
public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
Point point = (Point) object;
writer.addAttribute("x", Double.toString(1d * point.x / Constants.PIXELS_PER_INCH));
writer.addAttribute("y", Double.toString(1d * point.y / Constants.PIXELS_PER_INCH));
}
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
double x = Double.parseDouble(reader.getAttribute("x"));
double y = Double.parseDouble(reader.getAttribute("y"));
return new Point((int) Math.round(x * Constants.PIXELS_PER_INCH), (int) Math.round(y
* Constants.PIXELS_PER_INCH));
}
@SuppressWarnings("unchecked")
@Override
public boolean canConvert(Class clazz) {
return Point.class.isAssignableFrom(clazz);
}
}
@@ -1,456 +0,0 @@
package org.diylc.presenter;
import java.awt.Color;
import java.awt.Point;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.log4j.Logger;
import org.diylc.common.EventType;
import org.diylc.common.Orientation;
import org.diylc.components.boards.AbstractBoard;
import org.diylc.components.boards.BlankBoard;
import org.diylc.components.boards.PerfBoard;
import org.diylc.components.boards.VeroBoard;
import org.diylc.components.connectivity.CopperTrace;
import org.diylc.components.connectivity.HookupWire;
import org.diylc.components.connectivity.Jumper;
import org.diylc.components.connectivity.SolderPad;
import org.diylc.components.misc.Label;
import org.diylc.components.passive.RadialElectrolytic;
import org.diylc.components.passive.RadialFilmCapacitor;
import org.diylc.components.passive.Resistor;
import org.diylc.components.semiconductors.DIL_IC;
import org.diylc.components.semiconductors.DiodePlastic;
import org.diylc.components.semiconductors.LED;
import org.diylc.components.semiconductors.TransistorTO92;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.measures.Capacitance;
import org.diylc.core.measures.Resistance;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.diyfever.gui.simplemq.MessageDispatcher;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class ProjectFileManager {
private static final Logger LOG = Logger.getLogger(ProjectFileManager.class);
// private static final int V1_PIXELS_PER_INCH = 200;
private static final Size V1_GRID_SPACING = new Size(0.1d, SizeUnit.in);
private static final Map<String, Color> V1_COLOR_MAP = new HashMap<String, Color>();
static {
V1_COLOR_MAP.put("red", Color.red);
V1_COLOR_MAP.put("blue", Color.blue);
V1_COLOR_MAP.put("white", Color.white);
V1_COLOR_MAP.put("green", Color.green.darker());
V1_COLOR_MAP.put("black", Color.black);
V1_COLOR_MAP.put("yellow", Color.yellow);
}
private XStream xStream;
// Legacy deserializer for 3.0.1 through 3.0.7, loads Points referenced in
// pixels.
private XStream xStreamOld;
private String currentFileName = null;
private boolean modified = false;
private MessageDispatcher<EventType> messageDispatcher;
public ProjectFileManager(MessageDispatcher<EventType> messageDispatcher) {
super();
this.xStream = new XStream(new DomDriver());
xStream.autodetectAnnotations(true);
xStream.registerConverter(new PointConverter());
this.xStreamOld = new XStream(new DomDriver());
xStreamOld.autodetectAnnotations(true);
this.messageDispatcher = messageDispatcher;
}
public void startNewFile() {
currentFileName = null;
modified = false;
fireFileStatusChanged();
}
public void serializeProjectToFile(Project project, String fileName, boolean isBackup)
throws IOException {
if (!isBackup) {
LOG.info(String.format("saveProjectToFile(%s)", fileName));
}
FileOutputStream fos;
fos = new FileOutputStream(fileName);
xStream.toXML(project, fos);
fos.close();
if (!isBackup) {
this.currentFileName = fileName;
this.modified = false;
fireFileStatusChanged();
}
}
public Project deserializeProjectFromFile(String fileName, List<String> warnings)
throws SAXException, IOException, ParserConfigurationException {
LOG.info(String.format("loadProjectFromFile(%s)", fileName));
Project project;
File file = new File(fileName);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
doc.getDocumentElement().normalize();
if (doc.getDocumentElement().getNodeName().equalsIgnoreCase(Project.class.getName())) {
project = parseV3File(fileName);
} else {
if (!doc.getDocumentElement().getNodeName().equalsIgnoreCase("layout")) {
throw new IllegalArgumentException(
"Could not open DIY file. Root node is not named 'Layout'.");
}
String formatVersion = doc.getDocumentElement().getAttribute("formatVersion");
if (formatVersion == null || formatVersion.trim().isEmpty()) {
LOG.debug("Detected v1 file.");
project = parseV1File(doc.getDocumentElement(), warnings);
} else if (formatVersion.equals("2.0")) {
LOG.debug("Detected v2 file.");
project = parseV2File(doc.getDocumentElement());
} else {
throw new IllegalArgumentException("Unknown file format version: " + formatVersion);
}
}
Collections.sort(warnings);
this.currentFileName = fileName;
this.modified = false;
return project;
}
public void notifyFileChange() {
this.modified = true;
fireFileStatusChanged();
}
public String getCurrentFileName() {
return currentFileName;
}
public boolean isModified() {
return modified;
}
public void fireFileStatusChanged() {
messageDispatcher.dispatchMessage(EventType.FILE_STATUS_CHANGED, getCurrentFileName(),
isModified());
}
private Project parseV1File(Element root, List<String> warnings) {
Project project = new Project();
project.setTitle(root.getAttribute("Project"));
project.setAuthor(root.getAttribute("Credits"));
project.setGridSpacing(V1_GRID_SPACING);
String type = root.getAttribute("Type");
// Create the board.
int width = Integer.parseInt(root.getAttribute("Width")) + 1;
int height = Integer.parseInt(root.getAttribute("Height")) + 1;
int boardWidth = (int) (width * Constants.PIXELS_PER_INCH * V1_GRID_SPACING.getValue());
int boardHeight = (int) (height * Constants.PIXELS_PER_INCH * V1_GRID_SPACING.getValue());
int projectWidth = (int) project.getWidth().convertToPixels();
int projectHeight = (int) project.getHeight().convertToPixels();
int x = (projectWidth - boardWidth) / 2;
int y = (projectHeight - boardHeight) / 2;
AbstractBoard board;
if (type.equalsIgnoreCase("pcb")) {
board = new BlankBoard();
board.setBoardColor(Color.white);
board.setBorderColor(Color.black);
} else if (type.equalsIgnoreCase("perfboard")) {
board = new PerfBoard();
} else if (type.equalsIgnoreCase("stripboard")) {
board = new VeroBoard();
} else {
throw new IllegalArgumentException("Unrecognized board type: " + type);
}
board.setName("Main board");
Point referencePoint = new Point(CalcUtils.roundToGrid(x, V1_GRID_SPACING), CalcUtils
.roundToGrid(y, V1_GRID_SPACING));
board.setControlPoint(referencePoint, 0);
board.setControlPoint(new Point(CalcUtils.roundToGrid(x + boardWidth, V1_GRID_SPACING),
CalcUtils.roundToGrid(y + boardHeight, V1_GRID_SPACING)), 1);
project.getComponents().add(board);
NodeList childNodes = root.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node node = childNodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
String nodeName = node.getNodeName();
String nameAttr = node.getAttributes().getNamedItem("Name").getNodeValue();
Node valueNode = node.getAttributes().getNamedItem("Value");
String valueAttr = valueNode == null ? null : valueNode.getNodeValue();
int x1Attr = Integer.parseInt(node.getAttributes().getNamedItem("X1")
.getNodeValue());
int y1Attr = Integer.parseInt(node.getAttributes().getNamedItem("Y1")
.getNodeValue());
Point point1 = convertV1CoordinatesToV3Point(referencePoint, x1Attr, y1Attr);
Point point2 = null;
Integer x2Attr = null;
Integer y2Attr = null;
Color color = null;
if (node.getAttributes().getNamedItem("Color") != null) {
String colorAttr = node.getAttributes().getNamedItem("Color").getNodeValue();
color = V1_COLOR_MAP.get(colorAttr.toLowerCase());
}
if (node.getAttributes().getNamedItem("X2") != null
&& node.getAttributes().getNamedItem("Y2") != null) {
x2Attr = Integer.parseInt(node.getAttributes().getNamedItem("X2")
.getNodeValue());
y2Attr = Integer.parseInt(node.getAttributes().getNamedItem("Y2")
.getNodeValue());
point2 = convertV1CoordinatesToV3Point(referencePoint, x2Attr, y2Attr);
}
IDIYComponent<?> component = null;
if (nodeName.equalsIgnoreCase("text")) {
LOG.debug("Recognized " + nodeName);
Label label = new Label();
label.setName(nameAttr);
if (color != null) {
label.setColor(color);
}
label.setText(valueAttr);
label.setCenter(false);
label.setControlPoint(convertV1CoordinatesToV3Point(referencePoint, x1Attr,
y1Attr), 0);
component = label;
} else if (nodeName.equalsIgnoreCase("pad")) {
LOG.debug("Recognized " + nodeName);
SolderPad pad = new SolderPad();
pad.setName(nameAttr);
if (color != null) {
pad.setColor(color);
}
pad.setControlPoint(convertV1CoordinatesToV3Point(referencePoint, x1Attr,
y1Attr), 0);
component = pad;
} else if (nodeName.equalsIgnoreCase("trace")) {
LOG.debug("Recognized " + nodeName);
CopperTrace trace = new CopperTrace();
trace.setName(nameAttr);
if (color != null) {
trace.setLeadColor(color);
}
trace.setControlPoint(point1, 0);
trace.setControlPoint(point2, 1);
component = trace;
} else if (nodeName.equalsIgnoreCase("jumper")) {
LOG.debug("Recognized " + nodeName);
Jumper jumper = new Jumper();
jumper.setName(nameAttr);
jumper.setControlPoint(point1, 0);
jumper.setControlPoint(point2, 1);
component = jumper;
} else if (nodeName.equalsIgnoreCase("wire")) {
LOG.debug("Recognized " + nodeName);
HookupWire wire = new HookupWire();
Point midPoint = new Point((point1.x + point2.x) / 2, (point1.y + point2.y) / 2);
wire.setName(nameAttr);
wire.setControlPoint(point1, 0);
wire.setControlPoint(midPoint, 1);
wire.setControlPoint(midPoint, 2);
wire.setControlPoint(point2, 3);
component = wire;
} else if (nodeName.equalsIgnoreCase("resistor")) {
LOG.debug("Recognized " + nodeName);
Resistor resistor = new Resistor();
resistor.setName(nameAttr);
try {
resistor.setValue(Resistance.parseResistance(valueAttr));
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}
resistor.setLength(new Size(6d, SizeUnit.mm));
resistor.setWidth(new Size(2d, SizeUnit.mm));
resistor.setControlPoint(point1, 0);
resistor.setControlPoint(point2, 1);
component = resistor;
} else if (nodeName.equalsIgnoreCase("capacitor")) {
LOG.debug("Recognized " + nodeName);
RadialFilmCapacitor capacitor = new RadialFilmCapacitor();
capacitor.setName(nameAttr);
try {
capacitor.setValue(Capacitance.parseCapacitance(valueAttr));
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}
capacitor.setLength(new Size(6d, SizeUnit.mm));
capacitor.setWidth(new Size(2d, SizeUnit.mm));
capacitor.setControlPoint(point1, 0);
capacitor.setControlPoint(point2, 1);
component = capacitor;
} else if (nodeName.equalsIgnoreCase("electrolyte")) {
LOG.debug("Recognized " + nodeName);
RadialElectrolytic capacitor = new RadialElectrolytic();
capacitor.setName(nameAttr);
try {
capacitor.setValue(Capacitance.parseCapacitance(valueAttr));
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}
String sizeAttr = node.getAttributes().getNamedItem("Size").getNodeValue();
if (sizeAttr.equalsIgnoreCase("small")) {
capacitor.setLength(new Size(3.5d, SizeUnit.mm));
} else if (sizeAttr.equalsIgnoreCase("medium")) {
capacitor.setLength(new Size(5d, SizeUnit.mm));
} else if (sizeAttr.equalsIgnoreCase("large")) {
capacitor.setLength(new Size(7d, SizeUnit.mm));
} else {
capacitor.setLength(new Size(4d, SizeUnit.mm));
}
capacitor.setControlPoint(point1, 0);
capacitor.setControlPoint(point2, 1);
component = capacitor;
} else if (nodeName.equalsIgnoreCase("diode")) {
LOG.debug("Recognized " + nodeName);
DiodePlastic capacitor = new DiodePlastic();
capacitor.setName(nameAttr);
try {
capacitor.setValue(valueAttr);
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}
capacitor.setLength(new Size(6d, SizeUnit.mm));
capacitor.setWidth(new Size(2d, SizeUnit.mm));
capacitor.setControlPoint(point1, 0);
capacitor.setControlPoint(point2, 1);
component = capacitor;
} else if (nodeName.equalsIgnoreCase("led")) {
LOG.debug("Recognized " + nodeName);
LED led = new LED();
led.setName(nameAttr);
led.setValue(valueAttr);
led.setBodyColor(Color.red);
led.setBorderColor(Color.red.darker());
led.setLength(new Size(3d, SizeUnit.mm));
led.setControlPoint(point1, 0);
led.setControlPoint(point2, 1);
component = led;
} else if (nodeName.equalsIgnoreCase("transistor")) {
LOG.debug("Recognized " + nodeName);
TransistorTO92 transistor = new TransistorTO92();
transistor.setName(nameAttr);
try {
transistor.setValue(valueAttr);
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}
transistor.setControlPoint(point1, 0);
if (point1.y > point2.y) {
transistor.setOrientation(Orientation._180);
} else if (point1.y < point2.y) {
transistor.setOrientation(Orientation.DEFAULT);
} else if (point1.x < point2.x) {
transistor.setOrientation(Orientation._270);
} else if (point1.x > point2.x) {
transistor.setOrientation(Orientation._90);
}
// capacitor.setControlPoint(point2, 1);
component = transistor;
} else if (nodeName.equalsIgnoreCase("ic")) {
LOG.debug("Recognized " + nodeName);
DIL_IC ic = new DIL_IC();
if (x1Attr + 3 == x2Attr) {
if (y1Attr < y2Attr) {
ic
.setPinCount(DIL_IC.PinCount.valueOf("_" + 2
* (y2Attr - y1Attr + 1)));
} else {
ic.setOrientation(Orientation._180);
ic
.setPinCount(DIL_IC.PinCount.valueOf("_" + 2
* (y1Attr - y2Attr + 1)));
}
}
ic.setName(nameAttr);
// Translate control points.
for (int j = 0; j < ic.getControlPointCount(); j++) {
Point p = new Point(ic.getControlPoint(j));
p.translate(point1.x, point1.y);
ic.setControlPoint(p, j);
}
ic.setValue(valueAttr);
component = ic;
} else {
String message = "Could not recognize component type " + nodeName;
LOG.debug(message);
if (!warnings.contains(message)) {
warnings.add(message);
}
}
if (component != null) {
project.getComponents().add(component);
}
}
}
Collections.sort(project.getComponents(), ComparatorFactory.getInstance()
.getComponentZOrderComparator());
return project;
}
private Point convertV1CoordinatesToV3Point(Point reference, int x, int y) {
Point point = new Point(reference);
point.translate((int) (x * Constants.PIXELS_PER_INCH * V1_GRID_SPACING.getValue()),
(int) (y * Constants.PIXELS_PER_INCH * V1_GRID_SPACING.getValue()));
return point;
}
private Project parseV2File(Element root) {
Project project = new Project();
String projectName = root.getAttribute("projectName");
String credits = root.getAttribute("credits");
String width = root.getAttribute("width");
String height = root.getAttribute("height");
NodeList childNodes = root.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node node = childNodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (node.getNodeName().equalsIgnoreCase("component")) {
LOG.debug(node.getAttributes().getNamedItem("name").getNodeValue());
} else {
LOG.debug("Unrecognized node name found: " + node.getNodeName());
}
}
}
return project;
}
private Project parseV3File(String fileName) throws IOException {
Project project;
FileInputStream fis = new FileInputStream(fileName);
try {
project = (Project) xStream.fromXML(fis);
} catch (Exception e) {
LOG.warn("Could not open with the new xStream, trying the old one");
fis.close();
fis = new FileInputStream(fileName);
project = (Project) xStreamOld.fromXML(fis);
}
fis.close();
return project;
}
}
@@ -1,870 +0,0 @@
package org.diylc.swing;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.print.PrinterException;
import java.io.File;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;
import org.apache.log4j.Logger;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ITask;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IDIYComponent;
import org.diylc.core.IView;
import org.diylc.core.Theme;
import org.diylc.images.IconLoader;
import org.diylc.swing.gui.DialogFactory;
import org.diylc.swing.gui.editor.PropertyEditorDialog;
import org.diylc.swing.plugins.edit.ComponentTransferable;
import org.diylc.swing.plugins.file.BomDialog;
import org.diylc.swing.plugins.file.BomEntry;
import org.diylc.swing.plugins.file.BomMaker;
import org.diylc.swing.plugins.file.FileFilterEnum;
import com.diyfever.gui.ButtonDialog;
import com.diyfever.gui.IDrawingProvider;
import com.diyfever.gui.export.DrawingExporter;
import com.diyfever.gui.miscutils.ConfigurationManager;
import com.rits.cloning.Cloner;
public class ActionFactory {
private static final Logger LOG = Logger.getLogger(ActionFactory.class);
private static ActionFactory instance;
private static Cloner cloner = new Cloner();
public static ActionFactory getInstance() {
if (instance == null) {
instance = new ActionFactory();
}
return instance;
}
private ActionFactory() {
}
// File menu actions.
public NewAction createNewAction(IPlugInPort plugInPort) {
return new NewAction(plugInPort);
}
public OpenAction createOpenAction(IPlugInPort plugInPort, ISwingUI swingUI) {
return new OpenAction(plugInPort, swingUI);
}
public SaveAction createSaveAction(IPlugInPort plugInPort, ISwingUI swingUI) {
return new SaveAction(plugInPort, swingUI);
}
public SaveAsAction createSaveAsAction(IPlugInPort plugInPort, ISwingUI swingUI) {
return new SaveAsAction(plugInPort, swingUI);
}
public CreateBomAction createBomAction(IPlugInPort plugInPort) {
return new CreateBomAction(plugInPort);
}
public ExportPDFAction createExportPDFAction(IDrawingProvider drawingProvider, ISwingUI swingUI) {
return new ExportPDFAction(drawingProvider, swingUI);
}
public ExportPNGAction createExportPNGAction(IDrawingProvider drawingProvider, ISwingUI swingUI) {
return new ExportPNGAction(drawingProvider, swingUI);
}
public PrintAction createPrintAction(IDrawingProvider drawingProvider) {
return new PrintAction(drawingProvider);
}
public ExitAction createExitAction(IPlugInPort plugInPort) {
return new ExitAction(plugInPort);
}
// Edit menu actions.
public CutAction createCutAction(IPlugInPort plugInPort, Clipboard clipboard,
ClipboardOwner clipboardOwner) {
return new CutAction(plugInPort, clipboard, clipboardOwner);
}
public CopyAction createCopyAction(IPlugInPort plugInPort, Clipboard clipboard,
ClipboardOwner clipboardOwner) {
return new CopyAction(plugInPort, clipboard, clipboardOwner);
}
public PasteAction createPasteAction(IPlugInPort plugInPort, Clipboard clipboard) {
return new PasteAction(plugInPort, clipboard);
}
public SelectAllAction createSelectAllAction(IPlugInPort plugInPort) {
return new SelectAllAction(plugInPort);
}
public GroupAction createGroupAction(IPlugInPort plugInPort) {
return new GroupAction(plugInPort);
}
public UngroupAction createUngroupAction(IPlugInPort plugInPort) {
return new UngroupAction(plugInPort);
}
public EditProjectAction createEditProjectAction(IPlugInPort plugInPort) {
return new EditProjectAction(plugInPort);
}
public EditSelectionAction createEditSelectionAction(IPlugInPort plugInPort) {
return new EditSelectionAction(plugInPort);
}
public DeleteSelectionAction createDeleteSelectionAction(IPlugInPort plugInPort) {
return new DeleteSelectionAction(plugInPort);
}
public SendToBackAction createSendToBackAction(IPlugInPort plugInPort) {
return new SendToBackAction(plugInPort);
}
public BringToFrontAction createBringToFrontAction(IPlugInPort plugInPort) {
return new BringToFrontAction(plugInPort);
}
// Config actions.
public ConfigAction createConfigAction(IPlugInPort plugInPort, String title, String configKey,
boolean defaultValue) {
return new ConfigAction(plugInPort, title, configKey, defaultValue);
}
public ThemeAction createThemeAction(IPlugInPort plugInPort, Theme theme) {
return new ThemeAction(plugInPort, theme);
}
public RenumberAction createRenumberAction(IPlugInPort plugInPort, boolean xAxisFirst) {
return new RenumberAction(plugInPort, xAxisFirst);
}
// File menu actions.
public static class NewAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public NewAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "New");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.DocumentPlainYellow.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("NewAction triggered");
if (!plugInPort.allowFileAction()) {
return;
}
plugInPort.createNewProject();
List<PropertyWrapper> properties = plugInPort.getProjectProperties();
PropertyEditorDialog editor = DialogFactory.getInstance().createPropertyEditorDialog(
properties, "Edit Project");
editor.setVisible(true);
if (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) {
plugInPort.applyPropertiesToProject(properties);
}
// Save default values.
for (PropertyWrapper property : editor.getDefaultedProperties()) {
if (property.getValue() != null) {
plugInPort.setProjectDefaultPropertyValue(property.getName(), property
.getValue());
}
}
}
}
public static class OpenAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private ISwingUI swingUI;
public OpenAction(IPlugInPort plugInPort, ISwingUI swingUI) {
super();
this.plugInPort = plugInPort;
this.swingUI = swingUI;
putValue(AbstractAction.NAME, "Open");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.FolderOut.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("OpenAction triggered");
if (!plugInPort.allowFileAction()) {
return;
}
final File file = DialogFactory.getInstance().showOpenDialog(
FileFilterEnum.DIY.getFilter(), null, FileFilterEnum.DIY.getExtensions()[0],
null);
if (file != null) {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Opening from " + file.getAbsolutePath());
plugInPort.loadProjectFromFile(file.getAbsolutePath());
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not open file. " + e.getMessage(), "Error",
ISwingUI.ERROR_MESSAGE);
}
});
}
}
}
public static class SaveAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private ISwingUI swingUI;
public SaveAction(IPlugInPort plugInPort, ISwingUI swingUI) {
super();
this.plugInPort = plugInPort;
this.swingUI = swingUI;
putValue(AbstractAction.NAME, "Save");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.DiskBlue.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("SaveAction triggered");
if (plugInPort.getCurrentFileName() == null) {
final File file = DialogFactory.getInstance().showSaveDialog(
FileFilterEnum.DIY.getFilter(), null,
FileFilterEnum.DIY.getExtensions()[0], null);
if (file != null) {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Saving to " + file.getAbsolutePath());
plugInPort.saveProjectToFile(file.getAbsolutePath(), false);
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not save to file. " + e.getMessage(),
"Error", ISwingUI.ERROR_MESSAGE);
}
});
}
} else {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Saving to " + plugInPort.getCurrentFileName());
plugInPort.saveProjectToFile(plugInPort.getCurrentFileName(), false);
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not save to file. " + e.getMessage(), "Error",
ISwingUI.ERROR_MESSAGE);
}
});
}
}
}
public static class SaveAsAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private ISwingUI swingUI;
public SaveAsAction(IPlugInPort plugInPort, ISwingUI swingUI) {
super();
this.plugInPort = plugInPort;
this.swingUI = swingUI;
putValue(AbstractAction.NAME, "Save As");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S,
ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.DiskBlue.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("SaveAsAction triggered");
final File file = DialogFactory.getInstance().showSaveDialog(
FileFilterEnum.DIY.getFilter(), null, FileFilterEnum.DIY.getExtensions()[0],
null);
if (file != null) {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Saving to " + file.getAbsolutePath());
plugInPort.saveProjectToFile(file.getAbsolutePath(), false);
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not save to file. " + e.getMessage(), "Error",
ISwingUI.ERROR_MESSAGE);
}
});
}
}
}
public static class CreateBomAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public CreateBomAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Create B.O.M.");
putValue(AbstractAction.SMALL_ICON, IconLoader.BOM.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("CreateBomAction triggered");
List<BomEntry> bom = BomMaker.getInstance().createBom(
plugInPort.getCurrentProject().getComponents());
BomDialog dialog = DialogFactory.getInstance().createBomDialog(bom);
dialog.setVisible(true);
}
}
public static class ExportPDFAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IDrawingProvider drawingProvider;
private ISwingUI swingUI;
public ExportPDFAction(IDrawingProvider drawingProvider, ISwingUI swingUI) {
super();
this.drawingProvider = drawingProvider;
this.swingUI = swingUI;
putValue(AbstractAction.NAME, "Export to PDF");
putValue(AbstractAction.SMALL_ICON, IconLoader.PDF.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("ExportPDFAction triggered");
final File file = DialogFactory.getInstance().showSaveDialog(
FileFilterEnum.PDF.getFilter(), null, FileFilterEnum.PDF.getExtensions()[0],
null);
if (file != null) {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Exporting to " + file.getAbsolutePath());
DrawingExporter.getInstance().exportPDF(
ExportPDFAction.this.drawingProvider, file);
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not export to PDF. " + e.getMessage(), "Error",
ISwingUI.ERROR_MESSAGE);
}
});
}
}
}
public static class ExportPNGAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IDrawingProvider drawingProvider;
private ISwingUI swingUI;
public ExportPNGAction(IDrawingProvider drawingProvider, ISwingUI swingUI) {
super();
this.drawingProvider = drawingProvider;
this.swingUI = swingUI;
putValue(AbstractAction.NAME, "Export to PNG");
putValue(AbstractAction.SMALL_ICON, IconLoader.Image.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("ExportPNGAction triggered");
final File file = DialogFactory.getInstance().showSaveDialog(
FileFilterEnum.PNG.getFilter(), null, FileFilterEnum.PNG.getExtensions()[0],
null);
if (file != null) {
swingUI.executeBackgroundTask(new ITask<Void>() {
@Override
public Void doInBackground() throws Exception {
LOG.debug("Exporting to " + file.getAbsolutePath());
DrawingExporter.getInstance().exportPNG(
ExportPNGAction.this.drawingProvider, file);
return null;
}
@Override
public void complete(Void result) {
}
@Override
public void failed(Exception e) {
swingUI.showMessage("Could not export to PNG. " + e.getMessage(), "Error",
ISwingUI.ERROR_MESSAGE);
}
});
}
}
}
public static class PrintAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IDrawingProvider drawingProvider;
public PrintAction(IDrawingProvider drawingProvider) {
super();
this.drawingProvider = drawingProvider;
putValue(AbstractAction.NAME, "Print...");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_P,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Print.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("ExportPNGAction triggered");
try {
DrawingExporter.getInstance().print(this.drawingProvider);
} catch (PrinterException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
public static class ExitAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public ExitAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Exit");
putValue(AbstractAction.SMALL_ICON, IconLoader.Exit.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
if (plugInPort.allowFileAction()) {
System.exit(0);
}
}
}
// Edit menu actions.
public static class CutAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private Clipboard clipboard;
private ClipboardOwner clipboardOwner;
public CutAction(IPlugInPort plugInPort, Clipboard clipboard, ClipboardOwner clipboardOwner) {
super();
this.plugInPort = plugInPort;
this.clipboard = clipboard;
this.clipboardOwner = clipboardOwner;
putValue(AbstractAction.NAME, "Cut");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Cut.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Cut triggered");
clipboard.setContents(new ComponentTransferable(cloner.deepClone(plugInPort
.getSelectedComponents())), clipboardOwner);
plugInPort.deleteSelectedComponents();
}
}
public static class CopyAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private Clipboard clipboard;
private ClipboardOwner clipboardOwner;
public CopyAction(IPlugInPort plugInPort, Clipboard clipboard, ClipboardOwner clipboardOwner) {
super();
this.plugInPort = plugInPort;
this.clipboard = clipboard;
this.clipboardOwner = clipboardOwner;
putValue(AbstractAction.NAME, "Copy");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Copy.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Copy triggered");
clipboard.setContents(new ComponentTransferable(cloner.deepClone(plugInPort
.getSelectedComponents())), clipboardOwner);
}
}
public static class PasteAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private Clipboard clipboard;
public PasteAction(IPlugInPort plugInPort, Clipboard clipboard) {
super();
this.plugInPort = plugInPort;
this.clipboard = clipboard;
putValue(AbstractAction.NAME, "Paste");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Paste.getIcon());
}
@SuppressWarnings("unchecked")
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Paste triggered");
try {
List<IDIYComponent<?>> components = (List<IDIYComponent<?>>) clipboard
.getData(ComponentTransferable.listFlavor);
plugInPort.pasteComponents(cloner.deepClone(components));
} catch (Exception ex) {
LOG.error("Coule not paste.", ex);
}
}
}
public static class SelectAllAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public SelectAllAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Select All");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Selection.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Select All triggered");
plugInPort.selectAll();
}
}
public static class GroupAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public GroupAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Group Selection");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_G,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Group.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Group Selection triggered");
plugInPort.groupSelectedComponents();
}
}
public static class UngroupAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public UngroupAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Ungroup Selection");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_U,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.Ungroup.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Ungroup Selection triggered");
plugInPort.ungroupSelectedComponents();
}
}
public static class EditProjectAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public EditProjectAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Edit Project");
putValue(AbstractAction.SMALL_ICON, IconLoader.DocumentEdit.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Edit Project triggered");
List<PropertyWrapper> properties = plugInPort.getProjectProperties();
PropertyEditorDialog editor = DialogFactory.getInstance().createPropertyEditorDialog(
properties, "Edit Project");
editor.setVisible(true);
if (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) {
plugInPort.applyPropertiesToProject(properties);
}
// Save default values.
for (PropertyWrapper property : editor.getDefaultedProperties()) {
if (property.getValue() != null) {
plugInPort.setProjectDefaultPropertyValue(property.getName(), property
.getValue());
}
}
}
}
public static class EditSelectionAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public EditSelectionAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Edit Selection");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E,
ActionEvent.CTRL_MASK));
putValue(AbstractAction.SMALL_ICON, IconLoader.EditComponent.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Edit Selection triggered");
List<PropertyWrapper> properties = plugInPort.getMutualSelectionProperties();
if (properties == null || properties.isEmpty()) {
LOG.info("Nothing to edit");
return;
}
plugInPort.editSelection();
}
}
public static class DeleteSelectionAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public DeleteSelectionAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Delete Selection");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
putValue(AbstractAction.SMALL_ICON, IconLoader.Delete.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Delete Selection triggered");
plugInPort.deleteSelectedComponents();
}
}
public static class SendToBackAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public SendToBackAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Send Backward");
putValue(AbstractAction.SMALL_ICON, IconLoader.Back.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Send to Back triggered");
plugInPort.sendSelectionToBack();
}
}
public static class BringToFrontAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
public BringToFrontAction(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Bring Forward");
putValue(AbstractAction.SMALL_ICON, IconLoader.Front.getIcon());
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Bring to Front triggered");
plugInPort.bringSelectionToFront();
}
}
public static class ConfigAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private String configKey;
public ConfigAction(IPlugInPort plugInPort, String title, String configKey,
boolean defaultValue) {
super();
this.plugInPort = plugInPort;
this.configKey = configKey;
putValue(AbstractAction.NAME, title);
putValue(IView.CHECK_BOX_MENU_ITEM, true);
putValue(AbstractAction.SELECTED_KEY, ConfigurationManager.getInstance().readBoolean(
configKey, defaultValue));
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info(getValue(AbstractAction.NAME) + " triggered");
ConfigurationManager.getInstance().writeValue(configKey,
getValue(AbstractAction.SELECTED_KEY));
plugInPort.refresh();
}
}
public static class ThemeAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private Theme theme;
public ThemeAction(IPlugInPort plugInPort, Theme theme) {
super();
this.plugInPort = plugInPort;
this.theme = theme;
putValue(AbstractAction.NAME, theme.getName());
putValue(IView.RADIO_BUTTON_GROUP_KEY, "theme");
putValue(AbstractAction.SELECTED_KEY, plugInPort.getSelectedTheme().getName().equals(
theme.getName()));
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info(getValue(AbstractAction.NAME) + " triggered");
plugInPort.setSelectedTheme(theme);
}
}
public static class RenumberAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private boolean xAxisFirst;
public RenumberAction(IPlugInPort plugInPort, boolean xAxisFirst) {
super();
this.plugInPort = plugInPort;
this.xAxisFirst = xAxisFirst;
putValue(AbstractAction.NAME, xAxisFirst ? "X Axis First" : "Y Axis First");
}
@Override
public void actionPerformed(ActionEvent e) {
LOG.info(getValue(AbstractAction.NAME) + " triggered");
plugInPort.renumberSelectedComponents(xAxisFirst);
}
}
}
@@ -1,64 +0,0 @@
package org.diylc.swing;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.SwingConstants;
import javax.swing.JPopupMenu.Separator;
import org.diylc.common.BadPositionException;
import org.diylc.common.ITask;
import org.diylc.core.IView;
/**
* Interface for plugin access to the swing front end.
*
* @author Branislav Stojkovic
*/
public interface ISwingUI extends IView {
/**
* Injects a custom GUI panels provided by the plug-in and desired position
* in the window. Application will layout plug-in panels accordingly. <br>
* Valid positions are:
* <ul>
* <li> {@link SwingConstants#TOP}</li>
* <li> {@link SwingConstants#BOTTOM}</li>
* <li> {@link SwingConstants#LEFT}</li>
* <li> {@link SwingConstants#RIGHT}</li>
* </ul>
*
* Center position is reserved for the main canvas panel and cannot be used.
*
* @param component
* @param position
* @throws BadPositionException
* in case invalid position is specified
*/
void injectGUIComponent(JComponent component, int position) throws BadPositionException;
/**
* Injects a custom menu action into application's main menu. If
* <code>action</code> is set to null {@link Separator} will be added. If
* the specified menu does not exist it will be automatically created.
*
* @param action
* {@link Action} to inser
* @param menuName
* name of the menu to insert into
*/
void injectMenuAction(Action action, String menuName);
/**
* Injects a custom submenu into application's main menu. If
* <code>action</code> is set to null {@link Separator} will be added. If
* the specified menu does not exist it will be automatically created.
*
* @param name
* @param icon
* @param parentMenuName
*/
void injectSubmenu(String name, Icon icon, String parentMenuName);
<T extends Object> void executeBackgroundTask(ITask<T> task);
}
@@ -1,42 +0,0 @@
package org.diylc.swing.gui;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import javax.swing.Icon;
import javax.swing.JComponent;
public class CustomGlassPane extends JComponent {
private static final long serialVersionUID = 1L;
private Icon icon;
public CustomGlassPane() {
super();
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
if (icon != null) {
repaint();
}
}
});
}
public void setCursorIcon(Icon icon) {
this.icon = icon;
}
@Override
public void paint(Graphics g) {
Point cursor = getMousePosition();
if ((icon != null) && (cursor != null)) {
Graphics2D g2d = (Graphics2D) g;
icon.paintIcon(this, g2d, cursor.x + 10, cursor.y + 10);
}
}
}
@@ -1,155 +0,0 @@
package org.diylc.swing.gui;
import java.io.File;
import java.util.List;
import javax.swing.Icon;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.filechooser.FileFilter;
import org.diylc.common.PropertyWrapper;
import org.diylc.swing.gui.components.OverwritePromptFileChooser;
import org.diylc.swing.gui.editor.PropertyEditorDialog;
import org.diylc.swing.plugins.file.BomDialog;
import org.diylc.swing.plugins.file.BomEntry;
import org.diylc.swing.plugins.online.view.LoginDialog;
import org.diylc.swing.plugins.online.view.NewUserDialog;
import org.diylc.swing.plugins.online.view.UploadDialog;
import com.diyfever.gui.AboutDialog;
import com.diyfever.gui.IFileChooserAccessory;
import com.diyfever.gui.ProgressDialog;
import com.diyfever.gui.miscutils.ConfigurationManager;
public class DialogFactory {
private static DialogFactory instance;
private static final String PATH_KEY = "lastPath";
public static DialogFactory getInstance() {
if (instance == null) {
instance = new DialogFactory();
}
return instance;
}
private JFrame mainFrame;
private File lastDirectory;
private DialogFactory() {
}
/**
* Sets the frame to be used as dialog parent. This should be called prior
* to any other methods in this class.
*
* @param mainFrame
*/
public void initialize(JFrame mainFrame) {
this.mainFrame = mainFrame;
String lastDirectoryPath = (String) ConfigurationManager.getInstance()
.readString(PATH_KEY, null);
if (lastDirectoryPath != null) {
lastDirectory = new File(lastDirectoryPath);
}
}
public PropertyEditorDialog createPropertyEditorDialog(List<PropertyWrapper> properties,
String title) {
PropertyEditorDialog editor = new PropertyEditorDialog(mainFrame, properties, title);
return editor;
}
public BomDialog createBomDialog(List<BomEntry> bom) {
BomDialog dialog = new BomDialog(mainFrame, bom);
return dialog;
}
public File showOpenDialog(FileFilter fileFilter, File initialFile, String defaultExtension,
IFileChooserAccessory accessory) {
JFileChooser openFileChooser = new JFileChooser();
initializeFileChooser(openFileChooser, fileFilter, initialFile, defaultExtension, accessory);
int result = openFileChooser.showOpenDialog(mainFrame);
return processFileChooserResult(result, openFileChooser, defaultExtension);
}
public File showSaveDialog(FileFilter fileFilter, File initialFile, String defaultExtension,
IFileChooserAccessory accessory) {
JFileChooser saveFileChooser = new OverwritePromptFileChooser();
initializeFileChooser(saveFileChooser, fileFilter, initialFile, defaultExtension, accessory);
int result = saveFileChooser.showSaveDialog(mainFrame);
return processFileChooserResult(result, saveFileChooser, defaultExtension);
}
private void initializeFileChooser(JFileChooser fileChooser, FileFilter fileFilter,
File initialFile, String defaultExtension, IFileChooserAccessory accessory) {
if (accessory != null) {
accessory.install(fileChooser);
}
for (FileFilter filter : fileChooser.getChoosableFileFilters()) {
fileChooser.removeChoosableFileFilter(filter);
}
if (fileChooser instanceof OverwritePromptFileChooser) {
((OverwritePromptFileChooser) fileChooser).setFileFilter(fileFilter, defaultExtension);
} else {
fileChooser.setFileFilter(fileFilter);
}
if (lastDirectory != null) {
fileChooser.setCurrentDirectory(lastDirectory);
}
fileChooser.setSelectedFile(initialFile);
}
private File processFileChooserResult(int result, JFileChooser fileChooser,
String defaultExtension) {
fileChooser.setAccessory(null);
if (result == JFileChooser.APPROVE_OPTION) {
lastDirectory = fileChooser.getCurrentDirectory();
ConfigurationManager.getInstance().writeValue(PATH_KEY,
lastDirectory.getAbsolutePath());
if (fileChooser.getSelectedFile().getAbsolutePath().contains(".")) {
return fileChooser.getSelectedFile();
} else {
return new File(fileChooser.getSelectedFile().getAbsoluteFile() + "."
+ defaultExtension);
}
} else {
return null;
}
}
public AboutDialog createAboutDialog(String appName, Icon icon, String version, String author,
String url, String mail, String htmlContent) {
AboutDialog dialog = new AboutDialog(mainFrame, appName, icon, version, author, url, mail,
htmlContent);
return dialog;
}
public NewUserDialog createNewUserDialog() {
NewUserDialog dialog = new NewUserDialog(mainFrame);
return dialog;
}
public LoginDialog createLoginDialog() {
LoginDialog dialog = new LoginDialog(mainFrame);
return dialog;
}
public UploadDialog createUploadDialog() {
UploadDialog dialog = new UploadDialog(mainFrame);
return dialog;
}
public ProgressDialog createProgressDialog(String title, String[] buttonCaptions,
String description, boolean useProgress) {
ProgressDialog dialog = new ProgressDialog(mainFrame, title, buttonCaptions, description,
useProgress);
return dialog;
}
}
@@ -1,370 +0,0 @@
package org.diylc.swing.gui;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.swing.Action;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import javax.swing.Timer;
import org.apache.log4j.Logger;
import org.diylc.common.BadPositionException;
import org.diylc.common.EventType;
import org.diylc.common.IPlugIn;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ITask;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IView;
import org.diylc.images.IconLoader;
import org.diylc.presenter.Presenter;
import org.diylc.swing.ISwingUI;
import org.diylc.swing.gui.editor.PropertyEditorDialog;
import org.diylc.swing.plugins.autosave.AutoSavePlugin;
import org.diylc.swing.plugins.canvas.CanvasPlugin;
import org.diylc.swing.plugins.config.ConfigPlugin;
import org.diylc.swing.plugins.edit.EditMenuPlugin;
import org.diylc.swing.plugins.file.FileMenuPlugin;
import org.diylc.swing.plugins.help.HelpMenuPlugin;
import org.diylc.swing.plugins.layers.LayersMenuPlugin;
import org.diylc.swing.plugins.statusbar.StatusBar;
import org.diylc.swing.plugins.toolbox.ToolBox;
import com.diyfever.gui.ButtonDialog;
import com.diyfever.gui.miscutils.ConfigurationManager;
public class MainFrame extends JFrame implements ISwingUI {
private static final Logger LOG = Logger.getLogger(MainFrame.class);
private static final long serialVersionUID = 1L;
private JPanel centerPanel;
private JPanel leftPanel;
private JPanel rightPanel;
private JPanel topPanel;
private JPanel bottomPanel;
private Presenter presenter;
private JMenuBar mainMenuBar;
private Map<String, JMenu> menuMap;
private Map<String, ButtonGroup> buttonGroupMap;
private CanvasPlugin canvasPlugin;
public MainFrame() {
super("DIYLC 3");
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setPreferredSize(new Dimension(800, 600));
createBasePanels();
menuMap = new HashMap<String, JMenu>();
buttonGroupMap = new HashMap<String, ButtonGroup>();
setIconImages(Arrays.asList(IconLoader.IconSmall.getImage(), IconLoader.IconMedium
.getImage(), IconLoader.IconLarge.getImage()));
DialogFactory.getInstance().initialize(this);
this.presenter = new Presenter(this);
presenter.installPlugin(new ToolBox(this));
presenter.installPlugin(new FileMenuPlugin(this));
presenter.installPlugin(new EditMenuPlugin(this));
presenter.installPlugin(new ConfigPlugin(this));
presenter.installPlugin(new LayersMenuPlugin(this));
// presenter.installPlugin(new OnlineManager());
presenter.installPlugin(new HelpMenuPlugin(this));
presenter.installPlugin(new StatusBar(this));
canvasPlugin = new CanvasPlugin(this);
presenter.installPlugin(canvasPlugin);
presenter.installPlugin(new FramePlugin());
try {
File testFile = new File("test.tmp");
Writer out = new OutputStreamWriter(new FileOutputStream(testFile));
out.write("This is a test");
out.close();
testFile.delete();
presenter.installPlugin(new AutoSavePlugin(this));
} catch (Exception e) {
showMessage(
"The current user does not have permissions to access folder "
+ new File(".").getAbsolutePath()
+ ".\nAuto-save feature will not be available, contact your system administrator.",
"Warning", IView.WARNING_MESSAGE);
}
presenter.createNewProject();
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
if (presenter.allowFileAction()) {
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY,
false);
dispose();
presenter.dispose();
System.exit(0);
}
}
@Override
public void windowClosing(WindowEvent e) {
if (presenter.allowFileAction()) {
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY,
false);
dispose();
presenter.dispose();
System.exit(0);
}
}
});
// setGlassPane(new CustomGlassPane());
// getGlassPane().setVisible(true);
}
public Presenter getPresenter() {
return presenter;
}
@Override
public void setVisible(boolean b) {
super.setVisible(b);
// TODO: hack to prevent painting issues in the scroll bar rulers. Find
// a better fix if possible.
Timer timer = new Timer(500, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
canvasPlugin.refresh();
}
});
timer.setRepeats(false);
timer.start();
// if (b) {
// SwingUtilities.invokeLater(new Runnable() {
// @Override
// public void run() {
//
// }
// });
// }
}
private void createBasePanels() {
Container c = new Container();
c.setLayout(new BorderLayout());
centerPanel = new JPanel(new BorderLayout());
c.add(centerPanel, BorderLayout.CENTER);
topPanel = new JPanel();
topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS));
c.add(topPanel, BorderLayout.NORTH);
leftPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.X_AXIS));
c.add(leftPanel, BorderLayout.WEST);
bottomPanel = new JPanel();
bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.Y_AXIS));
c.add(bottomPanel, BorderLayout.SOUTH);
rightPanel = new JPanel();
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.X_AXIS));
c.add(rightPanel, BorderLayout.EAST);
setContentPane(c);
}
private JMenuBar getMainMenuBar() {
if (mainMenuBar == null) {
mainMenuBar = new JMenuBar();
setJMenuBar(mainMenuBar);
}
return mainMenuBar;
}
// IView
@Override
public void showMessage(String message, String title, int messageType) {
JOptionPane.showMessageDialog(this, message, title, messageType);
}
@Override
public int showConfirmDialog(String message, String title, int optionType, int messageType) {
return JOptionPane.showConfirmDialog(this, message, title, optionType, messageType);
}
@Override
public boolean editProperties(List<PropertyWrapper> properties,
Set<PropertyWrapper> defaultedProperties) {
PropertyEditorDialog editor = DialogFactory.getInstance().createPropertyEditorDialog(
properties, "Edit Selection");
editor.setVisible(true);
defaultedProperties.addAll(editor.getDefaultedProperties());
return ButtonDialog.OK.equals(editor.getSelectedButtonCaption());
}
private JMenu findOrCreateMenu(String menuName) {
JMenu menu;
if (menuMap.containsKey(menuName)) {
menu = menuMap.get(menuName);
} else {
menu = new JMenu(menuName);
menuMap.put(menuName, menu);
getMainMenuBar().add(menu);
}
return menu;
}
@Override
public void injectGUIComponent(JComponent component, int position) throws BadPositionException {
LOG.info(String.format("injectGUIComponent(%s, %s)", component.getClass().getName(),
position));
switch (position) {
case SwingConstants.TOP:
topPanel.add(component);
break;
case SwingConstants.LEFT:
leftPanel.add(component);
break;
case SwingConstants.BOTTOM:
bottomPanel.add(component);
break;
case SwingConstants.RIGHT:
rightPanel.add(component);
break;
case SwingConstants.CENTER:
centerPanel.add(component, BorderLayout.CENTER);
break;
default:
throw new BadPositionException();
}
pack();
}
@Override
public void injectMenuAction(Action action, String menuName) {
LOG.info(String.format("injectMenuAction(%s, %s)", action == null ? "Separator" : action
.getValue(Action.NAME), menuName));
JMenu menu = findOrCreateMenu(menuName);
if (action == null) {
menu.addSeparator();
} else {
Boolean isCheckBox = (Boolean) action.getValue(IView.CHECK_BOX_MENU_ITEM);
String groupName = (String) action.getValue(IView.RADIO_BUTTON_GROUP_KEY);
if (isCheckBox != null && isCheckBox) {
menu.add(new JCheckBoxMenuItem(action));
} else if (groupName != null) {
ButtonGroup group;
if (buttonGroupMap.containsKey(groupName)) {
group = buttonGroupMap.get(groupName);
} else {
group = new ButtonGroup();
buttonGroupMap.put(groupName, group);
}
JRadioButtonMenuItem item = new JRadioButtonMenuItem(action);
group.add(item);
menu.add(item);
} else {
menu.add(action);
}
}
}
@Override
public void injectSubmenu(String name, Icon icon, String parentMenuName) {
LOG.info(String.format("injectSubmenu(%s, icon, %s)", name, parentMenuName));
JMenu menu = findOrCreateMenu(parentMenuName);
JMenu submenu = new JMenu(name);
submenu.setIcon(icon);
menu.add(submenu);
menuMap.put(name, submenu);
}
@Override
public <T extends Object> void executeBackgroundTask(final ITask<T> task) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
SwingWorker<T, Void> worker = new SwingWorker<T, Void>() {
@Override
protected T doInBackground() throws Exception {
return task.doInBackground();
}
@Override
protected void done() {
try {
T result = get();
task.complete(result);
} catch (Exception e) {
LOG.error("Task failed", e);
task.failed(e);
}
setCursor(Cursor.getDefaultCursor());
}
};
worker.execute();
}
class FramePlugin implements IPlugIn {
private IPlugInPort plugInPort;
@Override
public void connect(IPlugInPort plugInPort) {
this.plugInPort = plugInPort;
}
@Override
public EnumSet<EventType> getSubscribedEventTypes() {
return EnumSet.of(EventType.FILE_STATUS_CHANGED);
}
@Override
public void processMessage(EventType eventType, Object... params) {
if (eventType == EventType.FILE_STATUS_CHANGED) {
String fileName = (String) params[0];
if (fileName == null) {
fileName = "Untitled";
}
String modified = (Boolean) params[1] ? " (modified)" : "";
setTitle(String.format("DIYLC %s beta - %s %s", plugInPort
.getCurrentVersionNumber(), fileName, modified));
}
}
}
}
@@ -1,285 +0,0 @@
package org.diylc.swing.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.apache.log4j.Logger;
import org.diylc.common.DrawOption;
import org.diylc.common.IPlugInPort;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IView;
import org.diylc.presenter.Presenter;
import com.diyfever.gui.miscutils.ConfigurationManager;
public class TemplateDialog extends JDialog {
private static final long serialVersionUID = 1L;
private static final Logger LOG = Logger.getLogger(TemplateDialog.class);
private static final Dimension panelSize = new Dimension(400, 300);
public static final String SHOW_TEMPLATES_KEY = "showTemplatesAtStartup";
private IPlugInPort plugInPort;
private JList fileList;
private JPanel canvasPanel;
private Presenter presenter;
private List<File> files;
private JCheckBox showTemplatesBox;
private JPanel mainPanel;
private JButton loadButton;
private JPanel infoPanel;
public TemplateDialog(JFrame owner, IPlugInPort plugInPort) {
super(owner, "Templates");
setModal(true);
setResizable(false);
this.plugInPort = plugInPort;
this.presenter = new Presenter(new IView() {
@Override
public int showConfirmDialog(String message, String title, int optionType,
int messageType) {
return JOptionPane.showConfirmDialog(TemplateDialog.this, message, title,
optionType, messageType);
}
@Override
public void showMessage(String message, String title, int messageType) {
JOptionPane.showMessageDialog(TemplateDialog.this, message, title, messageType);
}
@Override
public boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties) {
return false;
}
});
// this.presenter.installPlugin(new IPlugIn() {
//
// @Override
// public void connect(IPlugInPort plugInPort) {
// }
//
// @Override
// public EnumSet<EventType> getSubscribedEventTypes() {
// return EnumSet.of(EventType.REPAINT);
// }
//
// @Override
// public void processMessage(EventType eventType, Object... params) {
// if (eventType == EventType.REPAINT) {
// getCanvasPanel().repaint();
// }
// }
// });
setContentPane(getMainPanel());
pack();
setLocationRelativeTo(owner);
}
public JPanel getMainPanel() {
if (mainPanel == null) {
mainPanel = new JPanel(new GridBagLayout());
mainPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weightx = 0;
c.weighty = 1;
c.weightx = 1;
c.gridwidth = 2;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(0, 0, 4, 0);
mainPanel.add(getInfoPanel(), c);
c.gridy = 1;
c.weightx = 0;
c.gridwidth = 1;
c.insets = new Insets(0, 0, 0, 0);
JScrollPane scrollPane = new JScrollPane(getFileList());
mainPanel.add(scrollPane, c);
c.gridx = 1;
c.weightx = 1;
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(scrollPane.getBorder());
panel.add(getCanvasPanel(), BorderLayout.CENTER);
mainPanel.add(panel, c);
c.gridx = 0;
c.gridy = 2;
c.weightx = 0;
c.weighty = 0;
c.anchor = GridBagConstraints.LAST_LINE_START;
c.fill = GridBagConstraints.NONE;
mainPanel.add(getShowTemplatesBox(), c);
c.gridx = 1;
c.anchor = GridBagConstraints.LAST_LINE_END;
c.insets = new Insets(4, 0, 0, 0);
mainPanel.add(getLoadButton(), c);
}
return mainPanel;
}
public JButton getLoadButton() {
if (loadButton == null) {
loadButton = new JButton("Load Template");
loadButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
plugInPort.loadProject(presenter.getCurrentProject(), true);
dispose();
}
});
}
return loadButton;
}
public JPanel getInfoPanel() {
if (infoPanel == null) {
infoPanel = new JPanel();
infoPanel.setBackground(Color.decode("#FFFFCC"));
infoPanel.setBorder(new JTextField().getBorder());
JLabel infoLabel = new JLabel(
"<html>Templates are semi-product layouts that are used as a starting point for your projects.<br>"
+ "Pick a templete in the left list and click \"Load Template\" to load it or close this dialog to continue.<br>"
+ "You can create your own templates by placing a DIY file into <b>diylc/templates</b> directory.</html>");
infoLabel.setOpaque(false);
infoPanel.add(infoLabel);
}
return infoPanel;
}
public JList getFileList() {
if (fileList == null) {
fileList = new JList(getFiles().toArray());
fileList.setPreferredSize(new Dimension(128, -1));
fileList.setCellRenderer(new DefaultListCellRenderer() {
private static final long serialVersionUID = 1L;
@Override
public Component getListCellRendererComponent(JList list, Object value, int index,
boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index,
isSelected, cellHasFocus);
if (value instanceof File) {
label.setText(((File) value).getName());
}
return label;
}
});
fileList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
File file = (File) fileList.getSelectedValue();
if (file != null) {
presenter.loadProjectFromFile(file.getAbsolutePath());
Dimension dim = presenter.getCanvasDimensions(true);
double xFactor = panelSize.getWidth() / dim.getWidth();
double yFactor = panelSize.getHeight() / dim.getHeight();
presenter.setZoomLevel(Math.min(xFactor, yFactor));
getCanvasPanel().repaint();
}
}
});
fileList.setSelectedIndex(0);
}
return fileList;
}
public JCheckBox getShowTemplatesBox() {
if (showTemplatesBox == null) {
showTemplatesBox = new JCheckBox("Show this dialog at startup");
showTemplatesBox.setSelected(true);
showTemplatesBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ConfigurationManager.getInstance().writeValue(SHOW_TEMPLATES_KEY,
showTemplatesBox.isSelected());
}
});
}
return showTemplatesBox;
}
public List<File> getFiles() {
if (files == null) {
files = new ArrayList<File>();
File dir = new File("templates");
if (dir.exists()) {
for (File f : dir.listFiles()) {
if (f.isFile() && f.getName().toLowerCase().endsWith(".diy")) {
files.add(f);
}
}
}
LOG.debug("Found " + files.size() + " templates");
}
return files;
}
public JPanel getCanvasPanel() {
if (canvasPanel == null) {
canvasPanel = new JPanel() {
private static final long serialVersionUID = 1L;
@Override
public void paint(Graphics g) {
super.paint(g);
// Graphics2D g2d = (Graphics2D) g;
// AffineTransform transform = g2d.getTransform();
presenter.draw((Graphics2D) g, EnumSet.of(DrawOption.ZOOM,
DrawOption.ANTIALIASING), null);
// g2d.setTransform(transform);
// Rectangle rect = canvasPanel.getBounds();
// BorderFactory.createEtchedBorder().paintBorder(canvasPanel,
// g, 0, 0,
// (int) rect.getWidth(), (int) rect.getHeight());
}
};
canvasPanel.setBackground(Color.white);
canvasPanel.setPreferredSize(panelSize);
}
return canvasPanel;
}
}
@@ -1,38 +0,0 @@
package org.diylc.swing.gui.components;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
public class OverwritePromptFileChooser extends JFileChooser {
private static final long serialVersionUID = 1L;
private String defaultExtension;
public void approveSelection() {
File lSelectedFile;
if (getSelectedFile().getAbsolutePath().contains(".")) {
lSelectedFile = getSelectedFile();
} else {
lSelectedFile = new File(getSelectedFile().getAbsoluteFile() + "." + defaultExtension);
}
if (lSelectedFile != null && lSelectedFile.exists()) {
int lResponse = JOptionPane.showConfirmDialog(this, lSelectedFile.getAbsolutePath()
+ " already exists.\nDo you " + "want to replace it?", "Warning",
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (lResponse != JOptionPane.YES_OPTION) {
return;
}
}
super.approveSelection();
}
public void setFileFilter(FileFilter filter, String defaultExtension) {
this.defaultExtension = defaultExtension;
super.setFileFilter(filter);
}
}
@@ -1,34 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
public class BooleanEditor extends JCheckBox {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
public BooleanEditor(final PropertyWrapper property) {
super();
setSelected((Boolean) property.getValue());
addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
property.setChanged(true);
setBackground(oldBg);
property.setValue(isSelected());
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
}
@@ -1,36 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
public class ByteEditor extends JSlider {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
public ByteEditor(final PropertyWrapper property) {
super();
setMinimum(0);
setMaximum(127);
setValue((Byte) property.getValue());
addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
property.setChanged(true);
setBackground(oldBg);
property.setValue(new Integer(getValue()).byteValue());
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
}
@@ -1,52 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BorderFactory;
import javax.swing.JColorChooser;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import org.diylc.common.PropertyWrapper;
public class ColorEditor extends JLabel {
private static final long serialVersionUID = 1L;
private static final String title = "Click to edit";
public ColorEditor(final PropertyWrapper property) {
super(property.isUnique() ? title : ("(multi value) " + title));
setOpaque(true);
setHorizontalAlignment(SwingConstants.CENTER);
setBorder(BorderFactory.createEtchedBorder());
setBackground((Color) property.getValue());
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Color newColor = JColorChooser.showDialog(ColorEditor.this, "Choose Color",
getBackground());
if (newColor != null) {
property.setChanged(true);
property.setValue(newColor);
setBackground(newColor);
}
}
});
}
@Override
public void setBackground(Color bg) {
if (bg.getRed() < 127 || bg.getBlue() < 127 || bg.getGreen() < 127) {
setForeground(Color.white);
} else {
setForeground(Color.black);
}
super.setBackground(bg);
}
}
@@ -1,41 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
public class EnumEditor extends JComboBox {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
private final PropertyWrapper property;
public EnumEditor(final PropertyWrapper property) {
this.property = property;
Object[] values = property.getType().getEnumConstants();
setModel(new DefaultComboBoxModel(values));
setSelectedItem(property.getValue());
addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
property.setChanged(true);
setBackground(oldBg);
EnumEditor.this.property.setValue(e.getItem());
}
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
}
@@ -1,61 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import org.apache.log4j.Logger;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.measures.AbstractMeasure;
public class FieldEditorFactory {
private static final Logger LOG = Logger.getLogger(FieldEditorFactory.class);
public static Component createFieldEditor(PropertyWrapper property) {
if (property.getType().equals(String.class)) {
StringEditor editor = new StringEditor(property);
return editor;
}
if (property.getType().equals(Color.class)) {
ColorEditor editor = new ColorEditor(property);
return editor;
}
if (AbstractMeasure.class.isAssignableFrom(property.getType())) {
MeasureEditor editor = new MeasureEditor(property);
return editor;
}
if (ImageIcon.class.isAssignableFrom(property.getType())) {
ImageEditor editor = new ImageEditor(property);
return editor;
}
if (property.getType().isEnum()) {
EnumEditor editor = new EnumEditor(property);
return editor;
}
if (Byte.class.isAssignableFrom(property.getType())
|| byte.class.isAssignableFrom(property.getType())) {
ByteEditor editor = new ByteEditor(property);
return editor;
}
if (Boolean.class.isAssignableFrom(property.getType())
|| boolean.class.isAssignableFrom(property.getType())) {
BooleanEditor editor = new BooleanEditor(property);
return editor;
}
if (Font.class.isAssignableFrom(property.getType())) {
FontEditor editor = new FontEditor(property);
return editor;
}
if (Integer.class.isAssignableFrom(property.getType())
|| int.class.isAssignableFrom(property.getType())) {
IntEditor editor = new IntEditor(property);
return editor;
}
LOG.error("Unrecognized parameter type: " + property.getType().getName());
return new JLabel("Unrecognized");
}
}
@@ -1,42 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
import com.diyfever.gui.FontChooserComboBox;
public class FontEditor extends FontChooserComboBox {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
private final PropertyWrapper property;
public FontEditor(final PropertyWrapper property) {
this.property = property;
setSelectedItem(((Font) property.getValue()).getName());
addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
property.setChanged(true);
setBackground(oldBg);
Font oldFont = (Font) FontEditor.this.property.getValue();
Font newFont = new Font(getSelectedItem().toString(), oldFont.getStyle(),
oldFont.getSize());
FontEditor.this.property.setValue(newFont);
}
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
}
@@ -1,46 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import org.diylc.common.PropertyWrapper;
import org.diylc.swing.gui.DialogFactory;
import org.diylc.swing.plugins.file.FileFilterEnum;
public class ImageEditor extends JButton {
private static final long serialVersionUID = 1L;
private static final String title = "Click to load image file";
public ImageEditor(final PropertyWrapper property) {
super(property.isUnique() ? title : ("(multi value) " + title));
addActionListener(new ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
File file = DialogFactory.getInstance().showOpenDialog(
FileFilterEnum.IMAGES.getFilter(), null,
FileFilterEnum.IMAGES.getExtensions()[0], null);
if (file != null) {
property.setChanged(true);
ImageIcon image = new ImageIcon(file.getAbsolutePath());
property.setValue(image);
}
}
});
}
// @Override
// public void setBackground(Color bg) {
// if (bg.getRed() < 127 || bg.getBlue() < 127 || bg.getGreen() < 127) {
// setForeground(Color.white);
// } else {
// setForeground(Color.black);
// }
// super.setBackground(bg);
// }
}
@@ -1,35 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.BorderLayout;
import java.awt.Color;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
import com.diyfever.gui.DoubleTextField;
public class IntEditor extends DoubleTextField {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
public IntEditor(final PropertyWrapper property) {
setLayout(new BorderLayout());
setValue((double) (Integer) property.getValue());
addPropertyChangeListener(DoubleTextField.VALUE_PROPERTY, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
property.setChanged(true);
setBackground(oldBg);
property.setValue(((Double) evt.getNewValue()).intValue());
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
}
@@ -1,97 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.swing.JComboBox;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.measures.AbstractMeasure;
import org.diylc.core.measures.Unit;
import org.diylc.utils.Constants;
import com.diyfever.gui.DoubleTextField;
public class MeasureEditor extends Container {
private static final long serialVersionUID = 1L;
private Color oldBg;
private DoubleTextField valueField;
private JComboBox unitBox;
@SuppressWarnings("unchecked")
public MeasureEditor(final PropertyWrapper property) {
setLayout(new BorderLayout());
AbstractMeasure measure = ((AbstractMeasure) property.getValue());
valueField = new DoubleTextField(measure.getValue());
oldBg = valueField.getBackground();
valueField.addPropertyChangeListener(DoubleTextField.VALUE_PROPERTY,
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
try {
AbstractMeasure<?> newMeasure = (AbstractMeasure<?>) ((AbstractMeasure) property
.getValue()).clone();
newMeasure.setValue((Double) evt.getNewValue());
property.setValue(newMeasure);
property.setChanged(true);
valueField.setBackground(oldBg);
unitBox.setBackground(oldBg);
} catch (CloneNotSupportedException ex) {
}
}
});
add(valueField, BorderLayout.CENTER);
try {
Method method = measure.getUnit().getClass().getMethod("values");
unitBox = new JComboBox((Object[]) method.invoke(measure.getUnit()));
unitBox.setSelectedItem(measure.getUnit());
unitBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
AbstractMeasure<Enum<? extends Unit>> newMeasure = (AbstractMeasure<Enum<? extends Unit>>) ((AbstractMeasure) property
.getValue()).clone();
newMeasure.setUnit((Enum<? extends Unit>) unitBox.getSelectedItem());
property.setValue(newMeasure);
property.setChanged(true);
valueField.setBackground(oldBg);
unitBox.setBackground(oldBg);
} catch (CloneNotSupportedException ex) {
}
}
});
add(unitBox, BorderLayout.EAST);
if (!property.isUnique()) {
valueField.setBackground(Constants.MULTI_VALUE_COLOR);
unitBox.setBackground(Constants.MULTI_VALUE_COLOR);
}
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@@ -1,170 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import org.apache.log4j.Logger;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.ValidationException;
import com.diyfever.gui.ButtonDialog;
public class PropertyEditorDialog extends ButtonDialog {
private static final Logger LOG = Logger.getLogger(PropertyEditorDialog.class);
private static final long serialVersionUID = 1L;
private static final String DEFAULT_BOX_TOOLTIP = "<html>If this box is checked application will use the current value as a<br>default when creating new components of the same type</html>";
private List<PropertyWrapper> properties;
private Set<PropertyWrapper> defaultedProperties;
public PropertyEditorDialog(JFrame owner, List<PropertyWrapper> properties, String title) {
super(owner, title, new String[] { ButtonDialog.OK, ButtonDialog.CANCEL });
LOG.debug("Creating property editor for: " + properties);
this.properties = properties;
this.defaultedProperties = new HashSet<PropertyWrapper>();
setMinimumSize(new Dimension(240, 40));
layoutGui();
setLocationRelativeTo(owner);
//
// setModal(true);
//
// JPanel holderPanel = new JPanel();
// holderPanel.setLayout(new BorderLayout());
// holderPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
//
// holderPanel.add(createEditorFields(), BorderLayout.CENTER);
// holderPanel.add(createButtonPanel(), BorderLayout.SOUTH);
//
// setContentPane(holderPanel);
//
//
// pack();
// setLocationRelativeTo(owner);
}
@Override
protected boolean validateInput(String button) {
if (button.equals(ButtonDialog.OK)) {
for (PropertyWrapper property : properties) {
try {
property.getValidator().validate(property.getValue());
} catch (ValidationException ve) {
JOptionPane.showMessageDialog(PropertyEditorDialog.this, "Input error for \""
+ property.getName() + "\": " + ve.getMessage(), "Error",
JOptionPane.ERROR_MESSAGE);
return false;
}
}
}
return true;
}
private JPanel createEditorFields() {
JPanel editorPanel = new JPanel(new GridBagLayout());
editorPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridy = 0;
gbc.insets = new Insets(2, 2, 2, 2);
gbc.anchor = GridBagConstraints.LINE_START;
for (PropertyWrapper property : properties) {
gbc.gridx = 0;
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 0;
editorPanel.add(new JLabel(property.getName() + ": "), gbc);
gbc.gridx = 1;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1;
Component editor = FieldEditorFactory.createFieldEditor(property);
editor.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
getButton(OK).doClick();
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
getButton(CANCEL).doClick();
}
}
});
editorPanel.add(editor, gbc);
if (property.isDefaultable()) {
gbc.gridx = 2;
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 0;
editorPanel.add(createDefaultCheckBox(property), gbc);
}
gbc.gridy++;
}
return editorPanel;
}
private JCheckBox createDefaultCheckBox(final PropertyWrapper property) {
final JCheckBox checkBox = new JCheckBox();
checkBox.setToolTipText(DEFAULT_BOX_TOOLTIP);
checkBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (checkBox.isSelected()) {
defaultedProperties.add(property);
} else {
defaultedProperties.remove(property);
}
}
});
return checkBox;
}
public Set<PropertyWrapper> getDefaultedProperties() {
return defaultedProperties;
}
public static boolean showFor(JFrame owner, List<PropertyWrapper> properties, String title) {
PropertyEditorDialog editor = new PropertyEditorDialog(owner, properties, title);
editor.setVisible(true);
if (OK.equals(editor.getSelectedButtonCaption())) {
return true;
}
return false;
}
@Override
protected JComponent getMainComponent() {
return createEditorFields();
}
}
@@ -1,50 +0,0 @@
package org.diylc.swing.gui.editor;
import java.awt.Color;
import javax.swing.JTextField;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.diylc.common.PropertyWrapper;
import org.diylc.utils.Constants;
public class StringEditor extends JTextField {
private static final long serialVersionUID = 1L;
private Color oldBg = getBackground();
private final PropertyWrapper property;
public StringEditor(PropertyWrapper property) {
super(property.getValue() == null ? "" : (String) property.getValue());
this.property = property;
getDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void insertUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void removeUpdate(DocumentEvent e) {
textChanged();
}
});
if (!property.isUnique()) {
setBackground(Constants.MULTI_VALUE_COLOR);
}
}
private void textChanged() {
property.setChanged(true);
setBackground(oldBg);
property.setValue(getText());
}
}
@@ -1,73 +0,0 @@
package org.diylc.swing.plugins.autosave;
import java.io.File;
import java.util.EnumSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.swing.SwingUtilities;
import org.diylc.common.EventType;
import org.diylc.common.IPlugIn;
import org.diylc.common.IPlugInPort;
import org.diylc.core.IView;
import com.diyfever.gui.miscutils.ConfigurationManager;
public class AutoSavePlugin implements IPlugIn {
private static final String AUTO_SAVE_FILE_NAME = "autoSave.diy";
private ExecutorService executor;
private IPlugInPort plugInPort;
private IView view;
public AutoSavePlugin(IView view) {
this.view = view;
executor = Executors.newSingleThreadExecutor();
}
@Override
public void connect(IPlugInPort plugInPort) {
this.plugInPort = plugInPort;
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
boolean wasAbnormal = ConfigurationManager.getInstance().readBoolean(
IPlugInPort.ABNORMAL_EXIT_KEY, false);
if (wasAbnormal && new File(AUTO_SAVE_FILE_NAME).exists()) {
int decision = view
.showConfirmDialog(
"It appears that aplication was not closed normally in the previous session. Do you want to open the last auto-saved file?",
"Auto-Save", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE);
if (decision == IView.YES_OPTION) {
AutoSavePlugin.this.plugInPort.loadProjectFromFile(AUTO_SAVE_FILE_NAME);
}
}
// Set abnormal flag to true, GUI side of the app must flip to
// false when app closes regularly.
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, true);
}
});
}
@Override
public EnumSet<EventType> getSubscribedEventTypes() {
return EnumSet.of(EventType.PROJECT_MODIFIED);
}
@Override
public void processMessage(EventType eventType, Object... params) {
if (eventType == EventType.PROJECT_MODIFIED) {
executor.execute(new Runnable() {
@Override
public void run() {
plugInPort.saveProjectToFile(AUTO_SAVE_FILE_NAME, true);
}
});
}
}
}
@@ -1,29 +0,0 @@
package org.diylc.swing.plugins.canvas;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import org.diylc.common.IPlugInPort;
/**
* {@link DragGestureListener} for {@link CanvasPanel}.
*
* @author Branislav Stojkovic
*/
class CanvasGestureListener implements DragGestureListener {
private IPlugInPort presenter;
public CanvasGestureListener(IPlugInPort presenter) {
super();
this.presenter = presenter;
}
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
presenter.dragStarted(dge.getDragOrigin(), dge.getTriggerEvent().isControlDown(), dge
.getTriggerEvent().isShiftDown(), dge.getTriggerEvent().isAltDown());
dge.startDrag(presenter.getCursorAt(dge.getDragOrigin()), new EmptyTransferable(),
new CanvasSourceListener(presenter));
}
}
@@ -1,210 +0,0 @@
package org.diylc.swing.plugins.canvas;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.dnd.Autoscroll;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragSource;
import java.awt.dnd.DropTarget;
import java.awt.event.ActionEvent;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.VolatileImage;
import java.util.EnumSet;
import java.util.Set;
import javax.swing.AbstractAction;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import org.diylc.common.DrawOption;
import org.diylc.common.IPlugInPort;
import com.diyfever.gui.miscutils.ConfigurationManager;
/**
* GUI class used to draw onto.
*
* @author Branislav Stojkovic
*/
class CanvasPanel extends JComponent implements Autoscroll {
private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort;
private Image bufferImage;
private GraphicsConfiguration screenGraphicsConfiguration;
private static boolean USE_HARDWARE_ACCELLERATION = false;
// static final EnumSet<DrawOption> DRAW_OPTIONS = EnumSet.of(DrawOption.GRID,
// DrawOption.SELECTION, DrawOption.ZOOM, DrawOption.CONTROL_POINTS);
// static final EnumSet<DrawOption> DRAW_OPTIONS_ANTI_ALIASING = EnumSet.of(DrawOption.GRID,
// DrawOption.SELECTION, DrawOption.ZOOM, DrawOption.ANTIALIASING,
// DrawOption.CONTROL_POINTS);
public CanvasPanel(IPlugInPort plugInPort) {
super();
this.plugInPort = plugInPort;
setFocusable(true);
initializeListeners();
initializeDnD();
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = graphicsEnvironment.getScreenDevices();
screenGraphicsConfiguration = devices[0].getDefaultConfiguration();
initializeActions();
}
public void invalidateCache() {
bufferImage = null;
}
private void initializeDnD() {
// Initialize drag source recognizer.
DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(this,
DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK,
new CanvasGestureListener(plugInPort));
// Initialize drop target.
new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE,
new CanvasTargetListener(plugInPort), true);
}
private void initializeActions() {
getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "clearSlot");
getActionMap().put("clearSlot", new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
CanvasPanel.this.plugInPort.setNewComponentTypeSlot(null);
}
});
}
protected void createBufferImage() {
if (USE_HARDWARE_ACCELLERATION) {
bufferImage = screenGraphicsConfiguration.createCompatibleVolatileImage(getWidth(),
getHeight());
((VolatileImage) bufferImage).validate(screenGraphicsConfiguration);
} else {
bufferImage = createImage(getWidth(), getHeight());
}
}
@Override
public void paint(Graphics g) {
if (plugInPort == null) {
return;
}
if (bufferImage == null) {
createBufferImage();
}
Graphics2D g2d = (Graphics2D) bufferImage.getGraphics();
g2d.setClip(getVisibleRect());
Set<DrawOption> drawOptions = EnumSet.of(DrawOption.GRID, DrawOption.SELECTION,
DrawOption.ZOOM, DrawOption.CONTROL_POINTS);
if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.ANTI_ALIASING_KEY, true)) {
drawOptions.add(DrawOption.ANTIALIASING);
}
if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.OUTLINE_KEY, false)) {
drawOptions.add(DrawOption.OUTLINE_MODE);
}
plugInPort.draw(g2d, drawOptions, null);
if (USE_HARDWARE_ACCELLERATION) {
VolatileImage volatileImage = (VolatileImage) bufferImage;
do {
try {
if (volatileImage.contentsLost()) {
createBufferImage();
}
// int validation =
// volatileImage.validate(screenGraphicsConfiguration);
// if (validation == VolatileImage.IMAGE_INCOMPATIBLE) {
// createBufferImage();
// }
g.drawImage(bufferImage, 0, 0, this);
} catch (NullPointerException e) {
createBufferImage();
}
} while (volatileImage == null || volatileImage.contentsLost());
} else {
g.drawImage(bufferImage, 0, 0, this);
// bufferImage.flush();
}
}
@Override
public void update(Graphics g) {
paint(g);
}
private void initializeListeners() {
addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
invalidateCache();
invalidate();
}
});
// addKeyListener(new KeyAdapter() {
//
// @Override
// public void keyPressed(KeyEvent e) {
// if (e.getKeyCode() == KeyEvent.VK_DELETE) {
// plugInPort.deleteSelectedComponents();
// }
// // plugInPort.mouseMoved(getMousePosition(), e.isControlDown(),
// // e.isShiftDown(), e
// // .isAltDown());
// }
// });
addMouseMotionListener(new MouseAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
setCursor(plugInPort.getCursorAt(e.getPoint()));
plugInPort.mouseMoved(e.getPoint(), e.isControlDown(), e.isShiftDown(), e
.isAltDown());
}
});
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
plugInPort.mouseClicked(e.getPoint(), e.isControlDown(), e.isShiftDown(), e
.isAltDown(), e.getClickCount());
}
}
});
}
// Autoscroll
@Override
public void autoscroll(Point cursorLocn) {
scrollRectToVisible(new Rectangle(cursorLocn.x - 15, cursorLocn.y - 15, 30, 30));
}
@Override
public Insets getAutoscrollInsets() {
Rectangle rect = getVisibleRect();
return new Insets(rect.y - 15, rect.x - 15, rect.y + rect.height + 15, rect.x + rect.width
+ 15);
}
}
@@ -1,319 +0,0 @@
package org.diylc.swing.plugins.canvas;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.Transferable;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.util.EnumSet;
import javax.swing.JPopupMenu;
import javax.swing.SwingConstants;
import org.apache.log4j.Logger;
import org.diylc.common.BadPositionException;
import org.diylc.common.EventType;
import org.diylc.common.IPlugIn;
import org.diylc.common.IPlugInPort;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.presenter.Presenter;
import org.diylc.swing.ActionFactory;
import org.diylc.swing.ISwingUI;
import org.diylc.swing.plugins.edit.ComponentTransferable;
import org.diylc.swing.plugins.file.ProjectDrawingProvider;
import com.diyfever.gui.miscutils.ConfigurationManager;
import com.diyfever.gui.miscutils.IConfigListener;
import com.diyfever.gui.ruler.IRulerListener;
import com.diyfever.gui.ruler.RulerScrollPane;
public class CanvasPlugin implements IPlugIn, ClipboardOwner {
private static final Logger LOG = Logger.getLogger(CanvasPlugin.class);
private RulerScrollPane scrollPane;
private CanvasPanel canvasPanel;
private JPopupMenu popupMenu;
private ActionFactory.CutAction cutAction;
private ActionFactory.CopyAction copyAction;
private ActionFactory.PasteAction pasteAction;
private ActionFactory.EditSelectionAction editSelectionAction;
private ActionFactory.DeleteSelectionAction deleteSelectionAction;
private ActionFactory.GroupAction groupAction;
private ActionFactory.UngroupAction ungroupAction;
private ActionFactory.SendToBackAction sendToBackAction;
private ActionFactory.BringToFrontAction bringToFrontAction;
private IPlugInPort plugInPort;
private ISwingUI swingUI;
private Clipboard clipboard;
private double zoomLevel = 1;
public CanvasPlugin(ISwingUI swingUI) {
this.swingUI = swingUI;
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
}
@Override
public void connect(IPlugInPort plugInPort) {
this.plugInPort = plugInPort;
try {
swingUI.injectGUIComponent(getScrollPane(), SwingConstants.CENTER);
} catch (BadPositionException e) {
LOG.error("Could not install canvas plugin", e);
}
}
public CanvasPanel getCanvasPanel() {
if (canvasPanel == null) {
canvasPanel = new CanvasPanel(plugInPort);
canvasPanel.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
// Enable actions.
boolean enabled = !plugInPort.getSelectedComponents().isEmpty();
getCutAction().setEnabled(enabled);
getCopyAction().setEnabled(enabled);
try {
getPasteAction()
.setEnabled(
clipboard
.isDataFlavorAvailable(ComponentTransferable.listFlavor));
} catch (Exception ex) {
getPasteAction().setEnabled(false);
}
getEditSelectionAction().setEnabled(enabled);
getDeleteSelectionAction().setEnabled(enabled);
getGroupAction().setEnabled(enabled);
getUngroupAction().setEnabled(enabled);
getSendToBackAction().setEnabled(enabled);
getBringToFrontAction().setEnabled(enabled);
getPopupMenu().show(canvasPanel, e.getX(), e.getY());
}
}
});
}
return canvasPanel;
}
private RulerScrollPane getScrollPane() {
if (scrollPane == null) {
scrollPane = new RulerScrollPane(getCanvasPanel(), new ProjectDrawingProvider(
plugInPort, true, false), new Size(1d, SizeUnit.cm).convertToPixels(),
new Size(1d, SizeUnit.in).convertToPixels());
boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY,
true);
boolean wheelZoom = ConfigurationManager.getInstance().readBoolean(
IPlugInPort.WHEEL_ZOOM_KEY, false);
ConfigurationManager.getInstance().addConfigListener(IPlugInPort.WHEEL_ZOOM_KEY,
new IConfigListener() {
@Override
public void valueChanged(String key, Object value) {
scrollPane.setWheelScrollingEnabled(!(Boolean) value);
}
});
scrollPane.setMetric(metric);
scrollPane.setWheelScrollingEnabled(!wheelZoom);
scrollPane.addUnitListener(new IRulerListener() {
@Override
public void unitsChanged(boolean isMetric) {
plugInPort.setMetric(isMetric);
}
});
scrollPane.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
boolean wheelZoom = ConfigurationManager.getInstance().readBoolean(
IPlugInPort.WHEEL_ZOOM_KEY, false);
if (!wheelZoom) {
return;
}
double d = plugInPort.getZoomLevel();
Double[] availableZoomLevels = plugInPort.getAvailableZoomLevels();
if (e.getWheelRotation() > 0) {
int i = availableZoomLevels.length - 1;
while (i > 0 && availableZoomLevels[i] >= d) {
i--;
}
plugInPort.setZoomLevel(availableZoomLevels[i]);
} else {
int i = 0;
while (i < availableZoomLevels.length - 1 && availableZoomLevels[i] <= d) {
i++;
}
plugInPort.setZoomLevel(availableZoomLevels[i]);
}
}
});
}
return scrollPane;
}
public JPopupMenu getPopupMenu() {
if (popupMenu == null) {
popupMenu = new JPopupMenu();
popupMenu.add(getCutAction());
popupMenu.add(getCopyAction());
popupMenu.add(getPasteAction());
popupMenu.addSeparator();
popupMenu.add(getEditSelectionAction());
popupMenu.add(getDeleteSelectionAction());
popupMenu.add(getGroupAction());
popupMenu.add(getUngroupAction());
popupMenu.add(getSendToBackAction());
popupMenu.add(getBringToFrontAction());
popupMenu.addSeparator();
popupMenu.add(ActionFactory.getInstance().createEditProjectAction(plugInPort));
}
return popupMenu;
}
public ActionFactory.CutAction getCutAction() {
if (cutAction == null) {
cutAction = ActionFactory.getInstance().createCutAction(plugInPort, clipboard, this);
}
return cutAction;
}
public ActionFactory.CopyAction getCopyAction() {
if (copyAction == null) {
copyAction = ActionFactory.getInstance().createCopyAction(plugInPort, clipboard, this);
}
return copyAction;
}
public ActionFactory.PasteAction getPasteAction() {
if (pasteAction == null) {
pasteAction = ActionFactory.getInstance().createPasteAction(plugInPort, clipboard);
}
return pasteAction;
}
public ActionFactory.EditSelectionAction getEditSelectionAction() {
if (editSelectionAction == null) {
editSelectionAction = ActionFactory.getInstance().createEditSelectionAction(plugInPort);
}
return editSelectionAction;
}
public ActionFactory.DeleteSelectionAction getDeleteSelectionAction() {
if (deleteSelectionAction == null) {
deleteSelectionAction = ActionFactory.getInstance().createDeleteSelectionAction(
plugInPort);
}
return deleteSelectionAction;
}
public ActionFactory.GroupAction getGroupAction() {
if (groupAction == null) {
groupAction = ActionFactory.getInstance().createGroupAction(plugInPort);
}
return groupAction;
}
public ActionFactory.UngroupAction getUngroupAction() {
if (ungroupAction == null) {
ungroupAction = ActionFactory.getInstance().createUngroupAction(plugInPort);
}
return ungroupAction;
}
public ActionFactory.SendToBackAction getSendToBackAction() {
if (sendToBackAction == null) {
sendToBackAction = ActionFactory.getInstance().createSendToBackAction(plugInPort);
}
return sendToBackAction;
}
public ActionFactory.BringToFrontAction getBringToFrontAction() {
if (bringToFrontAction == null) {
bringToFrontAction = ActionFactory.getInstance().createBringToFrontAction(plugInPort);
}
return bringToFrontAction;
}
@Override
public EnumSet<EventType> getSubscribedEventTypes() {
return EnumSet.of(EventType.PROJECT_LOADED, EventType.ZOOM_CHANGED, EventType.REPAINT);
}
@Override
public void processMessage(final EventType eventType, Object... params) {
// SwingUtilities.invokeLater(new Runnable() {
//
// @Override
// public void run() {
// LOG.debug("event: " + eventType);
switch (eventType) {
case PROJECT_LOADED:
refreshSize();
if ((Boolean) params[1]) {
// Scroll to the center.
Rectangle visibleRect = canvasPanel.getVisibleRect();
visibleRect.setLocation((canvasPanel.getWidth() - visibleRect.width) / 2,
(canvasPanel.getHeight() - visibleRect.height) / 2);
canvasPanel.scrollRectToVisible(visibleRect);
canvasPanel.revalidate();
}
break;
case ZOOM_CHANGED:
Rectangle visibleRect = canvasPanel.getVisibleRect();
refreshSize();
// Try to set the visible area to be centered with the previous
// one.
double zoomFactor = (Double) params[0] / zoomLevel;
visibleRect.setBounds((int) (visibleRect.x * zoomFactor),
(int) (visibleRect.y * zoomFactor), visibleRect.width, visibleRect.height);
canvasPanel.scrollRectToVisible(visibleRect);
canvasPanel.revalidate();
zoomLevel = (Double) params[0];
break;
case REPAINT:
canvasPanel.repaint();
break;
}
// }
// });
}
private void refreshSize() {
Dimension d = plugInPort.getCanvasDimensions(true);
canvasPanel.setSize(d);
canvasPanel.setPreferredSize(d);
getScrollPane().setZoomLevel(plugInPort.getZoomLevel());
}
/**
* Causes ruler scroll pane to refresh by sending a fake mouse moved message
* to the canvasPanel.
*/
public void refresh() {
MouseEvent event = new MouseEvent(canvasPanel, MouseEvent.MOUSE_MOVED, System
.currentTimeMillis(), 0, 1, 1,// canvasPanel.getWidth() / 2,
// canvasPanel.getHeight() / 2,
0, false);
canvasPanel.dispatchEvent(event);
}
@Override
public void lostOwnership(Clipboard clipboard, Transferable contents) {
// TODO Auto-generated method stub
}
}
@@ -1,50 +0,0 @@
package org.diylc.swing.plugins.canvas;
import java.awt.Point;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import org.diylc.common.IPlugInPort;
/**
* {@link DragSourceListener} for {@link CanvasPanel}.
*
* @author Branislav Stojkovic
*/
class CanvasSourceListener implements DragSourceListener {
private IPlugInPort presenter;
public CanvasSourceListener(IPlugInPort presenter) {
super();
this.presenter = presenter;
}
@Override
public void dragDropEnd(DragSourceDropEvent dsde) {
presenter.dragEnded(null);
}
@Override
public void dragEnter(DragSourceDragEvent dsde) {
}
@Override
public void dragExit(DragSourceEvent dse) {
}
@Override
public void dragOver(DragSourceDragEvent dsde) {
Point p = dsde.getDragSourceContext().getComponent().getMousePosition();
if (p != null) {
dsde.getDragSourceContext().getComponent().firePropertyChange("dragPoint", p.x, p.y);
}
}
@Override
public void dropActionChanged(DragSourceDragEvent dsde) {
}
}
@@ -1,95 +0,0 @@
package org.diylc.swing.plugins.canvas;
import java.awt.Point;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import org.diylc.common.IPlugInPort;
/**
* {@link DropTargetListener} for {@link CanvasPanel}.
*
* @author Branislav Stojkovic
*/
class CanvasTargetListener implements DropTargetListener {
private IPlugInPort presenter;
// Cached values
private Point currentPoint = null;
private boolean lastAccept;
public CanvasTargetListener(IPlugInPort presenter) {
super();
this.presenter = presenter;
}
@Override
public void dragEnter(DropTargetDragEvent dtde) {
}
@Override
public void dragExit(DropTargetEvent dte) {
}
@Override
public void dragOver(DropTargetDragEvent dtde) {
// If dragOver was previously called for this location use cached value.
if (dtde.getLocation().equals(currentPoint)) {
if (lastAccept) {
dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
} else {
dtde.rejectDrag();
}
return;
}
try {
// Transferable t = dtde.getTransferable();
// if
// (t.isDataFlavorSupported(SelectionTransferable.selectionFlavor))
// {
// if (currentPoint != null) {
// List<IDIYComponent> selection = (List<IDIYComponent>) t
// .getTransferData(SelectionTransferable.selectionFlavor);
// Point startPoint = (Point) t
// .getTransferData(PointTransferable.pointFlavor);
// presenter.selectionMoved(dtde.getLocation().x
// - currentPoint.x, dtde.getLocation().y
// - currentPoint.y);
// }
// } else if
// (t.isDataFlavorSupported(PointTransferable.pointFlavor)) {
// Point startPoint = (Point) t
// .getTransferData(PointTransferable.pointFlavor);
// Point endPoint = dtde.getLocation();
// presenter.setSelectionRect(Utils.createRectangle(startPoint,
// endPoint));
// }
currentPoint = dtde.getLocation();
if (presenter.dragOver(currentPoint)) {
dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
lastAccept = true;
} else {
dtde.rejectDrag();
lastAccept = false;
}
} catch (Exception e) {
e.printStackTrace();
dtde.rejectDrag();
lastAccept = false;
}
}
@Override
public void drop(DropTargetDropEvent dtde) {
presenter.dragEnded(dtde.getLocation());
}
@Override
public void dropActionChanged(DropTargetDragEvent dtde) {
}
}

Some files were not shown because too many files have changed in this diff Show More