Compare commits

..

407 Commits

Author SHA1 Message Date
Branislav Stojkovic bb3b37f23b patched osx component loading issue, investigate further 2019-03-25 08:21:20 +01:00
Branislav Stojkovic fcea5975a8 change backup folder name 2019-03-24 21:38:27 +01:00
Branislav Stojkovic 2294ac45a2 copy loaded file as-is to backup folder 2019-03-24 21:37:37 +01:00
Branislav Stojkovic 5598f22b2f Added "Auto-Wrap Label" component
extracted string rendering function into a separate class
2019-03-24 08:34:28 +01:00
Branislav Stojkovic 812b7adb28 remove newPoints and reuse points for backward compatibility 2019-03-23 22:44:09 +01:00
Branislav Stojkovic 9fd5a8fe96 redo relaxed validation 2019-03-23 19:11:06 +01:00
Branislav Stojkovic 0b8952e354 relax validation of control point collision while dragging 2019-03-23 18:54:44 +01:00
Branislav Stojkovic 5c47ff1ef0 added ability to include or exclude switches from netlist analyzer 2019-03-23 18:05:28 +01:00
Branislav Stojkovic b85b93404b Added mini toolbar in the top-right corner of the screen with transform
actions exposed for quick access
2019-03-22 23:37:59 +01:00
Branislav Stojkovic b46f46aa99 When pasting a group of components that contain at least one "PCB Text"
instance, some of the other components get rendered mirrored while
position the pasted components
2019-03-22 22:29:05 +01:00
Branislav Stojkovic 48266d3b27 fix the 3rd control point when copy-pasting 2019-03-22 21:04:54 +01:00
Branislav Stojkovic eb6cc76f02 make autosave params configurable 2019-03-22 20:58:27 +01:00
Branislav Stojkovic a5d512ca37 Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2019-03-22 16:39:23 +01:00
Branislav Stojkovic 1d038b5f8c better log 2019-03-22 16:39:08 +01:00
Branislav Stojkovic 9366f9c602 Auto-save plugin now works by periodically creating project backups in
user\.diylc\autoSave directory and maintains file history, keeping the
last X versions of the file. Maximum size for all backups is
configurable and pre-set to 64MB
2019-03-22 16:38:01 +01:00
bancika 23b4fcae02 Update README.md 2019-03-22 10:34:55 +01:00
Branislav Stojkovic 14a994e68f Improve "Expand Selection" feature to use the same algorithm as netlists
for better precision<
2019-03-22 00:47:28 +01:00
Branislav Stojkovic 894ff1a2cb Assign new name for pasted component if the project already contains
components under that name
2019-03-20 22:35:28 +01:00
Branislav Stojkovic 78dcd27e1d Some schematic symbols (transistors, potentiometer...) get into bad
state when rotated and flipped at the same time
2019-03-20 20:06:38 +01:00
Branislav Stojkovic 714db98afa deleted old file
fixed pin rendering on some components
2019-03-20 19:27:46 +01:00
Branislav Stojkovic 2faa2c6d61 reorganized "stretchable" property into more granular control at the
point level

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

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

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

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

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

Updated rendering to reflect this change.

* Use the coordinate origin setter method

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

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

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

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

Conflicts:
	diylc/diylc-library/lib/diylc-core.jar
	diylc/diylc-swing/lib/diylc-core.jar
2017-05-06 12:19:42 +02:00
Branislav Stojkovic b745ae8e15 new splash screen 2017-05-06 12:11:07 +02:00
bancika 2a72c8380c Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-05-05 12:03:08 +02:00
bancika cc008568a0 Editable toggle switch color 2017-05-05 11:59:56 +02:00
bancika c5b5465bab Create README.md 2017-05-05 11:42:20 +02:00
bancika 0a7e5c7dc7 add donate button in the installer 2017-05-05 11:32:12 +02:00
bancika d62221b796 Update README.md 2017-05-03 19:34:37 +02:00
bancika 3e0a698d32 Update README.md 2017-05-03 19:34:07 +02:00
bancika c37b0f3071 Ability to change PCB board shape from rectangular to oval 2017-04-27 17:15:38 +02:00
bancika 0fcd523d6b DIL IC label improvements 2017-04-27 13:56:24 +02:00
bancika ccf6e7bb7e improve bring to front/back 2017-04-27 13:17:14 +02:00
bancika d211ea6ffc Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-27 12:48:16 +02:00
bancika a5bd532e47 force components to go to front or back 2017-04-27 12:05:34 +02:00
bancika ddfb64f1a4 do not block the UI at startup 2017-04-27 11:40:18 +02:00
bancika 5198c9e2b5 Update README.md 2017-04-26 20:06:57 +02:00
bancika b39f685a90 Update README.md 2017-04-26 19:56:09 +02:00
bancika b2501ccba1 Tilde to repeat last added component 2017-04-26 16:30:02 +02:00
bancika 3f4b0475bc pot icon improvement 2017-04-26 15:42:45 +02:00
bancika f43cd8d90a Merge branch 'master' of https://github.com/bancika/diy-layout-creator.git 2017-04-26 14:03:46 +02:00
bancika 66bdd41b29 Potentiometers can show an optional shaft, can have either solder lugs
or PCB pins and rendering includes the wafer
2017-04-26 14:03:36 +02:00
bancika c84fc3a200 Update README.md 2017-04-26 10:55:00 +02:00
bancika 1f44d63865 release 2017-04-26 10:52:44 +02:00
428 changed files with 39128 additions and 8763 deletions
+8
View File
@@ -0,0 +1,8 @@
Thank you for reporting issues and contributing ideas and features to DIYLC repository!
Before you proceed, please read the following:
* If you are reporting a bug, please attach the latest application log file together with description of steps that lead to the issue. They can be found in the user directory under `.diylc/logs` directory. On Windows 7 and later, it's located in `c:/Users/<your username>/.diylc/logs`. On Linux and MacOS, it's typically in `/Users/<your username>/.diylc/logs`.
* If you are having issues starting the application under MacOS, make sure that 3rd party apps are allowed on your Mac. This document covers how to do it - https://support.apple.com/en-us/HT202491.
* Try to look for similar unresolved issues that are already reported to avoid duplicates.
* Make sure that you are running the latest version of DIYLC.
+3
View File
@@ -0,0 +1,3 @@
.idea
*.iml
*.eml
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+47 -29
View File
@@ -1,32 +1,50 @@
<p align="justify"><strong>DIYLC is provided free of charge and can be used and redistributed freely. Please note that it takes a lot of time and effort to build, test and maintain it and to interact with the growing community of users. If you find DIYLC useful and want to support further development, please consider making a small PayPal donation. Every little bit counts! If you have some extra parts, transistors, tubes, ICs, caps...anything useful for a fellow DIYer, I'll gladly accept a donation in parts.</strong></p>
<p align="center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=U6GLS8HLTSU88" rel="nofollow"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif"></a> </p>
<a href="https://github.com/bancika/diy-layout-creator/releases/latest">Click here</a> to get the latest version for all platforms.</a>
<a href="https://github.com/bancika/diy-layout-creator/tree/wiki">Click here</a> to read the user documentation as well as developer documentation.
**OSX users**: make sure that __3rd party apps are allowed__ on your Mac before installing DIYLC. [This document](https://support.apple.com/en-us/HT202491) covers how to do it.
<a href="https://github.com/bancika/diy-layout-creator/releases/latest">Click here</a> to get the latest version for all platforms.</a><br>
<a href="https://github.com/bancika/diy-layout-creator/tree/wiki">Click here</a> to read the user documentation as well as developer documentation.<br>
<b>OSX users</b>: make sure that <i>3rd party apps are allowed</i> on your Mac before installing DIYLC. <a href="https://support.apple.com/en-us/HT202491">This document</a> covers how to do it.
<h3><a name="News"></a>Introduction<a href="#Introduction" class="section_anchor"></a></h3>
<p align="justify">DIY Layout Creator (DIYLC in short) is a freeware drawing tool developed with help of the large online community of DIY electronics enthusiasts. It incorporates many ideas that came from people using older versions of the application. The goal is to provide a simple interface and enough power to let the user draw schematics, board/chassis layouts and guitar wiring diagrams quickly and without a steep learning curve. Also, it is buitd around a flexible open source framework that may be used to draw pretty much anything. Below is a sample board layout drawn in DIYLC3. </p><p></p><p align="center"><a href="http://diy-fever.com/wordpress/wp-content/gallery/diylc/diylc_3_36_rangemaster.png" rel="nofollow"><img src="http://diy-fever.com/nextgen-image/833/480x0x90/a93c6f7598bc16fce4f4aad480631523"></a></p> <p></p><h3><a name="Key Features"></a>Features<a href="#Features" class="section_anchor"></a></h3><ul><li>platform independence, will run on any machine having Java JRE/JDK 1.6.0_45 or newer </li><li>easy to use interface, most of the operations can be done using mouse </li><li>draws schematics, board layouts, chassis layouts and guitar wiring diagrams </li><li>high flexibility, has the API to allow plug-ins and new components to be added without much trouble </li><li>improved performance and reduced memory consumption compared to the previous versions </li><li>save default values for each property of a component individually </li><li>group components together and treat them as one, e.g. move, edit or delete </li><li>export the output to image, PDF or printer </li><li>export PCB trace mask suitable for toner transfer </li><li>create a Bill of Materials as a part of the project or export it to few different file formats </li><li>zoom in/out feature </li><li>configurable grid spacing on the project level </li><li>auto update checks for new versions </li><li>import files created with older versions of the application </li><li>create and load project templates </li><li>cloud feature - share your projects, search through the cloud and download other users' projects </li></ul><p>To report bugs or request a new feature go to <a href="https://github.com/bancika/diy-layout-creator/issues" rel="nofollow">Issues</a> page and create a new issue describing your problem or request. </p><p>To join the discussion or request technical assistance, use the dedicated <a href="http://groups.google.com/group/diy-layout-creator" rel="nofollow">Discussion Group</a>. </p><h3><a name="Want_to_contribute?"></a>Want to contribute?<a href="#Want_to_contribute?" class="section_anchor"></a></h3><p>If you want to help the DIYLC project, there are several things you can do: </p><ul><li>Help with adding the information to the <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/Manual.md">user manual</a>. </li><li>Extend the component base, read <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/ComponentAPI.md" rel="nofollow">this wiki</a> to learn how to create new components. </li><li>Add a new functionality though plug-ins, read <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/PluginAPI.md" rel="nofollow">this wiki</a> to learn how to create new plug-ins. </li><li>If you are good with design, DIYLC could use a fancy splash screen and/or a new application icon in 16x16, 32x32 and 48x48 formats. </li><li>Consider making a small <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=25161" rel="nofollow">PayPal donation</a>. </li></ul><h3><a name="License_information"></a>License information<a href="#License_information" class="section_anchor"></a></h3><p>Source code is released under <a href="http://www.gnu.org/licenses/quick-guide-gplv3.html" rel="nofollow">GPL license</a> for non-commercial projects only. Contact the project owner to obtain a licence in case you plan to use the source code, or any part of it, in commercial purposes. </p><p></p>
<h3>Linux installation</h3>
Add the repository.
```
sudo sh -c 'echo "deb http://www.diy-fever.com/diylc_repository binary/">/etc/apt/sources.list.d/diylc.list'
```
Update the source list.
```
sudo apt-get update
```
Install the DIY Layout Creator tool.
```
sudo apt-get install diylc
```
<h3><a name="Credits"></a>Credits<a href="#Credits" class="section_anchor"></a></h3><ul><li>Big thanks goes to folks from the following sites that helped with testing and ideas: <a href="http://www.diystompboxes.com/smfforum/" rel="nofollow">DIY Stompboxes</a>, <a href="http://ax84.com/bbs" rel="nofollow">AX84</a> and <a href="http://freestompboxes.org" rel="nofollow">Free Stompboxes</a>. </li><li>I'm happy to report that DIYLC 3 is the fastest version ever. <a href="http://www.yourkit.com/java/profiler/index.jsp" rel="nofollow">YourKit Java Profiler</a> helped tremendously with memory and performance profiling and pointed me to places in the code that took longer to run or consumed more memory than I'd like them to. I strongly recommend this tool to anyone developing Java or .NET applications because it helps finding bottlenecks and allocation hot-spots very fast.<br><br>YourKit is kindly supporting open source projects with its full-featured Java Profiler.<br>YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications.<br>Take a look at YourKit's leading software products: <a href="http://www.yourkit.com/java/profiler/index.jsp" rel="nofollow">YourKit Java Profiler</a> and <a href="http://www.yourkit.com/.net/profiler/index.jsp" rel="nofollow">YourKit .NET Profiler</a> </li></ul>
<p align="justify">DIY Layout Creator (DIYLC in short) is a freeware drawing tool developed with help of the large online community of DIY electronics enthusiasts. It incorporates many ideas that came from people using older versions of the application. The goal is to provide a simple interface and enough power to let the user draw schematics, board/chassis layouts and guitar wiring diagrams quickly and without a steep learning curve. Also, it is buitd around a flexible open source framework that may be used to draw pretty much anything. Below is a sample board layout drawn in DIYLC3. </p>
<p></p>
<p align="center"><a href="http://diy-fever.com/wordpress/wp-content/gallery/diylc/diylc_3_36_rangemaster.png" rel="nofollow"><img src="http://diy-fever.com/nextgen-image/833/480x0x90/a93c6f7598bc16fce4f4aad480631523"></a></p>
<p></p>
<h3><a name="Key Features"></a>Features<a href="#Features" class="section_anchor"></a></h3>
<ul>
<li>platform independence, will run on any machine having Java JRE/JDK 1.6.0_45 or newer </li>
<li>easy to use interface, most of the operations can be done using mouse </li>
<li>draw PCB, perfboard, stripboard or point-to-point circuit layouts layouts, schematics and guitar wiring diagrams </li>
<li>high flexibility, has the API to allow plug-ins and new components to be added</li>
<li>improved performance and reduced memory consumption compared to the previous versions </li>
<li>save default values for each property of a component individually </li>
<li>group components together and treat them as one, e.g. move, edit or delete </li>
<li>export the output to image, PDF or printer </li>
<li>export PCB trace mask suitable for toner transfer </li>
<li>export the circuit to a SPICE compatible netlist (beta) </li>
<li>create a Bill of Materials as a part of the project or export it to few different file formats </li>
<li>analyze guitar wirings and show detailed pickup configuration in each switch configuration</li>
<li>zoom in/out feature </li>
<li>configurable grid spacing on the project level </li>
<li>auto update checks for new versions </li>
<li>import files created with older versions of the application </li>
<li>cloud feature - share your projects, search through the cloud and download other users' projects </li>
<li>highlight connected areas to simplify validation and circuit debugging</li>
</ul>
<p>To report bugs or request a new feature go to <a href="https://github.com/bancika/diy-layout-creator/issues" rel="nofollow">Issues</a> page and create a new issue describing your problem or request. </p>
<p>To join the discussion or request technical assistance, use the dedicated <a href="http://groups.google.com/group/diy-layout-creator" rel="nofollow">Discussion Group</a>. </p>
<h3><a name="Want_to_contribute?"></a>Want to contribute?<a href="#Want_to_contribute?" class="section_anchor"></a></h3>
<p>If you want to help the DIYLC project, there are several things you can do: </p>
<ul>
<li>Help with adding the information to the <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/Manual.md">user manual</a>. </li>
<li>Extend the component base, read <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/ComponentAPI.md" rel="nofollow">this wiki</a> to learn how to create new components. </li>
<li>Add a new functionality though plug-ins, read <a href="https://github.com/bancika/diy-layout-creator/blob/wiki/PluginAPI.md" rel="nofollow">this wiki</a> to learn how to create new plug-ins. </li>
<li>If you are good with design, DIYLC could use a fancy splash screen and/or a new application icon in 16x16, 32x32 and 48x48 formats. </li>
<li>Consider making a small <a href="http://diy-fever.com/donate" rel="nofollow">PayPal donation</a>. </li>
</ul>
<h3><a name="License_information"></a>License information<a href="#License_information" class="section_anchor"></a></h3>
<p>Source code is released under <a href="https://www.gnu.org/licenses/gpl-3.0.txt">GNU General Public License version 3</a>. Contact the project owner to obtain a license in case you plan to use the source code, or any part of it, in commercial purposes. </p>
<p></p>
<h3><a name="Credits"></a>Credits<a href="#Credits" class="section_anchor"></a></h3>
<ul>
<li>Big thanks goes to folks from the following online communities for contributing ideas and helped test the app: <a href="http://www.diystompboxes.com/smfforum/" rel="nofollow">DIY Stompboxes</a>, <a href="http://ax84.com/bbs" rel="nofollow">AX84</a> and <a href="http://freestompboxes.org" rel="nofollow">Free Stompboxes</a>. </li>
<li>I'm happy to report that DIYLC 3 is the fastest version ever. <a href="http://www.yourkit.com/java/profiler/index.jsp" rel="nofollow">YourKit Java Profiler</a> helped tremendously with memory and performance profiling and pointed me to places in the code that took longer to run or consumed more memory than I'd like them to. I strongly recommend this tool to anyone developing Java or .NET applications because it helps finding bottlenecks and allocation hot-spots very fast.<br><br>YourKit is kindly supporting open source projects with its full-featured Java Profiler.<br>YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications.<br>Take a look at YourKit's leading software products: <a href="http://www.yourkit.com/java/profiler/index.jsp" rel="nofollow">YourKit Java Profiler</a> and <a href="http://www.yourkit.com/.net/profiler/index.jsp" rel="nofollow">YourKit .NET Profiler</a> </li>
</ul>
+21
View File
@@ -0,0 +1,21 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//src/org/diylc/core/measures/Resistance.java=UTF-8
encoding//src/org/diylc/core/measures/ResistanceUnit.java=UTF-8
Binary file not shown.
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.announcements;
import java.io.Serializable;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.announcements;
import java.text.DateFormat;
@@ -42,7 +63,7 @@ public class AnnouncementProvider {
StringBuilder sb = new StringBuilder("<html>");
for (int i = 0; i < announcements.size(); i++) {
Date date = dateFormat.parse(announcements.get(i).getDate());
if (lastDate == null || lastDate.before(date) || (forceLast && i == announcements.size() - 1)) {
if (lastDate == null || lastDate.before(date) || lastDate.equals(date) || (forceLast && i == announcements.size() - 1)) {
sb.append("<font size='4'><b>").append(announcements.get(i).getTitle()).append("</b> on ")
.append(announcements.get(i).getDate()).append("</font>").append("<p>")
.append(announcements.get(i).getText()).append("</p>");
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.announcements;
import java.util.List;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public class BadPositionException extends Exception {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.util.Collection;
@@ -0,0 +1,47 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.util.List;
import java.util.Map;
import org.diylc.core.IDIYComponent;
public class BuildingBlockPackage {
private Map<String, List<IDIYComponent<?>>> block;
private String owner;
public BuildingBlockPackage(Map<String, List<IDIYComponent<?>>> blocks, String owner) {
super();
this.block = blocks;
this.owner = owner;
}
public Map<String, List<IDIYComponent<?>>> getBlocks() {
return block;
}
public String getOwner() {
return owner;
}
}
@@ -1,127 +1,138 @@
package org.diylc.common;
import javax.swing.Icon;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.BomPolicy;
import org.diylc.core.annotations.KeywordPolicy;
/**
* 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 flexibleZOrder;
private boolean stretchable;
private BomPolicy bomPolicy;
private boolean autoEdit;
private IComponentTransformer transformer;
private KeywordPolicy keywordPolicy;
private String keywordTag;
public ComponentType(String name, String description, CreationMethod creationMethod, String category,
String namePrefix, String author, Icon icon, Class<? extends IDIYComponent<?>> instanceClass, double zOrder,
boolean flexibleZOrder, boolean stretchable, BomPolicy bomPolicy, boolean autoEdit, IComponentTransformer transformer,
KeywordPolicy keywordPolicy, String keywordTag) {
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.flexibleZOrder = flexibleZOrder;
this.stretchable = stretchable;
this.bomPolicy = bomPolicy;
this.autoEdit = autoEdit;
this.transformer = transformer;
this.keywordPolicy = keywordPolicy;
this.keywordTag = keywordTag;
}
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 isFlexibleZOrder() {
return flexibleZOrder;
}
public boolean isStretchable() {
return stretchable;
}
public BomPolicy getBomPolicy() {
return bomPolicy;
}
public boolean isAutoEdit() {
return autoEdit;
}
public IComponentTransformer getTransformer() {
return transformer;
}
public KeywordPolicy getKeywordPolicy() {
return keywordPolicy;
}
public String getKeywordTag() {
return keywordTag;
}
@Override
public String toString() {
return name;
}
}
/*
*
* DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
*
* This file is part of DIYLC.
*
* DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* DIYLC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with DIYLC. If not, see
* <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import javax.swing.Icon;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.BomPolicy;
import org.diylc.core.annotations.KeywordPolicy;
/**
* 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 flexibleZOrder;
private BomPolicy bomPolicy;
private boolean autoEdit;
private IComponentTransformer transformer;
private KeywordPolicy keywordPolicy;
private String keywordTag;
public ComponentType(String name, String description, CreationMethod creationMethod, String category,
String namePrefix, String author, Icon icon, Class<? extends IDIYComponent<?>> instanceClass, double zOrder,
boolean flexibleZOrder, BomPolicy bomPolicy, boolean autoEdit, IComponentTransformer transformer,
KeywordPolicy keywordPolicy, String keywordTag) {
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.flexibleZOrder = flexibleZOrder;
this.bomPolicy = bomPolicy;
this.autoEdit = autoEdit;
this.transformer = transformer;
this.keywordPolicy = keywordPolicy;
this.keywordTag = keywordTag;
}
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 isFlexibleZOrder() {
return flexibleZOrder;
}
public BomPolicy getBomPolicy() {
return bomPolicy;
}
public boolean isAutoEdit() {
return autoEdit;
}
public IComponentTransformer getTransformer() {
return transformer;
}
public KeywordPolicy getKeywordPolicy() {
return keywordPolicy;
}
public String getKeywordTag() {
return keywordTag;
}
@Override
public String toString() {
return name;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Point;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum Display {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Graphics;
@@ -35,5 +56,9 @@ public enum DrawOption {
/**
* Draw components in outline mode.
*/
OUTLINE_MODE;
OUTLINE_MODE,
/**
* Include extra space around the layout.
*/
EXTRA_SPACE;
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Rectangle;
@@ -64,7 +85,8 @@ public enum EventType {
AVAILABLE_CTRL_POINTS_CHANGED,
/**
* Called when mouse cursor is moved. Point object is passed, containing the current cursor
* location (not taking zoom into account).
* location (not taking zoom into account) in pixels and two {@link Point2D} objects with coordinates in
* inches and mm
*/
MOUSE_MOVED,
/**
@@ -0,0 +1,93 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.io.Serializable;
public class Favorite implements Serializable, Comparable<Favorite> {
private static final long serialVersionUID = 1L;
private FavoriteType type;
private String name;
public Favorite(FavoriteType type, String name) {
super();
this.type = type;
this.name = name;
}
public FavoriteType getType() {
return type;
}
public String getName() {
return name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.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;
Favorite other = (Favorite) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (type != other.type)
return false;
return true;
}
@Override
public String toString() {
return type + ":" + name;
}
public enum FavoriteType {
Component, Block
}
public String toDisplay() {
String[] parts = name.split("\\.");
return parts[parts.length - 1];
}
@Override
public int compareTo(Favorite o) {
return toDisplay().compareToIgnoreCase(o.toDisplay());
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum GridType {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum HorizontalAlignment {
@@ -1,4 +1,27 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.io.IOException;
public interface IBlockProcessor {
@@ -8,7 +31,9 @@ public interface IBlockProcessor {
void loadBlock(String blockName) throws InvalidBlockException;
void deleteBlock(String blockName);
void deleteBlock(String blockName);
int importBlocks(String fileName) throws IOException;
public class BlockAlreadyExistsException extends Exception {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import org.diylc.core.IDIYComponent;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Point;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public interface IKeyProcessor {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Point;
@@ -37,8 +58,9 @@ public interface IMouseProcessor {
*
* @param point
* @param dragAction
* @param forceSelectionRect
*/
void dragStarted(Point point, int dragAction);
void dragStarted(Point point, int dragAction, boolean forceSelectionRect);
/**
* Checks if it's possible to drop over the specified point.
@@ -0,0 +1,57 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.util.List;
import org.diylc.netlist.Netlist;
import org.diylc.netlist.Node;
import org.diylc.netlist.Summary;
import org.diylc.netlist.TreeException;
public interface INetlistAnalyzer {
/**
* @return summarizer name
*/
String getName();
/**
* @return name of the icon to use
*/
String getIconName();
/**
* Summarizes all {@link Netlist}s provided.
*
* @param netlists
* @param preferredOutput optional, needed only where there's more than one possible output node.
* @return
* @throws TreeException
*/
List<Summary> summarize(List<Netlist> netlists, Node preferredOutput) throws TreeException;
/**
* @return name of the font to be used for display.
*/
String getFontName();
}
@@ -0,0 +1,51 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.util.List;
import org.diylc.netlist.Netlist;
/**
* Interface for {@link Netlist} related operations.
*
* @author Branislav Stojkovic
*/
public interface INetlistProcessor {
/**
* Finds all {@link Netlist}s for each switch position combination.
*
* @param includeSwitches
* @return
*/
List<Netlist> extractNetlists(boolean includeSwitches);
/**
* Finds all available {@link INetlistAnalyzer} implementations.
*
* @return
*/
List<INetlistAnalyzer> getNetlistAnalyzers();
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import org.diylc.appframework.simplemq.IMessageListener;
@@ -1,22 +1,44 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
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.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.diylc.appframework.simplemq.IMessageListener;
import org.diylc.appframework.simplemq.MessageDispatcher;
import org.diylc.appframework.update.VersionNumber;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.Template;
import org.diylc.core.Theme;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Point2D;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.diylc.appframework.simplemq.IMessageListener;
import org.diylc.appframework.simplemq.MessageDispatcher;
import org.diylc.appframework.update.Version;
import org.diylc.appframework.update.VersionNumber;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.core.Template;
import org.diylc.core.Theme;
/**
* Interface for communication between plug-ins and the application. Plug-ins may acquire
@@ -30,8 +52,8 @@ import org.diylc.core.Theme;
* @see IMessageListener
* @see EventType
*/
public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyProcessor, ITemplateProcessor,
IBlockProcessor {
public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyProcessor, IVariantProcessor,
IBlockProcessor, INetlistProcessor {
public static final String ANTI_ALIASING_KEY = "antiAliasing";
public static final String HI_QUALITY_RENDER_KEY = "hiQualityRender";
@@ -42,13 +64,18 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
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 HEARTBEAT = "heartbeat";
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";
public static final String RECENT_FILES_KEY = "recentFiles";
public static final String SHOW_RULERS_KEY = "showRulers";
public static final String SHOW_GRID_KEY = "showGrid";
public static final String SHOW_GRID_KEY = "showGrid";
public static final String HIGHLIGHT_CONTINUITY_AREA = "highlightContinuityArea";
public static final String HARDWARE_ACCELERATION = "hardwareAcceleration";
public static final String EXTRA_SPACE_KEY = "extraSpace";
public static final String FAVORITES_KEY = "favorites";
public static final int DND_TOGGLE_STICKY = 0x1;
public static final int DND_TOGGLE_SNAP = 0x40000000;
@@ -66,11 +93,12 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
* 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
* @param useZoom
* @param includeExtraSpace
*
* @return canvas dimensions
*/
Dimension getCanvasDimensions(boolean useZoom);
Dimension getCanvasDimensions(boolean useZoom, boolean includeExtraSpace);
/**
* Returns an instance of {@link Cursor} that should be used at the specified location.
@@ -93,9 +121,10 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
* Loads specified {@link Project}.
*
* @param project
* @param freshStart
* @param freshStart
* @param optional file name when loading from a file
*/
void loadProject(Project project, boolean freshStart);
void loadProject(Project project, boolean freshStart, String filename);
/**
* Creates a new project.
@@ -149,9 +178,10 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @param g2d
* @param drawOptions specific drawing options
* @param filter
* @param filter
* @param externalZoom
*/
void draw(Graphics2D g2d, Set<DrawOption> drawOptions, IComponentFiler filter);
void draw(Graphics2D g2d, Set<DrawOption> drawOptions, IComponentFiler filter, Double externalZoom);
Double[] getAvailableZoomLevels();
@@ -174,14 +204,27 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @return
*/
VersionNumber getCurrentVersionNumber();
VersionNumber getCurrentVersionNumber();
/**
* Returns few most recent versions.
*
* @return
*/
List<Version> getRecentUpdates();
/**
* Adds a list of components to the project.
*
* @param components
* @param components
* @param autoGroup
*/
void pasteComponents(Collection<IDIYComponent<?>> components);
void pasteComponents(Collection<IDIYComponent<?>> components, boolean autoGroup);
/**
* Duplicates selected components and places them nearby.
*/
void duplicateSelection();
/**
* Deletes all the selected components from the project.
@@ -239,9 +282,10 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
* component.
*
* @param componentType
* @param template
* @param template
* @param forceInstatiate
*/
void setNewComponentTypeSlot(ComponentType componentType, Template template);
void setNewComponentTypeSlot(ComponentType componentType, Template template, boolean forceInstatiate);
/**
* Changes default size notation, true for metric, false for imperial.
@@ -310,5 +354,10 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @param xAxisFirst
*/
void renumberSelectedComponents(boolean xAxisFirst);
void renumberSelectedComponents(boolean xAxisFirst);
/**
* @return size of extra space around the canvas
*/
double getExtraSpace();
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Point;
@@ -78,10 +99,12 @@ public interface ISelectionProcessor {
/**
* Returns the minimum rectangle containing all selected components, or null if none exists.
* Rectangle is scaled by the current zoom level.
*
* @param applyZoom
*
* @return
*/
Rectangle2D getSelectionBounds();
Rectangle2D getSelectionBounds(boolean applyZoom);
/**
* Moves selection for the specified offset.
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
/**
@@ -1,28 +0,0 @@
package org.diylc.common;
import java.util.List;
import org.diylc.core.Template;
public interface ITemplateProcessor {
public static final String TEMPLATES_KEY = "templates";
void saveSelectedComponentAsTemplate(String templateName);
List<Template> getTemplatesFor(String categoryName, String componentTypeName);
List<Template> getTemplatesForSelection();
void applyTemplateToSelection(Template template);
void deleteTemplate(String categoryName, String componentTypeName, String templateName);
void setTemplateDefault(String categoryName, String componentTypeName, String templateName, boolean defaultFlag);
public class TemplateAlreadyExistsException extends Exception {
private static final long serialVersionUID = 1L;
}
}
@@ -0,0 +1,55 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.io.IOException;
import java.util.List;
import org.diylc.core.Template;
public interface IVariantProcessor {
public static final String TEMPLATES_KEY = "templates";
public static final String DEFAULT_TEMPLATES_KEY = "defaultTemplates";
void saveSelectedComponentAsVariant(String variantName);
List<Template> getVariantsFor(ComponentType type);
List<Template> getVariantsForSelection();
void applyVariantToSelection(Template variant);
void deleteVariant(ComponentType type, String variantName);
void setDefaultVariant(ComponentType type, String variantName);
int importVariants(String fileName) throws IOException;
String getDefaultVariant(ComponentType type);
public class VariantAlreadyExistsException extends Exception {
private static final long serialVersionUID = 1L;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum LabelPosition {
@@ -0,0 +1,32 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum LineStyle {
SOLID, DASHED, DOTTED;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -1,37 +1,76 @@
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<Float, Stroke> basicStrokeMap = new HashMap<Float, Stroke>();
public Stroke fetchBasicStroke(float 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;
}
}
/*
*
* DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
*
* This file is part of DIYLC.
*
* DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* DIYLC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with DIYLC. If not, see
* <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Stroke;
import java.util.Arrays;
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<Float, Stroke> basicStrokeMap = new HashMap<Float, Stroke>();
private Map<Float, Stroke> zoomableStrokeMap = new HashMap<Float, Stroke>();
private Map<String, Stroke> dashStrokeMap = new HashMap<String, Stroke>();
public Stroke fetchBasicStroke(float 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;
}
public Stroke fetchZoomableStroke(float width) {
if (zoomableStrokeMap.containsKey(width)) {
return zoomableStrokeMap.get(width);
}
Stroke stroke = new ZoomableStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
zoomableStrokeMap.put(width, stroke);
return stroke;
}
public Stroke fetchStroke(float width, float[] dash, float phase, int cap) {
String key = width + "|" + Arrays.toString(dash) + "|" + phase + "|" + phase;
if (dashStrokeMap.containsKey(key)) {
return dashStrokeMap.get(key);
}
Stroke stroke = new BasicStroke(width, cap, BasicStroke.JOIN_ROUND, 0, dash, phase);
dashStrokeMap.put(key, stroke);
return stroke;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum Orientation {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum OrientationHV {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum PCBLayer {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.lang.reflect.InvocationTargetException;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum ResistorColorCode {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.Point;
@@ -0,0 +1,47 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.util.List;
import java.util.Map;
import org.diylc.core.Template;
public class VariantPackage {
private Map<String, List<Template>> variants;
private String owner;
public VariantPackage(Map<String, List<Template>> variants, String owner) {
super();
this.variants = variants;
this.owner = owner;
}
public Map<String, List<Template>> getVariants() {
return variants;
}
public String getOwner() {
return owner;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
public enum VerticalAlignment {
@@ -0,0 +1,57 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.common;
import java.awt.BasicStroke;
/***
* {@link BasicStroke} that will always be zoomed in when rendered.
*
* @author Branislav Stojkovic
*/
public class ZoomableStroke extends BasicStroke {
public ZoomableStroke() {
// TODO Auto-generated constructor stub
}
public ZoomableStroke(float width) {
super(width);
// TODO Auto-generated constructor stub
}
public ZoomableStroke(float width, int cap, int join) {
super(width, cap, join);
// TODO Auto-generated constructor stub
}
public ZoomableStroke(float width, int cap, int join, float miterlimit) {
super(width, cap, join, miterlimit);
// TODO Auto-generated constructor stub
}
public ZoomableStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase) {
super(width, cap, join, miterlimit, dash, dash_phase);
// TODO Auto-generated constructor stub
}
}
@@ -1,24 +1,38 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.components;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.geom.Rectangle2D;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.VerticalAlignment;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.EditableProperty;
import java.awt.Color;
import java.awt.Font;
import java.awt.Point;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.EditableProperty;
/**
* Abstract implementation of {@link IDIYComponent} that contains component name and toString.
@@ -40,8 +54,9 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
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);
public static Color METAL_COLOR = Color.decode("#759DAF");
public static Font LABEL_FONT = new Font("Square721 BT", Font.PLAIN, 14);
public static Color METAL_COLOR = Color.decode("#759DAF");
public static Color LIGHT_METAL_COLOR = Color.decode("#EEEEEE");
public static Color COPPER_COLOR = Color.decode("#DA8A67");
@EditableProperty(defaultable = false)
@@ -125,45 +140,6 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
return !clip.intersects(rect);
}
protected void drawCenteredText(Graphics2D g2d, String text, int x, int y, HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment) {
FontMetrics fontMetrics = g2d.getFontMetrics();
Rectangle stringBounds = fontMetrics.getStringBounds(text, g2d).getBounds();
Font font = g2d.getFont();
FontRenderContext renderContext = g2d.getFontRenderContext();
GlyphVector glyphVector = font.createGlyphVector(renderContext, text);
Rectangle visualBounds = glyphVector.getVisualBounds().getBounds();
int textX = 0;
switch (horizontalAlignment) {
case CENTER:
textX = x - stringBounds.width / 2;
break;
case LEFT:
textX = x;
break;
case RIGHT:
textX = x - stringBounds.width;
break;
}
int textY = 0;
switch (verticalAlignment) {
case TOP:
textY = y + stringBounds.height;
break;
case CENTER:
textY = y - visualBounds.height / 2 - visualBounds.y;
break;
case BOTTOM:
textY = y - visualBounds.y;
break;
}
g2d.drawString(text, textX, textY);
}
@SuppressWarnings("unchecked")
public IDIYComponent<T> clone() throws CloneNotSupportedException {
try {
@@ -244,9 +220,36 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
return true;
if (o1 == null || o2 == null)
return false;
if (o1.getClass().isArray()) {
if (o1.getClass().isArray()) {
if (o1.getClass().getComponentType() == byte.class)
return Arrays.equals((byte[]) o1, (byte[]) o2);
return Arrays.equals((Object[]) o1, (Object[]) o2);
}
return o1.equals(o2);
}
@Override
public String getControlPointNodeName(int index) {
return Integer.toString(index + 1);
}
@Override
public String getInternalLinkName(int index1, int index2) {
return null;
}
@Override
public String[] getSectionNames(int pointIndex) {
return null;
}
@Override
public String getCommonPointName(int pointIndex) {
return null;
}
@Override
public boolean canPointMoveFreely(int pointIndex) {
return true;
}
}
@@ -1,241 +1,339 @@
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(name="Color")
public Color getLeadColor() {
return color;
}
public void setLeadColor(Color color) {
this.color = color;
}
enum PointCount {
TWO, THREE, FOUR;
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
}
/*
*
* DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
*
* This file is part of DIYLC.
*
* DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* DIYLC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with DIYLC. If not, see
* <http://www.gnu.org/licenses/>.
*/
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 java.awt.geom.Path2D;
import org.diylc.common.LineStyle;
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);
// for backward compatibility
protected Point[] controlPoints = null;
protected Point[] controlPoints2 = 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;
protected LineStyle style = LineStyle.SOLID;
protected Boolean smooth = true;
private int lastUpdatePointIndex = -1;
/**
* Draws the specified curve onto graphics.
*
* @param curve
* @param g2d
* @param componentState
* @param theme
*/
protected abstract void drawCurve(Path2D curve, Graphics2D g2d, ComponentState componentState,
IDrawingObserver drawingObserver);
/**
* @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;
}
Point[] p = getControlPoints();
// smoothen the curve if needed
if (getSmooth() && lastUpdatePointIndex >= 0) {
if (getPointCount() == PointCount.FIVE && (lastUpdatePointIndex == 1 || lastUpdatePointIndex == 2)) {
p[3] = findThirdPoint(p[2], p[1]);
}
if (getPointCount() == PointCount.FIVE && lastUpdatePointIndex == 3) {
p[1] = findThirdPoint(p[2], p[3]);
}
if (getPointCount() == PointCount.SEVEN && (lastUpdatePointIndex == 2 || lastUpdatePointIndex == 3)) {
p[4] = findThirdPoint(p[3], p[2]);
}
if (getPointCount() == PointCount.SEVEN && lastUpdatePointIndex == 4) {
p[2] = findThirdPoint(p[3], p[4]);
}
lastUpdatePointIndex = -1;
}
if (componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING) {
// Do not track guidelines.
drawingObserver.stopTracking();
g2d.setStroke(Constants.DASHED_STROKE);
g2d.setColor(GUIDELINE_COLOR);
for (int i = 0; i < p.length - 1; i++) {
g2d.drawLine(p[i].x, p[i].y, p[i + 1].x, p[i + 1].y);
}
drawingObserver.startTracking();
}
Path2D path = new Path2D.Double();
path.moveTo(p[0].x, p[0].y);
if (getPointCount() == PointCount.TWO) {
path.lineTo(p[1].x, p[1].y);
} else if (getPointCount() == PointCount.THREE) {
path.curveTo(p[1].x, p[1].y, p[1].x, p[1].y, p[2].x, p[2].y);
} else if (getPointCount() == PointCount.FOUR) {
path.curveTo(p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y);
} else if (getPointCount() == PointCount.FIVE) {
path.quadTo(p[1].x, p[1].y, p[2].x, p[2].y);
path.quadTo(p[3].x, p[3].y, p[4].x, p[4].y);
} else if (getPointCount() == PointCount.SEVEN) {
path.curveTo(p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y);
path.curveTo(p[4].x, p[4].y, p[5].x, p[5].y, p[6].x, p[6].y);
}
Composite oldComposite = g2d.getComposite();
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
}
drawCurve(path, g2d, componentState, drawingObserver);
g2d.setComposite(oldComposite);
}
@EditableProperty(name = "Point Count")
public PointCount getPointCount() {
if (pointCount == null) {
pointCount = PointCount.FOUR;
}
return pointCount;
}
protected Point[] getControlPoints() {
if (this.controlPoints != null) {
// ensure backward compatibility by copying points from the old structure to the new one
switch (getPointCount()) {
case TWO:
this.controlPoints2 = new Point[2];
this.controlPoints2[0] = this.controlPoints[0];
this.controlPoints2[1] = this.controlPoints[3];
break;
case THREE:
this.controlPoints2 = new Point[3];
this.controlPoints2[0] = this.controlPoints[0];
this.controlPoints2[1] = this.controlPoints[1];
this.controlPoints2[2] = this.controlPoints[3];
break;
case FOUR:
this.controlPoints2 = new Point[4];
this.controlPoints2[0] = this.controlPoints[0];
this.controlPoints2[1] = this.controlPoints[1];
this.controlPoints2[2] = this.controlPoints[2];
this.controlPoints2[3] = this.controlPoints[3];
break;
default: // shouldn't happen
this.controlPoints2 = this.controlPoints;
}
// we don't need old points anymore
this.controlPoints = null;
}
return this.controlPoints2;
}
public void setPointCount(PointCount pointCount) {
Point[] p = getControlPoints();
Point[] newPoints = new Point[pointCount.count];
newPoints[0] = p[0];
newPoints[pointCount.count - 1] = p[p.length - 1];
if (pointCount == PointCount.THREE) {
newPoints[1] =
new Point((newPoints[pointCount.count - 1].x + newPoints[0].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[0].y) / 2);
} else if (pointCount == PointCount.FOUR) {
newPoints[1] =
new Point((newPoints[pointCount.count - 1].x + newPoints[0].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[0].y) / 2);
newPoints[2] =
new Point((newPoints[pointCount.count - 1].x + newPoints[0].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[0].y) / 2);
} else if (pointCount == PointCount.FIVE) {
newPoints[2] =
new Point((newPoints[pointCount.count - 1].x + newPoints[0].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[0].y) / 2);
newPoints[1] = new Point((newPoints[2].x + newPoints[0].x) / 2, (newPoints[2].y + newPoints[0].y) / 2);
newPoints[3] =
new Point((newPoints[pointCount.count - 1].x + newPoints[2].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[2].y) / 2);
} else if (pointCount == PointCount.SEVEN) {
newPoints[3] =
new Point((newPoints[pointCount.count - 1].x + newPoints[0].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[0].y) / 2);
newPoints[2] = new Point((newPoints[3].x + newPoints[0].x) / 2, (newPoints[3].y + newPoints[0].y) / 2);
newPoints[1] = new Point((newPoints[3].x + newPoints[0].x) / 2, (newPoints[3].y + newPoints[0].y) / 2);
newPoints[4] =
new Point((newPoints[pointCount.count - 1].x + newPoints[3].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[3].y) / 2);
newPoints[5] =
new Point((newPoints[pointCount.count - 1].x + newPoints[3].x) / 2,
(newPoints[pointCount.count - 1].y + newPoints[3].y) / 2);
}
this.controlPoints2 = newPoints;
this.pointCount = pointCount;
}
@Override
public int getControlPointCount() {
return getControlPoints().length;
}
@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) {
return index > 0 && index < getControlPointCount() - 1;
}
@Override
public Point getControlPoint(int index) {
return getControlPoints()[index];
}
@Override
public void setControlPoint(Point point, int index) {
Point[] p = getControlPoints();
p[index].setLocation(point);
this.lastUpdatePointIndex = index;
// if (getSmooth()) {
// if (getPointCount() == PointCount.FIVE && (index == 1 || index == 2)) {
// p[3] = findThirdPoint(p[2], p[1]);
// }
// if (getPointCount() == PointCount.FIVE && index == 3) {
// p[1] = findThirdPoint(p[2], p[3]);
// }
// if (getPointCount() == PointCount.SEVEN && (index == 2 || index == 3)) {
// p[4] = findThirdPoint(p[3], p[2]);
// }
// if (getPointCount() == PointCount.SEVEN && index == 4) {
// p[2] = findThirdPoint(p[3], p[4]);
// }
// }
}
private Point findThirdPoint(Point p0, Point p) {
return new Point(2 * p0.x - p.x, 2 * p0.y - p.y);
}
@EditableProperty(name = "Color")
public Color getLeadColor() {
return color;
}
public void setLeadColor(Color color) {
this.color = color;
}
@EditableProperty(name = "Style")
public LineStyle getStyle() {
if (style == null)
style = LineStyle.SOLID;
return style;
}
public void setStyle(LineStyle style) {
this.style = style;
}
@EditableProperty
public Boolean getSmooth() {
if (smooth == null)
this.smooth = true;
return this.smooth;
}
public void setSmooth(Boolean smooth) {
this.smooth = smooth;
// make the current curve smooth if needed
// Point[] p = getControlPoints();
// if (smooth) {
// if (getPointCount() == PointCount.FIVE) {
// p[3] = findThirdPoint(p[2], p[1]);
// }
// if (getPointCount() == PointCount.SEVEN) {
// p[4] = findThirdPoint(p[3], p[2]);
// }
// }
}
public enum PointCount {
TWO(2), THREE(3), FOUR(4), FIVE(5), SEVEN(7);
private int count;
private PointCount(int count) {
this.count = count;
}
@Override
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
}
@@ -1,462 +0,0 @@
package org.diylc.components;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
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;
/**
* 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("#CCCCCC");
public static Color LEAD_COLOR_ICON = LEAD_COLOR.darker().darker();
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 Color leadColor = LEAD_COLOR;
protected Display display = Display.NAME;
private boolean flipStanding = false;
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((getFlipStanding() ? points[1] : points[0]).x - width / 2,
(getFlipStanding() ? points[1] : 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 : getStandingBodyColor());
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);
// Go back to the original transformation to draw leads.
if (!outlineMode) {
AffineTransform textTransform = g2d.getTransform();
// if (length.convertToPixels() > points[0].distance(points[1]))
// {
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
// 0.5f));
// }
float leadThickness = getLeadThickness();
double leadLength = (distance - calculatePinSpacing(shapeRect)) / 2 - leadThickness / 2;
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(leadThickness));
Color leadColor =
shouldShadeLeads() ? getLeadColorForPainting(componentState).darker()
: getLeadColorForPainting(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 = getLeadColorForPainting(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));
}
g2d.setTransform(textTransform);
}
// Transform graphics to draw the body in the right place and at the
// right angle.
AffineTransform oldTransform = null;
double width;
double length;
if (useShapeRectAsPosition()) {
width = shapeRect.getHeight();
length = shapeRect.getWidth();
} else {
width = getWidth().convertToPixels();
length = getLength().convertToPixels();
}
oldTransform = g2d.getTransform();
g2d.translate((points[0].x + points[1].x - length) / 2, (points[0].y + points[1].y - width) / 2);
g2d.rotate(theta, length / 2, width / 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);
// // Go back to the original transformation to draw leads.
// if (!outlineMode) {
// AffineTransform textTransform = g2d.getTransform();
// g2d.setTransform(oldTransform);
// if (length.convertToPixels() > points[0].distance(points[1])) {
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
// 0.5f));
// }
// int leadThickness = getClosestOdd(getLeadThickness());
// double leadLength = (distance - calculatePinSpacing(shapeRect)) /
// 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));
// }
// g2d.setComposite(oldComposite);
// g2d.setTransform(textTransform);
// }
// Draw label.
g2d.setFont(project.getFont());
if (useShapeRectAsPosition()) {
g2d.translate(shapeRect.x, shapeRect.y);
}
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 = "";
label = display == Display.NAME ? getName() : (getValue() == null ? "" : getValue().toString());
if (display == Display.NONE) {
label = "";
}
if (display == Display.BOTH) {
label = getName() + " " + (getValue() == null ? "" : getValue().toString());
}
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
// Don't offset in outline mode.
int offset = outlineMode ? 0 : getLabelOffset((int) length, (int) textRect.getWidth());
// Adjust label angle if needed to make sure that it's readable.
if ((theta >= Math.PI / 2 && theta <= Math.PI) || (theta < -Math.PI / 2 && theta > -Math.PI)) {
g2d.rotate(Math.PI, length / 2, width / 2);
offset = -offset;
}
g2d.drawString(label, (int) (length - textRect.getWidth()) / 2 + offset,
calculateLabelYCoordinate(shapeRect, textRect, fontMetrics));
g2d.setTransform(oldTransform);
}
}
private void drawLead(Graphics2D g2d, ComponentState componentState) {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(getLeadThickness()));
Color leadColor =
shouldShadeLeads() ? getLeadColorForPainting(componentState).darker() : getLeadColorForPainting(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 = getLeadColorForPainting(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;
}
protected int getLabelOffset(int bodyWidth, int labelWidth) {
return 0;
}
/**
* @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();
/**
* Controls how component shape should be placed relative to start and end point.
*
* @return <code>true<code> if shape rect should be used to center the component or <code>false</code>
* to place the component relative to <code>length</code> and <code>width</code> values.
*/
protected boolean useShapeRectAsPosition() {
return true;
}
/**
* @return default lead thickness. Override this method to change it.
*/
protected float getLeadThickness() {
return getClosestOdd(LEAD_THICKNESS.convertToPixels());
}
/**
* @return default lead color. Override this method to change it.
*/
protected Color getLeadColorForPainting(ComponentState componentState) {
return componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: getLeadColor();
}
@EditableProperty(name = "Lead color")
public Color getLeadColor() {
if (leadColor == null) {
leadColor = LEAD_COLOR_ICON;
}
return leadColor;
}
public void setLeadColor(Color leadColor) {
this.leadColor = leadColor;
}
protected int calculatePinSpacing(Rectangle shapeRect) {
return shapeRect.width;
}
@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;
}
public Color getStandingBodyColor() {
return 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;
}
@EditableProperty(name = "Label color")
public Color getLabelColor() {
return labelColor;
}
public void setLabelColor(Color labelColor) {
this.labelColor = labelColor;
}
/**
* Override this method with @EditableProperty annotation in child classes where standing mode is
* supported
*
* @return
*/
public boolean getFlipStanding() {
return flipStanding;
}
public void setFlipStanding(boolean flipStanding) {
this.flipStanding = flipStanding;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.components;
import org.diylc.core.annotations.EditableProperty;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.components.transform;
import java.awt.Point;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.components.transform;
import java.awt.Point;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
public enum CreationMethod {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
public enum ExpansionMode {
@@ -0,0 +1,34 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
public interface IContinuity {
/**
* Tests control point connectivity.
*
* @param index1
* @param index2
* @return true if the two points are connected, false otherwise.
*/
boolean arePointsConnected(int index1, int index2);
}
@@ -1,9 +1,30 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
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;
@@ -89,8 +110,44 @@ public interface IDIYComponent<T> extends Serializable {
* same component</b>. The other control point must be able to overlap too.
*/
boolean canControlPointOverlap(int index);
VisibilityPolicy getControlPointVisibilityPolicy(int index);
/**
* @param index
* @return {@link VisibilityPolicy} of the control point.
*/
VisibilityPolicy getControlPointVisibilityPolicy(int index);
/**
* @param index
* @return name of the control point node, if the control point represents a graph node, null otherwise.
*/
String getControlPointNodeName(int index);
/**
* @param index1
* @param index2
* @return name of the internal linked formed by the two control points, null if they do not form an internal link
*/
String getInternalLinkName(int index1, int index2);
/**
* @param pointIndex
* @return name of the internal section containing the specified point, or null if the component does not have internal sections.
* One point can be shared between multiple sections, in which case, the result may contain more than one element.
*/
String[] getSectionNames(int pointIndex);
/**
* @param pointIndex
* @return name of the common point that joins all the other points with the same name together, e.g. GND
*/
String getCommonPointName(int pointIndex);
/**
* @param pointIndex
* @return true if the control point can move without affecting other points' position, false otherwise
*/
boolean canPointMoveFreely(int pointIndex);
/**
* Draws the component onto the {@link Graphics2D}.
@@ -132,5 +189,5 @@ public interface IDIYComponent<T> extends Serializable {
* @param other
* @return
*/
boolean equalsTo(IDIYComponent<?> other);
boolean equalsTo(IDIYComponent<?> other);
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
@@ -10,5 +31,11 @@ public interface IDrawingObserver {
void stopTracking();
void startTracking();
void startTracking();
void stopTrackingContinuityArea();
void startTrackingContinuityArea(boolean positive);
boolean isTrackingContinuityArea();
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
@@ -0,0 +1,51 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
* Interface for all component that can act as switches. They must have at least one position.
*
* @author Branislav Stojkovic
*/
public interface ISwitch {
/**
* @return a positive number of positions.
*/
int getPositionCount();
/**
* @param position
* @return name of switch positions, e.g. "ON", "OFF"...
*/
String getPositionName(int position);
/**
* Tests control point connectivity.
*
* @param index1
* @param index2
* @param position
* @return true if the two points are connected in the given switch position, false otherwise.
*/
boolean arePointsConnected(int index1, int index2, int position);
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
import java.io.File;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
import java.awt.Font;
@@ -32,7 +53,7 @@ public class Project implements Serializable {
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);
public static Font DEFAULT_FONT = new Font("Tahoma", Font.PLAIN, 14);
public static Font DEFAULT_FONT = new Font("Square721 BT", Font.PLAIN, 14);
private VersionNumber fileVersion;
@@ -106,7 +127,7 @@ public class Project implements Serializable {
this.height = height;
}
@EditableProperty(name = "Grid spacing", validatorClass = SpacingValidator.class, sortOrder = 6)
@EditableProperty(name = "Grid Spacing", validatorClass = SpacingValidator.class, sortOrder = 6)
public Size getGridSpacing() {
return gridSpacing;
}
@@ -234,6 +255,31 @@ public class Project implements Serializable {
if (other.width != null)
return false;
} else if (!width.equals(other.width))
return false;
if (gridSpacing == null) {
if (other.gridSpacing != null)
return false;
} else if (!gridSpacing.equals(other.gridSpacing))
return false;
if (font == null) {
if (other.font != null)
return false;
} else if (!font.equals(other.font))
return false;
if (groups == null) {
if (other.groups != null)
return false;
} else if (!groups.equals(other.groups))
return false;
if (lockedLayers == null) {
if (other.lockedLayers != null)
return false;
} else if (!lockedLayers.equals(other.lockedLayers))
return false;
if (hiddenLayers == null) {
if (other.hiddenLayers != null)
return false;
} else if (!hiddenLayers.equals(other.hiddenLayers))
return false;
return true;
}
@@ -265,11 +311,12 @@ public class Project implements Serializable {
project.setAuthor(this.getAuthor());
project.setDescription(this.getDescription());
project.setFileVersion(this.getFileVersion());
project.setGridSpacing(this.getGridSpacing());
project.setGridSpacing(this.getGridSpacing());
project.setHeight(this.getHeight());
project.setWidth(this.getWidth());
project.getLockedLayers().addAll(this.getLockedLayers());
project.getHiddenLayers().addAll(this.getHiddenLayers());
project.getHiddenLayers().addAll(this.getHiddenLayers());
project.setFont(this.getFont());
Map<IDIYComponent<?>, IDIYComponent<?>> cloneMap = new HashMap<IDIYComponent<?>, IDIYComponent<?>>();
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
import java.awt.Point;
@@ -8,15 +29,18 @@ public class Template {
private String name;
private Map<String, Object> values;
private List<Point> points;
private boolean defaultFlag;
private List<Point> points;
@SuppressWarnings("unused")
@Deprecated
private boolean defaultFlag;
public Template() {
}
public Template(String name, Map<String, Object> values, List<Point> points, boolean defaultFlag) {
super();
public Template(String name, Map<String, Object> values, List<Point> points) {
this.name = name;
this.values = values;
this.points = points;
this.defaultFlag = defaultFlag;
}
public String getName() {
@@ -43,19 +67,10 @@ public class Template {
this.points = points;
}
public boolean isDefaultFlag() {
return defaultFlag;
}
public void setDefaultFlag(boolean defaultFlag) {
this.defaultFlag = defaultFlag;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (defaultFlag ? 1231 : 1237);
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((points == null) ? 0 : points.hashCode());
result = prime * result + ((values == null) ? 0 : values.hashCode());
@@ -71,8 +86,6 @@ public class Template {
if (getClass() != obj.getClass())
return false;
Template other = (Template) obj;
if (defaultFlag != other.defaultFlag)
return false;
if (name == null) {
if (other.name != null)
return false;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
import java.awt.Color;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
public class ValidationException extends Exception {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core;
/**
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
/**
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
@@ -57,17 +78,10 @@ public @interface ComponentDescriptor {
double zOrder();
/**
* @return true if the component may go beyond it's predefined layer. In that case,
* <code>zOrder</code> is used as initial z order of the component.
* @return true if the component may go beyond it's predefined layer without warning the user.
*/
boolean flexibleZOrder() default false;
/**
* @return when false, moving one control point will cause all the others to move together with
* it.
*/
boolean stretchable() default true;
/**
* @return controls what should be shown the BOM
*/
@@ -96,6 +110,5 @@ public @interface ComponentDescriptor {
*
* @return
*/
String keywordTag() default "";
String keywordTag() default "";
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.util.Collections;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
public @interface ElementLabel {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.util.List;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
/**
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import java.lang.annotation.Retention;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import org.diylc.core.IPropertyValidator;
@@ -19,7 +40,7 @@ public class PositiveMeasureValidator implements IPropertyValidator {
if (value instanceof AbstractMeasure) {
AbstractMeasure<?> measure = (AbstractMeasure<?>) value;
if (measure.getValue() < 0) {
throw new ValidationException("must be greater than zero.");
throw new ValidationException("must be greater or equal to zero.");
}
} else {
throw new ValidationException("wrong data type, measure expected.");
@@ -0,0 +1,49 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.annotations;
import org.diylc.core.IPropertyValidator;
import org.diylc.core.ValidationException;
import org.diylc.core.measures.AbstractMeasure;
/**
* Validates any generic {@link AbstractMeasure} descendants and makes sure that the value is
* positive.
*
* @author Branislav Stojkovic
*/
public class PositiveNonZeroMeasureValidator implements IPropertyValidator {
@Override
public void validate(Object value) throws ValidationException {
if (value == null)
return;
if (value instanceof AbstractMeasure) {
AbstractMeasure<?> measure = (AbstractMeasure<?>) value;
if (measure.getValue() <= 0) {
throw new ValidationException("must be greater than zero.");
}
} else {
throw new ValidationException("wrong data type, measure expected.");
}
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import java.io.Serializable;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public class Capacitance extends AbstractMeasure<CapacitanceUnit> {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum CapacitanceUnit implements Unit {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public class Current extends AbstractMeasure<CurrentUnit> {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum CurrentUnit implements Unit {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public class Inductance extends AbstractMeasure<InductanceUnit> {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum InductanceUnit implements Unit {
@@ -0,0 +1,39 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import java.util.ArrayList;
public class MeasureList<T extends Enum<? extends Unit>> extends ArrayList<AbstractMeasure<T>> {
private static final long serialVersionUID = 1L;
private String name;
public MeasureList(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import org.diylc.core.annotations.EditableProperty;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public class Power extends AbstractMeasure<PowerUnit> {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum PowerUnit implements Unit {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import java.awt.Color;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum ResistanceUnit implements Unit {
@@ -14,7 +35,8 @@ public enum ResistanceUnit implements Unit {
@Override
public double getFactor() {
return factor;
return factor;
}
@Override
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import org.diylc.utils.Constants;
@@ -1,8 +1,31 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
import org.diylc.utils.Constants;
public enum SizeUnit implements Unit {
mm(1d), cm(10d), m(1e4d), in(25.4d), ft(25.4d * 12), yd(9144d);
px(25.4d / Constants.PIXELS_PER_INCH), mm(1d), cm(10d), m(1e4d), in(25.4d), ft(25.4d * 12), yd(9144d);
double factor;
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public interface Unit {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public class Voltage extends AbstractMeasure<VoltageUnit> {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.core.measures;
public enum VoltageUnit implements Unit {
@@ -1,3 +1,24 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.images;
import java.awt.Image;
@@ -0,0 +1,113 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.netlist;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.diylc.core.IDIYComponent;
/**
* Represents a group of {@link Node}s that are connected together.
*
* @author Branislav Stojkovic
*/
public class Group implements Comparable<Group> {
private Set<Node> nodes = new HashSet<Node>();
public Group() {
}
public Group(Node node1, Node node2) {
nodes.add(node1);
nodes.add(node2);
}
public Group connect(IDIYComponent<?> component, int index) {
getNodes().add(new Node(component, index));
return this;
}
public Set<Node> getNodes() {
return nodes;
}
public List<Node> getSortedNodes() {
List<Node> list = new ArrayList<Node>(nodes);
Collections.sort(list);
return list;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((nodes == null) ? 0 : nodes.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;
Group other = (Group) obj;
if (nodes == null) {
if (other.nodes != null)
return false;
} else if (!nodes.equals(other.nodes))
return false;
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
List<Node> list = getSortedNodes();
for (Node n : list) {
if (sb.length() > 0)
sb.append(" <-> ");
sb.append(n);
}
return sb.toString();
}
@Override
public int compareTo(Group o) {
return toString().compareToIgnoreCase(o.toString());
}
@Override
public Group clone() {
Group g = new Group();
g.nodes.addAll(nodes);
return g;
}
}
@@ -0,0 +1,31 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2018 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.netlist;
import java.util.List;
public interface ITree {
List<ITree> getChildren();
TreeConnectionType getConnectionType();
}

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