Compare commits

..

311 Commits

Author SHA1 Message Date
bancika e2fb415a59 switch to java 1.6.x 2016-04-28 13:44:52 +02:00
bancika 34720db33a Update README.md 2016-04-25 15:03:26 +02:00
bancika 146634f75d improved potentiometer symbol 2016-04-25 15:00:25 +02:00
bancika 6f19985c73 Merge remote-tracking branch 'origin/master' 2016-04-21 18:05:08 +02:00
bancika 0507812178 add missing files 2016-04-21 18:04:25 +02:00
bancika 368ec6a30d 3.29.0 add missing files 2016-04-21 18:01:05 +02:00
bancika c1268afb68 Update README.md 2016-04-20 12:27:35 +02:00
bancika 1c1703d606 Update README.md
3.29.0 release
2016-04-20 12:25:50 +02:00
bancika 3e18c5e1db 3.29.0 release
[Bug Fix] Issue with losing saved user configuration
[Bug Fix] Issue with disabled "Save as Template" context menu item
problem, as well as issue with strange rotation and probably few more
[Bug Fix] Undo steps kept after opening a new file
[New Feature] Transistors can be rotated and flipped vertically
[New Feature] DIL ICs can show pin numbers
[New Feature] Display both component value and name or neither of them
[New Feature] Potentiometer schematic symbol added
2016-04-20 11:46:00 +02:00
bancika fbc3c4bfc4 Update README.md 2015-09-04 11:36:09 +02:00
bancika 0b8a3d6f9f Update README.md 2015-09-04 11:35:31 +02:00
bancika f0a2473763 Update README.md 2015-09-04 11:34:39 +02:00
bancika 91f21c1896 Update README.md 2015-09-04 11:34:03 +02:00
bancika 9808e672c5 Update README.md 2015-09-04 11:31:45 +02:00
bancika 7e310a9a9c Update README.md 2015-09-04 11:28:57 +02:00
bancika 4843cc729f Update README.md 2015-05-19 12:55:52 +02:00
bancika 335e2a572f Create README.md 2015-05-19 12:52:51 +02:00
bancika 12e49ceabf 2013-08-15 12:00:13 +00:00
bancika f23f396c0a use lib 2013-08-15 11:48:04 +00:00
bancika 94b92cc0d7 selection & multi d&d fix 2013-08-15 11:47:59 +00:00
bancika 448f87666d selection & multi d&d fix 2013-08-15 11:47:52 +00:00
bancika 8c0cec70de undo 2013-05-01 09:49:41 +00:00
bancika 05eba5195e 3.28 2013-05-01 09:45:12 +00:00
bancika e5c54242bc Select all within a layer 2013-04-30 14:12:42 +00:00
bancika f7f669bff3 Select all within a layer 2013-04-30 14:12:34 +00:00
bancika 0a490d148a 2013-04-30 10:07:14 +00:00
bancika bee14895d7 Right click rotation during component creation throws an error 2013-04-30 10:06:49 +00:00
bancika 8def96d03c Right click rotation during component creation throws an error 2013-04-30 10:06:43 +00:00
bancika dab4e76f44 redo shape class hierarchy 2013-04-30 09:06:21 +00:00
bancika ac81b30e8e Trace cuts can be placed between two holes for tighter layouts 2013-04-29 14:16:25 +00:00
bancika 689ddebdb8 Trace cuts can be placed between two holes for tighter layouts 2013-04-29 10:58:44 +00:00
bancika 2b0d9dd9d3 Trace cuts can be placed between two holes for tighter layouts 2013-04-29 10:58:38 +00:00
bancika b335f0aabe fix ctrl selection 2013-04-29 10:31:29 +00:00
bancika bdfa255439 fix ctrl selection 2013-04-29 10:30:58 +00:00
bancika bc3875ecbf fix ctrl selection 2013-04-29 10:30:55 +00:00
bancika 59f516df9c Allow grid spacing as little as 0.1mm 2013-04-29 10:19:06 +00:00
bancika 0c86f60752 Allow grid spacing as little as 0.1mm 2013-04-29 10:19:03 +00:00
bancika 91deb1d7da apply template to existing components
do not mess up selection on right click
popup menu improvements
2013-04-29 10:08:36 +00:00
bancika 1714ddb444 apply template to existing components
do not mess up selection on right click
popup menu improvements
2013-04-29 10:08:26 +00:00
bancika 35326e7d17 apply template to existing components
do not mess up selection on right click
popup menu improvements
2013-04-29 10:08:19 +00:00
bancika b2dc050c32 added tri-pad board 2013-04-29 09:17:53 +00:00
bancika eb58f1786a Moving multiple components doesn't honor snap to grid OFF setting 2013-04-26 14:19:32 +00:00
bancika 16ce229b57 Moving multiple components doesn't honor snap to grid OFF setting 2013-04-26 14:19:29 +00:00
bancika 93954f60c7 Moved all schematic symbols to a dedicated category 2013-04-26 12:34:07 +00:00
bancika dc533368a8 Moved all schematic symbols to a dedicated category 2013-04-26 12:33:52 +00:00
bancika e9a54d1fe2 Ability to import existing DIY files into a project 2013-04-26 12:05:34 +00:00
bancika cfd7af2793 Added primitive shapes - ellipse, polygon and (rounded) rectangle 2013-04-25 16:32:14 +00:00
bancika f8310b1fac Added primitive shapes - ellipse, polygon and (rounded) rectangle 2013-04-25 16:32:06 +00:00
bancika 8a125e8a4f transparent icons 2013-04-25 15:00:28 +00:00
bancika b975cc79b1 2013-04-25 14:51:05 +00:00
bancika 171ebf4473 Ability to rotate selection 2013-04-25 14:37:19 +00:00
bancika 5cb9824da4 Ability to rotate selection 2013-04-25 14:37:00 +00:00
bancika 6ef5ad5854 Ability to rotate selection 2013-04-25 14:36:50 +00:00
bancika 18edd60763 More predictable movement of multiple components at the same time 2013-04-23 16:11:31 +00:00
bancika ea1da54202 More predictable movement of multiple components at the same time 2013-04-23 16:11:28 +00:00
bancika 7497e89afd Large components disappear when none of the edges is in the visible area 2013-04-23 15:45:24 +00:00
bancika 8ed165766f Large components disappear when none of the edges is in the visible area 2013-04-23 15:45:17 +00:00
bancika 8c98e9dece Large components disappear when none of the edges is in the visible area 2013-04-23 15:45:11 +00:00
bancika a082e0be63 added breadboard component 2013-04-22 10:22:51 +00:00
bancika 6f0df4fdc9 added breadboard component 2013-04-22 10:22:15 +00:00
bancika d85f496702 added breadboard component 2013-04-22 10:22:10 +00:00
bancika ef24664eac added breadboard component 2013-04-22 10:22:04 +00:00
bancika bfb554a930 copy paste error 2013-03-04 12:21:35 +00:00
bancika 0ff52979ea copy paste error 2013-03-04 12:21:30 +00:00
bancika eb1c4a6688 3.24 build 2013-03-04 10:14:58 +00:00
bancika 47d42c5456 3.24 build 2013-03-04 10:14:42 +00:00
bancika 297a4f3518 Potentiometer doesn't update when size only is changed 2013-03-04 10:14:05 +00:00
bancika d678f6fed1 Potentiometer doesn't update when size only is changed 2013-03-04 10:13:37 +00:00
bancika 3583d6e5f5 Snap to grid after releasing Ctrl button and creating a new component 2013-03-04 09:59:59 +00:00
bancika e84e0c10e1 Snap to grid after releasing Ctrl button and creating a new component 2013-03-04 09:59:55 +00:00
bancika b6c1ebd079 Faster startup when using image component templates 2012-11-02 16:13:39 +00:00
bancika 42190d3498 Faster startup when using image component templates 2012-11-02 16:13:34 +00:00
bancika 00bc6808d8 Faster startup when using image component templates 2012-11-02 16:13:27 +00:00
bancika 1e90621545 icon 2012-10-11 08:42:07 +00:00
bancika 06b204fc38 SIP IC 2012-10-10 15:52:18 +00:00
bancika ac95d45f95 SIP IC 2012-10-10 15:52:10 +00:00
bancika 16e3241a94 icon 2012-10-10 15:51:55 +00:00
bancika 1760161aa3 Editable colors for DIP IC 2012-10-10 15:51:48 +00:00
bancika c57e5f837c Editable lead color; changed default lead color 2012-10-10 14:49:51 +00:00
bancika 024884d85d Editable lead color; changed default lead color 2012-10-10 14:49:39 +00:00
bancika 50562ae901 Editable lead color; changed default lead color 2012-10-10 14:49:30 +00:00
bancika c8d0711889 Editable lead color; changed default lead color 2012-10-09 09:47:58 +00:00
bancika 4338200088 Editable lead color; changed default lead color 2012-10-09 09:47:45 +00:00
bancika 5ea4ed44a4 Ctrl + right click on component type in toolbox appends components of that type to selection 2012-10-09 09:14:55 +00:00
bancika b1a1611a3a Right click shouldn't change selection 2012-10-09 09:12:19 +00:00
bancika 9af88002b0 Pasted components are placed below traces 2012-10-09 08:39:50 +00:00
bancika a6386dda96 Pasted components are placed below traces 2012-10-09 08:39:44 +00:00
bancika 352b3aeb6f Clearer standing component (mainly diode) reversion 2012-10-09 08:28:10 +00:00
bancika 5d6b787404 TO-3 transistor rotation is wrong for 180 degrees 2012-10-09 08:27:20 +00:00
bancika 3e36bce7ad TO-3 transistor rotation is wrong for 180 degrees 2012-10-09 08:27:14 +00:00
bancika 5d4cbadf6e Clearer standing component (mainly diode) reversion 2012-10-08 16:20:07 +00:00
bancika 6d10c45a18 Clearer standing component (mainly diode) reversion 2012-10-08 16:19:58 +00:00
bancika 4c04b72d44 do not hard-code version in presenter 2012-10-08 14:31:18 +00:00
bancika dd15702ca6 do not hard-code version in presenter 2012-10-08 14:31:03 +00:00
bancika c6bfb5a562 2012-10-08 10:23:16 +00:00
bancika bfa71e93d5 osx build 2012-10-08 10:21:58 +00:00
bancika 1a048d0b7c 2012-10-08 09:45:45 +00:00
bancika 6039f85631 Two Voltage properties for ceramic capacitors 2012-10-06 09:18:57 +00:00
bancika c843d8c28d Component templates save shape of the component (for wires and such) 2012-10-04 13:51:22 +00:00
bancika e7b05f109f Component templates save shape of the component (for wires and such) 2012-10-04 13:50:42 +00:00
bancika 5d2c4e0fc9 Component templates save shape of the component (for wires and such) 2012-10-04 13:50:35 +00:00
bancika ac0da8667c copy-paste improvement 2012-10-04 11:15:06 +00:00
bancika cc81fa1a56 copy-paste improvement 2012-10-04 11:14:58 +00:00
bancika 954bf200d2 copy-paste improvement 2012-10-04 11:14:49 +00:00
bancika 7bf8ff9347 saving config bug 2012-10-01 09:17:03 +00:00
bancika 1eba691750 saving config bug 2012-10-01 09:16:57 +00:00
bancika c20b17b12e saving config bug 2012-10-01 09:16:50 +00:00
bancika b734c87946 removed deps 2012-10-01 09:15:16 +00:00
bancika 5e25f25fc7 xstream update 2012-10-01 09:12:05 +00:00
bancika 80582f61ec xstream update 2012-10-01 09:11:56 +00:00
bancika 9a43597f6f xstream update 2012-10-01 09:11:51 +00:00
bancika 2993900cc6 Do not show exception for config.properties 2012-10-01 08:14:16 +00:00
bancika 39efdca0b8 bring back default boxes 2012-09-30 11:27:33 +00:00
bancika 2dcaabf3f2 bring back default boxes 2012-09-30 11:26:56 +00:00
bancika af9798772f diode value fix 2012-09-30 11:23:29 +00:00
bancika 4ddcea7bc7 BOM and multi-edit doesn't work when there's a component without a value set 2012-09-30 10:28:59 +00:00
bancika 6087b39ccd LED symbol 2012-09-29 16:26:25 +00:00
bancika b77120f742 cascade build files 2012-09-29 12:24:54 +00:00
bancika 0acae7c28d Schottky diode 2012-09-28 15:51:19 +00:00
bancika 0cb0e950f7 Schottky diode 2012-09-28 15:51:11 +00:00
bancika 951dc3861a Zener diode symbol 2012-09-28 15:29:14 +00:00
bancika 0483656258 Zener diode symbol 2012-09-28 15:29:09 +00:00
bancika 34a0000d3c Diode symbol 2012-09-28 15:20:19 +00:00
bancika 426eb3c6c2 Diode symbol 2012-09-28 15:17:35 +00:00
bancika 4c8cae36c1 Diode symbol 2012-09-28 15:16:45 +00:00
bancika 5cd2ceeac3 Diode symbol 2012-09-28 15:16:34 +00:00
bancika 979eb7a9cf Diode symbol 2012-09-28 15:16:19 +00:00
bancika c9d60e4d4f classpath util method 2012-09-27 16:18:34 +00:00
bancika 948d8e7b4a classpath util method 2012-09-27 16:18:28 +00:00
bancika 2f06f00d2f classpath util method 2012-09-27 16:18:18 +00:00
bancika 45841657a0 Mirrored text for PCB artwork 2012-09-27 16:17:56 +00:00
bancika e481fdb986 Mirrored text for PCB artwork 2012-09-27 14:33:40 +00:00
bancika 44c358af2b Mirrored text for PCB artwork 2012-09-27 14:33:32 +00:00
bancika d57ce6dc4a classpath debug 2012-09-25 20:30:15 +00:00
bancika e9b81795b7 allow null values 2012-09-25 20:24:03 +00:00
bancika 6c7e149c93 inductor symbol
allow empty values
2012-09-25 14:45:37 +00:00
bancika db173acf77 inductor symbol
allow empty values
2012-09-25 14:45:22 +00:00
bancika deae73f6be inductor symbol
allow empty values
2012-09-25 14:45:11 +00:00
bancika 7ac43b5e1e classpath util method 2012-09-25 08:50:22 +00:00
bancika 514b659677 classpath util method 2012-09-25 08:50:11 +00:00
bancika 06d642b494 classpath util method 2012-09-25 08:48:18 +00:00
bancika 12b46bdfc8 classpath util method 2012-09-25 08:47:44 +00:00
bancika e98f61ae6f classpath 2012-09-24 16:24:46 +00:00
bancika 44cc3f1dd5 2012-09-24 14:29:32 +00:00
bancika 6e510c56a2 2012-09-24 14:29:04 +00:00
bancika b181a86fa9 Diode symbol 2012-09-24 14:23:30 +00:00
bancika fbb28d74cd Diode symbol 2012-09-24 14:23:09 +00:00
bancika bf9bf70761 Pentode symbol 2012-09-24 13:34:30 +00:00
bancika f7a5038912 Pentode symbol 2012-09-24 13:34:05 +00:00
bancika f62df8d58e Triode symbol 2012-09-24 10:49:01 +00:00
bancika d0f6302038 Triode symbol 2012-09-24 10:48:55 +00:00
bancika d7198e4705 jack outline 2012-09-21 13:42:07 +00:00
bancika 8ea4ba6aab jack outline 2012-09-21 13:42:00 +00:00
bancika e604a54dd8 switch outline 2012-09-21 12:31:20 +00:00
bancika 85207733d5 switch outline 2012-09-21 12:31:14 +00:00
bancika 3385d04d95 Outline mode for trimmers, potentiometers and transistors 2012-09-21 11:32:34 +00:00
bancika ec597d964c Outline mode for trimmers, potentiometers and transistors 2012-09-21 11:32:28 +00:00
bancika abf9faa05a Editable label color for leaded components 2012-09-21 10:42:33 +00:00
bancika e2412c223a Editable label color for leaded components 2012-09-21 10:42:26 +00:00
bancika edc4bd4928 2012-09-18 10:29:43 +00:00
bancika 90be75db5e 2012-09-18 10:29:35 +00:00
bancika ee0a503bbb OSX build 2012-09-18 10:25:20 +00:00
bancika eed1d9601c OSX build 2012-09-18 10:25:12 +00:00
bancika ce3d5fc808 update.xml 2012-09-17 10:58:58 +00:00
bancika 09db593d28 Added connector dot component
Zero-sized holes on pads
2012-09-13 15:12:41 +00:00
bancika 25cdfd199a Added connector dot component
Zero-sized holes on pads
2012-09-13 15:12:36 +00:00
bancika 92495b1cf0 Ability to flip standing diodes 2012-09-13 15:05:29 +00:00
bancika 039fabc916 Ability to flip standing diodes 2012-09-13 15:05:21 +00:00
bancika f7a73f2bcb Ability to flip standing diodes 2012-09-13 15:05:15 +00:00
bancika a6731fd284 Ability to rotate text 2012-09-07 14:48:12 +00:00
bancika 5db8288b0a Ability to rotate text 2012-09-07 14:48:04 +00:00
bancika aea4c434dd Radial components become transparent by themself 2012-09-07 09:13:40 +00:00
bancika 35dfe799c0 Radial components become transparent by themself 2012-09-07 09:13:35 +00:00
bancika 5087a84dc1 right click improvement 2012-09-03 08:41:16 +00:00
bancika bda92b6982 added template menu option 2012-09-03 08:38:38 +00:00
bancika 732cb102a3 fixed building 2012-08-31 16:34:32 +00:00
bancika cf7dc0778b 2012-08-31 15:27:33 +00:00
bancika 75b2afad09 Added support for component templates 2012-08-31 15:26:34 +00:00
bancika e85ffd1483 Ability to rotate toggle switch 2012-08-31 13:49:48 +00:00
bancika 5abf2ebaa3 Ability to rotate toggle switch 2012-08-31 13:49:42 +00:00
bancika b0164a1ddd Ability to rotate toggle switch 2012-08-31 13:49:34 +00:00
bancika 371fee0614 2012-08-31 13:17:46 +00:00
bancika 28f56693a9 icon rendering 2012-08-31 13:17:02 +00:00
bancika 9ebfad7d05 icon rendering 2012-08-31 13:16:43 +00:00
bancika acbd3d8378 Added support for component templates 2012-08-31 13:12:24 +00:00
bancika 4997e5b3bf render quality 2012-08-31 12:49:13 +00:00
bancika 5e86621f37 Hidden "default" checkboxes from the editor 2012-08-31 12:34:00 +00:00
bancika 84f2da5313 Added support for component templates 2012-08-31 11:23:08 +00:00
bancika f164473d25 Added support for component templates 2012-08-31 11:10:22 +00:00
bancika 8804295df6 Added support for component templates 2012-08-31 11:10:08 +00:00
bancika 8c3c6ea56e selection rect 2012-08-30 15:04:08 +00:00
bancika 7f5f61f5b0 back compatibility 2012-08-30 09:44:11 +00:00
bancika 6d79b453de back compatibility 2012-08-30 09:42:42 +00:00
bancika 894f070fee 2012-08-30 09:38:39 +00:00
bancika e115f87f65 v1 pot and label import bug 2012-08-30 09:38:15 +00:00
bancika 6068619c43 v1 pot and label import bug 2012-08-30 09:38:08 +00:00
bancika cb547e40fb v1 pot and label import bug 2012-08-30 09:37:59 +00:00
bancika 502186b1e3 Fixed ruler jumping issue 2012-08-29 16:08:07 +00:00
bancika a051382e6c better quality icon rendering 2012-08-29 15:53:34 +00:00
bancika 4e3451bdf9 TO-3 transistors 2012-08-29 15:52:27 +00:00
bancika 9f891d19c2 Label vertical and horizontal alignment can be changed 2012-08-29 13:29:46 +00:00
bancika 923107e3ea Label vertical and horizontal alignment can be changed 2012-08-29 13:23:03 +00:00
bancika a1d39c047e Label vertical and horizontal alignment can be changed 2012-08-29 13:22:58 +00:00
bancika 5b439c1603 TO-3 transistors 2012-08-29 12:53:35 +00:00
bancika c3308fa6e9 TO-3 transistors 2012-08-29 12:53:26 +00:00
bancika 19e1a3576a Miniature and ultra-miniature PCB mount relays 2012-08-28 15:03:46 +00:00
bancika 532b482fed Miniature and ultra-miniature PCB mount relays 2012-08-28 15:03:20 +00:00
bancika 6c34a4cd8d label fix 2012-08-28 15:01:45 +00:00
bancika de348acff7 Folded TO-220 transistor 2012-08-27 17:26:12 +00:00
bancika ce63423c66 Folded TO-220 transistor 2012-08-27 17:26:07 +00:00
bancika 293c3096b0 Editable pin spacing for all radial components
Folded elytics
2012-08-27 15:45:20 +00:00
bancika 3db2a06f52 Exception fix for java 7 2012-08-27 15:45:03 +00:00
bancika 064d83d2c4 2012-08-27 15:34:22 +00:00
bancika a1a9171c7c Editable pin spacing for all radial components
Folded elytics
2012-08-27 15:31:31 +00:00
bancika b0ce8242be Editable pin spacing for all radial components
Folded elytics
2012-08-27 15:31:25 +00:00
bancika c08e52b994 Editable pin spacing for all radial components
Folded elytics
2012-08-27 14:34:59 +00:00
bancika b454c017a2 Editable pin spacing for all radial components
Folded elytics
2012-08-27 14:34:50 +00:00
bancika 9a6a8cc646 Editable pin spacing for all radial components
Folded elytics
2012-08-27 14:34:45 +00:00
bancika 28cbc39b5f Added TO-1
Added folded TO-92
2012-08-27 10:31:23 +00:00
bancika 1b24c8eb16 Added TO-1
Added folded TO-92
2012-08-24 15:58:44 +00:00
bancika 80bd386564 Added TO-1
Added folded TO-92
2012-08-24 15:58:37 +00:00
bancika ddfac76b58 Component naming bug fix 2012-08-24 15:58:14 +00:00
bancika bb22ef61ff BOM backward compatibility 2012-08-24 14:09:09 +00:00
bancika 4b9349fbcb BOM backward compatibility 2012-08-24 14:08:01 +00:00
bancika 7d13dd647a BOM exception fix 2012-08-24 14:05:43 +00:00
bancika a1a290671d Show voltage and power ratings in the BOM where applicable 2012-08-24 13:43:07 +00:00
bancika 0c99b2b6a6 Show voltage and power ratings in BOM where applicable 2012-08-24 13:42:37 +00:00
bancika cce34c9d9a Show voltage and power ratings in BOM where applicable 2012-08-24 13:42:22 +00:00
bancika 1e34913d1a Show voltage and power ratings in BOM where applicable 2012-08-24 13:42:10 +00:00
bancika f419c1afb9 Multi-layer PCB support 2012-08-24 11:12:46 +00:00
bancika 4b2242336a Multi-layer PCB support 2012-08-24 11:12:35 +00:00
bancika 30ab42a47b Multi-layer PCB support 2012-08-24 11:12:30 +00:00
bancika 34c9648b47 Editable BOM color 2012-08-23 16:00:50 +00:00
bancika 0aea4c6eed Editable BOM color 2012-08-23 16:00:46 +00:00
bancika ff43225f11 Block user operations 2012-08-23 15:44:40 +00:00
bancika 585351bb11 Block user operations 2012-08-23 15:44:33 +00:00
bancika 58ac3d8148 Polygon Ground Fill component 2012-08-23 15:12:10 +00:00
bancika 00a05f6f15 Polygon Ground Fill component 2012-08-23 15:12:01 +00:00
bancika a800542a14 2012-08-23 09:49:20 +00:00
bancika 65a5775d5d better logging 2012-08-23 09:34:04 +00:00
bancika 2001015f9e Image fixes 2012-08-22 13:19:44 +00:00
bancika cd3b03433f Image fixes 2012-08-22 13:19:38 +00:00
bancika 547fb9b44f Undo-redo repeated several times messes up selection 2012-08-22 11:14:08 +00:00
bancika 78d76197cf Undo-redo repeated several times messes up selection 2012-08-22 11:14:03 +00:00
bancika e351d2669d Two components are created instead of one 2012-08-22 10:25:53 +00:00
bancika 9209782401 Better sorting in the BOM (e.g. R2 should go before R10)
Better Audo-Edit
2012-08-22 10:16:44 +00:00
bancika c406632299 Better sorting in the BOM (e.g. R2 should go before R10)
Better Audo-Edit
2012-08-22 10:16:19 +00:00
bancika 23fc091667 Better sorting in the BOM (e.g. R2 should go before R10)
Better Audo-Edit
2012-08-22 10:16:07 +00:00
bancika 6e6d70fcd3 Rectangle selection triggers file (modified) state 2012-08-21 21:53:21 +00:00
bancika 56fef06b22 removed unused libs 2012-08-21 15:30:40 +00:00
bancika 4897b803b6 2012-08-21 14:43:10 +00:00
bancika 6c698e935e Replaced deep cloning library with manual implementation 2012-08-21 14:16:19 +00:00
bancika 1645eae18d Replaced deep cloning library with manual implementation 2012-08-21 14:16:07 +00:00
bancika 5adbc2c6ca Some components can be placed in any layer using Send to Back/Bring to Front 2012-08-21 11:06:19 +00:00
bancika e3b1f0d4e6 Some components can be placed in any layer using Send to Back/Bring to Front 2012-08-21 11:06:08 +00:00
bancika bc88253c70 Some components can be placed in any layer using Send to Back/Bring to Front 2012-08-21 11:05:59 +00:00
bancika 1d45bf345c 2012-08-21 08:58:36 +00:00
bancika c61ec71ee1 2012-08-21 08:58:19 +00:00
bancika 35272c1339 check if the app is run from Jar directly 2012-08-21 08:53:41 +00:00
bancika 93e057dfb2 [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:32:18 +00:00
bancika aef5c88a3f [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:32:11 +00:00
bancika 591bdd313c [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:32:04 +00:00
bancika 3f9caf9918 [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:29:27 +00:00
bancika 246decdf7c [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:29:17 +00:00
bancika 0bc8141dc7 [Improvement] Improved overall performance
[Bug Fix] Should be more stable under OSX and not crash unexpectedly
2012-08-21 08:28:55 +00:00
bancika 6e8e8b9d49 release build 2012-08-20 09:49:51 +00:00
bancika c8ff6afe6e release build 2012-08-20 09:33:54 +00:00
bancika 714740da28 release build 2012-08-20 09:33:44 +00:00
bancika 45b759fa75 2012-08-17 15:56:41 +00:00
bancika 2445f05767 2012-08-17 15:39:49 +00:00
bancika 22578a4e3f 2012-08-17 14:57:22 +00:00
bancika 10a42b7fcf Better unsaved warning message 2012-08-17 14:51:14 +00:00
bancika 0498eb2c51 Better unsaved warning message 2012-08-17 14:51:05 +00:00
bancika d384711759 UNICODE font export to PDF files 2012-08-17 14:26:22 +00:00
bancika 5e0c422c30 UNICODE font export to PDF files 2012-08-17 14:26:06 +00:00
bancika 73cc182dad UNICODE font export to PDF files 2012-08-17 14:25:55 +00:00
bancika 7932657fb2 Transistors can show name or value 2012-08-17 13:28:07 +00:00
bancika 50bacee70a Transistors can show name or value 2012-08-17 13:27:59 +00:00
bancika 1c0219f4bf 2012-08-17 13:07:55 +00:00
bancika 4522d9aeb5 Faster component placement, auto-focus on "Value" box 2012-08-17 12:56:35 +00:00
bancika a25d43b710 Default resistor value to 100k 2012-08-17 12:55:36 +00:00
bancika 18261eab69 Control number of "Recently Used" items from config.properties 2012-08-17 12:35:15 +00:00
bancika 3b984d0850 Control number of "Recently Used" items from config.properties 2012-08-17 12:35:11 +00:00
bancika d72d898f3f Control number of "Recently Used" items from config.properties 2012-08-17 12:31:03 +00:00
bancika 03bc58eb96 Control number of "Recently Used" items from config.properties 2012-08-17 12:30:55 +00:00
bancika 17427a0071 2012-08-17 12:17:19 +00:00
bancika 39704e3625 Improved "Recently Used" toolbox, doesn't jump as you click 2012-08-17 11:38:01 +00:00
bancika 6ef7459d46 Move selected components with arrow keys (and ctrl/shift) 2012-08-17 10:41:31 +00:00
bancika a6448676f7 Move selected components with arrow keys (and ctrl/shift) 2012-08-17 10:41:19 +00:00
bancika 4cf6f9f4a5 Remove junk from BOM (eyelets, wires, traces) 2012-08-16 15:56:58 +00:00
bancika 162b67bf25 Remove junk from BOM (eyelets, wires, traces) 2012-08-16 15:51:21 +00:00
bancika ccc90dd3a6 Remove junk from BOM (eyelets, wires, traces) 2012-08-16 15:50:59 +00:00
bancika 237639b9a1 Remove junk from BOM (eyelets, wires, traces) 2012-08-16 15:50:46 +00:00
bancika 37b89fe3a2 2012-08-16 14:40:10 +00:00
bancika 860bb0071b improved toolbar click reliability 2012-08-16 14:32:37 +00:00
bancika 56fd800e77 added .diy associations 2012-08-16 11:03:46 +00:00
bancika 1a95e43f9f added .diy associations 2012-08-16 11:02:26 +00:00
bancika 9817aa549e added .diy associations 2012-08-16 10:58:53 +00:00
bancika c38bd87a7d Right click rotates component while laying out on the canvas 2012-08-16 10:24:00 +00:00
bancika 21e46b3835 Right click rotates component while laying out on the canvas 2012-08-16 10:23:51 +00:00
bancika 6a4508b4a9 2012-08-16 09:28:01 +00:00
bancika 33d3e03ffb minor changes 2012-08-16 09:27:05 +00:00
bancika 98c3804529 minor changes 2012-08-16 09:26:55 +00:00
bancika 4f88bb988a copy-paste performance improvement 2012-08-15 21:18:31 +00:00
bancika 5a4eeb2de2 graphics fix 2012-08-15 21:18:14 +00:00
bancika abf99285cf switch terminal size improvement 2012-03-31 17:12:13 +00:00
bancika e83a2bd5f8 removed beta 2012-03-30 01:58:24 +00:00
bancika 445a56f563 improved bring to front/back 2012-03-29 02:36:34 +00:00
bancika aa434048f3 9v battery snap 2012-03-28 02:04:08 +00:00
bancika 1b043abfe5 description update 2012-03-28 01:50:01 +00:00
bancika b08395ee27 lever guitar switch 2012-03-27 02:36:31 +00:00
764 changed files with 30441 additions and 1486 deletions
@@ -12,6 +12,6 @@
<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/app-framework.jar"/>
<classpathentry kind="lib" path="lib/bancika-gui-framework.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1 @@
/bin/
@@ -0,0 +1,17 @@
<?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>
@@ -0,0 +1,15 @@
<?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,4 +1,4 @@
<project name="diylc-swing" basedir="." default="jar">
<project name="diylc" basedir="." default="jar">
<property name="src.dir" value="src" />
<property name="lib.dir" value="${basedir}/lib" />
@@ -0,0 +1,86 @@
<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>
@@ -8,12 +8,13 @@ import javax.swing.UIManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.diylc.appframework.miscutils.ConfigurationManager;
import org.diylc.appframework.miscutils.PropertyInjector;
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.
*
@@ -24,7 +25,7 @@ import org.diylc.swing.gui.TemplateDialog;
*/
public class DIYLCStarter {
private static final Logger LOG = Logger.getLogger(DIYLCStarter.class);
private static final Logger LOG = Logger.getLogger(Presenter.class);
/**
* @param args
@@ -38,10 +39,8 @@ public class DIYLCStarter {
} 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.debug("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
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"));
@@ -0,0 +1,19 @@
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);
}
@@ -0,0 +1,375 @@
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);
}
@@ -2,15 +2,8 @@ package org.diylc.components;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.VerticalAlignment;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.EditableProperty;
@@ -32,7 +25,6 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
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);
public static Color METAL_COLOR = Color.decode("#236B8E");
@EditableProperty(defaultable = false)
@Override
@@ -78,43 +70,4 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
}
return true;
}
protected void drawCenteredText(Graphics2D g2d, String text, int x, int y,
HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {
FontMetrics fontMetrics = g2d.getFontMetrics();
Rectangle stringBounds = fontMetrics.getStringBounds(text, g2d).getBounds();
Font font = g2d.getFont();
FontRenderContext renderContext = g2d.getFontRenderContext();
GlyphVector glyphVector = font.createGlyphVector(renderContext, text);
Rectangle visualBounds = glyphVector.getVisualBounds().getBounds();
int textX = 0;
switch (horizontalAlignment) {
case CENTER:
textX = x - stringBounds.width / 2;
break;
case LEFT:
textX = x;
break;
case RIGHT:
textX = x - stringBounds.width;
break;
}
int textY = 0;
switch (verticalAlignment) {
case TOP:
textY = y + stringBounds.height;
break;
case CENTER:
textY = y - visualBounds.height / 2 - visualBounds.y;
break;
case BOTTOM:
textY = y - visualBounds.y;
break;
}
g2d.drawString(text, textX, textY);
}
}
@@ -12,7 +12,6 @@ import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
import org.diylc.common.Display;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
@@ -26,6 +25,8 @@ 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
@@ -143,14 +144,35 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
}
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) {
AffineTransform textTransform = g2d.getTransform();
g2d.setTransform(oldTransform);
if (length.convertToPixels() > points[0].distance(points[1])) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
}
int leadThickness = getClosestOdd(getLeadThickness());
double leadLength = (distance - shapeRect.width) / 2 - leadThickness / 2;
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness));
@@ -174,39 +196,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
* leadLength), (int) (points[1].y + Math.sin(theta - Math.PI)
* leadLength));
}
g2d.setComposite(oldComposite);
g2d.setTransform(textTransform);
}
// 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();
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
// Don't offset in outline mode.
int offset = outlineMode ? 0 : getLabelOffset((int) shapeRect.getWidth(), (int) textRect.getWidth());
// 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);
offset = -offset;
}
g2d.drawString(label, (int) (shapeRect.width - textRect.getWidth()) / 2 + offset,
calculateLabelYCoordinate(shapeRect, textRect, fontMetrics));
g2d.setTransform(oldTransform);
}
}
@@ -240,10 +230,6 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
protected boolean supportsStandingMode() {
return false;
}
protected int getLabelOffset(int bodyWidth, int labelWidth) {
return 0;
}
/**
* @return default component length.
@@ -6,12 +6,13 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.diylc.appframework.update.VersionNumber;
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
@@ -201,8 +202,8 @@ public class Project implements Serializable {
public void validate(Object value) throws ValidationException {
super.validate(value);
Size size = (Size) value;
if (size.compareTo(new Size(0.5d, SizeUnit.mm)) < 0) {
throw new ValidationException("must be at least 0.5mm");
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");
@@ -76,6 +76,6 @@ public class AbstractMeasure<T extends Enum<? extends Unit>> implements Serializ
@Override
public String toString() {
return format.format(value) + unit;
return format.format(value) + " " + unit;
}
}
@@ -0,0 +1,78 @@
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);
}
}
@@ -2,7 +2,7 @@ package org.diylc.core.measures;
public enum ResistanceUnit implements Unit {
R(1, "R"), K(1e3, "K"), M(1e6, "M");
R(1, "\u03a9"), K(1e3, "K"), M(1e6, "M");
double factor;
String display;
@@ -31,8 +31,7 @@ public enum IconLoader {
"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"), ElementsSelection("elements_selection.png"), BranchAdd(
"branch_add.png");
"pens.png"), Sort("sort.png");
protected String name;

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 875 B

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

Before

Width:  |  Height:  |  Size: 749 B

After

Width:  |  Height:  |  Size: 749 B

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 736 B

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

Before

Width:  |  Height:  |  Size: 714 B

After

Width:  |  Height:  |  Size: 714 B

Before

Width:  |  Height:  |  Size: 993 B

After

Width:  |  Height:  |  Size: 993 B

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 863 B

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 850 B

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 708 B

Before

Width:  |  Height:  |  Size: 960 B

After

Width:  |  Height:  |  Size: 960 B

Before

Width:  |  Height:  |  Size: 901 B

After

Width:  |  Height:  |  Size: 901 B

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 728 B

Before

Width:  |  Height:  |  Size: 595 B

After

Width:  |  Height:  |  Size: 595 B

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 914 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 853 B

After

Width:  |  Height:  |  Size: 853 B

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

Before

Width:  |  Height:  |  Size: 765 B

After

Width:  |  Height:  |  Size: 765 B

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 696 B

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 845 B

After

Width:  |  Height:  |  Size: 845 B

Before

Width:  |  Height:  |  Size: 928 B

After

Width:  |  Height:  |  Size: 928 B

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

Before

Width:  |  Height:  |  Size: 892 B

After

Width:  |  Height:  |  Size: 892 B

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 751 B

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 834 B

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 857 B

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 842 B

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

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