Compare commits

..

752 Commits

Author SHA1 Message Date
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
bancika a23342f682 2012-03-22 01:05:20 +00:00
bancika 93a4978e68 single coil pickup 2012-03-21 02:42:12 +00:00
bancika 0d845677c4 added humbucker pickup 2012-03-19 00:33:47 +00:00
bancika ab10103e41 added humbucker pickup 2012-03-19 00:15:56 +00:00
bancika 0d17046170 add OS version to log 2012-03-18 13:39:10 +00:00
bancika 880e618e30 Fonts are exported to PDF 2012-03-18 02:16:20 +00:00
bancika 176abc2428 Plastic DC jack 2012-03-17 23:47:15 +00:00
bancika 061bc520c6 Plastic DC jack 2012-03-17 02:21:26 +00:00
bancika 9c9d6ecd70 Plastic DC jack 2012-03-17 02:15:24 +00:00
bancika d9f5e2e42b Plastic DC jack 2012-03-17 02:02:53 +00:00
bancika 0c1659cde0 added closed jack 2012-03-17 00:29:28 +00:00
bancika 53feb60b63 added closed jack 2012-03-17 00:17:22 +00:00
bancika 8c2700b92c added closed jack 2012-03-17 00:17:06 +00:00
bancika 298d575696 added cliff style jack 2012-03-15 01:58:41 +00:00
bancika 931138083f added cliff style jack 2012-03-15 01:19:28 +00:00
bancika f2a814e41c added cliff style jack 2012-03-15 00:56:20 +00:00
bancika d07965a3c0 added ground symbol 2012-03-11 17:15:27 +00:00
bancika 9e1f5c3ac8 added ground symbol 2012-03-11 17:11:51 +00:00
bancika 569a50e97a utf-8 2012-03-10 13:28:07 +00:00
bancika 80e7e3a487 2012-03-10 13:27:42 +00:00
bancika 5d73617af3 2012-03-10 04:09:25 +00:00
bancika 8169e3a6ba BJT symbol 2012-03-10 04:03:44 +00:00
bancika a7b48f4f52 BJT symbol 2012-03-10 03:47:30 +00:00
bancika 89bf22bcf8 UTF-8 2012-03-10 02:58:49 +00:00
bancika ae99ce2702 use UTF-8 2012-03-10 01:14:01 +00:00
bancika 61937d6d42 Add IC symbol 2012-03-05 03:11:45 +00:00
bancika e618a1e1ad Add IC symbol 2012-03-04 23:22:47 +00:00
bancika 513a229e64 Added MOSFET Symbol 2012-03-04 23:16:44 +00:00
bancika f834aa6d0b Added JFET Symbol 2012-03-04 23:03:41 +00:00
bancika 35d8b13d41 Added MOSFET Symbol 2012-03-04 22:42:33 +00:00
bancika 989e0a03e4 Added MOSFET Symbol 2012-03-04 22:41:37 +00:00
bancika c6cb77f4ef Added MOSFET Symbol 2012-03-04 22:37:05 +00:00
bancika af1a11e848 Added MOSFET Symbol 2012-03-04 22:32:42 +00:00
bancika 4bcff4a574 2012-03-04 18:43:36 +00:00
bancika 36f65423e0 Add IC symbol 2012-03-04 18:35:00 +00:00
bancika ef11c931a7 2012-03-04 16:28:54 +00:00
bancika 732a9954b7 Add IC symbol 2012-03-04 15:09:53 +00:00
bancika 2b5b904d8d IC component can display name or value 2012-03-04 15:09:43 +00:00
bancika 6ca16d07e6 Application breaks when resistance is set to 0 ohms 2012-03-04 15:09:12 +00:00
bancika 4f113f032d fixed out of bounds exc 2012-03-04 14:27:10 +00:00
bancika e572412f1e fixed to use new file paths 2012-02-26 13:40:03 +00:00
bancika dd9e9f054c Expand selection feature, useful for debugging
Limit length of text in the status bar using "and X more" suffix
2012-02-26 03:54:12 +00:00
bancika 4ee7381959 2012-02-20 03:22:01 +00:00
bancika d11a8b906a Do not hard-code voltage and power ratings 2012-02-12 18:45:34 +00:00
bancika 9fdd96c889 R instead of omega for resistance 2012-02-12 18:13:32 +00:00
bancika d776a3df32 2012-02-12 15:26:30 +00:00
bancika ebf06841a0 Select components from context menu even when they are under other components 2012-02-12 14:36:18 +00:00
bancika 616b09b4b2 2012-02-12 05:21:57 +00:00
bancika dccd91e56b Imperial ruler is divided to .1" instead of 1/4" 2012-02-12 05:17:08 +00:00
bancika 59c543da34 2012-02-12 03:54:24 +00:00
bancika 7c933fa0f3 v1 import improvements 2012-02-12 03:53:50 +00:00
bancika 8294caa8ba Smarter resistor labels; try not to overlap label with bands 2012-02-11 14:07:05 +00:00
bancika a7637767cd 2012-02-10 04:24:53 +00:00
bancika 2dccd41f41 do not put space between value and multiplier K, M, etc 2012-02-10 04:23:10 +00:00
bancika 2dfec28dc9 perfboards can show coordinates 2012-02-10 03:17:42 +00:00
bancika fe527eece2 2012-02-08 05:02:10 +00:00
bancika d459ea898c ctrl+shift toggles snap to grid 2012-02-08 04:48:31 +00:00
bancika 19cfca3df8 2012-02-08 04:48:08 +00:00
bancika 3d3a6e27d2 2012-02-02 04:30:25 +00:00
bancika 10884452fd 2012-02-02 04:29:45 +00:00
bancika 6d4c2a8141 2012-02-02 04:29:37 +00:00
bancika 66f4d98ff9 add more pin options 2012-02-02 04:26:59 +00:00
bancika a00028131f Adjustable solder pad hole size 2011-09-03 20:01:09 +00:00
bancika 7f2b973638 Better lead and label rendering when lead spacing is smaller than component body 2011-09-03 19:47:35 +00:00
bancika 144bfb01ad Select All should not include locked components 2011-09-03 19:38:15 +00:00
bancika 84d0da6308 Renumber function sometimes doesn't work as expected 2011-09-03 19:19:07 +00:00
bancika 0df3bc37a0 increase PNG resolution to 300dpi 2011-09-03 19:07:19 +00:00
bancika a0b43def22 move to new project directory names 2011-08-29 22:14:50 +00:00
bancika 602c98ead4 move to new project directory names 2011-08-29 21:41:09 +00:00
bancika 4b64917654 move to new project directory names 2011-08-29 21:16:26 +00:00
bancika 030ba71126 2011-08-29 21:16:09 +00:00
bancika eb4d08be68 move to new project directory names 2011-08-29 21:10:45 +00:00
bancika b642dc6cbd move to new project directory names 2011-08-29 20:57:51 +00:00
bancika 112bfdd3d0 move to new project directory names 2011-08-29 20:54:36 +00:00
bancika 79f83308d8 move to new project directory names 2011-08-29 20:46:53 +00:00
bancika 5df467a254 2011-08-28 21:43:25 +00:00
bancika 7c4d82b28c added recently used tab 2011-08-28 21:31:49 +00:00
bancika 6b7d1c4277 Renumber selected components by X or Y axis 2011-08-28 17:09:10 +00:00
bancika a0ae53d53c fixed method finding issues 2011-08-28 16:23:35 +00:00
bancika bd79ef2817 Component edit dialog allows changing property values even when they are not the same 2011-08-28 16:10:38 +00:00
bancika 69e2296c23 show mutual properties across different component types 2011-08-27 20:36:37 +00:00
bancika 7d3a7c30ca check file permission before using auto-save 2011-08-26 18:31:36 +00:00
bancika bea19f326c Auto-increment component names when copy-pasting 2011-08-26 18:18:53 +00:00
bancika ba694add0c allow 0 ohm resistors 2011-08-26 17:59:50 +00:00
bancika f137a398dc double click on a component button to select all of that type 2011-08-26 17:56:33 +00:00
bancika 15ac8ff2e9 increase PNG resolution 2011-08-07 19:23:50 +00:00
bancika 1213dcaeac increase PNG resolution 2011-08-07 19:23:23 +00:00
bancika 2ebcd1fe96 ctrl+click should never clear selection 2011-08-07 19:07:19 +00:00
bancika 943d123ca9 outline mode
improved auto-create for pads
2011-03-05 19:53:19 +00:00
bancika 79c29dc349 2011-03-03 21:05:47 +00:00
bancika 746b5fbe1a 2011-03-03 20:56:56 +00:00
bancika 365c195091 fix for drawing area and optimization 2011-03-02 18:14:39 +00:00
bancika d89a500a5f fix for drawing area and optimization 2011-03-02 18:13:34 +00:00
bancika 085732fb2c 2011-03-01 00:17:53 +00:00
bancika eab7654883 Curved traces and wires can have 2, 3 and 4 control points 2011-02-28 00:09:13 +00:00
bancika 5488657984 config menu order 2011-02-27 23:38:11 +00:00
bancika 1a256716db tube socket improvement 2011-02-27 23:30:05 +00:00
bancika 2b9c76e876 add file version info
improve image serialization
serialize points referenced in inches
2011-02-27 23:26:11 +00:00
bancika 5ae8a3477e add file version info
improve image serialization
serialize points referenced in inches
2011-02-27 23:23:51 +00:00
bancika 209e970c00 catch drag end outside the area 2011-02-27 22:56:40 +00:00
bancika ae96fb9eef label has editable font 2011-02-27 21:58:57 +00:00
bancika 401f2b5e6f label has editable font 2011-02-27 21:56:08 +00:00
bancika e2da0b884d vertical vero board 2011-02-27 20:48:18 +00:00
bancika bcf390b888 switchable wheel zoom 2011-02-27 19:25:39 +00:00
bancika 144e8f0cfe standing resistors, capacitors and diodes 2011-02-27 19:09:15 +00:00
bancika 84d744a80b switchable wheel zoom 2011-02-27 18:34:33 +00:00
bancika 5430ca71a3 added 6 pin IC 2011-02-26 21:12:45 +00:00
bancika 4665d5d42e added tube 2011-02-26 21:05:40 +00:00
bancika 275918d079 dnd collision improvement 2011-02-26 15:35:53 +00:00
bancika a83093519f 2011-02-26 11:30:05 +00:00
bancika 2e14929eb1 send to back/front renamed 2011-02-26 11:28:40 +00:00
bancika a0b7cdc30e auto-save added 2011-02-26 11:26:49 +00:00
bancika ab5c9ad143 code cleanup 2011-02-24 00:05:27 +00:00
bancika 4154225e71 auto-edit mode 2011-02-24 00:02:32 +00:00
bancika 3856af3e18 continuous component creation 2011-02-23 23:44:00 +00:00
bancika 80e7ebcbe9 auto-create pads 2011-02-23 20:42:40 +00:00
bancika abdf02eac8 configurable snap to grid 2011-02-18 22:17:03 +00:00
bancika 746aadd8a2 improve bring to front/send to back 2011-02-18 13:17:56 +00:00
bancika ac4496040f improve bring to front/send to back 2011-02-18 13:16:58 +00:00
bancika d810096030 relax logging 2011-02-16 19:10:57 +00:00
bancika 4727017be7 fix for default browser 2011-02-15 20:36:18 +00:00
bancika b2dae15ee6 fix for default browser 2011-02-15 19:18:01 +00:00
bancika 56e112ff81 don't show grid on the thumbnail 2011-02-13 11:46:53 +00:00
bancika 6f5926e18e removed unused theme members 2011-02-13 09:43:27 +00:00
bancika b1f4773b10 2011-02-12 20:59:04 +00:00
bancika e5d33fb80d switchable sticky points
added themes
fixed ruler precision
improved board rendering
2011-02-12 20:35:09 +00:00
bancika b8545d27a1 line tracing fix 2011-02-06 20:38:21 +00:00
bancika 70ac30473b use clip to improve performance 2011-02-06 18:27:50 +00:00
bancika 4774e97ba2 use clip to improve performance 2011-02-06 18:22:30 +00:00
bancika de7378c722 2011-02-06 16:23:29 +00:00
bancika e2b3ed1b0e configurable render quality 2011-02-06 16:01:57 +00:00
bancika 99d38feb1c improved speed 2011-02-03 23:42:07 +00:00
bancika a561f6a3f9 tweaked boards 2011-02-03 23:10:23 +00:00
bancika 6eee1525ee better scaling
added marshall board and trimmer
2011-02-03 21:47:16 +00:00
bancika 02d38bed01 added eyelet/turret 2011-01-31 22:47:21 +00:00
bancika b96bad2688 cleanup component area map on loading
fixed lead area mapping bug
2011-01-31 22:05:05 +00:00
bancika 12ca93e2c9 fixed color code rounding 2011-01-31 21:49:01 +00:00
bancika d9b9542883 configurable jumper color 2011-01-31 20:03:41 +00:00
bancika 9e04cff806 fixed lead alignment issue 2011-01-31 20:03:22 +00:00
bancika 16600328cc copy paste doesn't work for some components 2011-01-31 19:32:18 +00:00
bancika 85d7d8a450 fixed lead alignment issue 2011-01-31 00:19:57 +00:00
bancika f358b5d87b fixed lead alignment issue 2011-01-31 00:18:39 +00:00
bancika fa02280292 code cleanup 2011-01-30 23:45:25 +00:00
bancika 8ea53b6876 added capacitor symbol 2011-01-30 23:35:07 +00:00
bancika 4d6e994555 added resistor wattage and capacitor voltage 2011-01-30 21:50:24 +00:00
bancika 10581c51fb added abstract class for leaded schematic symbols and resistor symbol 2011-01-30 21:33:08 +00:00
bancika 2cf6b573a7 added abstract class for leaded schematic symbols and resistor symbol 2011-01-30 21:31:42 +00:00
bancika 629fb5fff7 2011-01-30 18:46:38 +00:00
bancika bc154608f4 allow property edit validation 2011-01-30 17:21:42 +00:00
bancika a8cc661d09 better error handling when drawing 2011-01-30 14:10:38 +00:00
bancika 0b10f0bfe3 V1 file importer can recognize hookup wire and transistors 2011-01-30 12:02:29 +00:00
bancika f435571aae added keyboard shortcuts to some menu options 2011-01-30 11:43:54 +00:00
bancika 6bb248032f added square pad 2011-01-30 11:32:55 +00:00
bancika 1b04023a93 added axial electrolytic 2011-01-29 22:38:46 +00:00
bancika a32c8c4c8d added axial electrolytic 2011-01-29 22:35:09 +00:00
bancika 4a89159c80 reset component selection when switching tabs 2011-01-29 22:00:33 +00:00
bancika e5113e110e reset component selection when switching tabs 2011-01-29 22:00:01 +00:00
bancika c2051fcea2 improved electrolytic cap and resistor 2011-01-29 21:56:43 +00:00
bancika a42592410e improved electrolytic cap and resistor 2011-01-29 21:55:51 +00:00
bancika 22185a2d14 Potentiometer misdraw at 180 degrees 2011-01-29 18:31:25 +00:00
bancika ac6aaf4e06 added LED 2011-01-29 13:47:00 +00:00
bancika 1be52c1dfa improved zooming 2011-01-29 09:49:28 +00:00
bancika 328d09123b removed sysout 2011-01-29 09:02:19 +00:00
bancika 04cd80b561 added TO220 transistor
improved status text
2011-01-29 08:59:53 +00:00
bancika 3a419ba3bc added transistor 2011-01-28 20:05:37 +00:00
bancika 971ceb7160 added template support 2011-01-28 19:21:35 +00:00
bancika e0d8990954 added template support 2011-01-28 19:19:05 +00:00
bancika a70ec95822 added template support 2011-01-28 19:13:49 +00:00
bancika 8aacf915e3 added template support 2011-01-28 18:57:21 +00:00
bancika 777d3f6deb added template support 2011-01-28 18:55:40 +00:00
bancika 7de327b9bd fixed point visibility on curved trace
added option to hide color bands on the resistor
2011-01-28 17:48:46 +00:00
bancika 11b7756a59 added resistor color codes
fixed double value parsing
2011-01-27 22:34:41 +00:00
bancika b3351ef081 version info 2011-01-27 20:17:06 +00:00
bancika b1dbf4f1d2 added action to right click menu 2011-01-27 19:52:59 +00:00
bancika 9161182924 added send to back/bring to front 2011-01-27 19:49:33 +00:00
bancika 94f769f785 added send to back/bring to front 2011-01-27 19:44:37 +00:00
bancika 6dffcd6349 added send to back/bring to front 2011-01-27 19:41:36 +00:00
bancika 6fad7a2427 fixed NPE and wrong undo/redo for ungroup 2011-01-27 19:21:34 +00:00
bancika 4ab6231590 refactored actions out
added right click menu
2011-01-27 19:16:40 +00:00
bancika 5de6caf073 fixed bug with file name when creating new file 2011-01-26 23:57:09 +00:00
bancika be7ab3412d optimize image saving/loading 2011-01-26 23:50:48 +00:00
bancika 3dd4a4c5e3 added worker thread 2011-01-26 21:49:57 +00:00
bancika fb6f973a6e added worker thread 2011-01-26 21:48:57 +00:00
bancika e8d45e1426 added image alpha 2011-01-26 21:06:51 +00:00
bancika 51c916cbb5 added image component 2011-01-26 20:09:15 +00:00
bancika a8ba97dc77 revived cut action 2011-01-26 19:45:44 +00:00
bancika 103860a42b added update file 2011-01-26 19:04:51 +00:00
bancika 126d629cdc refactored awt.transferable out of the presenter
fixed copy/paste between instances
2011-01-26 18:44:40 +00:00
bancika f28dda37a6 optimize refresh when creating new component 2011-01-25 22:48:51 +00:00
bancika 3a7fdeb792 allow curve shape control points to overlap 2011-01-25 21:38:37 +00:00
bancika 13e0cec8ad better logging 2011-01-25 19:13:07 +00:00
bancika df33d7fd6e improved IC 2011-01-24 21:28:53 +00:00
bancika 2f672bf2b4 round corners 2011-01-24 21:02:33 +00:00
bancika e84f77a7ca pulled out scripting because of locale issues 2011-01-24 20:58:18 +00:00
bancika efeaf92ccb ability to center label 2011-01-24 20:12:51 +00:00
bancika 8927b2c326 tweak control point visibility 2011-01-24 20:00:11 +00:00
bancika 3476d3a608 import text component 2011-01-24 19:49:04 +00:00
bancika 6c052403d3 import electrolytics 2011-01-24 19:40:22 +00:00
bancika 1322f48918 removed unused ode 2011-01-24 19:23:03 +00:00
bancika 62cbe4826f improved stick mechanism when more than one point is stuck 2011-01-24 19:13:09 +00:00
bancika 2aa8aed874 improved importer for v1 2011-01-24 18:54:04 +00:00
bancika 6d361283a1 Configurable wheel zoom 2011-01-24 18:21:57 +00:00
bancika b33b6b6495 show selection size on demand
removed scroll buttons in toolbox
2011-01-24 18:17:13 +00:00
bancika fb5baf9571 added transparency to pot 2011-01-23 23:54:24 +00:00
bancika 2d6927993e fixed creation bug with d&d 2011-01-23 23:47:35 +00:00
bancika 5806d17e56 added v1 conversion warnings 2011-01-23 23:25:20 +00:00
bancika fcc001cb98 reduced number of base layers 2011-01-23 23:18:45 +00:00
bancika 1de1b9d6ec refactored some swing out of the core parts 2011-01-23 22:57:52 +00:00
bancika 726f17aa7f refactor some swing references 2011-01-23 19:58:47 +00:00
bancika 72ae295a09 fixed NPE 2011-01-23 18:51:04 +00:00
bancika 0aa61ecd8a 2011-01-23 18:34:15 +00:00
bancika 4106d2dad5 added label 2011-01-23 18:23:34 +00:00
bancika f9c08ecbaa changed curve position
synchronous messages
added pot
2011-01-23 17:26:34 +00:00
bancika a422c9ad2d don't stick to locked components 2011-01-22 13:23:58 +00:00
bancika 1cede9e071 added layer locking 2011-01-22 13:20:40 +00:00
bancika 664bf91852 added layer locking
added eyelet board
2011-01-22 13:17:43 +00:00
bancika 99d85a2d1f fixed drag&drop when spacing changes 2011-01-21 23:06:48 +00:00
bancika 9fdf7c3e46 added radial electrolytic 2011-01-21 22:03:52 +00:00
bancika 2c00a7a973 improved piece of code 2011-01-21 21:17:30 +00:00
bancika 91509c2bce added plastic diode 2011-01-21 21:10:57 +00:00
bancika abe9fbbbd5 added plastic diode 2011-01-21 21:09:17 +00:00
bancika 5e886ed90c turn off auto gc 2011-01-21 20:49:50 +00:00
bancika 7c5a125cd2 select components when dropped 2011-01-21 20:44:15 +00:00
bancika 3339a1b6eb added object cache 2011-01-21 20:41:08 +00:00
bancika d1603161a3 added object cache 2011-01-21 20:39:53 +00:00
bancika c51357f58c added object cache 2011-01-21 18:57:05 +00:00
bancika d67a0e7c87 fixed board collapsing bug 2011-01-21 08:44:33 +00:00
bancika 3f4aa807f0 fixed board collapsing bug 2011-01-21 08:35:18 +00:00
bancika 9ae74ac0a1 improved lead drawing 2011-01-20 23:34:33 +00:00
bancika be7e9a1d53 do not drag while creating new component 2011-01-20 23:23:40 +00:00
bancika dd53cfe569 don't allow selection rect when creating new
update selection when dropped
2011-01-20 21:52:51 +00:00
bancika 90f760dcd1 naming 2011-01-20 21:47:09 +00:00
bancika c875060e6a fixed compiler warning 2011-01-20 21:44:36 +00:00
bancika 0aeaa0dea0 refactored selection code 2011-01-20 21:40:53 +00:00
bancika 0c92d76d99 changed status text formatting 2011-01-20 21:24:07 +00:00
bancika a315bc06fa refactored instantiation code out the presenter 2011-01-20 21:19:32 +00:00
bancika 2309e80edc ctrl to unstuck components 2011-01-20 20:33:42 +00:00
bancika e0fd55c374 added component slot while creating
invalidate components when deleted
2011-01-20 19:03:04 +00:00
bancika 419293a956 fixed pdf scaling
changed few colors
2011-01-20 00:12:16 +00:00
bancika 55f7d2e057 added grid type
renamed few classes
2011-01-19 19:38:36 +00:00
bancika 69ef633af3 improved lead looks 2011-01-19 18:58:38 +00:00
bancika e38fb84621 boards don't disappear when points are flipped 2011-01-19 18:47:15 +00:00
bancika d4f2662bde fixed ghost painting 2011-01-19 18:42:08 +00:00
bancika be9a47753c removed old class 2011-01-19 18:30:20 +00:00
bancika 15b03b12a5 refactored file management out of presenter 2011-01-19 18:28:31 +00:00
bancika 69e961b296 refactored file management out of presenter 2011-01-19 18:24:13 +00:00
bancika 0d6fa98221 removed log for memory tracking 2011-01-19 18:14:37 +00:00
bancika 8a83bca7f2 do not show unnecessary decimals 2011-01-18 20:51:57 +00:00
bancika 7f1f7b60a5 fixed editing units 2011-01-18 20:39:28 +00:00
bancika 5e88aeedc1 2011-01-18 20:35:13 +00:00
bancika 8c4c884062 use enter and escape in the editor dialog 2011-01-17 23:14:33 +00:00
bancika fb46acad60 Adjust label angle if needed to make sure that it's readable 2011-01-17 23:07:46 +00:00
bancika a2ea8ee393 control point collision detection 2011-01-17 22:58:35 +00:00
bancika 5cea9f0193 persist zoom level 2011-01-17 22:48:43 +00:00
bancika b9aeaff6da bom tweak
anti-aliasing made as configurable item
2011-01-17 22:28:43 +00:00
bancika e866762b05 always show control point when creating new component
changed board alignment
fixed sticking to non-stickable points
2011-01-17 20:24:29 +00:00
bancika dcb5b668db fix main class 2011-01-17 19:57:31 +00:00
bancika f37e0dfc95 setup sticky and visibility policy for each point inidividually 2011-01-17 19:46:42 +00:00
bancika 7ad87076d3 added icons, fixed donate option 2011-01-17 19:20:02 +00:00
bancika 6dba12eab8 board improvements
show point for non-stretchable components too
2011-01-17 00:19:47 +00:00
bancika c02b37bcba fixed modified flag on drag end 2011-01-16 23:26:17 +00:00
bancika 584d84ff77 improved display of control points and status message 2011-01-16 23:18:15 +00:00
bancika 796276b1c1 object optimization 2011-01-16 23:08:31 +00:00
bancika c3d5556121 improved point-by-point creation 2011-01-16 23:04:32 +00:00
bancika 5b0eb295c8 show directories in file choosers 2011-01-16 21:17:03 +00:00
bancika 1d0f393931 added point by point component creation 2011-01-16 21:11:41 +00:00
bancika 8186841851 improved vero board 2011-01-16 13:35:53 +00:00
bancika 2478c7e51b temporary disable accessory in file choosers 2011-01-16 13:35:29 +00:00
bancika 1b2495f23e fixed save and save as to update the title bar 2011-01-16 13:28:34 +00:00
bancika 2af10da63c refactor drawing code out of presenter 2011-01-16 13:28:15 +00:00
bancika 6da2a6e94c refactor drawing code out of presenter 2011-01-16 13:27:45 +00:00
bancika 2660841ceb allow choosing name/value 2011-01-16 09:50:00 +00:00
bancika 6f6d802829 hotspot tracking optimization 2011-01-16 09:32:34 +00:00
bancika b81d633ce5 improve curve detection 2011-01-16 09:07:01 +00:00
bancika 63cf354c25 fixed paste translation 2011-01-16 08:47:17 +00:00
bancika e1377a8b09 painting optimization 2011-01-16 08:45:22 +00:00
bancika 1781c45317 outline optimization 2011-01-16 08:38:10 +00:00
bancika 7fd817191b optimize selection rect 2011-01-15 21:52:53 +00:00
bancika e8048d9d94 fix board name 2011-01-15 21:50:27 +00:00
bancika 657ce2e580 use acceleration 2011-01-15 21:48:36 +00:00
bancika 60e0ce6392 painting optimization 2011-01-15 21:05:31 +00:00
bancika 0ceed9a93a sort properties for project 2011-01-15 20:51:30 +00:00
bancika a470fb2abd title and desc non defaultable 2011-01-15 20:50:12 +00:00
bancika c8796102d9 moved utility method 2011-01-15 20:48:23 +00:00
bancika 1efe629f3d version # 2011-01-15 20:42:35 +00:00
bancika e9bcae11e3 improve paste 2011-01-15 20:41:31 +00:00
bancika 03444c3146 added helper methods for config reader 2011-01-15 20:32:46 +00:00
bancika 84818eef6a refresh selection on delete 2011-01-15 15:38:55 +00:00
bancika 3759fbc1ba allow expressions in double text field 2011-01-15 15:35:45 +00:00
bancika f05c3ccc86 save project default properties 2011-01-15 15:05:07 +00:00
bancika b99d438eb8 checks for file modifications 2011-01-15 14:19:36 +00:00
bancika 52df431beb checks for file modifications 2011-01-15 14:04:33 +00:00
bancika d16ee1d890 added menu item to edit selection 2011-01-15 11:13:19 +00:00
bancika cb1155e8fa fixed rounding to grid 2011-01-15 10:33:16 +00:00
bancika c677e98cad editable project properties 2011-01-15 10:31:07 +00:00
bancika dd4080accb make grid spacing flexible 2011-01-15 10:11:09 +00:00
bancika c8de2aa271 improved color editor 2011-01-14 16:23:00 +00:00
bancika 4420a97993 fixed double text field warning icon 2011-01-14 14:02:58 +00:00
bancika 1f5fa8ae14 fixed measure editing
fixed trace lead color
2011-01-14 13:57:51 +00:00
bancika 628d370019 changed about dialog 2011-01-14 13:41:55 +00:00
bancika 9652059ce7 added help items 2011-01-14 13:36:10 +00:00
bancika 8bc851875d added help items 2011-01-14 13:22:18 +00:00
bancika acf5b78a6c added help items 2011-01-14 13:21:44 +00:00
bancika d91d7baff3 added trace mask icon 2011-01-14 13:02:28 +00:00
bancika 0976a25c88 added trace mask icon 2011-01-14 12:49:51 +00:00
bancika a399fedfd7 improved d&d 2011-01-14 12:38:50 +00:00
bancika ef443925c2 added export trace
improved status message on selection
2011-01-14 10:00:04 +00:00
bancika e5c0b01aca include stuck components in drag 2011-01-13 21:34:45 +00:00
bancika f3ed8d1a7c tweak colors 2011-01-13 18:50:27 +00:00
bancika 7afeb48407 impoved bom 2011-01-12 23:59:34 +00:00
bancika 2dc7a50e2f zoom level doesn't reflect in the rulers 2011-01-12 23:57:47 +00:00
bancika aac45e8978 added project info component 2011-01-12 23:01:35 +00:00
bancika b9e5704225 improved few components 2011-01-12 22:48:00 +00:00
bancika 521e3fda5f added bom component 2011-01-12 20:50:13 +00:00
bancika 23f4cb7468 fixed npe 2011-01-12 20:43:51 +00:00
bancika dd1ec04f1c track string drawing 2011-01-12 20:43:40 +00:00
bancika f050ab5818 doc 2011-01-12 18:25:44 +00:00
bancika 09e4862bcc grouping improvement 2011-01-12 17:46:57 +00:00
bancika 27bac25c8b added group/ungroup 2011-01-12 00:39:39 +00:00
bancika a04c90b689 update prefixes 2011-01-11 23:38:35 +00:00
bancika d2bacdaa21 add ant build 2011-01-11 23:36:29 +00:00
bancika f8dd6a36c0 update prefixes 2011-01-11 23:31:25 +00:00
bancika 5d22d282fa use red when selected 2011-01-11 21:48:38 +00:00
bancika 19d561d35d show selection in status bar 2011-01-11 21:34:15 +00:00
bancika 070e3edf52 use red when selected 2011-01-11 21:22:07 +00:00
bancika e3a3dfe82e use red rectangle when selected 2011-01-11 19:22:48 +00:00
bancika a97f83f1ac use red rectangle when selected 2011-01-11 19:21:05 +00:00
bancika 37a7362d9e fixed d&d bug with multiple selection 2011-01-11 18:54:53 +00:00
bancika e9936e4adb select all works now 2011-01-11 18:47:40 +00:00
bancika cb72d596a3 editable colors for boards 2011-01-10 23:47:39 +00:00
bancika ce63511188 editable colors for boards 2011-01-10 23:43:01 +00:00
bancika c2e5b6d20c improved switch and IC 2011-01-10 23:32:47 +00:00
bancika dcbd351589 improved switch 2011-01-10 23:12:07 +00:00
bancika 56beaa7f9b draw leads on the top, useful for radial components 2011-01-10 23:06:23 +00:00
bancika c4cedd8946 better measure 2011-01-10 22:51:26 +00:00
bancika d141b9c477 added delete functionality 2011-01-10 22:38:50 +00:00
bancika e249667bbd allow custom cm and in spacing
more precise ruler
2011-01-10 19:45:05 +00:00
bancika ee01f390da better measurement 2011-01-10 19:37:13 +00:00
bancika 3fd425f2cd removed old code 2011-01-10 18:48:17 +00:00
bancika e17c0d5753 abstract class reorganization
sort properties by name
2011-01-10 18:43:23 +00:00
bancika dc1f0ac7bd 2011-01-10 18:32:14 +00:00
bancika 13cfcb16df editable board spacing 2011-01-10 18:31:24 +00:00
bancika 218126c85e renamed class 2011-01-10 18:26:49 +00:00
bancika e7784f442b added abstract curve 2011-01-10 00:07:22 +00:00
bancika 573b58902b jumper to blue 2011-01-09 23:49:58 +00:00
bancika 974c5bcf21 added trace cut 2011-01-09 23:38:55 +00:00
bancika 481c28d835 fixed npe 2011-01-09 23:38:37 +00:00
bancika 5f860348df change layer to double
added solder pad
2011-01-09 23:10:24 +00:00
bancika 7af112a28b added ic pins 2011-01-09 14:28:02 +00:00
bancika c898fee28e added color properties to abstract leaded comp 2011-01-09 13:11:46 +00:00
bancika f2fa8195b3 added some icons 2011-01-09 12:44:24 +00:00
bancika 41bcfec45e added some icons 2011-01-09 12:44:07 +00:00
bancika 32efad1490 process polygon line 2011-01-09 12:19:44 +00:00
bancika 6a80bcdbe6 process shape outline 2011-01-09 12:16:53 +00:00
bancika 37a74f7918 added wire 2011-01-09 12:16:27 +00:00
bancika 94c53a2344 doc 2011-01-09 00:46:24 +00:00
bancika 672aef6799 2011-01-09 00:42:00 +00:00
bancika 9a2fdc264f disable alpha on jumpers 2011-01-09 00:39:04 +00:00
bancika d43e098216 added transparency 2011-01-09 00:08:13 +00:00
bancika 300753bb85 sort categories 2011-01-08 19:24:06 +00:00
bancika fa2709efc0 moved logic to component processor 2011-01-08 18:37:11 +00:00
bancika 43d931a1e6 cleanup 2011-01-08 18:31:36 +00:00
bancika 4dd470f185 support for line recognition
recognize deprecated properties
2011-01-08 18:22:36 +00:00
bancika f3bc414676 Added jumper and trace 2011-01-08 18:19:57 +00:00
bancika 0b319cf46f 2011-01-08 15:50:51 +00:00
bancika 90e8f4004b changed switch 2011-01-08 15:48:15 +00:00
bancika 80fff261bb removed old code 2011-01-08 15:39:22 +00:00
bancika ad43ecd0ed added selection size 2011-01-08 15:35:33 +00:00
bancika a4309a169c fixed z-order selection 2011-01-08 14:18:05 +00:00
bancika ca1d71e2eb draw control points on the top 2011-01-08 14:13:55 +00:00
bancika 695887ba4c do not show control points of non-stretchable 2011-01-08 14:10:24 +00:00
bancika 33d03a377d do not look for setter if no annotation is found 2011-01-08 14:06:18 +00:00
bancika 2d942a3214 moved common code to the main project 2011-01-08 14:02:53 +00:00
bancika 746b7d4e97 reorganized packages
added toggle switch
2011-01-08 14:02:21 +00:00
bancika 8a115e5cbd fixed d&d jumping issue when zoomed 2011-01-08 14:00:56 +00:00
bancika 93ac7b24d1 Code cleanup 2011-01-08 10:56:59 +00:00
bancika a91e2c2617 fixed d&d jumping issue 2011-01-08 10:55:08 +00:00
bancika 69f1e8afcd Z-order component handling 2011-01-08 10:17:01 +00:00
bancika d2cc7cd214 Z-order component handling 2011-01-08 10:16:17 +00:00
bancika e0a3a64696 fixed dynamic jar loading 2011-01-08 10:03:27 +00:00
bancika b9fe3d84e2 Z-order component handling 2011-01-08 09:34:21 +00:00
bancika 5b0753c42c improved perfboard 2011-01-08 09:33:27 +00:00
bancika d4cece7f5a improved perfboard 2011-01-08 09:02:48 +00:00
bancika 435f8d62f2 added boards 2011-01-07 17:03:39 +00:00
bancika a5c5296365 moving library to new project 2011-01-07 16:37:37 +00:00
bancika a6b378c173 2011-01-07 16:34:40 +00:00
bancika defd97118a IC painting issue fix 2011-01-06 00:42:32 +00:00
bancika 53433f0836 increased repaint hack time 2011-01-06 00:39:52 +00:00
bancika e612b39b26 better d&d of control points
doc
2011-01-06 00:23:59 +00:00
bancika b33d1c3e37 improved IC 2011-01-05 23:54:57 +00:00
bancika 3b3a9baa82 warning fixed 2011-01-05 19:43:48 +00:00
bancika 1b3457623d warning fixed 2011-01-05 19:42:18 +00:00
bancika 7bd3245024 added enum editor 2011-01-05 19:41:32 +00:00
bancika 51eee908c2 changed control point api 2011-01-05 19:21:59 +00:00
bancika 8db24c2588 added project to component.draw
better logging
2011-01-05 01:00:16 +00:00
bancika dd50ccf785 simplified component framework 2011-01-05 00:20:09 +00:00
bancika 69acfcff2f simplified component framework 2011-01-05 00:09:11 +00:00
bancika d1892cae70 added more capacitors 2011-01-04 22:58:04 +00:00
bancika 2c994228f4 added more capacitors 2011-01-04 22:54:57 +00:00
bancika 74c7007b23 added capacitor 2011-01-04 22:47:41 +00:00
bancika 872293ea0e doc 2011-01-04 22:29:10 +00:00
bancika cb5c95478f abstract leaded component changes 2011-01-04 22:19:24 +00:00
bancika 2bd2ecd13d renamed BOM objects 2011-01-04 21:13:13 +00:00
bancika 32409b186f doc 2011-01-04 21:01:46 +00:00
bancika a88f0d0a45 refactored component framework 2011-01-04 20:55:35 +00:00
bancika 73da0f4a9b 2011-01-04 19:07:30 +00:00
bancika 50ac3a9487 package renamed 2011-01-04 18:59:19 +00:00
bancika bc3eea1ff8 package renamed 2011-01-04 18:54:02 +00:00
bancika 4e935aecc9 package renamed 2011-01-04 18:44:00 +00:00
bancika b38bb5526e horizontal leaded components 2011-01-03 22:51:00 +00:00
bancika d248e7b211 doc 2011-01-03 22:41:30 +00:00
bancika 60d5f1747b auto-increment names
abstract leaded component
2011-01-03 22:13:56 +00:00
bancika 79a48a04e0 2011-01-03 19:23:10 +00:00
bancika 602bd81bb4 fixed d&d alignment issues 2011-01-03 18:33:18 +00:00
bancika 76d0646095 fixed undo with d&d 2011-01-03 17:17:56 +00:00
bancika 315a8ea259 fixed undo with d&d 2011-01-03 17:17:11 +00:00
bancika dab2ecf7d4 painting optimization 2011-01-03 17:12:29 +00:00
bancika ae03132dc4 improved d&d
fixed deadlock
2011-01-03 14:54:49 +00:00
bancika 2948097d07 doc 2011-01-03 14:33:13 +00:00
bancika 773fa10b62 improved d&d 2011-01-03 14:31:34 +00:00
bancika 68ffef2e8c better d&d cursor 2011-01-03 14:31:08 +00:00
bancika 86e07e60b8 painting issue fix 2011-01-03 13:48:04 +00:00
bancika cb56375de9 painting issue fix 2011-01-03 13:26:20 +00:00
bancika 2f87896523 2011-01-03 10:31:44 +00:00
bancika 65650edad6 2011-01-02 23:36:52 +00:00
bancika f680ecf9cf drag cursor to hand 2011-01-02 22:31:14 +00:00
bancika 751af001a6 auto-gc 2011-01-02 21:24:54 +00:00
bancika 950a899b68 2011-01-02 18:13:02 +00:00
bancika 77cb69e62a added new src for library 2011-01-02 18:12:35 +00:00
bancika 96d869aec6 2011-01-02 18:12:18 +00:00
bancika e2e3c9d7e7 removed components from the test src 2011-01-02 18:11:55 +00:00
bancika d48131e5b0 2011-01-02 17:23:59 +00:00
bancika 4d3bee4ad8 added docs 2011-01-02 13:25:00 +00:00
bancika d4e42566a7 added PropertyInjector 2011-01-02 13:16:56 +00:00
bancika 6e0bcaa878 added docs 2011-01-02 12:37:57 +00:00
bancika 4da06d79b0 code format 2011-01-02 12:15:31 +00:00
bancika 9fecfe947c 2010-01-12 18:36:49 +00:00
bancika 0ef611fe40 new HttpProxy 2009-12-23 22:49:25 +00:00
bancika d7d774bec3 added jettison jar 2009-12-22 22:26:38 +00:00
bancika 7d833f77ed deleted unused file 2009-12-22 00:15:32 +00:00
bancika 65f7703660 added ant 2009-12-22 00:07:08 +00:00
bancika c8c3b7e9cd removed mysql dependency 2009-12-20 18:58:56 +00:00
bancika 02d70eae6f 2009-12-20 17:54:12 +00:00
819 changed files with 52579 additions and 2221 deletions
@@ -0,0 +1,17 @@
<?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>
@@ -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>
File diff suppressed because one or more lines are too long
@@ -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>
@@ -0,0 +1,78 @@
<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>
@@ -0,0 +1,2 @@
#org.diylc.utils.Constants.CANVAS_COLOR=#005D96
#org.diylc.utils.Constants.GRID_COLOR=#FFFFFF
@@ -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>
@@ -0,0 +1,76 @@
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);
}
}
}
@@ -0,0 +1,7 @@
package org.diylc.common;
public class BadPositionException extends Exception {
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,88 @@
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;
}
}
@@ -0,0 +1,11 @@
package org.diylc.common;
public enum Display {
NAME, VALUE;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -0,0 +1,40 @@
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;
}
@@ -0,0 +1,83 @@
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;
}
@@ -0,0 +1,6 @@
package org.diylc.common;
public enum GridType {
LINES, CROSSHAIR, DOT, NONE;
}
@@ -0,0 +1,8 @@
package org.diylc.common;
import org.diylc.core.IDIYComponent;
public interface IComponentFiler {
boolean testComponent(IDIYComponent<?> component);
}
@@ -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);
}
@@ -0,0 +1,34 @@
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);
}
@@ -0,0 +1,11 @@
package org.diylc.common;
public enum LabelPosition {
ABOVE, BELOW;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -0,0 +1,39 @@
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;
}
}
@@ -0,0 +1,15 @@
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";
}
}
}
@@ -0,0 +1,11 @@
package org.diylc.common;
public enum OrientationHV {
VERTICAL, HORIZONTAL;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -0,0 +1,156 @@
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;
}
}
@@ -0,0 +1,14 @@
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();
}
}
@@ -0,0 +1,73 @@
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;
}
}
@@ -0,0 +1,249 @@
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();
}
}
}
@@ -0,0 +1,336 @@
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;
}
}
@@ -0,0 +1,72 @@
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;
}
}
@@ -0,0 +1,21 @@
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;
}
}
@@ -0,0 +1,13 @@
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 {
}
}
@@ -0,0 +1,11 @@
package org.diylc.core;
/**
* Enumerates all possible states that a component can be in.
*
* @author Branislav Stojkovic
*/
public enum ComponentState {
NORMAL, SELECTED, LOCKED, DRAGGING
}
@@ -0,0 +1,6 @@
package org.diylc.core;
public enum CreationMethod {
SINGLE_CLICK, POINT_BY_POINT;
}
@@ -0,0 +1,122 @@
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);
}
@@ -0,0 +1,15 @@
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();
}
@@ -0,0 +1,16 @@
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;
}
@@ -0,0 +1,38 @@
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);
}
@@ -0,0 +1,225 @@
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;
// }
}
@@ -0,0 +1,86 @@
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;
}
}
@@ -0,0 +1,11 @@
package org.diylc.core;
public class ValidationException extends Exception {
private static final long serialVersionUID = 1L;
public ValidationException(String message) {
super(message);
}
}
@@ -0,0 +1,22 @@
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;
}
@@ -0,0 +1,62 @@
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;
}
@@ -0,0 +1,42 @@
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;
}
@@ -0,0 +1,20 @@
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.");
}
}
}
@@ -0,0 +1,81 @@
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;
}
}
@@ -0,0 +1,31 @@
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);
}
}
@@ -0,0 +1,24 @@
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;
}
}
@@ -0,0 +1,31 @@
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);
}
}
@@ -0,0 +1,24 @@
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;
}
}
@@ -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);
}
}
@@ -0,0 +1,24 @@
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;
}
}
@@ -0,0 +1,47 @@
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());
}
}
@@ -0,0 +1,17 @@
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;
}
}
@@ -0,0 +1,6 @@
package org.diylc.core.measures;
public interface Unit {
double getFactor();
}
@@ -0,0 +1,61 @@
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;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

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