diff --git a/diylc/diylc-core/.classpath b/diylc/diylc-core/.classpath
index 0ff43279..ad4f9a9e 100644
--- a/diylc/diylc-core/.classpath
+++ b/diylc/diylc-core/.classpath
@@ -1,20 +1,67 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/diylc/diylc-core/.project b/diylc/diylc-core/.project
index 4aeb0445..8ea4afa3 100644
--- a/diylc/diylc-core/.project
+++ b/diylc/diylc-core/.project
@@ -10,8 +10,14 @@
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+ org.eclipse.m2e.core.maven2Nature
org.eclipse.jdt.core.javanature
diff --git a/diylc/diylc-core/src/main/java/org/diylc/announcements/Announcement.java b/diylc/diylc-core/src/main/java/org/diylc/announcements/Announcement.java
index 45000a04..75b1b938 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/announcements/Announcement.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/announcements/Announcement.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.announcements;
import java.io.Serializable;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/announcements/AnnouncementProvider.java b/diylc/diylc-core/src/main/java/org/diylc/announcements/AnnouncementProvider.java
index ff6d99b7..2ed67b64 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/announcements/AnnouncementProvider.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/announcements/AnnouncementProvider.java
@@ -1,41 +1,43 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.announcements;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.plugins.cloud.model.IServiceAPI;
-import com.diyfever.httpproxy.PhpFlatProxy;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import com.diyfever.httpproxy.PhpFlatProxy;
import com.diyfever.httpproxy.ProxyFactory;
+import org.diylc.plugins.cloud.model.IServiceAPI;
+
public class AnnouncementProvider {
private String serviceUrl = "http://www.diy-fever.com/diylc/api/v1/announcements.html";
- private String LAST_READ_KEY = "announcement.lastReadDate";
+ private String LAST_READ_KEY = "announcement.lastReadDate";
private String USER_ID_KEY = "userId";
private IAnnouncementService service;
@@ -55,20 +57,20 @@ public class AnnouncementProvider {
ConfigurationManager.getInstance().readString(IServiceAPI.URL_KEY, "http://www.diy-fever.com/diylc/api/v1");
ProxyFactory factory = new ProxyFactory(new PhpFlatProxy());
service = factory.createProxy(IAnnouncementService.class, serviceUrl);
- }
-
- private String getUserId() {
- String userId = ConfigurationManager.getInstance().readString(USER_ID_KEY, null);
- if (userId == null) {
- userId = UUID.randomUUID().toString();
- ConfigurationManager.getInstance().writeValue(USER_ID_KEY, userId);
- }
- return userId;
+ }
+
+ private String getUserId() {
+ String userId = ConfigurationManager.getInstance().readString(USER_ID_KEY, null);
+ if (userId == null) {
+ userId = UUID.randomUUID().toString();
+ ConfigurationManager.getInstance().writeValue(USER_ID_KEY, userId);
+ }
+ return userId;
}
public String getCurrentAnnouncements(boolean forceLast) throws ParseException {
- announcements = service.getAnnouncements(getUserId());
- if (announcements == null)
+ announcements = service.getAnnouncements(getUserId());
+ if (announcements == null)
return null;
boolean hasUnread = false;
StringBuilder sb = new StringBuilder("");
diff --git a/diylc/diylc-core/src/main/java/org/diylc/announcements/IAnnouncementService.java b/diylc/diylc-core/src/main/java/org/diylc/announcements/IAnnouncementService.java
index c291a771..82663f26 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/announcements/IAnnouncementService.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/announcements/IAnnouncementService.java
@@ -19,12 +19,12 @@
along with DIYLC. If not, see .
*/
-package org.diylc.announcements;
-
+package org.diylc.announcements;
+
import java.util.List;
-import com.diyfever.httpproxy.ParamName;
-
-public interface IAnnouncementService {
-
- public List getAnnouncements(@ParamName("userId")String userId);
-}
+import com.diyfever.httpproxy.ParamName;
+
+public interface IAnnouncementService {
+
+ public List getAnnouncements(@ParamName("userId")String userId);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferable.java b/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferable.java
index 30d5e9fe..6ad86357 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferable.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferable.java
@@ -19,8 +19,8 @@
along with DIYLC. If not, see .
*/
-package org.diylc.clipboard;
-
+package org.diylc.clipboard;
+
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
@@ -28,55 +28,56 @@ import java.io.IOException;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
-import org.diylc.core.IDIYComponent;
-
-/**
- * Represents component selection as a {@link List} of {@link IDIYComponent} objects. Implements
- * {@link Transferable}, so it is suitable for clipboard usage.
- *
- * @author Branislav Stojkovic
- */
-public class ComponentTransferable implements Transferable, Serializable {
-
- private static final long serialVersionUID = 1L;
-
+
+import org.diylc.core.IDIYComponent;
+
+/**
+ * Represents component selection as a {@link List} of {@link IDIYComponent} objects. Implements
+ * {@link Transferable}, so it is suitable for clipboard usage.
+ *
+ * @author Branislav Stojkovic
+ */
+public class ComponentTransferable implements Transferable, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
public static final DataFlavor listFlavor = new DataFlavor(ComponentTransferable.class, "application/diylc");
private List> components;
- private Set>> groups;
-
- public ComponentTransferable() {
- super();
+ private Set>> groups;
+
+ public ComponentTransferable() {
+ super();
}
public ComponentTransferable(List> components) {
super();
this.components = components;
this.groups = null;
- }
-
- public ComponentTransferable(List> components, Set>> groups) {
+ }
+
+ public ComponentTransferable(List> components, Set>> groups) {
super();
this.components = components;
- this.groups = groups;
- }
-
- @Override
- public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
- if (flavor.equals(listFlavor)) {
- return this;
- }
- throw new UnsupportedFlavorException(flavor);
- }
-
- @Override
- public DataFlavor[] getTransferDataFlavors() {
- return new DataFlavor[] {listFlavor};
- }
-
- @Override
- public boolean isDataFlavorSupported(DataFlavor flavor) {
- return flavor.equals(listFlavor);
+ this.groups = groups;
+ }
+
+ @Override
+ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+ if (flavor.equals(listFlavor)) {
+ return this;
+ }
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+ @Override
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] {listFlavor};
+ }
+
+ @Override
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return flavor.equals(listFlavor);
}
public List> getComponents() {
@@ -85,5 +86,5 @@ public class ComponentTransferable implements Transferable, Serializable {
public Set>> getGroups() {
return groups;
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferableFactory.java b/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferableFactory.java
index 9aa9802a..7c13438e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferableFactory.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/clipboard/ComponentTransferableFactory.java
@@ -25,6 +25,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
+
import org.diylc.core.IDIYComponent;
public class ComponentTransferableFactory {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/BadPositionException.java b/diylc/diylc-core/src/main/java/org/diylc/common/BadPositionException.java
index 6173a8cd..c6c6e41c 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/BadPositionException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/BadPositionException.java
@@ -19,10 +19,10 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public class BadPositionException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
-}
+package org.diylc.common;
+
+public class BadPositionException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlock.java b/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlock.java
index ad336d38..1d39414b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlock.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlock.java
@@ -1,27 +1,28 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
-import java.util.Collection;
+import java.util.Collection;
+
import org.diylc.core.IDIYComponent;
public class BuildingBlock {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlockPackage.java b/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlockPackage.java
index db3fbf5b..0466025a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlockPackage.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/BuildingBlockPackage.java
@@ -23,6 +23,7 @@ package org.diylc.common;
import java.util.List;
import java.util.Map;
+
import org.diylc.core.IDIYComponent;
public class BuildingBlockPackage {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/ComponentType.java b/diylc/diylc-core/src/main/java/org/diylc/common/ComponentType.java
index 54c44b41..6c0985ee 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/ComponentType.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/ComponentType.java
@@ -20,6 +20,7 @@ package org.diylc.common;
import java.io.Serializable;
import java.util.List;
import javax.swing.Icon;
+
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.BomPolicy;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/DefaultComponentTransformer.java b/diylc/diylc-core/src/main/java/org/diylc/common/DefaultComponentTransformer.java
index 6fb4e290..ef61e570 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/DefaultComponentTransformer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/DefaultComponentTransformer.java
@@ -5,6 +5,7 @@ import java.awt.geom.Point2D;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.apache.log4j.Logger;
+
import org.diylc.core.Angle;
import org.diylc.core.IDIYComponent;
import org.diylc.presenter.ComponentProcessor;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/Display.java b/diylc/diylc-core/src/main/java/org/diylc/common/Display.java
index f39b09e4..11120a23 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/Display.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/Display.java
@@ -19,14 +19,14 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum Display {
-
- NAME, VALUE, NONE, BOTH;
-
- @Override
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum Display {
+
+ NAME, VALUE, NONE, BOTH;
+
+ @Override
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/DrawOption.java b/diylc/diylc-core/src/main/java/org/diylc/common/DrawOption.java
index 6c0f9ee0..01182ec5 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/DrawOption.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/DrawOption.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
import java.awt.Graphics;
@@ -56,17 +56,17 @@ public enum DrawOption {
/**
* Draw components in outline mode.
*/
- OUTLINE_MODE,
- /**
- * Include extra space around the layout.
- */
- EXTRA_SPACE,
- /**
- * Whether components should be cached or not.
- */
- ENABLE_CACHING,
- /**
- * Whether locked components should be rendered as transparent or not.
- */
+ OUTLINE_MODE,
+ /**
+ * Include extra space around the layout.
+ */
+ EXTRA_SPACE,
+ /**
+ * Whether components should be cached or not.
+ */
+ ENABLE_CACHING,
+ /**
+ * Whether locked components should be rendered as transparent or not.
+ */
LOCKED_ALPHA;
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/EventType.java b/diylc/diylc-core/src/main/java/org/diylc/common/EventType.java
index e7eb8359..0367deef 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/EventType.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/EventType.java
@@ -1,28 +1,29 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
-import java.awt.Rectangle;
-import java.awt.geom.Point2D;
+import java.awt.Rectangle;
+import java.awt.geom.Point2D;
+
import org.diylc.core.Project;
/**
@@ -84,7 +85,7 @@ 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) in pixels and two {@link Point2D} objects with coordinates in
+ * location (not taking zoom into account) in pixels and two {@link Point2D} objects with coordinates in
* inches and mm
*/
MOUSE_MOVED,
@@ -101,9 +102,9 @@ public enum EventType {
/**
* Called to update the status message. New status message is passed as a first parameter.
*/
- STATUS_MESSAGE_CHANGED,
- /**
- * Signals the listeners to scroll to selection.
- */
+ STATUS_MESSAGE_CHANGED,
+ /**
+ * Signals the listeners to scroll to selection.
+ */
SCROLL_TO;
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/GridType.java b/diylc/diylc-core/src/main/java/org/diylc/common/GridType.java
index 4423bf5e..617183d4 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/GridType.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/GridType.java
@@ -19,9 +19,9 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum GridType {
-
- LINES, CROSSHAIR, DOT, NONE;
-}
+package org.diylc.common;
+
+public enum GridType {
+
+ LINES, CROSSHAIR, DOT, NONE;
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/HorizontalAlignment.java b/diylc/diylc-core/src/main/java/org/diylc/common/HorizontalAlignment.java
index ee2c73b1..8d70a8af 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/HorizontalAlignment.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/HorizontalAlignment.java
@@ -19,12 +19,12 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum HorizontalAlignment {
- LEFT, CENTER, RIGHT;
-
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum HorizontalAlignment {
+ LEFT, CENTER, RIGHT;
+
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IBlockProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/IBlockProcessor.java
index 85aa96a7..ab13fd31 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IBlockProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IBlockProcessor.java
@@ -19,32 +19,32 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
+package org.diylc.common;
import java.io.IOException;
-
-public interface IBlockProcessor {
-
+
+public interface IBlockProcessor {
+
public static final String BLOCKS_KEY = "buildingBlocks";
- public static final String DEFAULT_BLOCKS_IMPORTED_KEY = "defaultBlocksImported";
-
- void saveSelectionAsBlock(String blockName);
-
- void loadBlock(String blockName) throws InvalidBlockException;
-
+ public static final String DEFAULT_BLOCKS_IMPORTED_KEY = "defaultBlocksImported";
+
+ void saveSelectionAsBlock(String blockName);
+
+ void loadBlock(String blockName) throws InvalidBlockException;
+
void deleteBlock(String blockName);
- int importBlocks(String fileName) throws IOException;
-
- public class BlockAlreadyExistsException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- }
-
- public class InvalidBlockException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- }
-}
+ int importBlocks(String fileName) throws IOException;
+
+ public class BlockAlreadyExistsException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ }
+
+ public class InvalidBlockException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IComponentFilter.java b/diylc/diylc-core/src/main/java/org/diylc/common/IComponentFilter.java
index 798a3c2f..d049c2b0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IComponentFilter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IComponentFilter.java
@@ -19,11 +19,11 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-import org.diylc.core.IDIYComponent;
-
-public interface IComponentFilter {
-
- boolean testComponent(IDIYComponent> component);
-}
+package org.diylc.common;
+
+import org.diylc.core.IDIYComponent;
+
+public interface IComponentFilter {
+
+ boolean testComponent(IDIYComponent> component);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IComponentTransformer.java b/diylc/diylc-core/src/main/java/org/diylc/common/IComponentTransformer.java
index 847b73dc..6de83c5c 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IComponentTransformer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IComponentTransformer.java
@@ -19,26 +19,27 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
+package org.diylc.common;
+
import java.awt.geom.Point2D;
-import org.diylc.core.IDIYComponent;
-
-public interface IComponentTransformer {
-
- public static final int CLOCKWISE = 1;
- public static final int COUNTER_CLOCKWISE = 1;
-
- public static final int HORIZONTAL = 0;
- public static final int VERTICAL = 1;
-
- boolean canRotate(IDIYComponent> component);
-
- boolean canMirror(IDIYComponent> component);
-
- boolean mirroringChangesCircuit();
-
- void rotate(IDIYComponent> component, Point2D center, int direction);
-
- void mirror(IDIYComponent> component, Point2D center, int direction);
-}
+
+import org.diylc.core.IDIYComponent;
+
+public interface IComponentTransformer {
+
+ public static final int CLOCKWISE = 1;
+ public static final int COUNTER_CLOCKWISE = 1;
+
+ public static final int HORIZONTAL = 0;
+ public static final int VERTICAL = 1;
+
+ boolean canRotate(IDIYComponent> component);
+
+ boolean canMirror(IDIYComponent> component);
+
+ boolean mirroringChangesCircuit();
+
+ void rotate(IDIYComponent> component, Point2D center, int direction);
+
+ void mirror(IDIYComponent> component, Point2D center, int direction);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IKeyProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/IKeyProcessor.java
index 7fdff0b7..f9139411 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IKeyProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IKeyProcessor.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
public interface IKeyProcessor {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IMouseProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/IMouseProcessor.java
index 7b82cdf4..66f3712f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IMouseProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IMouseProcessor.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
import java.awt.Point;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/INetlistAnalyzer.java b/diylc/diylc-core/src/main/java/org/diylc/common/INetlistAnalyzer.java
index e92b21e8..aa5fda5c 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/INetlistAnalyzer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/INetlistAnalyzer.java
@@ -22,6 +22,7 @@
package org.diylc.common;
import java.util.List;
+
import org.diylc.netlist.Netlist;
import org.diylc.netlist.Node;
import org.diylc.netlist.Summary;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/INetlistProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/INetlistProcessor.java
index 3f539d0c..15f331d3 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/INetlistProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/INetlistProcessor.java
@@ -22,6 +22,7 @@
package org.diylc.common;
import java.util.List;
+
import org.diylc.netlist.INetlistParser;
import org.diylc.netlist.Netlist;
import org.diylc.netlist.NetlistException;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IPlugIn.java b/diylc/diylc-core/src/main/java/org/diylc/common/IPlugIn.java
index 57d932d9..03994942 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IPlugIn.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IPlugIn.java
@@ -19,22 +19,22 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-import org.diylc.appframework.simplemq.IMessageListener;
-
-/**
- * Interface for plug-ins.
- *
- * @author Branislav Stojkovic
- */
-public interface IPlugIn extends IMessageListener {
-
- /**
- * Method that connects the plug-in with {@link IPlugInPort}. Called by the application when
- * plug-in is installed.
- *
- * @param plugInPort
- */
- void connect(IPlugInPort plugInPort);
-}
+package org.diylc.common;
+
+import org.diylc.appframework.simplemq.IMessageListener;
+
+/**
+ * Interface for plug-ins.
+ *
+ * @author Branislav Stojkovic
+ */
+public interface IPlugIn extends IMessageListener {
+
+ /**
+ * Method that connects the plug-in with {@link IPlugInPort}. Called by the application when
+ * plug-in is installed.
+ *
+ * @param plugInPort
+ */
+ void connect(IPlugInPort plugInPort);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IPlugInPort.java b/diylc/diylc-core/src/main/java/org/diylc/common/IPlugInPort.java
index a23779bf..16779e43 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IPlugInPort.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IPlugInPort.java
@@ -1,47 +1,48 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Point;
-import java.awt.geom.Area;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-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.clipboard.ComponentTransferable;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
-import org.diylc.core.Template;
-import org.diylc.core.Theme;
-import org.diylc.core.measures.Size;
-import org.diylc.test.ITestProcessor;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.geom.Area;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+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.clipboard.ComponentTransferable;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
+import org.diylc.core.Template;
+import org.diylc.core.Theme;
+import org.diylc.core.measures.Size;
+import org.diylc.test.ITestProcessor;
/**
* Interface for communication between plug-ins and the application. Plug-ins may acquire
@@ -63,7 +64,7 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
public static final String EXPORT_GRID_KEY = "exportGrid";
public static final String STICKY_POINTS_KEY = "stickyPoints";
public static final String METRIC_KEY = "metric";
-
+
public static final String SNAP_TO_KEY = "snapTo";
public static final String CONTINUOUS_CREATION_KEY = "continuousCreation";
public static final String AUTO_EDIT_KEY = "autoEdit";
@@ -75,27 +76,27 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
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 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 String RENUMBER_ON_PASTE_KEY = "renumberOnPaste";
- public static final String RULER_IN_SUBDIVISION_KEY = "rulerInSubdivision";
- public static final String CACHING_ENABLED_KEY = "cachingEnabled";
-
- public static final String RULER_IN_SUBDIVISION_2 = "base of 2";
- public static final String RULER_IN_SUBDIVISION_10 = "base of 10";
- public static final String RULER_IN_SUBDIVISION_DEFAULT = RULER_IN_SUBDIVISION_10;
-
- public static final String SNAP_TO_NONE = "None";
- public static final String SNAP_TO_GRID = "Grid";
- public static final String SNAP_TO_COMPONENTS = "Components";
- public static final String SNAP_TO_DEFAULT = SNAP_TO_GRID;
-
- public static final String LOCKED_ALPHA = "lockedAlpha";
-
- public static final String LANGUAGE = "language";
+ 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 String RENUMBER_ON_PASTE_KEY = "renumberOnPaste";
+ public static final String RULER_IN_SUBDIVISION_KEY = "rulerInSubdivision";
+ public static final String CACHING_ENABLED_KEY = "cachingEnabled";
+
+ public static final String RULER_IN_SUBDIVISION_2 = "base of 2";
+ public static final String RULER_IN_SUBDIVISION_10 = "base of 10";
+ public static final String RULER_IN_SUBDIVISION_DEFAULT = RULER_IN_SUBDIVISION_10;
+
+ public static final String SNAP_TO_NONE = "None";
+ public static final String SNAP_TO_GRID = "Grid";
+ public static final String SNAP_TO_COMPONENTS = "Components";
+ public static final String SNAP_TO_DEFAULT = SNAP_TO_GRID;
+
+ public static final String LOCKED_ALPHA = "lockedAlpha";
+
+ public static final String LANGUAGE = "language";
public static final String LANGUAGE_DEFAULT = "English";
public static final int DND_TOGGLE_STICKY = 0x1;
@@ -114,7 +115,7 @@ 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 useZoom is set to true, the result is scaled by zoom factor.
*
- * @param useZoom
+ * @param useZoom
* @param includeExtraSpace
*
* @return canvas dimensions
@@ -126,9 +127,9 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* Note: point coordinates are scaled for zoom factor.
*
- * @param point
- * @param ctrlDown
- * @param shiftDown
+ * @param point
+ * @param ctrlDown
+ * @param shiftDown
* @param altDown
* @return cursor
*/
@@ -145,7 +146,7 @@ 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, String filename);
@@ -168,14 +169,14 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
* @param fileName
* @param isBackup
*/
- void saveProjectToFile(String fileName, boolean isBackup);
-
- /**
- * Exports the current project into one or more files - one per layer and potentially drill layer.
- *
- * @param fileNameBase
- * @param g2d
- */
+ void saveProjectToFile(String fileName, boolean isBackup);
+
+ /**
+ * Exports the current project into one or more files - one per layer and potentially drill layer.
+ *
+ * @param fileNameBase
+ * @param g2d
+ */
void exportToGerber(String fileNameBase, Graphics2D g2d);
/**
@@ -210,9 +211,9 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @param g2d
* @param drawOptions specific drawing options
- * @param filter
- * @param externalZoom
- * @param scaleFactor
+ * @param filter
+ * @param externalZoom
+ * @param scaleFactor
* @param visibleRect
*/
void draw(Graphics2D g2d, Set drawOptions, IComponentFilter filter, Double externalZoom, Double scaleFactor, Rectangle2D visibleRect);
@@ -238,20 +239,20 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @return
*/
- VersionNumber getCurrentVersionNumber();
-
- /**
- * Returns few most recent versions.
- *
- * @return
- */
+ VersionNumber getCurrentVersionNumber();
+
+ /**
+ * Returns few most recent versions.
+ *
+ * @return
+ */
List getRecentUpdates();
/**
* Adds a list of components to the project.
*
- * @param componentTransferable
- * @param autoGroup
+ * @param componentTransferable
+ * @param autoGroup
* @param assignNewNames
*/
void pasteComponents(ComponentTransferable componentTransferable, boolean autoGroup, boolean assignNewNames);
@@ -317,8 +318,8 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
* component.
*
* @param componentType
- * @param template optional
- * @param model optional datasheet model
+ * @param template optional
+ * @param model optional datasheet model
* @param forceInstatiate
*/
void setNewComponentTypeSlot(ComponentType componentType, Template template, String[] model, boolean forceInstatiate);
@@ -373,29 +374,29 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*
* @param xAxisFirst
*/
- void renumberSelectedComponents(boolean xAxisFirst);
-
- /**
- * @return size of extra space around the canvas
- */
- double getExtraSpace();
-
- /**
- * Applies changes to the current project as specified by the provided {@link IProjectEditor}.
- *
- * @param editor
- */
- void applyEditor(IProjectEditor editor);
-
- /**
- * Locks or unlocks a single component.
- */
- void lockComponent(IDIYComponent> c, boolean locked);
-
- /**
- * Checks for proximity between continuity areas and creates additional components around any problematic areas to visually identify them.
- *
- * @param threshold
- */
+ void renumberSelectedComponents(boolean xAxisFirst);
+
+ /**
+ * @return size of extra space around the canvas
+ */
+ double getExtraSpace();
+
+ /**
+ * Applies changes to the current project as specified by the provided {@link IProjectEditor}.
+ *
+ * @param editor
+ */
+ void applyEditor(IProjectEditor editor);
+
+ /**
+ * Locks or unlocks a single component.
+ */
+ void lockComponent(IDIYComponent> c, boolean locked);
+
+ /**
+ * Checks for proximity between continuity areas and creates additional components around any problematic areas to visually identify them.
+ *
+ * @param threshold
+ */
List checkContinuityAreaProximity(Size threshold);
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IProjectEditor.java b/diylc/diylc-core/src/main/java/org/diylc/common/IProjectEditor.java
index 67d3b92d..45db5460 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IProjectEditor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IProjectEditor.java
@@ -22,6 +22,7 @@
package org.diylc.common;
import java.util.Set;
+
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/ISelectionProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/ISelectionProcessor.java
index e0a59b95..5a35c363 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/ISelectionProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/ISelectionProcessor.java
@@ -1,33 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-import java.util.List;
-import org.diylc.clipboard.ComponentTransferable;
-import org.diylc.core.ExpansionMode;
-import org.diylc.core.IDIYComponent;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.Collection;
+import java.util.List;
+
+import org.diylc.clipboard.ComponentTransferable;
+import org.diylc.core.ExpansionMode;
+import org.diylc.core.IDIYComponent;
import org.diylc.core.measures.Size;
public interface ISelectionProcessor {
@@ -37,20 +38,20 @@ public interface ISelectionProcessor {
*
* @return
*/
- Collection> getSelectedComponents();
-
- /**
- * Returns selected component types
- *
- * @return
- */
+ Collection> getSelectedComponents();
+
+ /**
+ * Returns selected component types
+ *
+ * @return
+ */
Collection getSelectedComponentTypes();
/**
* Updates the selection with the specified list of component. Also, updates control point map
* with all components that are stuck to the newly selected components.
*
- * @param newSelection
+ * @param newSelection
* @param panToSelection
*/
void setSelection(Collection> newSelection, boolean panToSelection);
@@ -59,7 +60,7 @@ public interface ISelectionProcessor {
* Finds all components at the specified location, sorted by z-index from top to bottom. Location
* depends on the current zoom level.
*
- * @param point
+ * @param point
* @param includeLocked
* @return
*/
@@ -108,8 +109,8 @@ 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
+ *
+ * @param applyZoom
*
* @return
*/
@@ -122,36 +123,36 @@ public interface ISelectionProcessor {
* @param yOffset
* @param includeStuckComponents
*/
- void nudgeSelection(Size xOffset, Size yOffset, boolean includeStuckComponents);
-
- /**
- * Selects components that match the criteria.
- *
- * @param criteria
- */
- void selectMatching(String criteria);
-
-
- /**
- * Attempts to apply the specified model to all selected components.
- *
- * @param model
- */
- void applyModelToSelection(String[] model);
-
- /**
- * Sends each of the selected components one step back.
- */
- void sendSelectionToBack();
-
- /**
- * Brings each of the selected components one step to front.
- */
- void bringSelectionToFront();
-
- /**
- * Move selected components to z index starting from the provided value
- * @param zIndex
- */
+ void nudgeSelection(Size xOffset, Size yOffset, boolean includeStuckComponents);
+
+ /**
+ * Selects components that match the criteria.
+ *
+ * @param criteria
+ */
+ void selectMatching(String criteria);
+
+
+ /**
+ * Attempts to apply the specified model to all selected components.
+ *
+ * @param model
+ */
+ void applyModelToSelection(String[] model);
+
+ /**
+ * Sends each of the selected components one step back.
+ */
+ void sendSelectionToBack();
+
+ /**
+ * Brings each of the selected components one step to front.
+ */
+ void bringSelectionToFront();
+
+ /**
+ * Move selected components to z index starting from the provided value
+ * @param zIndex
+ */
void moveSelectionToZIndex(int zIndex);
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/ITask.java b/diylc/diylc-core/src/main/java/org/diylc/common/ITask.java
index ecee4840..cce16f95 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/ITask.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/ITask.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/IVariantProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/common/IVariantProcessor.java
index bdf3f312..900bf51d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/IVariantProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/IVariantProcessor.java
@@ -19,37 +19,38 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
+package org.diylc.common;
+
import java.io.IOException;
import java.util.List;
+
import org.diylc.core.Template;
-
-public interface IVariantProcessor {
-
+
+public interface IVariantProcessor {
+
public static final String TEMPLATES_KEY = "templates";
public static final String DEFAULT_TEMPLATES_KEY = "defaultTemplates";
- public static final String DEFAULT_TEMPLATES_IMPORT_DATE_KEY = "defaultTemplatesImportDate";
-
- void saveSelectedComponentAsVariant(String variantName);
-
- List getVariantsFor(ComponentType type);
-
- List getVariantsForSelection();
-
- void applyVariantToSelection(Template variant);
-
- void deleteVariant(ComponentType type, String variantName);
-
+ public static final String DEFAULT_TEMPLATES_IMPORT_DATE_KEY = "defaultTemplatesImportDate";
+
+ void saveSelectedComponentAsVariant(String variantName);
+
+ List getVariantsFor(ComponentType type);
+
+ List 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;
-
- }
-}
+ String getDefaultVariant(ComponentType type);
+
+ public class VariantAlreadyExistsException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/LabelPosition.java b/diylc/diylc-core/src/main/java/org/diylc/common/LabelPosition.java
index 288a724d..04681bbb 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/LabelPosition.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/LabelPosition.java
@@ -19,14 +19,14 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum LabelPosition {
-
- ABOVE, BELOW;
-
- @Override
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum LabelPosition {
+
+ ABOVE, BELOW;
+
+ @Override
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/LineStyle.java b/diylc/diylc-core/src/main/java/org/diylc/common/LineStyle.java
index ae19e84e..6cbf55de 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/LineStyle.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/LineStyle.java
@@ -19,14 +19,14 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum LineStyle {
-
- SOLID, DASHED, DOTTED;
-
- @Override
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum LineStyle {
+
+ SOLID, DASHED, DOTTED;
+
+ @Override
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/Orientation.java b/diylc/diylc-core/src/main/java/org/diylc/common/Orientation.java
index 4e61f43a..97901e06 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/Orientation.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/Orientation.java
@@ -19,19 +19,19 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum Orientation {
-
- DEFAULT, _90, _180, _270;
-
- @Override
- public String toString() {
- if (this == DEFAULT) {
- return "Default";
- } else {
- return name().replace("_", "") + " degrees clockwise";
- }
+package org.diylc.common;
+
+public enum Orientation {
+
+ DEFAULT, _90, _180, _270;
+
+ @Override
+ public String toString() {
+ if (this == DEFAULT) {
+ return "Default";
+ } else {
+ return name().replace("_", "") + " degrees clockwise";
+ }
}
public double toDegrees() {
@@ -52,5 +52,5 @@ public enum Orientation {
public double toRadians() {
return Math.toRadians(toDegrees());
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/OrientationHV.java b/diylc/diylc-core/src/main/java/org/diylc/common/OrientationHV.java
index 6beba748..26f2ad93 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/OrientationHV.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/OrientationHV.java
@@ -19,14 +19,14 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum OrientationHV {
-
- VERTICAL, HORIZONTAL;
-
- @Override
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum OrientationHV {
+
+ VERTICAL, HORIZONTAL;
+
+ @Override
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/PCBLayer.java b/diylc/diylc-core/src/main/java/org/diylc/common/PCBLayer.java
index 5b58542f..56e86ce8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/PCBLayer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/PCBLayer.java
@@ -23,18 +23,18 @@ package org.diylc.common;
import org.diylc.core.gerber.GerberLayer;
-public enum PCBLayer {
-
+public enum PCBLayer {
+
_1("Bottom"), _2("Top"), _3("Inner 1"), _4("Inner 2"), _5("Inner 3"), _6("Inner 4"), _7("Inner 5"), _8("Inner 6");
private String label;
private PCBLayer(String label) {
this.label = label;
- }
-
- public String toString() {
- return label;
+ }
+
+ public String toString() {
+ return label;
};
public int getId() {
@@ -48,5 +48,5 @@ public enum PCBLayer {
default:
throw new RuntimeException("Unsupported PCB layer: " + this);
}
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/PropertyWrapper.java b/diylc/diylc-core/src/main/java/org/diylc/common/PropertyWrapper.java
index a4344fd3..3232d432 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/PropertyWrapper.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/PropertyWrapper.java
@@ -1,28 +1,29 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.common;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
import org.diylc.core.IPropertyValidator;
/**
@@ -74,19 +75,19 @@ public class PropertyWrapper implements Cloneable {
// }
public void writeTo(Object object) throws IllegalArgumentException, IllegalAccessException,
- InvocationTargetException, SecurityException, NoSuchMethodException {
- // nothing to do if no setter
- if (setter == null)
+ InvocationTargetException, SecurityException, NoSuchMethodException {
+ // nothing to do if no setter
+ if (setter == null)
return;
object.getClass().getMethod(setter, type).invoke(object, this.value);
}
public Method getGetter() throws SecurityException, NoSuchMethodException {
return getOwnerObject().getClass().getMethod(getter);
- }
-
- public boolean isReadOnly() {
- return setter == null;
+ }
+
+ public boolean isReadOnly() {
+ return setter == null;
}
public String getName() {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/ResistorColorCode.java b/diylc/diylc-core/src/main/java/org/diylc/common/ResistorColorCode.java
index 0629e6d9..46023d3f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/ResistorColorCode.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/ResistorColorCode.java
@@ -19,17 +19,17 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum ResistorColorCode {
-
- NONE, _4_BAND, _5_BAND;
-
- @Override
- public String toString() {
- if (name().startsWith("_")) {
- return name().substring(1).replace("_", " ").toLowerCase();
- }
- return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum ResistorColorCode {
+
+ NONE, _4_BAND, _5_BAND;
+
+ @Override
+ public String toString() {
+ if (name().startsWith("_")) {
+ return name().substring(1).replace("_", " ").toLowerCase();
+ }
+ return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/VariantPackage.java b/diylc/diylc-core/src/main/java/org/diylc/common/VariantPackage.java
index 9c63936d..43dac280 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/VariantPackage.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/VariantPackage.java
@@ -23,6 +23,7 @@ package org.diylc.common;
import java.util.List;
import java.util.Map;
+
import org.diylc.core.Template;
public class VariantPackage {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/common/VerticalAlignment.java b/diylc/diylc-core/src/main/java/org/diylc/common/VerticalAlignment.java
index 13d06069..7c0d4924 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/common/VerticalAlignment.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/common/VerticalAlignment.java
@@ -19,12 +19,12 @@
along with DIYLC. If not, see .
*/
-package org.diylc.common;
-
-public enum VerticalAlignment {
- TOP, CENTER, BOTTOM;
-
- public String toString() {
- return name().substring(0, 1) + name().substring(1).toLowerCase();
- }
-}
+package org.diylc.common;
+
+public enum VerticalAlignment {
+ TOP, CENTER, BOTTOM;
+
+ public String toString() {
+ return name().substring(0, 1) + name().substring(1).toLowerCase();
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractAngledComponent.java b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractAngledComponent.java
index 3cfcc05f..f4bd1595 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractAngledComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractAngledComponent.java
@@ -22,6 +22,7 @@
package org.diylc.components;
import java.awt.Shape;
+
import org.diylc.common.Orientation;
import org.diylc.core.Angle;
import org.diylc.core.annotations.EditableProperty;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractComponent.java b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractComponent.java
index c1da4523..675e1c11 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractComponent.java
@@ -1,40 +1,41 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Shape;
-import java.awt.geom.Point2D;
-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 java.util.stream.Collectors;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+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 java.util.stream.Collectors;
+
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Size;
/**
* Abstract implementation of {@link IDIYComponent} that contains component name and toString.
@@ -57,14 +58,14 @@ public abstract class AbstractComponent implements IDIYComponent {
public static Color LABEL_COLOR = Color.black;
public static Color LABEL_COLOR_SELECTED = Color.red;
public static Font LABEL_FONT = new Font("Square721 BT", Font.PLAIN, 14);
- public static Color METAL_COLOR = Color.decode("#759DAF");
+ 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");
- public static Color GOLD_COLOR = Color.decode("#F4B301");
- public static Color FR4_COLOR = Color.decode("#6B9B6B");
- public static Color FR4_LIGHT_COLOR = Color.decode("#BABE71");
- public static Color PHENOLIC_COLOR = Color.decode("#F8EBB3");
- public static Color PHENOLIC_DARK_COLOR = Color.decode("#CD8500");
+ public static Color COPPER_COLOR = Color.decode("#DA8A67");
+ public static Color GOLD_COLOR = Color.decode("#F4B301");
+ public static Color FR4_COLOR = Color.decode("#6B9B6B");
+ public static Color FR4_LIGHT_COLOR = Color.decode("#BABE71");
+ public static Color PHENOLIC_COLOR = Color.decode("#F8EBB3");
+ public static Color PHENOLIC_DARK_COLOR = Color.decode("#CD8500");
@EditableProperty(defaultable = false)
@Override
@@ -88,13 +89,13 @@ public abstract class AbstractComponent implements IDIYComponent {
}
@Override
- public String getValueForDisplay() {
- if (getValue() == null)
- return "";
-
- Object val = getValue();
- if (val.getClass().isArray()) {
- return String.join(" / ", Arrays.stream((Object[])val).map(x -> x == null ? "" : x.toString()).collect(Collectors.toList()));
+ public String getValueForDisplay() {
+ if (getValue() == null)
+ return "";
+
+ Object val = getValue();
+ if (val.getClass().isArray()) {
+ return String.join(" / ", Arrays.stream((Object[])val).map(x -> x == null ? "" : x.toString()).collect(Collectors.toList()));
}
return val.toString();
}
@@ -107,17 +108,17 @@ public abstract class AbstractComponent implements IDIYComponent {
*/
protected int getClosestOdd(double x) {
return ((int) x / 2) * 2 + 1;
- }
-
- /**
- * Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is even.
- *
- * @param x
- * @return
- */
- protected int getClosestOdd(Size s) {
- double x = s.convertToPixels();
- return ((int) x / 2) * 2 + 1;
+ }
+
+ /**
+ * Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is even.
+ *
+ * @param x
+ * @return
+ */
+ protected int getClosestOdd(Size s) {
+ double x = s.convertToPixels();
+ return ((int) x / 2) * 2 + 1;
}
/**
@@ -136,9 +137,9 @@ public abstract class AbstractComponent implements IDIYComponent {
* @param clip
* @return true if none of the control points lie in the clip rectangle.
*/
- protected boolean checkPointsClipped(Shape clip) {
- if (clip == null) {
- return false;
+ protected boolean checkPointsClipped(Shape clip) {
+ if (clip == null) {
+ return false;
}
for (int i = 0; i < getControlPointCount(); i++) {
if (clip.contains(getControlPoint(i))) {
@@ -171,7 +172,7 @@ public abstract class AbstractComponent implements IDIYComponent {
@SuppressWarnings("unchecked")
public IDIYComponent clone() throws CloneNotSupportedException {
try {
- // Instantiate object of the same type
+ // Instantiate object of the same type
Class> clazz = this.getClass();
AbstractComponent newInstance = (AbstractComponent) clazz.getDeclaredConstructor().newInstance();
while (AbstractComponent.class.isAssignableFrom(clazz)) {
@@ -191,7 +192,7 @@ public abstract class AbstractComponent implements IDIYComponent {
&& value.getClass().getComponentType().isAssignableFrom(Point2D.class)) {
Object newArray = Array.newInstance(value.getClass().getComponentType(), Array.getLength(value));
for (int i = 0; i < Array.getLength(value); i++) {
- Point2D p = (Point2D) Array.get(value, i);
+ Point2D p = (Point2D) Array.get(value, i);
if (p != null)
Array.set(newArray, i, new Point2D.Double(p.getX(), p.getY()));
}
@@ -199,7 +200,7 @@ public abstract class AbstractComponent implements IDIYComponent {
}
// Deep copy points.
// TODO: something nicer
- if (value != null && value instanceof Point2D) {
+ if (value != null && value instanceof Point2D) {
Point2D p = (Point2D) value;
value = new Point2D.Double(p.getX(), p.getY());
}
@@ -212,7 +213,7 @@ public abstract class AbstractComponent implements IDIYComponent {
} catch (Exception e) {
throw new CloneNotSupportedException("Could not clone the component. Reason: " + e.getMessage());
}
- }
+ }
@Override
public boolean equalsTo(IDIYComponent> other) {
@@ -229,7 +230,7 @@ public abstract class AbstractComponent implements IDIYComponent {
// in
// AbstractComponent or one of it's child classes
for (Field field : fields) {
- if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isFinal(field.getModifiers()) &&
+ if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isFinal(field.getModifiers()) &&
!Modifier.isTransient(field.getModifiers())) {
field.setAccessible(true);
try {
@@ -251,45 +252,45 @@ public abstract class AbstractComponent implements IDIYComponent {
return true;
if (o1 == null || o2 == null)
return false;
- if (o1.getClass().isArray()) {
- if (o1.getClass().getComponentType() == byte.class)
- return Arrays.equals((byte[]) o1, (byte[]) o2);
- if (o1.getClass().getComponentType() == double.class)
- return Arrays.equals((double[]) o1, (double[]) o2);
- if (o1.getClass().getComponentType() == int.class)
+ if (o1.getClass().isArray()) {
+ if (o1.getClass().getComponentType() == byte.class)
+ return Arrays.equals((byte[]) o1, (byte[]) o2);
+ if (o1.getClass().getComponentType() == double.class)
+ return Arrays.equals((double[]) o1, (double[]) o2);
+ if (o1.getClass().getComponentType() == int.class)
return Arrays.equals((int[]) o1, (int[]) 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 boolean canPointMoveFreely(int pointIndex) {
- return true;
- }
-
- @Override
- public Rectangle2D getCachingBounds() {
- return null;
- }
-
- @Override
- public void createdIn(Project project) {
- // TODO Auto-generated method stub
+ }
+
+ @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 boolean canPointMoveFreely(int pointIndex) {
+ return true;
+ }
+
+ @Override
+ public Rectangle2D getCachingBounds() {
+ return null;
+ }
+
+ @Override
+ public void createdIn(Project project) {
+ // TODO Auto-generated method stub
}
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractCurvedComponent.java b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractCurvedComponent.java
index 2b7cd16e..69458fa4 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractCurvedComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractCurvedComponent.java
@@ -30,6 +30,10 @@ import java.util.List;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import com.google.common.collect.Streams;
+import com.thoughtworks.xstream.annotations.XStreamOmitField;
+
import org.diylc.common.IPlugInPort;
import org.diylc.common.LineStyle;
import org.diylc.common.ObjectCache;
@@ -41,8 +45,6 @@ import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
-import com.google.common.collect.Streams;
-import com.thoughtworks.xstream.annotations.XStreamOmitField;
public abstract class AbstractCurvedComponent extends AbstractTransparentComponent {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractLabeledComponent.java b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractLabeledComponent.java
index 84c0ddc5..76176a24 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractLabeledComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractLabeledComponent.java
@@ -19,13 +19,13 @@
along with DIYLC. If not, see .
*/
-package org.diylc.components;
-
-import org.diylc.core.annotations.EditableProperty;
-
-public abstract class AbstractLabeledComponent extends AbstractTransparentComponent {
-
- private static final long serialVersionUID = 1L;
+package org.diylc.components;
+
+import org.diylc.core.annotations.EditableProperty;
+
+public abstract class AbstractLabeledComponent extends AbstractTransparentComponent {
+
+ private static final long serialVersionUID = 1L;
protected Integer fontSizeOverride;
@@ -36,5 +36,5 @@ public abstract class AbstractLabeledComponent extends AbstractTransparentCom
public void setFontSizeOverride(Integer fontSizeOverride) {
this.fontSizeOverride = fontSizeOverride;
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractTransparentComponent.java b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractTransparentComponent.java
index adfb4793..78a9615d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/AbstractTransparentComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/AbstractTransparentComponent.java
@@ -19,24 +19,24 @@
along with DIYLC. If not, see .
*/
-package org.diylc.components;
-
-import org.diylc.core.annotations.EditableProperty;
-
-public abstract class AbstractTransparentComponent extends AbstractComponent {
-
- private static final long serialVersionUID = 1L;
-
- public static byte MAX_ALPHA = 127;
-
- protected byte alpha = MAX_ALPHA;
-
- @EditableProperty
- public Byte getAlpha() {
- return alpha;
- }
-
- public void setAlpha(Byte alpha) {
- this.alpha = alpha;
- }
-}
+package org.diylc.components;
+
+import org.diylc.core.annotations.EditableProperty;
+
+public abstract class AbstractTransparentComponent extends AbstractComponent {
+
+ private static final long serialVersionUID = 1L;
+
+ public static byte MAX_ALPHA = 127;
+
+ protected byte alpha = MAX_ALPHA;
+
+ @EditableProperty
+ public Byte getAlpha() {
+ return alpha;
+ }
+
+ public void setAlpha(Byte alpha) {
+ this.alpha = alpha;
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/transform/DefaultTransformer.java b/diylc/diylc-core/src/main/java/org/diylc/components/transform/DefaultTransformer.java
index 57c828c9..e9e4407b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/transform/DefaultTransformer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/transform/DefaultTransformer.java
@@ -1,28 +1,29 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.transform;
-import java.awt.geom.Point2D;
-import org.diylc.common.IComponentTransformer;
+import java.awt.geom.Point2D;
+
+import org.diylc.common.IComponentTransformer;
import org.diylc.core.IDIYComponent;
public class DefaultTransformer implements IComponentTransformer {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/transform/LeadedComponentTransformer.java b/diylc/diylc-core/src/main/java/org/diylc/components/transform/LeadedComponentTransformer.java
index 2e858493..14ed0ae6 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/transform/LeadedComponentTransformer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/transform/LeadedComponentTransformer.java
@@ -1,29 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.transform;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import org.diylc.common.IComponentTransformer;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import org.diylc.common.IComponentTransformer;
import org.diylc.core.IDIYComponent;
public class LeadedComponentTransformer implements IComponentTransformer {
@@ -46,7 +47,7 @@ public class LeadedComponentTransformer implements IComponentTransformer {
@Override
public void rotate(IDIYComponent> component, Point2D center, int direction) {
AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2 * direction, center.getX(), center.getY());
- for (int index = 0; index < component.getControlPointCount(); index++) {
+ for (int index = 0; index < component.getControlPointCount(); index++) {
Point2D p = new Point2D.Double();
rotate.transform(component.getControlPoint(index), p);
component.setControlPoint(p, index);
diff --git a/diylc/diylc-core/src/main/java/org/diylc/components/transform/SimpleComponentTransformer.java b/diylc/diylc-core/src/main/java/org/diylc/components/transform/SimpleComponentTransformer.java
index e53ee659..3cf9fd74 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/components/transform/SimpleComponentTransformer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/components/transform/SimpleComponentTransformer.java
@@ -1,30 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.transform;
-import java.awt.Point;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import org.diylc.common.IComponentTransformer;
+import java.awt.Point;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import org.diylc.common.IComponentTransformer;
import org.diylc.core.IDIYComponent;
public class SimpleComponentTransformer implements IComponentTransformer {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/AllowAllValidator.java b/diylc/diylc-core/src/main/java/org/diylc/core/AllowAllValidator.java
index bc060dca..f3087579 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/AllowAllValidator.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/AllowAllValidator.java
@@ -19,15 +19,15 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-/**
- * Validator that allows all values.
- *
- * @author Branislav Stojkovic
- */
-public class AllowAllValidator implements IPropertyValidator {
-
- @Override
- public void validate(Object owner, Object value) throws ValidationException {}
-}
+package org.diylc.core;
+
+/**
+ * Validator that allows all values.
+ *
+ * @author Branislav Stojkovic
+ */
+public class AllowAllValidator implements IPropertyValidator {
+
+ @Override
+ public void validate(Object owner, Object value) throws ValidationException {}
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/ComponentState.java b/diylc/diylc-core/src/main/java/org/diylc/core/ComponentState.java
index 005b6b07..b245b81b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/ComponentState.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/ComponentState.java
@@ -19,14 +19,14 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-/**
- * Enumerates all possible states that a component can be in.
- *
- * @author Branislav Stojkovic
- */
-public enum ComponentState {
-
- NORMAL, SELECTED, LOCKED, DRAGGING
-}
+package org.diylc.core;
+
+/**
+ * Enumerates all possible states that a component can be in.
+ *
+ * @author Branislav Stojkovic
+ */
+public enum ComponentState {
+
+ NORMAL, SELECTED, LOCKED, DRAGGING
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/CreationMethod.java b/diylc/diylc-core/src/main/java/org/diylc/core/CreationMethod.java
index 09dd2661..c1479ccd 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/CreationMethod.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/CreationMethod.java
@@ -19,9 +19,9 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-public enum CreationMethod {
-
- SINGLE_CLICK, POINT_BY_POINT;
-}
+package org.diylc.core;
+
+public enum CreationMethod {
+
+ SINGLE_CLICK, POINT_BY_POINT;
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/ExpansionMode.java b/diylc/diylc-core/src/main/java/org/diylc/core/ExpansionMode.java
index 8d73e4c6..31fa58c0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/ExpansionMode.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/ExpansionMode.java
@@ -19,9 +19,9 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-public enum ExpansionMode {
-
- ALL, SAME_TYPE, IMMEDIATE,
-}
+package org.diylc.core;
+
+public enum ExpansionMode {
+
+ ALL, SAME_TYPE, IMMEDIATE,
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/IDIYComponent.java b/diylc/diylc-core/src/main/java/org/diylc/core/IDIYComponent.java
index ecf2c54e..3ea5b8c2 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/IDIYComponent.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/IDIYComponent.java
@@ -1,31 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.io.Serializable;
-import org.diylc.core.annotations.ComponentDescriptor;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.Serializable;
+
+import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty;
/**
@@ -50,7 +51,7 @@ public interface IDIYComponent extends Serializable, Cloneable {
public static final int CHASSIS = 1;
public static final int BOARD = 2;
public static final int TRACE = 3;
- public static final int COMPONENT = 4;
+ public static final int COMPONENT = 4;
public static final int WIRING = 5;
public static final int TEXT = 6;
@@ -111,37 +112,37 @@ public interface IDIYComponent extends Serializable, Cloneable {
* same component. The other control point must be able to overlap too.
*/
boolean canControlPointOverlap(int index);
-
- /**
- * @param index
- * @return {@link VisibilityPolicy} of the control point.
+
+ /**
+ * @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 true if the control point can move without affecting other points' position, false otherwise
*/
- 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 true if the control point can move without affecting other points' position, false otherwise
- */
boolean canPointMoveFreely(int pointIndex);
/**
@@ -184,18 +185,18 @@ public interface IDIYComponent extends Serializable, Cloneable {
* @param other
* @return
*/
- boolean equalsTo(IDIYComponent> other);
-
- /**
- * Used only if {@link ComponentDescriptor#enableCache()} is set to true.
- * @return
- */
- Rectangle2D getCachingBounds();
-
- /**
- * Notifies the component that it's being created in the context of the specified project
- *
- * @param project
- */
+ boolean equalsTo(IDIYComponent> other);
+
+ /**
+ * Used only if {@link ComponentDescriptor#enableCache()} is set to true.
+ * @return
+ */
+ Rectangle2D getCachingBounds();
+
+ /**
+ * Notifies the component that it's being created in the context of the specified project
+ *
+ * @param project
+ */
void createdIn(Project project);
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/IDrawingObserver.java b/diylc/diylc-core/src/main/java/org/diylc/core/IDrawingObserver.java
index c7e69562..c22df443 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/IDrawingObserver.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/IDrawingObserver.java
@@ -21,22 +21,22 @@
*/
package org.diylc.core;
-/**
- * Interface for tracking component drawing process. Components may use it to stop or restart
- * tracking. Anything drawn while tracking is stopped will not be added to the mouse hot-spot area.
- *
- * @author Branislav Stojkovic
- */
-public interface IDrawingObserver {
+/**
+ * Interface for tracking component drawing process. Components may use it to stop or restart
+ * tracking. Anything drawn while tracking is stopped will not be added to the mouse hot-spot area.
+ *
+ * @author Branislav Stojkovic
+ */
+public interface IDrawingObserver {
/**
* Notifies the observer that it should start tracking the drawing process.
- */
- void stopTracking();
+ */
+ void stopTracking();
/**
* Notifies the observer that it should stop tracking the drawing process.
- */
+ */
void startTracking();
/**
@@ -64,5 +64,5 @@ public interface IDrawingObserver {
*
* @param marker
*/
- void setContinuityMarker(String marker);
-}
+ void setContinuityMarker(String marker);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/IPropertyValidator.java b/diylc/diylc-core/src/main/java/org/diylc/core/IPropertyValidator.java
index 15b8fa91..329c19f3 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/IPropertyValidator.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/IPropertyValidator.java
@@ -19,19 +19,19 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-/**
- * Interface for validating property value changes.
- *
- * @author Branislav Stojkovic
- */
-public interface IPropertyValidator {
-
+package org.diylc.core;
+
+/**
+ * Interface for validating property value changes.
+ *
+ * @author Branislav Stojkovic
+ */
+public interface IPropertyValidator {
+
/**
- * @param owner
- * @param value
- * @throws ValidationException if validation fails. Message will contain the reason.
- */
- void validate(Object owner, Object value) throws ValidationException;
-}
+ * @param owner
+ * @param value
+ * @throws ValidationException if validation fails. Message will contain the reason.
+ */
+ void validate(Object owner, Object value) throws ValidationException;
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/IView.java b/diylc/diylc-core/src/main/java/org/diylc/core/IView.java
index 17828a14..d367ac37 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/IView.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/IView.java
@@ -1,29 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core;
-import java.io.File;
-import java.util.List;
-import java.util.Set;
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
import org.diylc.common.PropertyWrapper;
@@ -55,8 +56,8 @@ public interface IView {
int showConfirmDialog(String message, String title, int optionType, int messageType);
- boolean editProperties(List properties, Set defaultedProperties, String title);
-
+ boolean editProperties(List properties, Set defaultedProperties, String title);
+
String showInputDialog(String message, String title);
File promptFileSave();
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/Project.java b/diylc/diylc-core/src/main/java/org/diylc/core/Project.java
index 86ce44a8..76f4ce72 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/Project.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/Project.java
@@ -1,41 +1,42 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core;
-import java.awt.Font;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.diylc.appframework.update.VersionNumber;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.MultiLineText;
-import org.diylc.core.annotations.PositiveMeasureValidator;
-import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
-import org.diylc.core.measures.Size;
+import java.awt.Font;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.diylc.appframework.update.VersionNumber;
+
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.MultiLineText;
+import org.diylc.core.annotations.PositiveMeasureValidator;
+import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
+import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
/**
@@ -62,11 +63,11 @@ public class Project implements Serializable, Cloneable {
private String description;
private Size width;
private Size height;
- private Size gridSpacing;
+ private Size gridSpacing;
private Integer dotSpacing;
private List> components;
private Set>> groups;
- private Set lockedLayers;
+ private Set lockedLayers;
private Set> lockedComponents;
private Set hiddenLayers;
private Font font = DEFAULT_FONT;
@@ -75,7 +76,7 @@ public class Project implements Serializable, Cloneable {
components = new ArrayList>();
groups = new HashSet>>();
lockedLayers = new HashSet();
- hiddenLayers = new HashSet();
+ hiddenLayers = new HashSet();
lockedComponents = new HashSet>();
title = DEFAULT_TITLE;
author = System.getProperty("user.name");
@@ -137,17 +138,17 @@ public class Project implements Serializable, Cloneable {
public void setGridSpacing(Size gridSpacing) {
this.gridSpacing = gridSpacing;
- }
-
- @EditableProperty(name = "Dot Spacing", validatorClass = PositiveNonZeroMeasureValidator.class)
- public Integer getDotSpacing() {
- if (dotSpacing == null)
- dotSpacing = 1;
- return dotSpacing;
- }
-
- public void setDotSpacing(Integer dotSpacing) {
- this.dotSpacing = dotSpacing;
+ }
+
+ @EditableProperty(name = "Dot Spacing", validatorClass = PositiveNonZeroMeasureValidator.class)
+ public Integer getDotSpacing() {
+ if (dotSpacing == null)
+ dotSpacing = 1;
+ return dotSpacing;
+ }
+
+ public void setDotSpacing(Integer dotSpacing) {
+ this.dotSpacing = dotSpacing;
}
/**
@@ -166,12 +167,12 @@ public class Project implements Serializable, Cloneable {
*/
public Set>> getGroups() {
return groups;
- }
-
- public Set> getLockedComponents() {
- if (lockedComponents == null)
- lockedComponents = new HashSet>();
- return lockedComponents;
+ }
+
+ public Set> getLockedComponents() {
+ if (lockedComponents == null)
+ lockedComponents = new HashSet>();
+ return lockedComponents;
}
public Set getLockedLayers() {
@@ -275,36 +276,36 @@ public class Project implements Serializable, Cloneable {
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.getFamily().equals(other.font.getFamily()) || font.getSize() != other.font.getSize() || font.getStyle() != other.font.getStyle())
- 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 (getLockedComponents() == null) {
- if (other.lockedComponents != null)
- return false;
- } else if (!getLockedComponents().equals(other.lockedComponents))
- return false;
- if (hiddenLayers == null) {
- if (other.hiddenLayers != null)
- return false;
- } else if (!hiddenLayers.equals(other.hiddenLayers))
+ 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.getFamily().equals(other.font.getFamily()) || font.getSize() != other.font.getSize() || font.getStyle() != other.font.getStyle())
+ 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 (getLockedComponents() == null) {
+ if (other.lockedComponents != null)
+ return false;
+ } else if (!getLockedComponents().equals(other.lockedComponents))
+ return false;
+ if (hiddenLayers == null) {
+ if (other.hiddenLayers != null)
+ return false;
+ } else if (!hiddenLayers.equals(other.hiddenLayers))
return false;
return true;
}
@@ -340,7 +341,7 @@ public class Project implements Serializable, Cloneable {
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>> cloneMap = new HashMap, IDIYComponent>>();
@@ -361,10 +362,10 @@ public class Project implements Serializable, Cloneable {
cloneGroup.add(cloneMap.get(component));
}
project.groups.add(cloneGroup);
- }
-
- for (IDIYComponent> component : this.getLockedComponents()) {
- project.lockedComponents.add(cloneMap.get(component));
+ }
+
+ for (IDIYComponent> component : this.getLockedComponents()) {
+ project.lockedComponents.add(cloneMap.get(component));
}
return project;
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/Template.java b/diylc/diylc-core/src/main/java/org/diylc/core/Template.java
index 798191dc..44c6b568 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/Template.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/Template.java
@@ -19,17 +19,17 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
+package org.diylc.core;
import java.awt.geom.Point2D;
import java.time.LocalDateTime;
import java.util.List;
-import java.util.Map;
-
-public class Template {
-
- private String name;
- private Map values;
+import java.util.Map;
+
+public class Template {
+
+ private String name;
+ private Map values;
private List points;
@SuppressWarnings("unused")
@Deprecated
@@ -41,37 +41,37 @@ public class Template {
public Template(String name, Map values, List points) {
this(name, values, points, LocalDateTime.now());
- }
-
- public Template(String name, Map values, List points, LocalDateTime createdOn) {
- this.name = name;
- this.values = values;
+ }
+
+ public Template(String name, Map values, List points, LocalDateTime createdOn) {
+ this.name = name;
+ this.values = values;
+ this.points = points;
+ this.createdOn = createdOn;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map getValues() {
+ return values;
+ }
+
+ public void setValues(Map values) {
+ this.values = values;
+ }
+
+ public List getPoints() {
+ return points;
+ }
+
+ public void setPoints(List points) {
this.points = points;
- this.createdOn = createdOn;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Map getValues() {
- return values;
- }
-
- public void setValues(Map values) {
- this.values = values;
- }
-
- public List getPoints() {
- return points;
- }
-
- public void setPoints(List points) {
- this.points = points;
}
public LocalDateTime getCreatedOn() {
@@ -80,8 +80,8 @@ public class Template {
public void setCreatedOn(LocalDateTime createdOn) {
this.createdOn = createdOn;
- }
-
+ }
+
@Override
public int hashCode() {
final int prime = 31;
@@ -125,8 +125,8 @@ public class Template {
return true;
}
- @Override
- public String toString() {
- return name;
- }
-}
+ @Override
+ public String toString() {
+ return name;
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/Theme.java b/diylc/diylc-core/src/main/java/org/diylc/core/Theme.java
index 21ba7516..2902eec1 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/Theme.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/Theme.java
@@ -1,27 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core;
-import java.awt.Color;
+import java.awt.Color;
import java.io.Serializable;
public class Theme implements Serializable {
@@ -31,14 +31,14 @@ public class Theme implements Serializable {
private String name;
private Color bgColor;
private Color gridColor;
- private Color outlineColor;
+ private Color outlineColor;
private Color dotColor;
public Theme(String name, Color bgColor, Color gridColor, Color dotColor, Color outlineColor) {
super();
this.name = name;
this.bgColor = bgColor;
- this.gridColor = gridColor;
+ this.gridColor = gridColor;
this.dotColor = dotColor;
this.outlineColor = outlineColor;
}
@@ -53,12 +53,12 @@ public class Theme implements Serializable {
public Color getGridColor() {
return gridColor;
- }
-
- public Color getDotColor() {
- if (dotColor == null)
- dotColor = gridColor;
- return dotColor;
+ }
+
+ public Color getDotColor() {
+ if (dotColor == null)
+ dotColor = gridColor;
+ return dotColor;
}
public Color getOutlineColor() {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/ValidationException.java b/diylc/diylc-core/src/main/java/org/diylc/core/ValidationException.java
index c4d4db7d..e64bef35 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/ValidationException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/ValidationException.java
@@ -19,13 +19,13 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core;
-
-public class ValidationException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public ValidationException(String message) {
- super(message);
- }
-}
+package org.diylc.core;
+
+public class ValidationException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public ValidationException(String message) {
+ super(message);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/VisibilityPolicy.java b/diylc/diylc-core/src/main/java/org/diylc/core/VisibilityPolicy.java
index 036e765d..d8a54689 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/VisibilityPolicy.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/VisibilityPolicy.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/BomPolicy.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/BomPolicy.java
index a4f5882c..24d324c5 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/BomPolicy.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/BomPolicy.java
@@ -19,15 +19,15 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
-/**
- * Tells the system how to represent components in the B.O.M.
- *
- * @see ComponentDescriptor
- *
- * @author Branislav Stojkovic
- */
-public enum BomPolicy {
- SHOW_ALL_NAMES, SHOW_ONLY_TYPE_NAME, NEVER_SHOW,
-}
+package org.diylc.core.annotations;
+
+/**
+ * Tells the system how to represent components in the B.O.M.
+ *
+ * @see ComponentDescriptor
+ *
+ * @author Branislav Stojkovic
+ */
+public enum BomPolicy {
+ SHOW_ALL_NAMES, SHOW_ONLY_TYPE_NAME, NEVER_SHOW,
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ComponentDescriptor.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ComponentDescriptor.java
index 960c8e93..af368285 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ComponentDescriptor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ComponentDescriptor.java
@@ -1,31 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.annotations;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import org.diylc.common.DefaultComponentTransformer;
-import org.diylc.common.IComponentTransformer;
-import org.diylc.core.CreationMethod;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.diylc.common.DefaultComponentTransformer;
+import org.diylc.common.IComponentTransformer;
+import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
/**
@@ -109,22 +110,22 @@ public @interface ComponentDescriptor {
*
* @return
*/
- String keywordTag() default "";
-
- /**
- * @return true if the component drawing should be cached
- */
- boolean enableCache() default false;
-
- /**
- * @return true if component datasheet should be loaded from the corresponding file
- */
- boolean enableDatasheet() default false;
-
- /**
- * If datasheet is enabled, this property determines how many columns define a component, e.g. in how many steps we can instantiate a component
- *
- * @return
- */
+ String keywordTag() default "";
+
+ /**
+ * @return true if the component drawing should be cached
+ */
+ boolean enableCache() default false;
+
+ /**
+ * @return true if component datasheet should be loaded from the corresponding file
+ */
+ boolean enableDatasheet() default false;
+
+ /**
+ * If datasheet is enabled, this property determines how many columns define a component, e.g. in how many steps we can instantiate a component
+ *
+ * @return
+ */
int datasheetCreationStepCount() default 0;
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/DynamicList.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/DynamicList.java
index 05e5f4c1..6613c740 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/DynamicList.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/DynamicList.java
@@ -19,13 +19,13 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+package org.diylc.core.annotations;
+
import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface DynamicList {
-
- public String availableValueFunction();
-}
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DynamicList {
+
+ public String availableValueFunction();
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/EditableProperty.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/EditableProperty.java
index ebc8085b..ba31063a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/EditableProperty.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/EditableProperty.java
@@ -1,29 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.annotations;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import org.diylc.core.AllowAllValidator;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.diylc.core.AllowAllValidator;
import org.diylc.core.IPropertyValidator;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ElementLabel.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ElementLabel.java
index 16d01752..6d39b9b8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ElementLabel.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/ElementLabel.java
@@ -19,9 +19,9 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
-public @interface ElementLabel {
-
- public String functionName();
-}
+package org.diylc.core.annotations;
+
+public @interface ElementLabel {
+
+ public String functionName();
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/IAutoCreator.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/IAutoCreator.java
index 6ea5e88f..e22cd4af 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/IAutoCreator.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/IAutoCreator.java
@@ -19,23 +19,24 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+package org.diylc.core.annotations;
+
import java.util.List;
-import org.diylc.core.IDIYComponent;
-
-/**
- * Interface for creating components automatically each time a component is created by the user.
- *
- * @author Branislav Stojkovic
- */
-public interface IAutoCreator {
-
- /**
- * @param lastAdded the component created by the user
- * @return {@link List} of {@link IDIYComponent}s that will be automatically created as a result.
- * Empty {@link List} or {@code null} are valid responses for cases when no components
- * should be auto-created.
- */
- public List> createIfNeeded(IDIYComponent> lastAdded);
-}
+
+import org.diylc.core.IDIYComponent;
+
+/**
+ * Interface for creating components automatically each time a component is created by the user.
+ *
+ * @author Branislav Stojkovic
+ */
+public interface IAutoCreator {
+
+ /**
+ * @param lastAdded the component created by the user
+ * @return {@link List} of {@link IDIYComponent}s that will be automatically created as a result.
+ * Empty {@link List} or {@code null} are valid responses for cases when no components
+ * should be auto-created.
+ */
+ public List> createIfNeeded(IDIYComponent> lastAdded);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/KeywordPolicy.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/KeywordPolicy.java
index 9b351204..933bafeb 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/KeywordPolicy.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/KeywordPolicy.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.annotations;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/MultiLineText.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/MultiLineText.java
index 020070b6..8079c919 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/MultiLineText.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/MultiLineText.java
@@ -19,12 +19,12 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+package org.diylc.core.annotations;
+
import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface MultiLineText {
-
-}
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MultiLineText {
+
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PercentEditor.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PercentEditor.java
index 2e92021b..506e1a8f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PercentEditor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PercentEditor.java
@@ -19,13 +19,13 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+package org.diylc.core.annotations;
+
import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PercentEditor {
-
- public byte _100PercentValue();
-}
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PercentEditor {
+
+ public byte _100PercentValue();
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveMeasureValidator.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveMeasureValidator.java
index 3ec08d2c..087e9e2a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveMeasureValidator.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveMeasureValidator.java
@@ -19,35 +19,35 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+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 PositiveMeasureValidator implements IPropertyValidator {
-
- @Override
- public void validate(Object owner, 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 or equal to zero.");
- }
+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 PositiveMeasureValidator implements IPropertyValidator {
+
+ @Override
+ public void validate(Object owner, 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 or equal to zero.");
+ }
} else if (value instanceof Integer) {
Integer i = (Integer) value;
if (i < 0)
throw new ValidationException("must be greater or equal to zero.");
- } else {
- throw new ValidationException("wrong data type.");
- }
- }
-}
+ } else {
+ throw new ValidationException("wrong data type.");
+ }
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveNonZeroMeasureValidator.java b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveNonZeroMeasureValidator.java
index 68072061..16ad13fb 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveNonZeroMeasureValidator.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/annotations/PositiveNonZeroMeasureValidator.java
@@ -19,35 +19,35 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.annotations;
-
+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 owner, 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.");
- }
+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 owner, 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 if (value instanceof Integer) {
Integer i = (Integer) value;
if (i < 0)
throw new ValidationException("must be greater or equal to zero.");
- } else {
- throw new ValidationException("wrong data type.");
- }
- }
-}
+ } else {
+ throw new ValidationException("wrong data type.");
+ }
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberExporter.java b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberExporter.java
index 1dfccda5..066254c7 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberExporter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberExporter.java
@@ -13,6 +13,9 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
+
+import com.bancika.gerberwriter.DataLayer;
+
import org.diylc.core.ComponentState;
import org.diylc.core.IDIYComponent;
import org.diylc.core.IView;
@@ -20,7 +23,6 @@ import org.diylc.core.Project;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.lang.LangUtil;
-import com.bancika.gerberwriter.DataLayer;
public class GerberExporter {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberG2DWrapper.java b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberG2DWrapper.java
index 37efd070..e541cb0a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberG2DWrapper.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberG2DWrapper.java
@@ -30,13 +30,15 @@ import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
import java.util.HashMap;
import java.util.Map;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+
import com.bancika.gerberwriter.DataLayer;
import com.bancika.gerberwriter.Point;
import com.bancika.gerberwriter.padmasters.Circle;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
+
public class GerberG2DWrapper extends Graphics2D
implements IDrawingObserver, IGerberDrawingObserver {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberPathRenderer.java b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberPathRenderer.java
index 74d2d142..bc47380e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberPathRenderer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/GerberPathRenderer.java
@@ -19,15 +19,17 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import javax.imageio.ImageIO;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
-import org.diylc.core.measures.SizeUnit;
+
import com.bancika.gerberwriter.DataLayer;
import com.bancika.gerberwriter.Point;
import com.bancika.gerberwriter.path.MoveTo;
import com.bancika.gerberwriter.path.Path;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
+import org.diylc.core.measures.SizeUnit;
+
public class GerberPathRenderer {
public static void drawComponent(Project currentProject, GerberG2DWrapper g2d, IDIYComponent> c,
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/IGerberComponentCustom.java b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/IGerberComponentCustom.java
index f63efbc5..2416a8da 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/gerber/IGerberComponentCustom.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/gerber/IGerberComponentCustom.java
@@ -3,6 +3,7 @@ package org.diylc.core.gerber;
import java.awt.Graphics2D;
import java.util.EnumSet;
import java.util.Set;
+
import org.diylc.core.ComponentState;
import org.diylc.core.IDrawingObserver;
import org.diylc.core.Project;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/images/IconLoader.java b/diylc/diylc-core/src/main/java/org/diylc/core/images/IconLoader.java
index a0aa6f76..38d8d07f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/images/IconLoader.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/images/IconLoader.java
@@ -1,31 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.images;
-import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import javax.imageio.ImageIO;
-import javax.swing.Icon;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/AbstractMeasure.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/AbstractMeasure.java
index 2abd8352..6bf2a51a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/AbstractMeasure.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/AbstractMeasure.java
@@ -1,28 +1,28 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
-import java.io.Serializable;
-import java.text.DecimalFormat;
+import java.io.Serializable;
+import java.text.DecimalFormat;
import java.text.Format;
/***
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Capacitance.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Capacitance.java
index 2ad74ac6..bb306582 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Capacitance.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Capacitance.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public class Capacitance extends AbstractMeasure {
@@ -49,11 +49,11 @@ public class Capacitance extends AbstractMeasure {
}
}
throw new IllegalArgumentException("Could not parse capacitance: " + value);
- }
-
- public Double getNormalizedValue() {
- if (value == null || unit == null)
- return null;
- return value * unit.getFactor();
+ }
+
+ public Double getNormalizedValue() {
+ if (value == null || unit == null)
+ return null;
+ return value * unit.getFactor();
}
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/CapacitanceUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/CapacitanceUnit.java
index 18447d86..ad87e1f6 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/CapacitanceUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/CapacitanceUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum CapacitanceUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Current.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Current.java
index 3379a1ec..562c8b74 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Current.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Current.java
@@ -19,19 +19,19 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.measures;
-
-public class Current extends AbstractMeasure {
-
- private static final long serialVersionUID = 1L;
-
- public Current(Double value, CurrentUnit unit) {
- super(value, unit);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public Current clone() throws CloneNotSupportedException {
- return new Current(value, unit);
- }
-}
+package org.diylc.core.measures;
+
+public class Current extends AbstractMeasure {
+
+ private static final long serialVersionUID = 1L;
+
+ public Current(Double value, CurrentUnit unit) {
+ super(value, unit);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public Current clone() throws CloneNotSupportedException {
+ return new Current(value, unit);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/CurrentUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/CurrentUnit.java
index e1e2fcde..272142c8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/CurrentUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/CurrentUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum CurrentUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Frequency.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Frequency.java
index 564bc980..e047720b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Frequency.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Frequency.java
@@ -19,19 +19,19 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.measures;
-
-public class Frequency extends AbstractMeasure {
-
- private static final long serialVersionUID = 1L;
-
- public Frequency(Double value, FrequencyUnit unit) {
- super(value, unit);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public Frequency clone() throws CloneNotSupportedException {
- return new Frequency(value, unit);
- }
-}
+package org.diylc.core.measures;
+
+public class Frequency extends AbstractMeasure {
+
+ private static final long serialVersionUID = 1L;
+
+ public Frequency(Double value, FrequencyUnit unit) {
+ super(value, unit);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public Frequency clone() throws CloneNotSupportedException {
+ return new Frequency(value, unit);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/FrequencyUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/FrequencyUnit.java
index 4776502a..72a7d0f9 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/FrequencyUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/FrequencyUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum FrequencyUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Inductance.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Inductance.java
index 12762571..62cf83c5 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Inductance.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Inductance.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public class Inductance extends AbstractMeasure {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/InductanceUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/InductanceUnit.java
index e3f289a2..7191dd6b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/InductanceUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/InductanceUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum InductanceUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/MeasureList.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/MeasureList.java
index 20a8a53a..9e27e776 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/MeasureList.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/MeasureList.java
@@ -19,21 +19,21 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.measures;
-
-import java.util.ArrayList;
-
-public class MeasureList> extends ArrayList> {
-
- private static final long serialVersionUID = 1L;
-
- private String name;
-
- public MeasureList(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-}
+package org.diylc.core.measures;
+
+import java.util.ArrayList;
+
+public class MeasureList> extends ArrayList> {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+
+ public MeasureList(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Nudge.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Nudge.java
index 9863f2bc..3946daa1 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Nudge.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Nudge.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
import org.diylc.core.annotations.EditableProperty;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Power.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Power.java
index 17e8ba27..308910b5 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Power.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Power.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public class Power extends AbstractMeasure {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/PowerUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/PowerUnit.java
index 00de0562..b373a304 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/PowerUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/PowerUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum PowerUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Resistance.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Resistance.java
index 0628e423..d98c7568 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Resistance.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Resistance.java
@@ -1,27 +1,28 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
-import java.awt.Color;
+import java.awt.Color;
+
import org.diylc.common.ResistorColorCode;
public class Resistance extends AbstractMeasure {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/ResistanceUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/ResistanceUnit.java
index 4484a1d5..471788a1 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/ResistanceUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/ResistanceUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum ResistanceUnit implements Unit {
@@ -35,7 +35,7 @@ public enum ResistanceUnit implements Unit {
@Override
public double getFactor() {
- return factor;
+ return factor;
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Size.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Size.java
index 352623ed..c9e00c9b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Size.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Size.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
import org.diylc.utils.Constants;
@@ -44,13 +44,13 @@ public class Size extends AbstractMeasure implements Comparable
// return (int) Math.round(Constants.PIXELS_PER_INCH / Constants.GRIDS_PER_INCH
// * (grids + remainder));
return getValue() * getUnit().getFactor() / SizeUnit.in.getFactor() * Constants.PIXELS_PER_INCH;
- }
-
- public double convertToUnits(SizeUnit unit) {
- if (unit == getUnit()) {
- return this.getValue();
- }
- return convertToPixels() * SizeUnit.px.getFactor();
+ }
+
+ public double convertToUnits(SizeUnit unit) {
+ if (unit == getUnit()) {
+ return this.getValue();
+ }
+ return convertToPixels() * SizeUnit.px.getFactor();
}
@Override
@@ -67,14 +67,14 @@ public class Size extends AbstractMeasure implements Comparable
}
}
throw new IllegalArgumentException("Could not parse size: " + value);
- }
-
- public static Size fromPixels(double pixels, SizeUnit unit) {
- return new Size(pixels / unit.getFactor() * SizeUnit.in.getFactor() / Constants.PIXELS_PER_INCH, unit);
- }
-
- public Size scale(double factor) {
- return new Size(value * factor, unit);
+ }
+
+ public static Size fromPixels(double pixels, SizeUnit unit) {
+ return new Size(pixels / unit.getFactor() * SizeUnit.in.getFactor() / Constants.PIXELS_PER_INCH, unit);
+ }
+
+ public Size scale(double factor) {
+ return new Size(value * factor, unit);
}
@Override
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/SizeUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/SizeUnit.java
index 4f8084ba..c5cab803 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/SizeUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/SizeUnit.java
@@ -19,22 +19,22 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.measures;
+package org.diylc.core.measures;
import org.diylc.utils.Constants;
-
-public enum SizeUnit implements Unit {
-
- px(25.4d / Constants.PIXELS_PER_INCH), mm(1d), cm(10d), m(1e3d), in(25.4d), ft(25.4d * 12), yd(9144d);
-
- double factor;
-
- private SizeUnit(double factor) {
- this.factor = factor;
- }
-
- @Override
- public double getFactor() {
- return factor;
- }
-}
+
+public enum SizeUnit implements Unit {
+
+ px(25.4d / Constants.PIXELS_PER_INCH), mm(1d), cm(10d), m(1e3d), in(25.4d), ft(25.4d * 12), yd(9144d);
+
+ double factor;
+
+ private SizeUnit(double factor) {
+ this.factor = factor;
+ }
+
+ @Override
+ public double getFactor() {
+ return factor;
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Unit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Unit.java
index b0fe8d18..22841ac0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Unit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Unit.java
@@ -19,9 +19,9 @@
along with DIYLC. If not, see .
*/
-package org.diylc.core.measures;
-
-public interface Unit {
-
- double getFactor();
-}
+package org.diylc.core.measures;
+
+public interface Unit {
+
+ double getFactor();
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Voltage.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Voltage.java
index c9ec9889..a4e25de9 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/Voltage.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/Voltage.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public class Voltage extends AbstractMeasure {
@@ -49,11 +49,11 @@ public class Voltage extends AbstractMeasure {
}
}
throw new IllegalArgumentException("Could not parse voltage: " + value);
- }
-
- public Double getNormalizedValue() {
- if (value == null || unit == null)
- return null;
- return value * unit.getFactor();
+ }
+
+ public Double getNormalizedValue() {
+ if (value == null || unit == null)
+ return null;
+ return value * unit.getFactor();
}
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/core/measures/VoltageUnit.java b/diylc/diylc-core/src/main/java/org/diylc/core/measures/VoltageUnit.java
index 854a733a..6eb0caaa 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/core/measures/VoltageUnit.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/core/measures/VoltageUnit.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.core.measures;
public enum VoltageUnit implements Unit {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/lang/LangUtil.java b/diylc/diylc-core/src/main/java/org/diylc/lang/LangUtil.java
index b996e72d..69d1762c 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/lang/LangUtil.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/lang/LangUtil.java
@@ -32,6 +32,7 @@ import java.util.Map;
import java.util.stream.Stream;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.common.IPlugInPort;
import org.diylc.utils.ResourceLoader;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/AbstractNetlistParser.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/AbstractNetlistParser.java
index f4d6d6b6..4c58c388 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/AbstractNetlistParser.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/AbstractNetlistParser.java
@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import org.diylc.core.IDIYComponent;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/ContinuityGraph.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/ContinuityGraph.java
index 3d583279..5f7a0613 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/ContinuityGraph.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/ContinuityGraph.java
@@ -24,6 +24,7 @@ import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+
import org.diylc.presenter.ContinuityArea;
import org.diylc.utils.RTree;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/Group.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/Group.java
index ed3423d6..88e4afd8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/Group.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/Group.java
@@ -27,6 +27,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+
import org.diylc.core.IDIYComponent;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/INetlistParser.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/INetlistParser.java
index c1fc01a0..df655bdc 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/INetlistParser.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/INetlistParser.java
@@ -20,6 +20,7 @@ package org.diylc.netlist;
import java.util.List;
import java.util.Map;
+
import org.diylc.core.IDIYComponent;
/*
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/Netlist.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/Netlist.java
index 76c3fd6b..8c269ccf 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/Netlist.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/Netlist.java
@@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+
import org.diylc.core.IDIYComponent;
public class Netlist implements Comparable {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistAnalyzer.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistAnalyzer.java
index abf82f04..0ccd8c2d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistAnalyzer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistAnalyzer.java
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import org.diylc.core.IDIYComponent;
public abstract class NetlistAnalyzer {
@@ -82,32 +83,32 @@ public abstract class NetlistAnalyzer {
return;
}
- // Only mark the current node as visited to allow proper path exploration
+ // Only mark the current node as visited to allow proper path exploration
visited.add(nodeA);
- List newConcurrentPaths = new ArrayList();
-
- // Track processed connections to prevent duplicates from bidirectional links
+ List newConcurrentPaths = new ArrayList();
+
+ // Track processed connections to prevent duplicates from bidirectional links
Set processedConnections = new HashSet();
for (Node n : groupA.getNodes()) {
IDIYComponent> c = n.getComponent();
for (int i = 0; i < c.getControlPointCount(); i++) {
- int targetPoint = i;
- int sourcePoint = n.getPointIndex();
-
- // Skip self-connections
- if (targetPoint == sourcePoint) continue;
-
- // Check if there's a connection between these points
- if (c.getInternalLinkName(targetPoint, sourcePoint) != null) {
- // Create a unique identifier for this connection regardless of direction
- String connectionId = c.getName() + "_" +
- Math.min(sourcePoint, targetPoint) + "_" +
- Math.max(sourcePoint, targetPoint);
-
- // Skip if we've already processed this connection (prevents duplicate branches)
- if (processedConnections.contains(connectionId)) continue;
+ int targetPoint = i;
+ int sourcePoint = n.getPointIndex();
+
+ // Skip self-connections
+ if (targetPoint == sourcePoint) continue;
+
+ // Check if there's a connection between these points
+ if (c.getInternalLinkName(targetPoint, sourcePoint) != null) {
+ // Create a unique identifier for this connection regardless of direction
+ String connectionId = c.getName() + "_" +
+ Math.min(sourcePoint, targetPoint) + "_" +
+ Math.max(sourcePoint, targetPoint);
+
+ // Skip if we've already processed this connection (prevents duplicate branches)
+ if (processedConnections.contains(connectionId)) continue;
processedConnections.add(connectionId);
TreeLeaf l = new TreeLeaf(c, targetPoint, sourcePoint);
Node newNodeA = new Node(c, targetPoint, n.getZIndex());
@@ -148,16 +149,16 @@ public abstract class NetlistAnalyzer {
concurrentPaths.addAll(newConcurrentPaths);
}
- /**
- * Merges paths that share common elements, taking into account bidirectional connections.
- *
- * @param paths List of paths to merge
- * @param backward Direction for merging (forward/backward)
- */
- protected void mergePaths(List paths, boolean backward) {
- // Skip if there are no paths or only one path
- if (paths == null || paths.size() <= 1) {
- return;
+ /**
+ * Merges paths that share common elements, taking into account bidirectional connections.
+ *
+ * @param paths List of paths to merge
+ * @param backward Direction for merging (forward/backward)
+ */
+ protected void mergePaths(List paths, boolean backward) {
+ // Skip if there are no paths or only one path
+ if (paths == null || paths.size() <= 1) {
+ return;
}
Map uniques = new HashMap();
for (Tree t : paths) {
@@ -204,7 +205,7 @@ public abstract class NetlistAnalyzer {
boolean canMerge = true;
unique = pathsToMerge.get(0).getChildren().get(backward ? i : pathsToMerge.get(0).getChildren().size() - i - 1);
for (Tree t : pathsToMerge) {
- // Fix: Correct index calculation to check the proper element in each path
+ // Fix: Correct index calculation to check the proper element in each path
if (t.getChildren().size() <= i || !t.getChildren().get(backward ? i : t.getChildren().size() - i - 1).equals(unique)) {
canMerge = false;
break;
@@ -246,73 +247,73 @@ public abstract class NetlistAnalyzer {
}
}
- /**
- * Creates a unique identifier for a connection between two points
- * that is the same regardless of the direction of connection.
- * This helps prevent duplicate paths in bidirectional connections.
- *
- * @param component The component containing the connection
- * @param point1 First point index
- * @param point2 Second point index
- * @return A direction-agnostic connection identifier
- */
- protected String createBidirectionalConnectionId(IDIYComponent> component, int point1, int point2) {
- if (component == null) return null;
-
- // Always use min/max to ensure the same ID regardless of direction
- int minPoint = Math.min(point1, point2);
- int maxPoint = Math.max(point1, point2);
-
- return component.getName() + "_" + minPoint + "_" + maxPoint;
- }
-
- /**
- * Compares two tree paths to check if they represent the same physical connection path
- * but possibly in reverse directions. This helps identify paths that should be merged
- * due to bidirectional connections.
- *
- * @param path1 First path to compare
- * @param path2 Second path to compare
- * @return true if the paths represent the same physical connection (possibly in reverse order)
- */
- protected boolean arePathsEquivalent(Tree path1, Tree path2) {
- if (path1 == null || path2 == null) return false;
- if (path1 == path2) return true;
-
- // Different connection types can't be equivalent
- if (path1.getConnectionType() != path2.getConnectionType()) return false;
-
- // Must have same number of elements
- List children1 = path1.getChildren();
- List children2 = path2.getChildren();
- if (children1.size() != children2.size()) return false;
-
- // Simple path with no children
- if (children1.isEmpty()) return true;
-
- // Check forward direction (standard comparison)
- boolean forwardMatch = true;
- for (int i = 0; i < children1.size(); i++) {
- if (!children1.get(i).equals(children2.get(i))) {
- forwardMatch = false;
- break;
- }
- }
-
- if (forwardMatch) return true;
-
- // Check reverse direction (bidirectional check)
- boolean reverseMatch = true;
- for (int i = 0; i < children1.size(); i++) {
- if (!children1.get(i).equals(children2.get(children2.size() - 1 - i))) {
- reverseMatch = false;
- break;
- }
- }
-
- return reverseMatch;
- }
-
+ /**
+ * Creates a unique identifier for a connection between two points
+ * that is the same regardless of the direction of connection.
+ * This helps prevent duplicate paths in bidirectional connections.
+ *
+ * @param component The component containing the connection
+ * @param point1 First point index
+ * @param point2 Second point index
+ * @return A direction-agnostic connection identifier
+ */
+ protected String createBidirectionalConnectionId(IDIYComponent> component, int point1, int point2) {
+ if (component == null) return null;
+
+ // Always use min/max to ensure the same ID regardless of direction
+ int minPoint = Math.min(point1, point2);
+ int maxPoint = Math.max(point1, point2);
+
+ return component.getName() + "_" + minPoint + "_" + maxPoint;
+ }
+
+ /**
+ * Compares two tree paths to check if they represent the same physical connection path
+ * but possibly in reverse directions. This helps identify paths that should be merged
+ * due to bidirectional connections.
+ *
+ * @param path1 First path to compare
+ * @param path2 Second path to compare
+ * @return true if the paths represent the same physical connection (possibly in reverse order)
+ */
+ protected boolean arePathsEquivalent(Tree path1, Tree path2) {
+ if (path1 == null || path2 == null) return false;
+ if (path1 == path2) return true;
+
+ // Different connection types can't be equivalent
+ if (path1.getConnectionType() != path2.getConnectionType()) return false;
+
+ // Must have same number of elements
+ List children1 = path1.getChildren();
+ List children2 = path2.getChildren();
+ if (children1.size() != children2.size()) return false;
+
+ // Simple path with no children
+ if (children1.isEmpty()) return true;
+
+ // Check forward direction (standard comparison)
+ boolean forwardMatch = true;
+ for (int i = 0; i < children1.size(); i++) {
+ if (!children1.get(i).equals(children2.get(i))) {
+ forwardMatch = false;
+ break;
+ }
+ }
+
+ if (forwardMatch) return true;
+
+ // Check reverse direction (bidirectional check)
+ boolean reverseMatch = true;
+ for (int i = 0; i < children1.size(); i++) {
+ if (!children1.get(i).equals(children2.get(children2.size() - 1 - i))) {
+ reverseMatch = false;
+ break;
+ }
+ }
+
+ return reverseMatch;
+ }
+
protected Group findGroup(Netlist netlist, Node node) {
for (Group g : netlist.getGroups())
if (g.getNodes().contains(node))
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistBuilder.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistBuilder.java
index 9762c12c..5178513a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistBuilder.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/NetlistBuilder.java
@@ -30,6 +30,11 @@ import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
+
+import com.google.common.graph.GraphBuilder;
+import com.google.common.graph.ImmutableGraph;
+import com.google.common.graph.ImmutableGraph.Builder;
+
import org.diylc.common.ComponentType;
import org.diylc.core.ICommonNode;
import org.diylc.core.IContinuity;
@@ -42,9 +47,7 @@ import org.diylc.presenter.ComponentProcessor;
import org.diylc.presenter.Connection;
import org.diylc.presenter.ContinuityArea;
import org.diylc.utils.RTree;
-import com.google.common.graph.GraphBuilder;
-import com.google.common.graph.ImmutableGraph;
-import com.google.common.graph.ImmutableGraph.Builder;
+
import com.google.common.graph.Traverser;
public class NetlistBuilder {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/Node.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/Node.java
index 238d24ec..bd4b24a0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/Node.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/Node.java
@@ -22,6 +22,7 @@
package org.diylc.netlist;
import java.awt.geom.Point2D;
+
import org.diylc.core.ICommonNode;
import org.diylc.core.IDIYComponent;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeLeaf.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeLeaf.java
index 11cfcd37..9d4cc9d8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeLeaf.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeLeaf.java
@@ -22,6 +22,7 @@
package org.diylc.netlist;
import java.util.List;
+
import org.diylc.core.IDIYComponent;
public class TreeLeaf implements ITree {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/CommentEntity.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/CommentEntity.java
index 89dad269..7a280b33 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/CommentEntity.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/CommentEntity.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.cloud.model;
import java.io.Serializable;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/ProjectEntity.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/ProjectEntity.java
index a5c8fdb6..74cb90ed 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/ProjectEntity.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/ProjectEntity.java
@@ -1,29 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.cloud.model;
-import java.io.Serializable;
-import org.diylc.core.annotations.DynamicList;
-import org.diylc.core.annotations.EditableProperty;
+import java.io.Serializable;
+
+import org.diylc.core.annotations.DynamicList;
+import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.annotations.MultiLineText;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/UserEntity.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/UserEntity.java
index 893f493f..266b0c38 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/UserEntity.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/model/UserEntity.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.cloud.model;
import java.io.Serializable;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudException.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudException.java
index e48bcfda..f0525276 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudException.java
@@ -19,18 +19,18 @@
along with DIYLC. If not, see .
*/
-package org.diylc.plugins.cloud.presenter;
-
-public class CloudException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public CloudException(Exception e) {
- super(e);
- }
-
- public CloudException(String string) {
- super(string);
- }
-
-}
+package org.diylc.plugins.cloud.presenter;
+
+public class CloudException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public CloudException(Exception e) {
+ super(e);
+ }
+
+ public CloudException(String string) {
+ super(string);
+ }
+
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudListener.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudListener.java
index 50bd0c5f..df44432e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudListener.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudListener.java
@@ -19,11 +19,11 @@
along with DIYLC. If not, see .
*/
-package org.diylc.plugins.cloud.presenter;
-
-public interface CloudListener {
-
- public void loggedIn();
-
- public void loggedOut();
-}
+package org.diylc.plugins.cloud.presenter;
+
+public interface CloudListener {
+
+ public void loggedIn();
+
+ public void loggedOut();
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudPresenter.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudPresenter.java
index a9bd2e49..05a7644e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudPresenter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/CloudPresenter.java
@@ -1,48 +1,50 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.cloud.presenter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.URL;
-import java.nio.channels.Channels;
-import java.nio.channels.ReadableByteChannel;
-import java.util.Collections;
-import java.util.List;
-import org.apache.log4j.Logger;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.common.PropertyWrapper;
-import org.diylc.plugins.cloud.model.CommentEntity;
-import org.diylc.plugins.cloud.model.IServiceAPI;
-import org.diylc.plugins.cloud.model.ProjectEntity;
-import org.diylc.plugins.cloud.model.UserEntity;
-import org.diylc.presenter.ComparatorFactory;
-import org.diylc.presenter.ComponentProcessor;
-import com.diyfever.httpproxy.PhpFlatProxy;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.util.Collections;
+import java.util.List;
+import org.apache.log4j.Logger;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import com.diyfever.httpproxy.PhpFlatProxy;
import com.diyfever.httpproxy.ProxyFactory;
+import org.diylc.common.PropertyWrapper;
+import org.diylc.plugins.cloud.model.CommentEntity;
+import org.diylc.plugins.cloud.model.IServiceAPI;
+import org.diylc.plugins.cloud.model.ProjectEntity;
+import org.diylc.plugins.cloud.model.UserEntity;
+import org.diylc.presenter.ComparatorFactory;
+import org.diylc.presenter.ComponentProcessor;
+
/**
* Contains all the back-end logic for using the cloud and manipulating projects on the cloud.
*
@@ -165,11 +167,11 @@ public class CloudPresenter {
if (username == null || token == null)
throw new CloudException("Login failed. Please try to login again.");
-
+
if (projectId == null)
- LOG.info("Uploading a new project: " + projectName);
- else
- LOG.info("Updating project: " + projectId);
+ LOG.info("Uploading a new project: " + projectName);
+ else
+ LOG.info("Updating project: " + projectId);
try {
String res =
@@ -180,24 +182,24 @@ public class CloudPresenter {
} catch (Exception e) {
throw new CloudException(e);
}
- }
-
- public void replaceProjectFile(String diylcVersion, File thumbnail, File project, Integer projectId) throws IOException, CloudException {
- String username = ConfigurationManager.getInstance().readString(USERNAME_KEY, null);
- String token = ConfigurationManager.getInstance().readString(TOKEN_KEY, null);
-
- if (username == null || token == null)
- throw new CloudException("Login failed. Please try to login again.");
-
- LOG.info("Replacing project files for: " + projectId);
- try {
- String res =
- getService().replaceProjectFiles(username, token, getMachineId(), diylcVersion, thumbnail, project, projectId);
- if (!res.equals(SUCCESS))
- throw new CloudException(res);
- } catch (Exception e) {
- throw new CloudException(e);
- }
+ }
+
+ public void replaceProjectFile(String diylcVersion, File thumbnail, File project, Integer projectId) throws IOException, CloudException {
+ String username = ConfigurationManager.getInstance().readString(USERNAME_KEY, null);
+ String token = ConfigurationManager.getInstance().readString(TOKEN_KEY, null);
+
+ if (username == null || token == null)
+ throw new CloudException("Login failed. Please try to login again.");
+
+ LOG.info("Replacing project files for: " + projectId);
+ try {
+ String res =
+ getService().replaceProjectFiles(username, token, getMachineId(), diylcVersion, thumbnail, project, projectId);
+ if (!res.equals(SUCCESS))
+ throw new CloudException(res);
+ } catch (Exception e) {
+ throw new CloudException(e);
+ }
}
public void updateProjectDetails(ProjectEntity project, String diylcVersion) throws IOException, CloudException {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotConnectedException.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotConnectedException.java
index deeeebd7..96835cb8 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotConnectedException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotConnectedException.java
@@ -19,10 +19,10 @@
along with DIYLC. If not, see .
*/
-package org.diylc.plugins.cloud.presenter;
-
-public class NotConnectedException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
-}
+package org.diylc.plugins.cloud.presenter;
+
+public class NotConnectedException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotExistsException.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotExistsException.java
index ea5f1024..6c812b8e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotExistsException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotExistsException.java
@@ -19,13 +19,13 @@
along with DIYLC. If not, see .
*/
-package org.diylc.plugins.cloud.presenter;
-
-public class NotExistsException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public NotExistsException(String message) {
- super(message);
- }
-}
+package org.diylc.plugins.cloud.presenter;
+
+public class NotExistsException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public NotExistsException(String message) {
+ super(message);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotLoggedInException.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotLoggedInException.java
index df07800d..94267e3a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotLoggedInException.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/NotLoggedInException.java
@@ -19,10 +19,10 @@
along with DIYLC. If not, see .
*/
-package org.diylc.plugins.cloud.presenter;
-
-public class NotLoggedInException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
-}
+package org.diylc.plugins.cloud.presenter;
+
+public class NotLoggedInException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/SearchSession.java b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/SearchSession.java
index 853f897a..e92f912b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/SearchSession.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/plugins/cloud/presenter/SearchSession.java
@@ -1,27 +1,28 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.cloud.presenter;
-import java.util.List;
+import java.util.List;
+
import org.diylc.plugins.cloud.model.ProjectEntity;
/**
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/BuildingBlockManager.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/BuildingBlockManager.java
index 795c9a8f..4fa11508 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/BuildingBlockManager.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/BuildingBlockManager.java
@@ -32,16 +32,18 @@ import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.IConfigurationManager;
-import org.diylc.common.BuildingBlockPackage;
-import org.diylc.common.IBlockProcessor;
-import org.diylc.common.IBlockProcessor.InvalidBlockException;
-import org.diylc.common.IPlugInPort;
-import org.diylc.core.IDIYComponent;
-import org.diylc.serialization.ProjectFileManager;
+
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
+import org.diylc.common.BuildingBlockPackage;
+import org.diylc.common.IBlockProcessor;
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.IBlockProcessor.InvalidBlockException;
+import org.diylc.core.IDIYComponent;
+import org.diylc.serialization.ProjectFileManager;
+
public class BuildingBlockManager {
private static final String BLOCKS_FILE_NAME = "blocks.xml";
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/CalcUtils.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/CalcUtils.java
index fb424f13..d362ef3d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/CalcUtils.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/CalcUtils.java
@@ -20,6 +20,7 @@ package org.diylc.presenter;
import java.awt.geom.Point2D;
import java.util.List;
+
import org.diylc.core.IDIYComponent;
import org.diylc.core.measures.Size;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/ComparatorFactory.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/ComparatorFactory.java
index b1fc457c..378b2ec2 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/ComparatorFactory.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/ComparatorFactory.java
@@ -1,31 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.presenter;
-import java.util.Comparator;
-import org.diylc.common.ComponentType;
-import org.diylc.common.PropertyWrapper;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
+import java.util.Comparator;
+
+import org.diylc.common.ComponentType;
+import org.diylc.common.PropertyWrapper;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
public class ComparatorFactory {
@@ -97,10 +98,10 @@ public class ComparatorFactory {
propertyNameComparator = new Comparator() {
@Override
- public int compare(PropertyWrapper o1, PropertyWrapper o2) {
- if (o1.isReadOnly() && !o2.isReadOnly())
- return 1;
- if (!o1.isReadOnly() && o2.isReadOnly())
+ public int compare(PropertyWrapper o1, PropertyWrapper o2) {
+ if (o1.isReadOnly() && !o2.isReadOnly())
+ return 1;
+ if (!o1.isReadOnly() && o2.isReadOnly())
return -1;
int comp = Integer.valueOf(o1.getSortOrder()).compareTo(o2.getSortOrder());
if (comp != 0)
@@ -131,17 +132,17 @@ public class ComparatorFactory {
};
}
return componentZOrderComparator;
- }
-
- public Comparator> getComponentProjectZOrderComparator(final Project project) {
- return new Comparator>() {
-
- @Override
- public int compare(IDIYComponent> o1, IDIYComponent> o2) {
- int index1 = project.getComponents().indexOf(o1);
- int index2 = project.getComponents().indexOf(o2);
- return Integer.valueOf(index1).compareTo(index2);
- }
- };
+ }
+
+ public Comparator> getComponentProjectZOrderComparator(final Project project) {
+ return new Comparator>() {
+
+ @Override
+ public int compare(IDIYComponent> o1, IDIYComponent> o2) {
+ int index1 = project.getComponents().indexOf(o1);
+ int index2 = project.getComponents().indexOf(o2);
+ return Integer.valueOf(index1).compareTo(index2);
+ }
+ };
}
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/ComponentProcessor.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/ComponentProcessor.java
index 72fcd326..2bab6e2b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/ComponentProcessor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/ComponentProcessor.java
@@ -1,50 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.presenter;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import org.apache.log4j.Logger;
-import org.diylc.common.ComponentType;
-import org.diylc.common.IComponentTransformer;
-import org.diylc.common.PropertyWrapper;
-import org.diylc.core.CreationMethod;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IPropertyValidator;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import org.apache.log4j.Logger;
+
+import org.diylc.common.ComponentType;
+import org.diylc.common.IComponentTransformer;
+import org.diylc.common.PropertyWrapper;
+import org.diylc.core.CreationMethod;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IPropertyValidator;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
import org.diylc.lang.LangUtil;
/**
@@ -92,13 +93,13 @@ public class ComponentProcessor {
double zOrder;
boolean flexibleZOrder;
BomPolicy bomPolicy;
- boolean autoEdit;
+ boolean autoEdit;
boolean cacheDrawing;
IComponentTransformer transformer;
KeywordPolicy keywordPolicy;
- String keywordTag;
- List datasheet = null;
- int datasheetCreationStepCount = 0;
+ String keywordTag;
+ List datasheet = null;
+ int datasheetCreationStepCount = 0;
if (clazz.isAnnotationPresent(ComponentDescriptor.class)) {
ComponentDescriptor annotation = clazz.getAnnotation(ComponentDescriptor.class);
@@ -114,11 +115,11 @@ public class ComponentProcessor {
autoEdit = annotation.autoEdit();
transformer = getComponentTransformer(annotation.transformer());
keywordPolicy = annotation.keywordPolicy();
- keywordTag = annotation.keywordTag();
- cacheDrawing = annotation.enableCache();
- if (annotation.enableDatasheet()) {
- datasheet = DatasheetService.getInstance().loadDatasheet(clazz);
- datasheetCreationStepCount = annotation.datasheetCreationStepCount();
+ keywordTag = annotation.keywordTag();
+ cacheDrawing = annotation.enableCache();
+ if (annotation.enableDatasheet()) {
+ datasheet = DatasheetService.getInstance().loadDatasheet(clazz);
+ datasheetCreationStepCount = annotation.datasheetCreationStepCount();
}
} else { // default
return null;
@@ -141,7 +142,7 @@ public class ComponentProcessor {
}
ComponentType componentType =
new ComponentType(name, description, creationMethod, category, namePrefix, author, icon, clazz, zOrder,
- flexibleZOrder, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag, cacheDrawing, datasheet,
+ flexibleZOrder, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag, cacheDrawing, datasheet,
datasheetCreationStepCount);
componentTypeMap.put(clazz.getName(), componentType);
return componentType;
@@ -161,9 +162,9 @@ public class ComponentProcessor {
for (Method getter : clazz.getMethods()) {
if (getter.getName().startsWith("get")) {
- if (getter.isAnnotationPresent(EditableProperty.class) && !getter.isAnnotationPresent(Deprecated.class)
- // since Java 8 in generic classes we get properties of both the generic type and Object
- // added this condition to skip Object property that we do not need
+ if (getter.isAnnotationPresent(EditableProperty.class) && !getter.isAnnotationPresent(Deprecated.class)
+ // since Java 8 in generic classes we get properties of both the generic type and Object
+ // added this condition to skip Object property that we do not need
&& getter.getReturnType() != Object.class) {
EditableProperty annotation = getter.getAnnotation(EditableProperty.class);
String name;
@@ -172,22 +173,22 @@ public class ComponentProcessor {
} else {
name = annotation.name();
}
- IPropertyValidator validator = getPropertyValidator(annotation.validatorClass());
-
- String setterName = null;
+ IPropertyValidator validator = getPropertyValidator(annotation.validatorClass());
+
+ String setterName = null;
try {
- Method setter = clazz.getMethod("set" + getter.getName().substring(3), getter.getReturnType());
- setterName = setter.getName();
- } catch (NoSuchMethodException e) {
- LOG.debug("No matching setter found for " + clazz.getName() + "." + getter.getName() + ". Skipping...");
- }
-
- LangUtil.translate(name); // temporary, just to make sure we catch it in the dict
- if (getter.getReturnType().isEnum()) {
- for(Object o : getter.getReturnType().getEnumConstants()) {
- LangUtil.translate(o.toString());
- }
- }
+ Method setter = clazz.getMethod("set" + getter.getName().substring(3), getter.getReturnType());
+ setterName = setter.getName();
+ } catch (NoSuchMethodException e) {
+ LOG.debug("No matching setter found for " + clazz.getName() + "." + getter.getName() + ". Skipping...");
+ }
+
+ LangUtil.translate(name); // temporary, just to make sure we catch it in the dict
+ if (getter.getReturnType().isEnum()) {
+ for(Object o : getter.getReturnType().getEnumConstants()) {
+ LangUtil.translate(o.toString());
+ }
+ }
PropertyWrapper property =
new PropertyWrapper(name, getter.getReturnType(), getter.getName(), setterName,
@@ -292,22 +293,22 @@ public class ComponentProcessor {
}
componentTransformerMap.put(clazz.getName(), transformer);
return transformer;
- }
-
- public static boolean hasStickyPoint(IDIYComponent> c) {
- for (int i = 0; i < c.getControlPointCount(); i++)
- if (c.isControlPointSticky(0))
- return true;
- return false;
- }
-
- private static int touchSensitivity = 5;
-
- public static boolean componentPointsTouch(IDIYComponent> c1, IDIYComponent> c2) {
- for (int i = 0; i < c1.getControlPointCount(); i++)
- for (int j = 0; j < c2.getControlPointCount(); j++)
- if (c1.isControlPointSticky(i) && c2.isControlPointSticky(j) && c1.getControlPoint(i).distance(c2.getControlPoint(j)) < touchSensitivity)
- return true;
- return false;
+ }
+
+ public static boolean hasStickyPoint(IDIYComponent> c) {
+ for (int i = 0; i < c.getControlPointCount(); i++)
+ if (c.isControlPointSticky(0))
+ return true;
+ return false;
+ }
+
+ private static int touchSensitivity = 5;
+
+ public static boolean componentPointsTouch(IDIYComponent> c1, IDIYComponent> c2) {
+ for (int i = 0; i < c1.getControlPointCount(); i++)
+ for (int j = 0; j < c2.getControlPointCount(); j++)
+ if (c1.isControlPointSticky(i) && c2.isControlPointSticky(j) && c1.getControlPoint(i).distance(c2.getControlPoint(j)) < touchSensitivity)
+ return true;
+ return false;
}
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/ContinuityArea.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/ContinuityArea.java
index afb68b60..455f51c7 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/ContinuityArea.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/ContinuityArea.java
@@ -20,6 +20,7 @@ package org.diylc.presenter;
import java.awt.geom.Area;
import java.io.Serializable;
+
import org.diylc.netlist.AreaSimplifier;
public class ContinuityArea implements Serializable {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/DatasheetService.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/DatasheetService.java
index 48ceea99..24bc5ad0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/DatasheetService.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/DatasheetService.java
@@ -55,10 +55,11 @@ public class DatasheetService {
private DatasheetService() {}
public List loadDatasheet(Class> clazz) {
+ ClassLoader classloader = Thread.currentThread().getContextClassLoader();
return datasheetCache.computeIfAbsent(clazz.getCanonicalName(), key -> {
String fileName = clazz.getSimpleName() + ".datasheet";
LOG.info("Loading datasheet file for " + fileName);
- URL resource = clazz.getResource(fileName);
+ URL resource = classloader.getResource(fileName);
if (resource == null) {
LOG.warn("Datasheet file not found: " + fileName);
return null;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingCache.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingCache.java
index 079f8720..e0aacfe2 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingCache.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingCache.java
@@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
+
import org.diylc.common.ComponentType;
import org.diylc.core.ComponentForRender;
import org.diylc.core.ComponentState;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java
index d3aa9b24..f2920b1d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/DrawingManager.java
@@ -48,6 +48,7 @@ import java.util.stream.Collectors;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.IConfigurationManager;
import org.diylc.appframework.simplemq.MessageDispatcher;
+
import org.diylc.common.DrawOption;
import org.diylc.common.EventType;
import org.diylc.common.GridType;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/G2DWrapper.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/G2DWrapper.java
index 39a426bf..f5fac8a0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/G2DWrapper.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/G2DWrapper.java
@@ -62,6 +62,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+
import org.diylc.common.ObjectCache;
import org.diylc.common.ZoomableStroke;
import org.diylc.core.IDrawingObserver;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/InstantiationManager.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/InstantiationManager.java
index 48456d52..a54dbc75 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/InstantiationManager.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/InstantiationManager.java
@@ -1,51 +1,52 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.presenter;
-import java.awt.geom.Point2D;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.apache.log4j.Logger;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.clipboard.ComponentTransferable;
-import org.diylc.common.ComponentType;
-import org.diylc.common.IPlugInPort;
-import org.diylc.common.Orientation;
-import org.diylc.common.OrientationHV;
-import org.diylc.common.PropertyWrapper;
-import org.diylc.core.Angle;
-import org.diylc.core.CreationMethod;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
-import org.diylc.core.Template;
-import org.diylc.core.annotations.KeywordPolicy;
+import java.awt.geom.Point2D;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.log4j.Logger;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.clipboard.ComponentTransferable;
+import org.diylc.common.ComponentType;
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.Orientation;
+import org.diylc.common.OrientationHV;
+import org.diylc.common.PropertyWrapper;
+import org.diylc.core.Angle;
+import org.diylc.core.CreationMethod;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
+import org.diylc.core.Template;
+import org.diylc.core.annotations.KeywordPolicy;
import org.diylc.core.measures.Size;
/**
@@ -60,7 +61,7 @@ public class InstantiationManager {
public static int MAX_RECENT_COMPONENTS = 16;
private ComponentType componentTypeSlot;
- private Template template;
+ private Template template;
private String[] model;
private List> componentSlot;
private Point2D firstControlPoint;
@@ -68,9 +69,9 @@ public class InstantiationManager {
public static final ComponentType clipboardType = new ComponentType("Clipboard contents",
"Components from the clipboard", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null,
- false, null, KeywordPolicy.NEVER_SHOW, null, false, null, 0);
- public static final ComponentType blockType = new ComponentType("Building block",
- "Components from the building block", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null,
+ false, null, KeywordPolicy.NEVER_SHOW, null, false, null, 0);
+ public static final ComponentType blockType = new ComponentType("Building block",
+ "Components from the building block", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null,
false, null, KeywordPolicy.NEVER_SHOW, null, false, null, 0);
public InstantiationManager() {}
@@ -81,10 +82,10 @@ public class InstantiationManager {
public Template getTemplate() {
return template;
- }
-
- public String[] getModel() {
- return model;
+ }
+
+ public String[] getModel() {
+ return model;
}
public List> getComponentSlot() {
@@ -97,17 +98,17 @@ public class InstantiationManager {
public Point2D getPotentialControlPoint() {
return potentialControlPoint;
- }
-
- public void setPotentialControlPoint(Point2D potentialControlPoint) {
- this.potentialControlPoint = potentialControlPoint;
+ }
+
+ public void setPotentialControlPoint(Point2D potentialControlPoint) {
+ this.potentialControlPoint = potentialControlPoint;
}
- public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, String[] model,
+ public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, String[] model,
Project currentProject, boolean forceInstatiate)
throws Exception {
this.componentTypeSlot = componentTypeSlot;
- this.template = template;
+ this.template = template;
this.model = model;
if (componentTypeSlot == null) {
this.componentSlot = null;
@@ -150,7 +151,7 @@ public class InstantiationManager {
return changeMade;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
public void pasteComponents(ComponentTransferable componentTransferable, Point2D scaledPoint, boolean snapToGrid,
Size gridSpacing, boolean autoGroup, Project currentProject, boolean assignNewNames) {
// Adjust location of components so they are centered under the mouse
@@ -158,26 +159,26 @@ public class InstantiationManager {
double minX = Integer.MAX_VALUE;
double maxX = Integer.MIN_VALUE;
double minY = Integer.MAX_VALUE;
- double maxY = Integer.MIN_VALUE;
-
- Set existingNames = new HashSet();
- for (IDIYComponent> c : currentProject.getComponents())
- existingNames.add(c.getName());
-
- List> allComponents = new ArrayList>(currentProject.getComponents());
-
- List> components = componentTransferable.getComponents();
+ double maxY = Integer.MIN_VALUE;
- for (IDIYComponent> component : components) {
- // assign a new name if it already exists in the project
- if (assignNewNames && existingNames.contains(component.getName())) {
- ComponentType componentType =
- ComponentProcessor.getInstance().extractComponentTypeFrom((Class extends IDIYComponent>>) component.getClass());
- String newName = createUniqueName(componentType, allComponents);
- existingNames.add(newName);
- component.setName(newName);
- allComponents.add(component);
- }
+ Set existingNames = new HashSet();
+ for (IDIYComponent> c : currentProject.getComponents())
+ existingNames.add(c.getName());
+
+ List> allComponents = new ArrayList>(currentProject.getComponents());
+
+ List> components = componentTransferable.getComponents();
+
+ for (IDIYComponent> component : components) {
+ // assign a new name if it already exists in the project
+ if (assignNewNames && existingNames.contains(component.getName())) {
+ ComponentType componentType =
+ ComponentProcessor.getInstance().extractComponentTypeFrom((Class extends IDIYComponent>>) component.getClass());
+ String newName = createUniqueName(componentType, allComponents);
+ existingNames.add(newName);
+ component.setName(newName);
+ allComponents.add(component);
+ }
for (int i = 0; i < component.getControlPointCount(); i++) {
Point2D p = component.getControlPoint(i);
@@ -203,7 +204,7 @@ public class InstantiationManager {
}
for (IDIYComponent> component : components) {
for (int i = 0; i < component.getControlPointCount(); i++) {
- Point2D p = component.getControlPoint(i);
+ Point2D p = component.getControlPoint(i);
Point2D newP = new Point2D.Double(p.getX() - x, p.getY() - y);
component.setControlPoint(newP, i);
}
@@ -221,11 +222,11 @@ public class InstantiationManager {
CalcUtils.snapPointToGrid(scaledPoint, gridSpacing);
}
// Update the location according to mouse location
- updateSingleClick(scaledPoint, snapToGrid, gridSpacing);
-
- // copy group information if available
- if (componentTransferable.getGroups() != null) {
- currentProject.getGroups().addAll(componentTransferable.getGroups());
+ updateSingleClick(scaledPoint, snapToGrid, gridSpacing);
+
+ // copy group information if available
+ if (componentTransferable.getGroups() != null) {
+ currentProject.getGroups().addAll(componentTransferable.getGroups());
}
}
@@ -260,7 +261,7 @@ public class InstantiationManager {
} else {
Point2D p = new Point2D.Double();
for (IDIYComponent> component : componentSlot) {
- for (int i = 0; i < component.getControlPointCount(); i++) {
+ for (int i = 0; i < component.getControlPointCount(); i++) {
Point2D oldP = component.getControlPoint(i);
p.setLocation(oldP.getX() + dx, oldP.getY() + dy);
component.setControlPoint(p, i);
@@ -272,23 +273,23 @@ public class InstantiationManager {
@SuppressWarnings("unchecked")
private List> instantiateComponent(ComponentType componentType, Point2D point,
- Project currentProject) throws InstantiationException, IllegalAccessException, NoSuchMethodException,
+ Project currentProject) throws InstantiationException, IllegalAccessException, NoSuchMethodException,
SecurityException, IllegalArgumentException, InvocationTargetException {
LOG.info("Instatiating component of type: " + componentType.getInstanceClass().getName());
// Instantiate the component.
- IDIYComponent> component;
- if (model == null) {
- component = componentType.getInstanceClass().getDeclaredConstructor().newInstance();
- } else {
- Constructor extends IDIYComponent>> constructor = componentType.getInstanceClass().getConstructor(String[].class);
- component = constructor.newInstance((Object)model);
- }
+ IDIYComponent> component;
+ if (model == null) {
+ component = componentType.getInstanceClass().getDeclaredConstructor().newInstance();
+ } else {
+ Constructor extends IDIYComponent>> constructor = componentType.getInstanceClass().getConstructor(String[].class);
+ component = constructor.newInstance((Object)model);
+ }
component.createdIn(currentProject);
// Translate them to the desired location.
if (point != null) {
- for (int j = 0; j < component.getControlPointCount(); j++) {
+ for (int j = 0; j < component.getControlPointCount(); j++) {
Point2D p = component.getControlPoint(j);
Point2D controlPoint = new Point2D.Double(p.getX() + point.getX(), p.getY() + point.getY());
// snapPointToGrid(controlPoint);
@@ -297,15 +298,15 @@ public class InstantiationManager {
}
loadComponentShapeFromTemplate(component, template);
-
- if (model == null) {
+
+ if (model == null) {
// do not fill with defaults if creating by a model
- fillWithDefaultProperties(component, template);
- }
-
- // preserve component from the template if RENUMBER_ON_PASTE_KEY is OFF
- if (template == null || ConfigurationManager.getInstance().readBoolean(IPlugInPort.RENUMBER_ON_PASTE_KEY, true)) {
- component.setName(createUniqueName(componentType, currentProject.getComponents()));
+ fillWithDefaultProperties(component, template);
+ }
+
+ // preserve component from the template if RENUMBER_ON_PASTE_KEY is OFF
+ if (template == null || ConfigurationManager.getInstance().readBoolean(IPlugInPort.RENUMBER_ON_PASTE_KEY, true)) {
+ component.setName(createUniqueName(componentType, currentProject.getComponents()));
}
// Write to recent components
@@ -343,9 +344,9 @@ public class InstantiationManager {
public String createUniqueName(ComponentType componentType, List> components) {
boolean exists = true;
- Set takenNames = components.stream()
- .map(x -> x.getName())
- .filter(Objects::nonNull)
+ Set takenNames = components.stream()
+ .map(x -> x.getName())
+ .filter(Objects::nonNull)
.collect(Collectors.toSet());
int i = 0;
while (exists) {
@@ -382,11 +383,11 @@ public class InstantiationManager {
ConfigurationManager.getInstance().readObject(
Presenter.DEFAULTS_KEY_PREFIX + object.getClass().getName() + ":" + property.getName(), null);
if (defaultValue != null) {
- property.setValue(defaultValue);
+ property.setValue(defaultValue);
try {
- property.writeTo(object);
- } catch (Exception e) {
- LOG.error("Could not write property " + property.getName(), e);
+ property.writeTo(object);
+ } catch (Exception e) {
+ LOG.error("Could not write property " + property.getName(), e);
}
}
}
@@ -397,11 +398,11 @@ public class InstantiationManager {
LOG.warn("Cannot find property " + pair.getKey());
} else {
LOG.debug("Filling value from template for " + pair.getKey());
- property.setValue(pair.getValue());
+ property.setValue(pair.getValue());
try {
- property.writeTo(object);
- } catch (Exception e) {
- LOG.error("Could not write property " + property.getName(), e);
+ property.writeTo(object);
+ } catch (Exception e) {
+ LOG.error("Could not write property " + property.getName(), e);
}
}
}
@@ -417,7 +418,7 @@ public class InstantiationManager {
public void loadComponentShapeFromTemplate(IDIYComponent> component, Template template) {
if (template != null && template.getPoints() != null
&& template.getPoints().size() >= component.getControlPointCount()) {
- for (int i = 0; i < component.getControlPointCount(); i++) {
+ for (int i = 0; i < component.getControlPointCount(); i++) {
Point2D oldP = component.getControlPoint(0);
Point2D p = new Point2D.Double(oldP.getX() + template.getPoints().get(i).getX(), oldP.getY() + template.getPoints().get(i).getY());
component.setControlPoint(p, i);
@@ -435,7 +436,7 @@ public class InstantiationManager {
PropertyWrapper angleProperty = null;
for (PropertyWrapper propertyWrapper : properties) {
if (propertyWrapper.getType().getName().equals(Orientation.class.getName())
- || propertyWrapper.getType().getName().equals(OrientationHV.class.getName())
+ || propertyWrapper.getType().getName().equals(OrientationHV.class.getName())
|| propertyWrapper.getName().equalsIgnoreCase("angle")) {
angleProperty = propertyWrapper;
break;
@@ -455,10 +456,10 @@ public class InstantiationManager {
} else if (value instanceof OrientationHV) {
angleProperty.setValue(OrientationHV.values()[(((OrientationHV) value).ordinal() + 1)
% OrientationHV.values().length]);
- } else if (value instanceof Angle) {
- Angle angle = (Angle) angleProperty.getValue();
- Angle newAngle = angle.rotate(1);
- angleProperty.setValue(newAngle);
+ } else if (value instanceof Angle) {
+ Angle angle = (Angle) angleProperty.getValue();
+ Angle newAngle = angle.rotate(1);
+ angleProperty.setValue(newAngle);
}
angleProperty.writeTo(component);
}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/PCBLayerFilter.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/PCBLayerFilter.java
index 41b84544..b431a129 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/PCBLayerFilter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/PCBLayerFilter.java
@@ -1,29 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.presenter;
-import java.lang.reflect.Method;
-import org.diylc.common.IComponentFilter;
-import org.diylc.common.PCBLayer;
+import java.lang.reflect.Method;
+
+import org.diylc.common.IComponentFilter;
+import org.diylc.common.PCBLayer;
import org.diylc.core.IDIYComponent;
public class PCBLayerFilter implements IComponentFilter {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/Presenter.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/Presenter.java
index c6a2aa50..b3e4909d 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/Presenter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/Presenter.java
@@ -55,6 +55,11 @@ import org.diylc.appframework.miscutils.Utils;
import org.diylc.appframework.simplemq.MessageDispatcher;
import org.diylc.appframework.update.Version;
import org.diylc.appframework.update.VersionNumber;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.security.AnyTypePermission;
+
import org.diylc.clipboard.ComponentTransferable;
import org.diylc.common.ComponentType;
import org.diylc.common.DrawOption;
@@ -90,9 +95,6 @@ import org.diylc.test.DIYTest;
import org.diylc.test.Snapshot;
import org.diylc.utils.Constants;
import org.diylc.utils.ReflectionUtils;
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-import com.thoughtworks.xstream.security.AnyTypePermission;
/**
* The main presenter class, contains core app logic and drawing routines.
diff --git a/diylc/diylc-core/src/main/java/org/diylc/presenter/VariantManager.java b/diylc/diylc-core/src/main/java/org/diylc/presenter/VariantManager.java
index a87c9b8b..0ecc4add 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/presenter/VariantManager.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/presenter/VariantManager.java
@@ -34,12 +34,14 @@ import java.util.TreeMap;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.IConfigurationManager;
+
+import com.thoughtworks.xstream.XStream;
+
import org.diylc.common.ComponentType;
import org.diylc.common.IPlugInPort;
import org.diylc.common.VariantPackage;
import org.diylc.core.Template;
import org.diylc.serialization.ProjectFileManager;
-import com.thoughtworks.xstream.XStream;
public class VariantManager {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/AreaConverter.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/AreaConverter.java
index 05ade6a2..978994f1 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/AreaConverter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/AreaConverter.java
@@ -19,8 +19,8 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
+package org.diylc.serialization;
+
import java.awt.geom.Area;
import java.awt.geom.Path2D;
import java.awt.geom.PathIterator;
@@ -30,18 +30,18 @@ import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
-import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
-
-/**
- * Serializes {@link Area} objects by converting coordinates from pixels to inches, thus avoiding
- * the resolution to affect point placement.
- *
- * @author Branislav Stojkovic
- */
-public class AreaConverter implements Converter {
-
- @Override
- public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+
+/**
+ * Serializes {@link Area} objects by converting coordinates from pixels to inches, thus avoiding
+ * the resolution to affect point placement.
+ *
+ * @author Branislav Stojkovic
+ */
+public class AreaConverter implements Converter {
+
+ @Override
+ public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
Area area = (Area) object;
PathIterator iterator = area.getPathIterator(null);
// writer.startNode("area");
@@ -72,16 +72,16 @@ public class AreaConverter implements Converter {
writer.endNode();
iterator.next();
}
-// writer.endNode();
- }
-
- @Override
+// writer.endNode();
+ }
+
+ @Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
Area area = new Area();
// reader.moveDown();
int wind = Integer.parseInt(reader.getAttribute("wind"));
Path2D path = null;
- while (reader.hasMoreChildren()) {
+ while (reader.hasMoreChildren()) {
reader.moveDown();
int type = Integer.parseInt(reader.getAttribute("type"));
List values = new ArrayList();
@@ -119,14 +119,14 @@ public class AreaConverter implements Converter {
Area partArea = new Area(path);
area.add(partArea);
}
- return area;
- }
-
- @SuppressWarnings("rawtypes")
- @Override
+ return area;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
public boolean canConvert(Class clazz) {
if (clazz == null)
- return false;
- return Area.class.isAssignableFrom(clazz);
- }
-}
+ return false;
+ return Area.class.isAssignableFrom(clazz);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/ColorConverter.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/ColorConverter.java
index a9517715..c49f3d1a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/ColorConverter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/ColorConverter.java
@@ -19,33 +19,33 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
+package org.diylc.serialization;
+
import java.awt.Color;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
-
-/**
- * Serializes {@link Color} objects as hex values instead of r/g/b. Backwards compatible when unmarshalling.
- *
- * @author Branislav Stojkovic
- */
-public class ColorConverter extends com.thoughtworks.xstream.converters.extended.ColorConverter {
-
- @Override
- public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
+
+/**
+ * Serializes {@link Color} objects as hex values instead of r/g/b. Backwards compatible when unmarshalling.
+ *
+ * @author Branislav Stojkovic
+ */
+public class ColorConverter extends com.thoughtworks.xstream.converters.extended.ColorConverter {
+
+ @Override
+ public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
Color c = (Color) object;
if (c.getAlpha() == 255) {
writer.addAttribute("hex", String.format("%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue()));
- } else {
+ } else {
writer.addAttribute("hex", String.format("%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue()));
writer.addAttribute("alpha", String.format("%02x", c.getAlpha()));
- }
- }
-
- @Override
+ }
+ }
+
+ @Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
if (reader.getAttribute("hex") != null) {
String hex = reader.getAttribute("hex");
@@ -56,14 +56,14 @@ public class ColorConverter extends com.thoughtworks.xstream.converters.extended
else
return new Color(color.getRed(), color.getGreen(), color.getBlue(), (int)Long.parseLong(alpha, 16));
}
- return super.unmarshal(reader, context);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
+ return super.unmarshal(reader, context);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
public boolean canConvert(Class clazz) {
if (clazz == null)
- return false;
- return Color.class.isAssignableFrom(clazz);
- }
-}
+ return false;
+ return Color.class.isAssignableFrom(clazz);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/FontConverter.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/FontConverter.java
index 4b361a7b..e2d9923f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/FontConverter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/FontConverter.java
@@ -19,47 +19,47 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
+package org.diylc.serialization;
+
import java.awt.Font;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.Mapper;
-
-/**
- * Serializes {@link Font} objects in a more compact fashion. Backwards compatible when unmarshalling.
- *
- * @author Branislav Stojkovic
- */
+
+/**
+ * Serializes {@link Font} objects in a more compact fashion. Backwards compatible when unmarshalling.
+ *
+ * @author Branislav Stojkovic
+ */
public class FontConverter extends com.thoughtworks.xstream.converters.extended.FontConverter {
public FontConverter(Mapper mapper) {
super(mapper);
- }
-
- @Override
- public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
- Font f = (Font) object;
+ }
+
+ @Override
+ public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
+ Font f = (Font) object;
writer.addAttribute("name", f.getFontName());
writer.addAttribute("size", Integer.toString(f.getSize()));
- writer.addAttribute("style", Integer.toString(f.getStyle()));
- }
-
- @Override
+ writer.addAttribute("style", Integer.toString(f.getStyle()));
+ }
+
+ @Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
if (reader.getAttribute("name") != null) {
return new Font(reader.getAttribute("name"), Integer.parseInt(reader.getAttribute("style")), Integer.parseInt(reader.getAttribute("size")));
}
- return super.unmarshal(reader, context);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
+ return super.unmarshal(reader, context);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
public boolean canConvert(Class clazz) {
if (clazz == null)
- return false;
- return Font.class.isAssignableFrom(clazz);
- }
-}
+ return false;
+ return Font.class.isAssignableFrom(clazz);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/IOldFileParser.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/IOldFileParser.java
index 5c1d708d..c496ba10 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/IOldFileParser.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/IOldFileParser.java
@@ -19,15 +19,17 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
+package org.diylc.serialization;
+
import java.util.List;
+
+import org.w3c.dom.Element;
+
import org.diylc.core.Project;
-import org.w3c.dom.Element;
-
-public interface IOldFileParser {
-
- boolean canParse(String version);
-
- Project parseFile(Element root, List warnings);
-}
+
+public interface IOldFileParser {
+
+ boolean canParse(String version);
+
+ Project parseFile(Element root, List warnings);
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/MeasureConverter.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/MeasureConverter.java
index 16c25ce7..4618a9a0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/MeasureConverter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/MeasureConverter.java
@@ -19,34 +19,35 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
-import org.diylc.core.measures.AbstractMeasure;
+package org.diylc.serialization;
+
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
-
-/**
- * Serializes objects of types derived from {@link AbstractMeasure} objects in a compact format. Backwards compatible when unmarshalling.
- *
- * @author Branislav Stojkovic
- */
-public class MeasureConverter implements Converter {
-
+
+import org.diylc.core.measures.AbstractMeasure;
+
+/**
+ * Serializes objects of types derived from {@link AbstractMeasure} objects in a compact format. Backwards compatible when unmarshalling.
+ *
+ * @author Branislav Stojkovic
+ */
+public class MeasureConverter implements Converter {
+
@SuppressWarnings("rawtypes")
- @Override
- public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
+ @Override
+ public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
AbstractMeasure m = (AbstractMeasure) object;
- if (m.getValue() != null)
+ if (m.getValue() != null)
writer.addAttribute("value", Double.toString(m.getValue()));
if (m.getUnit() != null)
- writer.addAttribute("unit", m.getUnit().name());
- }
-
+ writer.addAttribute("unit", m.getUnit().name());
+ }
+
@SuppressWarnings({"unchecked", "rawtypes"})
- @Override
+ @Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
Double value = null;
String unitStr = null;
@@ -81,14 +82,14 @@ public class MeasureConverter implements Converter {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return null;
- }
-
- @SuppressWarnings("rawtypes")
- @Override
+ return null;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
public boolean canConvert(Class clazz) {
if (clazz == null)
- return false;
- return AbstractMeasure.class.isAssignableFrom(clazz);
- }
-}
+ return false;
+ return AbstractMeasure.class.isAssignableFrom(clazz);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/PointConverter.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/PointConverter.java
index 40758044..24e93b6e 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/PointConverter.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/PointConverter.java
@@ -19,32 +19,34 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
+package org.diylc.serialization;
import java.awt.geom.Point2D;
-import org.diylc.utils.Constants;
+
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
-import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
-
-/**
- * Serializes {@link Point2D} objects by converting coordinates from pixels to inches, thus avoiding
- * the resolution to affect point placement.
- *
- * @author Branislav Stojkovic
- */
-public class PointConverter implements Converter {
-
- @Override
- public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
- Point2D point = (Point2D) object;
- writer.addAttribute("x", Double.toString(1d * point.getX() / Constants.PIXELS_PER_INCH));
- writer.addAttribute("y", Double.toString(1d * point.getY() / Constants.PIXELS_PER_INCH));
- }
-
- @Override
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+
+import org.diylc.utils.Constants;
+
+/**
+ * Serializes {@link Point2D} objects by converting coordinates from pixels to inches, thus avoiding
+ * the resolution to affect point placement.
+ *
+ * @author Branislav Stojkovic
+ */
+public class PointConverter implements Converter {
+
+ @Override
+ public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
+ Point2D point = (Point2D) object;
+ writer.addAttribute("x", Double.toString(1d * point.getX() / Constants.PIXELS_PER_INCH));
+ writer.addAttribute("y", Double.toString(1d * point.getY() / Constants.PIXELS_PER_INCH));
+ }
+
+ @Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
double x;
double y;
@@ -56,18 +58,18 @@ public class PointConverter implements Converter {
y = Double.parseDouble(reader.getValue());
reader.moveUp();
return new Point2D.Double(x, y);
- } else {
+ } else {
x = Double.parseDouble(reader.getAttribute("x"));
y = Double.parseDouble(reader.getAttribute("y"));
return new Point2D.Double(x * Constants.PIXELS_PER_INCH, y * Constants.PIXELS_PER_INCH);
- }
- }
-
- @SuppressWarnings("rawtypes")
- @Override
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
public boolean canConvert(Class clazz) {
if (clazz == null)
- return false;
- return Point2D.class.isAssignableFrom(clazz);
- }
-}
+ return false;
+ return Point2D.class.isAssignableFrom(clazz);
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/serialization/ProjectFileManager.java b/diylc/diylc-core/src/main/java/org/diylc/serialization/ProjectFileManager.java
index 22b88bca..380646af 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/serialization/ProjectFileManager.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/serialization/ProjectFileManager.java
@@ -19,8 +19,8 @@
along with DIYLC. If not, see .
*/
-package org.diylc.serialization;
-
+package org.diylc.serialization;
+
import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
@@ -43,10 +43,6 @@ import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.Utils;
import org.diylc.appframework.simplemq.MessageDispatcher;
import org.diylc.appframework.update.VersionNumber;
-import org.diylc.common.EventType;
-import org.diylc.core.Project;
-import org.diylc.presenter.Presenter;
-import org.diylc.test.DIYTest;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -56,33 +52,38 @@ import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.mapper.MapperWrapper;
import com.thoughtworks.xstream.security.AnyTypePermission;
-
-public class ProjectFileManager {
-
- private static final Logger LOG = Logger.getLogger(ProjectFileManager.class);
-
- private XStream xStream;
- // Legacy deserializer for 3.0.1 through 3.0.7, loads Points referenced in
- // pixels.
+
+import org.diylc.common.EventType;
+import org.diylc.core.Project;
+import org.diylc.presenter.Presenter;
+import org.diylc.test.DIYTest;
+
+public class ProjectFileManager {
+
+ private static final Logger LOG = Logger.getLogger(ProjectFileManager.class);
+
+ private XStream xStream;
+ // Legacy deserializer for 3.0.1 through 3.0.7, loads Points referenced in
+ // pixels.
private XStream xStreamOld;
public static final XStream xStreamSerializer = new XStream(new DomDriver("UTF-8"));
static {
configure(xStreamSerializer);
- }
-
- private String currentFileName = null;
- private boolean modified = false;
-
- private MessageDispatcher messageDispatcher;
-
+ }
+
+ private String currentFileName = null;
+ private boolean modified = false;
+
+ private MessageDispatcher messageDispatcher;
+
private List parsers;
- private Set missingFields = new HashSet();
-
- public ProjectFileManager(MessageDispatcher messageDispatcher) {
- super();
+ private Set missingFields = new HashSet();
+
+ public ProjectFileManager(MessageDispatcher messageDispatcher) {
+ super();
this.xStream = new XStream(new DomDriver("UTF-8")) {
@Override
@@ -99,12 +100,12 @@ public class ProjectFileManager {
}
};
}
- };
- configure(xStream);
+ };
+ configure(xStream);
this.xStreamOld = new XStream(new DomDriver());
- this.xStreamOld.addPermission(AnyTypePermission.ANY);
- this.xStreamOld.autodetectAnnotations(true);
- this.messageDispatcher = messageDispatcher;
+ this.xStreamOld.addPermission(AnyTypePermission.ANY);
+ this.xStreamOld.autodetectAnnotations(true);
+ this.messageDispatcher = messageDispatcher;
}
public static void configure(XStream xStream) {
@@ -130,87 +131,87 @@ public class ProjectFileManager {
xStream.addImmutableType(org.diylc.core.measures.Inductance.class, true);
xStream.addImmutableType(org.diylc.core.measures.Size.class, true);
xStream.addPermission(AnyTypePermission.ANY);
- }
-
- public void startNewFile() {
- currentFileName = null;
- modified = false;
- fireFileStatusChanged();
- }
-
- public List getParsers() {
- if (parsers == null) {
- parsers = new ArrayList();
- Set> componentTypeClasses = null;
- try {
- componentTypeClasses = Utils.getClasses("org.diylc.serialization");
- for (Class> clazz : componentTypeClasses) {
- if (!Modifier.isAbstract(clazz.getModifiers()) && IOldFileParser.class.isAssignableFrom(clazz)) {
- IOldFileParser instance = (IOldFileParser) clazz.getDeclaredConstructor().newInstance();
- parsers.add(instance);
- }
- }
- } catch (Exception e) {
- LOG.error("Could not find old version parsers", e);
- }
- }
- return parsers;
- }
-
- public synchronized void serializeProjectToFile(Project project, String fileName, boolean isBackup)
- throws IOException {
- if (!isBackup) {
- LOG.info(String.format("serializeProjectToFile(%s)", fileName));
- }
+ }
+
+ public void startNewFile() {
+ currentFileName = null;
+ modified = false;
+ fireFileStatusChanged();
+ }
+
+ public List getParsers() {
+ if (parsers == null) {
+ parsers = new ArrayList();
+ Set> componentTypeClasses = null;
+ try {
+ componentTypeClasses = Utils.getClasses("org.diylc.serialization");
+ for (Class> clazz : componentTypeClasses) {
+ if (!Modifier.isAbstract(clazz.getModifiers()) && IOldFileParser.class.isAssignableFrom(clazz)) {
+ IOldFileParser instance = (IOldFileParser) clazz.getDeclaredConstructor().newInstance();
+ parsers.add(instance);
+ }
+ }
+ } catch (Exception e) {
+ LOG.error("Could not find old version parsers", e);
+ }
+ }
+ return parsers;
+ }
+
+ public synchronized void serializeProjectToFile(Project project, String fileName, boolean isBackup)
+ throws IOException {
+ if (!isBackup) {
+ LOG.info(String.format("serializeProjectToFile(%s)", fileName));
+ }
FileOutputStream fos;
// write to a temp file to avoid loss of data in case of crash
- String tempName = fileName + ".temp";
- fos = new FileOutputStream(tempName);
- Writer writer = new OutputStreamWriter(fos, "UTF-8");
- writer.write("\n");
- xStream.toXML(project, writer);
+ String tempName = fileName + ".temp";
+ fos = new FileOutputStream(tempName);
+ Writer writer = new OutputStreamWriter(fos, "UTF-8");
+ writer.write("\n");
+ xStream.toXML(project, writer);
fos.close();
// switch the files at the end
new File(fileName).delete();
- new File(tempName).renameTo(new File(fileName));
- if (!isBackup) {
- this.currentFileName = fileName;
- this.modified = false;
- fireFileStatusChanged();
- }
- }
-
- public Project deserializeProjectFromFile(String fileName, List warnings) throws SAXException, IOException,
- ParserConfigurationException {
- LOG.info(String.format("loadProjectFromFile(%s)", fileName));
- Project project = null;
- File file = new File(fileName);
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.parse(new InputSource(new InputStreamReader(new FileInputStream(file))));
- doc.getDocumentElement().normalize();
- if (doc.getDocumentElement().getNodeName().equals(Project.class.getName()) || doc.getDocumentElement().getNodeName().equals("project")) {
- project = parseV3File(fileName, warnings);
- } else {
- if (!doc.getDocumentElement().getNodeName().equalsIgnoreCase("layout")) {
- throw new IllegalArgumentException("Could not open DIY file. Root node is not named 'Layout'.");
- }
- String formatVersion = doc.getDocumentElement().getAttribute("formatVersion");
-
- // try to find a parser for an older version
- List parsers = getParsers();
- for (int i = 0; i < parsers.size(); i++) {
- if (parsers.get(i).canParse(formatVersion))
- project = parsers.get(i).parseFile(doc.getDocumentElement(), warnings);
- }
-
- if (project == null)
- throw new IllegalArgumentException("Unknown file format version: " + formatVersion);
- }
- Collections.sort(warnings);
- this.currentFileName = fileName;
- this.modified = false;
- return project;
+ new File(tempName).renameTo(new File(fileName));
+ if (!isBackup) {
+ this.currentFileName = fileName;
+ this.modified = false;
+ fireFileStatusChanged();
+ }
+ }
+
+ public Project deserializeProjectFromFile(String fileName, List warnings) throws SAXException, IOException,
+ ParserConfigurationException {
+ LOG.info(String.format("loadProjectFromFile(%s)", fileName));
+ Project project = null;
+ File file = new File(fileName);
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document doc = db.parse(new InputSource(new InputStreamReader(new FileInputStream(file))));
+ doc.getDocumentElement().normalize();
+ if (doc.getDocumentElement().getNodeName().equals(Project.class.getName()) || doc.getDocumentElement().getNodeName().equals("project")) {
+ project = parseV3File(fileName, warnings);
+ } else {
+ if (!doc.getDocumentElement().getNodeName().equalsIgnoreCase("layout")) {
+ throw new IllegalArgumentException("Could not open DIY file. Root node is not named 'Layout'.");
+ }
+ String formatVersion = doc.getDocumentElement().getAttribute("formatVersion");
+
+ // try to find a parser for an older version
+ List parsers = getParsers();
+ for (int i = 0; i < parsers.size(); i++) {
+ if (parsers.get(i).canParse(formatVersion))
+ project = parsers.get(i).parseFile(doc.getDocumentElement(), warnings);
+ }
+
+ if (project == null)
+ throw new IllegalArgumentException("Unknown file format version: " + formatVersion);
+ }
+ Collections.sort(warnings);
+ this.currentFileName = fileName;
+ this.modified = false;
+ return project;
}
public void serializeTestToFile(DIYTest test, String fileName) throws IOException {
@@ -232,26 +233,26 @@ public class ProjectFileManager {
project = (DIYTest) xStream.fromXML(reader);
fis.close();
return project;
- }
-
- public void notifyFileChange() {
- this.modified = true;
- fireFileStatusChanged();
- }
-
- public String getCurrentFileName() {
- return currentFileName;
- }
-
- public boolean isModified() {
- return modified;
- }
-
- public void fireFileStatusChanged() {
- messageDispatcher.dispatchMessage(EventType.FILE_STATUS_CHANGED, getCurrentFileName(), isModified());
- }
-
- private Project parseV3File(String fileName, List warnings) throws IOException {
+ }
+
+ public void notifyFileChange() {
+ this.modified = true;
+ fireFileStatusChanged();
+ }
+
+ public String getCurrentFileName() {
+ return currentFileName;
+ }
+
+ public boolean isModified() {
+ return modified;
+ }
+
+ public void fireFileStatusChanged() {
+ messageDispatcher.dispatchMessage(EventType.FILE_STATUS_CHANGED, getCurrentFileName(), isModified());
+ }
+
+ private Project parseV3File(String fileName, List warnings) throws IOException {
Project project;
VersionNumber fileVersion;
try {
@@ -260,24 +261,24 @@ public class ProjectFileManager {
warnings.add("The file is created with a newer version of DIYLC and may contain features that are not supported by your version of DIYLC. Please update.");
} catch (Exception e) {
warnings.add("Could not read file version number, the file may be corrupted.");
- }
+ }
FileInputStream fis = new FileInputStream(fileName);
- missingFields.clear();
- try {
- Reader reader = new InputStreamReader(fis, "UTF-8");
- project = (Project) xStream.fromXML(reader);
- } catch (Exception e) {
- LOG.warn("Could not open with the new xStream, trying the old one", e);
- fis.close();
- fis = new FileInputStream(fileName);
- project = (Project) xStreamOld.fromXML(fis);
+ missingFields.clear();
+ try {
+ Reader reader = new InputStreamReader(fis, "UTF-8");
+ project = (Project) xStream.fromXML(reader);
+ } catch (Exception e) {
+ LOG.warn("Could not open with the new xStream, trying the old one", e);
+ fis.close();
+ fis = new FileInputStream(fileName);
+ project = (Project) xStreamOld.fromXML(fis);
}
if (!missingFields.isEmpty()) {
LOG.warn("The opened file is missing the following properties: " + String.join(", ", missingFields));
warnings.add("The project references unknown component properties, most likely because it was created with a newer version of DIYLC.");
- }
- fis.close();
- return project;
+ }
+ fis.close();
+ return project;
}
private VersionNumber readV3Version(String fileName) throws Exception {
@@ -308,5 +309,5 @@ public class ProjectFileManager {
public XStream getXStream() {
return xStream;
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/test/Snapshot.java b/diylc/diylc-core/src/main/java/org/diylc/test/Snapshot.java
index c8b68c55..47808f83 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/test/Snapshot.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/test/Snapshot.java
@@ -3,6 +3,7 @@ package org.diylc.test;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
+
import org.diylc.core.IDIYComponent;
import org.diylc.core.Project;
import org.diylc.presenter.ComponentArea;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/test/TestPlayer.java b/diylc/diylc-core/src/main/java/org/diylc/test/TestPlayer.java
index beb0008e..e6cf453b 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/test/TestPlayer.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/test/TestPlayer.java
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
+
import org.diylc.common.ComponentType;
import org.diylc.common.IPlugInPort;
import org.diylc.core.Template;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/BomEntry.java b/diylc/diylc-core/src/main/java/org/diylc/utils/BomEntry.java
index 2794e3ed..db9a742a 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/BomEntry.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/BomEntry.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.utils;
public class BomEntry {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/BomMaker.java b/diylc/diylc-core/src/main/java/org/diylc/utils/BomMaker.java
index 2d82ba1f..98f549a0 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/BomMaker.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/BomMaker.java
@@ -1,37 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.utils;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.diylc.common.ComponentType;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.annotations.BomPolicy;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.diylc.common.ComponentType;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.annotations.BomPolicy;
import org.diylc.presenter.ComponentProcessor;
public class BomMaker {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java b/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java
index 49ec82f9..7d71e266 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java
@@ -19,28 +19,29 @@
along with DIYLC. If not, see .
*/
-package org.diylc.utils;
-
+package org.diylc.utils;
+
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Stroke;
import java.awt.Toolkit;
-import org.diylc.core.Theme;
-
-public class Constants {
-
- public static final int PIXELS_PER_INCH = 200;
- public static final double PIXEL_SIZE = 1d * PIXELS_PER_INCH / Toolkit.getDefaultToolkit().getScreenResolution();
-
- public static Color CANVAS_COLOR = Color.white;
-
- public static final Stroke DASHED_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10f,
- new float[] {2.0f, 4.0f}, 0.0f);
-
+
+import org.diylc.core.Theme;
+
+public class Constants {
+
+ public static final int PIXELS_PER_INCH = 200;
+ public static final double PIXEL_SIZE = 1d * PIXELS_PER_INCH / Toolkit.getDefaultToolkit().getScreenResolution();
+
+ public static Color CANVAS_COLOR = Color.white;
+
+ public static final Stroke DASHED_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10f,
+ new float[] {2.0f, 4.0f}, 0.0f);
+
public static final Theme DEFAULT_THEME = new Theme("Light", Constants.CANVAS_COLOR, new Color(240, 240, 240), new Color(200, 200, 200),
- Color.black);
-
- public static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
-
- public static final Color MULTI_VALUE_COLOR = Color.yellow;
-}
+ Color.black);
+
+ public static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
+
+ public static final Color MULTI_VALUE_COLOR = Color.yellow;
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/KeywordExtractor.java b/diylc/diylc-core/src/main/java/org/diylc/utils/KeywordExtractor.java
index 552c5c68..1b7f1027 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/KeywordExtractor.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/KeywordExtractor.java
@@ -1,32 +1,33 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.utils;
-import java.util.HashSet;
-import java.util.Set;
-import org.diylc.common.ComponentType;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.KeywordPolicy;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.diylc.common.ComponentType;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.KeywordPolicy;
import org.diylc.presenter.ComponentProcessor;
public class KeywordExtractor {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/MemoryCleaner.java b/diylc/diylc-core/src/main/java/org/diylc/utils/MemoryCleaner.java
index a29be829..614f3bc4 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/MemoryCleaner.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/MemoryCleaner.java
@@ -1,30 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.utils;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collection;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collection;
import org.apache.log4j.Logger;
public class MemoryCleaner {
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/Pair.java b/diylc/diylc-core/src/main/java/org/diylc/utils/Pair.java
index 5fc1d3bf..21622baa 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/Pair.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/Pair.java
@@ -19,25 +19,25 @@
along with DIYLC. If not, see .
*/
-package org.diylc.utils;
-
-public class Pair {
-
- private A first;
- private B second;
-
- public Pair(A first, B second) {
- super();
- this.first = first;
- this.second = second;
- }
-
- public A getFirst() {
- return first;
- }
-
- public B getSecond() {
- return second;
+package org.diylc.utils;
+
+public class Pair {
+
+ private A first;
+ private B second;
+
+ public Pair(A first, B second) {
+ super();
+ this.first = first;
+ this.second = second;
+ }
+
+ public A getFirst() {
+ return first;
+ }
+
+ public B getSecond() {
+ return second;
}
public void setFirst(A first) {
@@ -78,5 +78,5 @@ public class Pair {
} else if (!second.equals(other.second))
return false;
return true;
- }
-}
+ }
+}
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/ReflectionUtils.java b/diylc/diylc-core/src/main/java/org/diylc/utils/ReflectionUtils.java
index e5831faa..e797334f 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/ReflectionUtils.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/ReflectionUtils.java
@@ -29,6 +29,7 @@ import java.util.List;
import java.util.Set;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.Utils;
+
import org.diylc.core.annotations.IAutoCreator;
import org.diylc.netlist.INetlistParser;
import org.diylc.presenter.Presenter;
diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/VersionReader.java b/diylc/diylc-core/src/main/java/org/diylc/utils/VersionReader.java
index a33cb17f..472213d9 100644
--- a/diylc/diylc-core/src/main/java/org/diylc/utils/VersionReader.java
+++ b/diylc/diylc-core/src/main/java/org/diylc/utils/VersionReader.java
@@ -7,11 +7,13 @@ import java.text.SimpleDateFormat;
import java.util.List;
import org.diylc.appframework.update.Change;
import org.diylc.appframework.update.Version;
-import org.diylc.presenter.Presenter;
+
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
+import org.diylc.presenter.Presenter;
+
public class VersionReader {
public static void main(String[] args) {
try {
diff --git a/diylc/diylc-core/src/test/java/org/diylc/AllTests.java b/diylc/diylc-core/src/test/java/org/diylc/AllTests.java
index 0188c725..4496e9f5 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/AllTests.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/AllTests.java
@@ -19,17 +19,18 @@
along with DIYLC. If not, see .
*/
-package org.diylc;
-
-import org.diylc.plugins.file.BomMakerTest;
-import org.diylc.presenter.ClassProcessorTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-
-@RunWith(Suite.class)
-@SuiteClasses({BomMakerTest.class, ClassProcessorTest.class})
-public class AllTests {
-
-}
+package org.diylc;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import org.diylc.plugins.file.BomMakerTest;
+import org.diylc.presenter.ClassProcessorTest;
+
+
+@RunWith(Suite.class)
+@SuiteClasses({BomMakerTest.class, ClassProcessorTest.class})
+public class AllTests {
+
+}
diff --git a/diylc/diylc-core/src/test/java/org/diylc/core/gerber/GerberPathRendererTest.java b/diylc/diylc-core/src/test/java/org/diylc/core/gerber/GerberPathRendererTest.java
index 84d7c6c8..c574e46b 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/core/gerber/GerberPathRendererTest.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/core/gerber/GerberPathRendererTest.java
@@ -11,6 +11,8 @@ import org.junit.Test;
import com.bancika.gerberwriter.DataLayer;
import com.bancika.gerberwriter.GenerationSoftware;
+import org.diylc.core.gerber.GerberPathRenderer;
+
public class GerberPathRendererTest {
@Test
@@ -20,7 +22,7 @@ public class GerberPathRendererTest {
Shape shape = textToShape(text, font);
DataLayer dataLayer = new DataLayer("Copper.Top", false, new GenerationSoftware("v", "a", "ver"));
GerberPathRenderer.outputPathArea(shape.getPathIterator(null), dataLayer, 0.1, false, "Conductor");
- dataLayer.dumpGerberToFile(font + text + ".gbr");
+// dataLayer.dumpGerberToFile(font + text + ".gbr");
}
private Shape textToShape(String text, String font) {
diff --git a/diylc/diylc-core/src/test/java/org/diylc/netlist/TreeAsciiUtilTest.java b/diylc/diylc-core/src/test/java/org/diylc/netlist/TreeAsciiUtilTest.java
index ee1df9e1..8868d801 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/netlist/TreeAsciiUtilTest.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/netlist/TreeAsciiUtilTest.java
@@ -8,6 +8,8 @@ import java.util.List;
import org.junit.Test;
+import org.diylc.netlist.TreeAsciiUtil;
+
public class TreeAsciiUtilTest {
@Test
diff --git a/diylc/diylc-core/src/test/java/org/diylc/plugins/file/BomMakerTest.java b/diylc/diylc-core/src/test/java/org/diylc/plugins/file/BomMakerTest.java
index d6f9747e..269b35e4 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/plugins/file/BomMakerTest.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/plugins/file/BomMakerTest.java
@@ -1,41 +1,42 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.plugins.file;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-
+
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
-
+
+import org.junit.Test;
+
import org.diylc.core.IDIYComponent;
import org.diylc.core.measures.Capacitance;
import org.diylc.core.measures.CapacitanceUnit;
-import org.diylc.testcomponents.MockDIYComponent;
import org.diylc.utils.BomEntry;
import org.diylc.utils.BomMaker;
-import org.junit.Test;
+import org.diylc.testcomponents.MockDIYComponent;
public class BomMakerTest {
@@ -49,12 +50,12 @@ public class BomMakerTest {
components.add(new MockDIYComponent());
List bom = BomMaker.getInstance().createBom(components);
assertNotNull(bom);
- assertEquals(2, bom.size());
- Collections.sort(bom, new Comparator() {
-
- @Override
- public int compare(BomEntry o1, BomEntry o2) {
- return o1.getQuantity().compareTo(o2.getQuantity());
+ assertEquals(2, bom.size());
+ Collections.sort(bom, new Comparator() {
+
+ @Override
+ public int compare(BomEntry o1, BomEntry o2) {
+ return o1.getQuantity().compareTo(o2.getQuantity());
}});
BomEntry entry1 = bom.get(0);
assertEquals("something", entry1.getName());
diff --git a/diylc/diylc-core/src/test/java/org/diylc/presenter/CalcUtilsTest.java b/diylc/diylc-core/src/test/java/org/diylc/presenter/CalcUtilsTest.java
index 9a868739..611162aa 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/presenter/CalcUtilsTest.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/presenter/CalcUtilsTest.java
@@ -2,9 +2,11 @@ package org.diylc.presenter;
import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
-import org.junit.Test;
+import org.diylc.presenter.CalcUtils;
public class CalcUtilsTest {
diff --git a/diylc/diylc-core/src/test/java/org/diylc/presenter/ClassProcessorTest.java b/diylc/diylc-core/src/test/java/org/diylc/presenter/ClassProcessorTest.java
index d1401f1a..df646c06 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/presenter/ClassProcessorTest.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/presenter/ClassProcessorTest.java
@@ -19,24 +19,26 @@
along with DIYLC. If not, see .
*/
-package org.diylc.presenter;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.List;
-
-import org.diylc.common.PropertyWrapper;
-import org.diylc.testcomponents.MockDIYComponent;
-import org.junit.Test;
-
-
-public class ClassProcessorTest {
-
- @Test
- public void testExtractProperties() {
- List properties = ComponentProcessor.getInstance().extractProperties(MockDIYComponent.class);
- assertNotNull(properties);
- assertEquals(5, properties.size());
- };
-}
+package org.diylc.presenter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import org.diylc.common.PropertyWrapper;
+import org.diylc.presenter.ComponentProcessor;
+import org.diylc.testcomponents.MockDIYComponent;
+
+
+public class ClassProcessorTest {
+
+ @Test
+ public void testExtractProperties() {
+ List properties = ComponentProcessor.getInstance().extractProperties(MockDIYComponent.class);
+ assertNotNull(properties);
+ assertEquals(5, properties.size());
+ };
+}
diff --git a/diylc/diylc-core/src/test/java/org/diylc/testcomponents/MockDIYComponent.java b/diylc/diylc-core/src/test/java/org/diylc/testcomponents/MockDIYComponent.java
index 22e06c01..eba2319b 100644
--- a/diylc/diylc-core/src/test/java/org/diylc/testcomponents/MockDIYComponent.java
+++ b/diylc/diylc-core/src/test/java/org/diylc/testcomponents/MockDIYComponent.java
@@ -1,44 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.testcomponents;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Point;
-import java.awt.geom.Point2D;
-
-import org.diylc.components.AbstractComponent;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Capacitance;
-import org.diylc.core.measures.CapacitanceUnit;
-import org.diylc.core.measures.Resistance;
-import org.diylc.core.measures.ResistanceUnit;
-import org.diylc.core.measures.Size;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.geom.Point2D;
+
+import org.diylc.components.AbstractComponent;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Capacitance;
+import org.diylc.core.measures.CapacitanceUnit;
+import org.diylc.core.measures.Resistance;
+import org.diylc.core.measures.ResistanceUnit;
+import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Mock", author = "bancika", category = "Sample", instanceNamePrefix = "M",
@@ -164,10 +164,10 @@ public class MockDIYComponent extends AbstractComponent {
@Override
public void drawIcon(Graphics2D g2d, int width, int height) {
g2d.drawString("X", 10, 10);
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
}
}
diff --git a/diylc/diylc-core/target/classes/org/diylc/announcements/AnnouncementProvider.class b/diylc/diylc-core/target/classes/org/diylc/announcements/AnnouncementProvider.class
index ae0d5279..4dc02576 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/announcements/AnnouncementProvider.class and b/diylc/diylc-core/target/classes/org/diylc/announcements/AnnouncementProvider.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferable.class b/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferable.class
index 8740d196..8af665ec 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferable.class and b/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferable.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferableFactory.class b/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferableFactory.class
index 3ad15182..8069092a 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferableFactory.class and b/diylc/diylc-core/target/classes/org/diylc/clipboard/ComponentTransferableFactory.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlock.class b/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlock.class
index 37ce6621..77f9ee45 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlock.class and b/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlock.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlockPackage.class b/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlockPackage.class
index 5b5ae3c6..04594791 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlockPackage.class and b/diylc/diylc-core/target/classes/org/diylc/common/BuildingBlockPackage.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/ComponentType.class b/diylc/diylc-core/target/classes/org/diylc/common/ComponentType.class
index 49337298..c84293d7 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/ComponentType.class and b/diylc/diylc-core/target/classes/org/diylc/common/ComponentType.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/DefaultComponentTransformer.class b/diylc/diylc-core/target/classes/org/diylc/common/DefaultComponentTransformer.class
index e9a01a11..5eb1fd00 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/DefaultComponentTransformer.class and b/diylc/diylc-core/target/classes/org/diylc/common/DefaultComponentTransformer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/EventType.class b/diylc/diylc-core/target/classes/org/diylc/common/EventType.class
index 440b91f1..e463c841 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/EventType.class and b/diylc/diylc-core/target/classes/org/diylc/common/EventType.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/IVariantProcessor$VariantAlreadyExistsException.class b/diylc/diylc-core/target/classes/org/diylc/common/IVariantProcessor$VariantAlreadyExistsException.class
index f53b608e..d5eda285 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/IVariantProcessor$VariantAlreadyExistsException.class and b/diylc/diylc-core/target/classes/org/diylc/common/IVariantProcessor$VariantAlreadyExistsException.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/PropertyWrapper.class b/diylc/diylc-core/target/classes/org/diylc/common/PropertyWrapper.class
index a661a968..15f6ebf2 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/PropertyWrapper.class and b/diylc/diylc-core/target/classes/org/diylc/common/PropertyWrapper.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/common/VariantPackage.class b/diylc/diylc-core/target/classes/org/diylc/common/VariantPackage.class
index 4241282b..493453fb 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/common/VariantPackage.class and b/diylc/diylc-core/target/classes/org/diylc/common/VariantPackage.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent$1.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent$1.class
index d1700953..731811ba 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent$1.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent.class
index 7042dcb9..435864b3 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractAngledComponent.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractComponent.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractComponent.class
index 1e444c7e..55157029 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractComponent.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractComponent.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$1.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$1.class
index 900c472d..8dc2aa7e 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$1.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$PointCount.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$PointCount.class
index b90deae0..a50d3ed8 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$PointCount.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent$PointCount.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent.class b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent.class
index 122066b5..06fb5a69 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent.class and b/diylc/diylc-core/target/classes/org/diylc/components/AbstractCurvedComponent.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/transform/DefaultTransformer.class b/diylc/diylc-core/target/classes/org/diylc/components/transform/DefaultTransformer.class
index a6e217d5..e0af43b2 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/transform/DefaultTransformer.class and b/diylc/diylc-core/target/classes/org/diylc/components/transform/DefaultTransformer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/transform/LeadedComponentTransformer.class b/diylc/diylc-core/target/classes/org/diylc/components/transform/LeadedComponentTransformer.class
index 445405b1..b3ea0e43 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/transform/LeadedComponentTransformer.class and b/diylc/diylc-core/target/classes/org/diylc/components/transform/LeadedComponentTransformer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/components/transform/SimpleComponentTransformer.class b/diylc/diylc-core/target/classes/org/diylc/components/transform/SimpleComponentTransformer.class
index 04c6c75f..e834fb24 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/components/transform/SimpleComponentTransformer.class and b/diylc/diylc-core/target/classes/org/diylc/components/transform/SimpleComponentTransformer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/Project$SpacingValidator.class b/diylc/diylc-core/target/classes/org/diylc/core/Project$SpacingValidator.class
index d8144536..5644b041 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/Project$SpacingValidator.class and b/diylc/diylc-core/target/classes/org/diylc/core/Project$SpacingValidator.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/Project.class b/diylc/diylc-core/target/classes/org/diylc/core/Project.class
index c48ec0ce..a383016a 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/Project.class and b/diylc/diylc-core/target/classes/org/diylc/core/Project.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberExporter.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberExporter.class
index e8cc3dce..05c5fc1d 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberExporter.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberExporter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper$GerberProperties.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper$GerberProperties.class
index 80b1e742..a9692f0b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper$GerberProperties.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper$GerberProperties.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper.class
index 426bc926..062d6a42 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberG2DWrapper.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer$PathWithNegative.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer$PathWithNegative.class
index 858e1270..6242a8c9 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer$PathWithNegative.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer$PathWithNegative.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer.class
index f661a884..b370add7 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/GerberPathRenderer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/gerber/IGerberComponentCustom.class b/diylc/diylc-core/target/classes/org/diylc/core/gerber/IGerberComponentCustom.class
index ba09b934..7b3d6435 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/gerber/IGerberComponentCustom.class and b/diylc/diylc-core/target/classes/org/diylc/core/gerber/IGerberComponentCustom.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance$1.class b/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance$1.class
index 3a1d7a51..50c1dbfa 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance$1.class and b/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance.class b/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance.class
index caee5a29..8aeb3389 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance.class and b/diylc/diylc-core/target/classes/org/diylc/core/measures/Resistance.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/lang/LangUtil.class b/diylc/diylc-core/target/classes/org/diylc/lang/LangUtil.class
index 6ec4f02c..17532fe4 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/lang/LangUtil.class and b/diylc/diylc-core/target/classes/org/diylc/lang/LangUtil.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser$1.class b/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser$1.class
index c26e301a..23816fff 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser$1.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser.class b/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser.class
index afdcfbde..ed1a438b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/AbstractNetlistParser.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph$ContinuityNode.class b/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph$ContinuityNode.class
index 6d39c977..183904b1 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph$ContinuityNode.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph$ContinuityNode.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph.class b/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph.class
index 290d6762..27ad09f6 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/ContinuityGraph.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/Group.class b/diylc/diylc-core/target/classes/org/diylc/netlist/Group.class
index 3cf1755f..0665d530 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/Group.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/Group.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/Netlist.class b/diylc/diylc-core/target/classes/org/diylc/netlist/Netlist.class
index 54642b24..81e85dd7 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/Netlist.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/Netlist.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistAnalyzer.class b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistAnalyzer.class
index df545b0a..ebf00650 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistAnalyzer.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistAnalyzer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$1.class b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$1.class
index 784cc4f8..d5b4d3e8 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$1.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$ProjectGraphNode.class b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$ProjectGraphNode.class
index 7a0817ea..bf42d068 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$ProjectGraphNode.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder$ProjectGraphNode.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder.class b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder.class
index 45c2a017..534f6efd 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/NetlistBuilder.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/Node.class b/diylc/diylc-core/target/classes/org/diylc/netlist/Node.class
index 8c2e9cdd..7c6d629d 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/Node.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/Node.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/netlist/TreeLeaf.class b/diylc/diylc-core/target/classes/org/diylc/netlist/TreeLeaf.class
index cb1cb205..613de052 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/netlist/TreeLeaf.class and b/diylc/diylc-core/target/classes/org/diylc/netlist/TreeLeaf.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/model/ProjectEntity.class b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/model/ProjectEntity.class
index 549eb577..6afd663b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/model/ProjectEntity.class and b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/model/ProjectEntity.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/CloudPresenter.class b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/CloudPresenter.class
index 3438233f..f08d82cc 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/CloudPresenter.class and b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/CloudPresenter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/SearchSession.class b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/SearchSession.class
index 93c9b591..0b54fce9 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/SearchSession.class and b/diylc/diylc-core/target/classes/org/diylc/plugins/cloud/presenter/SearchSession.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager$1.class
index da7ce0ff..303451da 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager.class b/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager.class
index fdf61cd9..36e7b564 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/BuildingBlockManager.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/CalcUtils.class b/diylc/diylc-core/target/classes/org/diylc/presenter/CalcUtils.class
index 30327e8f..4c4d2c11 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/CalcUtils.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/CalcUtils.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$1.class
index e5bcfb43..bf087cfe 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$2.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$2.class
index 2a4f265b..474daadb 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$2.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$2.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$3.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$3.class
index bc01889d..3f138d36 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$3.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$3.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$4.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$4.class
index e637201c..36689464 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$4.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$4.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$5.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$5.class
index 7e584d05..563e5c59 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$5.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$5.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$6.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$6.class
index ef517841..cda6f70c 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$6.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory$6.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory.class
index 0f6cbcf3..0b0a4547 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComparatorFactory.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ComponentProcessor.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ComponentProcessor.class
index 8f4b38cf..6dd4468f 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ComponentProcessor.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ComponentProcessor.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/ContinuityArea.class b/diylc/diylc-core/target/classes/org/diylc/presenter/ContinuityArea.class
index 36087262..6ac42e89 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/ContinuityArea.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/ContinuityArea.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/DatasheetService.class b/diylc/diylc-core/target/classes/org/diylc/presenter/DatasheetService.class
index d327bc11..05ec58a2 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/DatasheetService.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/DatasheetService.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache$CacheValue.class b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache$CacheValue.class
index a86567ef..97bb1dab 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache$CacheValue.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache$CacheValue.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache.class b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache.class
index 3cffc6e3..d544f5a8 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingCache.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingManager.class b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingManager.class
index a838c423..4fbc883b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingManager.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/DrawingManager.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper$1.class
index 9b7a2467..910defe6 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper.class b/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper.class
index 9b1b9da4..82bf2d86 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/G2DWrapper.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager$1.class
index f53c9d1d..722adb2f 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager.class b/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager.class
index e60f7433..0f4abe13 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/InstantiationManager.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/PCBLayerFilter.class b/diylc/diylc-core/target/classes/org/diylc/presenter/PCBLayerFilter.class
index 7eba1e70..7c804b1d 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/PCBLayerFilter.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/PCBLayerFilter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$1.class
index 293edeb0..65a37fb4 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$2.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$2.class
index 34ad4866..869a70ba 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$2.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$2.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$3.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$3.class
index 7673fa58..5037e272 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$3.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$3.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$4.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$4.class
index a1001fff..a062be1a 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$4.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$4.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$5.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$5.class
index 74506d36..6307d3d3 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$5.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$5.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$6.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$6.class
index de1b9ca7..41cc49a1 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$6.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$6.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$7.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$7.class
index 4eeb2054..46793da6 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$7.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter$7.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter.class b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter.class
index b1849f3d..f5c1a6e5 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/Presenter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager$1.class b/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager$1.class
index 592b6b6f..1725bb08 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager$1.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager.class b/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager.class
index 77ab6a65..7504822f 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager.class and b/diylc/diylc-core/target/classes/org/diylc/presenter/VariantManager.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/serialization/MeasureConverter.class b/diylc/diylc-core/target/classes/org/diylc/serialization/MeasureConverter.class
index af1f0b20..9be96892 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/serialization/MeasureConverter.class and b/diylc/diylc-core/target/classes/org/diylc/serialization/MeasureConverter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/serialization/PointConverter.class b/diylc/diylc-core/target/classes/org/diylc/serialization/PointConverter.class
index d0ec3972..3fe22b4c 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/serialization/PointConverter.class and b/diylc/diylc-core/target/classes/org/diylc/serialization/PointConverter.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1$1.class b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1$1.class
index 70276c10..6511dcd6 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1$1.class and b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1.class b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1.class
index 767d0969..730e8aa7 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1.class and b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager.class b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager.class
index 39f43ec8..3b5ea80c 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager.class and b/diylc/diylc-core/target/classes/org/diylc/serialization/ProjectFileManager.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/test/Snapshot.class b/diylc/diylc-core/target/classes/org/diylc/test/Snapshot.class
index 8119acc4..1aefb2be 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/test/Snapshot.class and b/diylc/diylc-core/target/classes/org/diylc/test/Snapshot.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer$StepResult.class b/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer$StepResult.class
index b07678a4..d7f9e64b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer$StepResult.class and b/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer$StepResult.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer.class b/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer.class
index 537e59a4..ee227648 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer.class and b/diylc/diylc-core/target/classes/org/diylc/test/TestPlayer.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker$1.class b/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker$1.class
index e2d23c74..cf7f95f0 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker$1.class and b/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker.class b/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker.class
index 899f7ced..5c2aa30b 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker.class and b/diylc/diylc-core/target/classes/org/diylc/utils/BomMaker.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/Constants.class b/diylc/diylc-core/target/classes/org/diylc/utils/Constants.class
index fcce582e..94f4ef76 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/Constants.class and b/diylc/diylc-core/target/classes/org/diylc/utils/Constants.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/KeywordExtractor.class b/diylc/diylc-core/target/classes/org/diylc/utils/KeywordExtractor.class
index 5eb9f9e4..301e31a6 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/KeywordExtractor.class and b/diylc/diylc-core/target/classes/org/diylc/utils/KeywordExtractor.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils$1.class b/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils$1.class
index c3c38ffc..fc235ae2 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils$1.class and b/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils$1.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils.class b/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils.class
index a05f189f..382ed845 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils.class and b/diylc/diylc-core/target/classes/org/diylc/utils/ReflectionUtils.class differ
diff --git a/diylc/diylc-core/target/classes/org/diylc/utils/VersionReader.class b/diylc/diylc-core/target/classes/org/diylc/utils/VersionReader.class
index 7b126e67..680d41ef 100644
Binary files a/diylc/diylc-core/target/classes/org/diylc/utils/VersionReader.class and b/diylc/diylc-core/target/classes/org/diylc/utils/VersionReader.class differ
diff --git a/diylc/diylc-library/.project b/diylc/diylc-library/.project
index 0602154b..0f0c953c 100644
--- a/diylc/diylc-library/.project
+++ b/diylc/diylc-library/.project
@@ -10,8 +10,14 @@
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+ org.eclipse.m2e.core.maven2Nature
org.eclipse.jdt.core.javanature
diff --git a/diylc/diylc-library/build.xml b/diylc/diylc-library/build.xml
index 70bb7b4f..35600c23 100644
--- a/diylc/diylc-library/build.xml
+++ b/diylc/diylc-library/build.xml
@@ -17,7 +17,7 @@
Compile with JDK ${java.runtime.version}
-
+
diff --git a/diylc/diylc-library/lib/diylc-core.jar b/diylc/diylc-library/lib/diylc-core.jar
index 50da0068..2144c74e 100644
Binary files a/diylc/diylc-library/lib/diylc-core.jar and b/diylc/diylc-library/lib/diylc-core.jar differ
diff --git a/diylc/diylc-library/pom.xml b/diylc/diylc-library/pom.xml
index 01ada803..507199dc 100644
--- a/diylc/diylc-library/pom.xml
+++ b/diylc/diylc-library/pom.xml
@@ -53,6 +53,11 @@
poi
3.5-FINAL
+
+ junit
+ junit
+ test
+
diff --git a/diylc/diylc-library/src/main/java/org/diylc/awt/StringUtils.java b/diylc/diylc-library/src/main/java/org/diylc/awt/StringUtils.java
index c88eedc7..0b4558c5 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/awt/StringUtils.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/awt/StringUtils.java
@@ -32,6 +32,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
+
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.VerticalAlignment;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/Abstract3LegSymbol.java b/diylc/diylc-library/src/main/java/org/diylc/components/Abstract3LegSymbol.java
index a131aedc..0c53468d 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/Abstract3LegSymbol.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/Abstract3LegSymbol.java
@@ -1,52 +1,54 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components;
-import java.awt.Color;
-import java.awt.FontMetrics;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.awt.StringUtils;
-import org.diylc.common.Display;
-import org.diylc.common.HorizontalAlignment;
-import org.diylc.common.IPlugInPort;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.Orientation;
-import org.diylc.common.VerticalAlignment;
-import org.diylc.components.semiconductors.SymbolFlipping;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.Theme;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.awt.StringUtils;
+import org.diylc.common.Display;
+import org.diylc.common.HorizontalAlignment;
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.ObjectCache;
+import org.diylc.common.Orientation;
+import org.diylc.common.VerticalAlignment;
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.semiconductors.SymbolFlipping;
+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;
public abstract class Abstract3LegSymbol extends AbstractComponent {
@@ -61,26 +63,26 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
protected SymbolFlipping flip = SymbolFlipping.NONE;
protected Display display = Display.NAME;
transient protected Shape[] body;
- protected Orientation orientation = Orientation.DEFAULT;
+ protected Orientation orientation = Orientation.DEFAULT;
protected boolean moveLabel = false;
public Abstract3LegSymbol() {
super();
- updateControlPoints();
+ updateControlPoints();
controlPoints[3] = getDefaultLabelPosition(controlPoints);
- }
-
- public Point2D[] getControlPoints() {
- if (controlPoints.length == 3) {
- controlPoints = new Point2D[] { controlPoints[0], controlPoints[1], controlPoints[2], getDefaultLabelPosition(controlPoints) };
- }
- return controlPoints;
- }
-
- protected Point2D getDefaultLabelPosition(Point2D[] oldControlPoints) {
- int f = flip == SymbolFlipping.X ? -1 : 1;
- int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
- return new Point2D.Double(oldControlPoints[0].getX() + f * (PIN_SPACING.convertToPixels() * 1.5 + d), oldControlPoints[0].getY());
+ }
+
+ public Point2D[] getControlPoints() {
+ if (controlPoints.length == 3) {
+ controlPoints = new Point2D[] { controlPoints[0], controlPoints[1], controlPoints[2], getDefaultLabelPosition(controlPoints) };
+ }
+ return controlPoints;
+ }
+
+ protected Point2D getDefaultLabelPosition(Point2D[] oldControlPoints) {
+ int f = flip == SymbolFlipping.X ? -1 : 1;
+ int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
+ return new Point2D.Double(oldControlPoints[0].getX() + f * (PIN_SPACING.convertToPixels() * 1.5 + d), oldControlPoints[0].getY());
}
@Override
@@ -102,13 +104,13 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
}
g2d.setColor(finalColor);
- if (this.body == null) {
- this.body = getBody();
- applyOrientation(this.body);
+ if (this.body == null) {
+ this.body = getBody();
+ applyOrientation(this.body);
}
- AffineTransform old = g2d.getTransform();
-
+ AffineTransform old = g2d.getTransform();
+
Point2D[] controlPoints = getControlPoints();
if (this.flip == SymbolFlipping.Y) {
@@ -121,14 +123,14 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
g2d.translate(-1 * controlPoints[0].getX(), 0);
}
- g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(2));
+ g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(2));
if (body[0] != null)
g2d.draw(body[0]);
- g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
+ g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
if (body[1] != null)
g2d.draw(body[1]);
-
+
if (body[2] != null)
g2d.fill(body[2]);
g2d.setTransform(old);
@@ -158,24 +160,24 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
}
FontMetrics fontMetrics = g2d.getFontMetrics();
- Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
- Rectangle shapeRect = null;;
- for (int i = 0; i < 3; i++)
- if (body[i] != null) {
- Rectangle bounds = body[i].getBounds();
- if (shapeRect == null)
- shapeRect = bounds;
- else
- shapeRect = shapeRect.union(bounds);
- }
-
- if (getMoveLabel()) {
- StringUtils.drawCenteredText(g2d, label, controlPoints[3].getX(), controlPoints[3].getY(), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
- : HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
+ Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
+ Rectangle shapeRect = null;;
+ for (int i = 0; i < 3; i++)
+ if (body[i] != null) {
+ Rectangle bounds = body[i].getBounds();
+ if (shapeRect == null)
+ shapeRect = bounds;
+ else
+ shapeRect = shapeRect.union(bounds);
+ }
+
+ if (getMoveLabel()) {
+ StringUtils.drawCenteredText(g2d, label, controlPoints[3].getX(), controlPoints[3].getY(), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
+ : HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
} else {
StringUtils.drawCenteredText(g2d, label, getLabelX(shapeRect, textRect, fontMetrics, outlineMode),
getLabelY(shapeRect, textRect, fontMetrics, outlineMode), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
- : HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
+ : HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
}
}
@@ -197,44 +199,44 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
protected double getLabelY(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
return getControlPoints()[0].getY();
- }
-
- protected void setDefaultPointLocations(Point2D[] controlPoints, int pinSpacing, double x, double y) {
- controlPoints[1].setLocation(x + pinSpacing * 2, y - pinSpacing * 2);
- controlPoints[2].setLocation(x + pinSpacing * 2, y + pinSpacing * 2);
- controlPoints[3].setLocation(x + pinSpacing * 2, y);
+ }
+
+ protected void setDefaultPointLocations(Point2D[] controlPoints, int pinSpacing, double x, double y) {
+ controlPoints[1].setLocation(x + pinSpacing * 2, y - pinSpacing * 2);
+ controlPoints[2].setLocation(x + pinSpacing * 2, y + pinSpacing * 2);
+ controlPoints[3].setLocation(x + pinSpacing * 2, y);
}
protected void updateControlPoints() {
- int pinSpacing = (int) PIN_SPACING.convertToPixels();
- Point2D[] controlPoints = getControlPoints();
+ int pinSpacing = (int) PIN_SPACING.convertToPixels();
+ Point2D[] controlPoints = getControlPoints();
double x = controlPoints[0].getX();
double y = controlPoints[0].getY();
-
- setDefaultPointLocations(controlPoints, pinSpacing, x, y);
-
- // apply rotation if needed
- if (getOrientation() != Orientation.DEFAULT)
- {
- Point2D first = controlPoints[0];
- double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
- AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.getX(), first.getY());
- for (int i = 1; i < controlPoints.length; i++) {
- rotate.transform(controlPoints[i], controlPoints[i]);
- }
- }
-
- // flip at the end
- if (flip == SymbolFlipping.X) {
- controlPoints[1].setLocation(controlPoints[0].getX() - (controlPoints[1].getX() - controlPoints[0].getX()), controlPoints[1].getY());
- controlPoints[2].setLocation(controlPoints[0].getX() - (controlPoints[2].getX() - controlPoints[0].getX()), controlPoints[2].getY());
- controlPoints[3].setLocation(controlPoints[0].getX() - (controlPoints[3].getX() - controlPoints[0].getX()), controlPoints[3].getY());
- }
- if (flip == SymbolFlipping.Y) {
- controlPoints[1].setLocation(controlPoints[1].getX(), controlPoints[0].getY() - (controlPoints[1].getY() - controlPoints[0].getY()));
- controlPoints[2].setLocation(controlPoints[2].getX(), controlPoints[0].getY() - (controlPoints[2].getY() - controlPoints[0].getY()));
- controlPoints[3].setLocation(controlPoints[3].getX(), controlPoints[0].getY() - (controlPoints[3].getY() - controlPoints[0].getY()));
+
+ setDefaultPointLocations(controlPoints, pinSpacing, x, y);
+
+ // apply rotation if needed
+ if (getOrientation() != Orientation.DEFAULT)
+ {
+ Point2D first = controlPoints[0];
+ double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
+ AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.getX(), first.getY());
+ for (int i = 1; i < controlPoints.length; i++) {
+ rotate.transform(controlPoints[i], controlPoints[i]);
+ }
+ }
+
+ // flip at the end
+ if (flip == SymbolFlipping.X) {
+ controlPoints[1].setLocation(controlPoints[0].getX() - (controlPoints[1].getX() - controlPoints[0].getX()), controlPoints[1].getY());
+ controlPoints[2].setLocation(controlPoints[0].getX() - (controlPoints[2].getX() - controlPoints[0].getX()), controlPoints[2].getY());
+ controlPoints[3].setLocation(controlPoints[0].getX() - (controlPoints[3].getX() - controlPoints[0].getX()), controlPoints[3].getY());
+ }
+ if (flip == SymbolFlipping.Y) {
+ controlPoints[1].setLocation(controlPoints[1].getX(), controlPoints[0].getY() - (controlPoints[1].getY() - controlPoints[0].getY()));
+ controlPoints[2].setLocation(controlPoints[2].getX(), controlPoints[0].getY() - (controlPoints[2].getY() - controlPoints[0].getY()));
+ controlPoints[3].setLocation(controlPoints[3].getX(), controlPoints[0].getY() - (controlPoints[3].getY() - controlPoints[0].getY()));
}
}
@@ -263,18 +265,18 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
public void setControlPoint(Point2D point, int index) {
getControlPoints()[index].setLocation(point);
- // make sure we have a new drawing
+ // make sure we have a new drawing
body = null;
- }
-
- @Override
- public boolean canPointMoveFreely(int pointIndex) {
- return pointIndex == 3;
- }
-
- @Override
- public boolean canControlPointOverlap(int index) {
- return index >= 3;
+ }
+
+ @Override
+ public boolean canPointMoveFreely(int pointIndex) {
+ return pointIndex == 3;
+ }
+
+ @Override
+ public boolean canControlPointOverlap(int index) {
+ return index >= 3;
}
@EditableProperty
@@ -285,8 +287,8 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
public void setFlip(SymbolFlipping flip) {
this.flip = flip;
- updateControlPoints();
- // make sure we have a new drawing
+ updateControlPoints();
+ // make sure we have a new drawing
body = null;
}
@@ -297,15 +299,15 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
public void setColor(Color color) {
this.color = color;
- }
-
- @EditableProperty(name = "Moveable Label")
- public boolean getMoveLabel() {
- return moveLabel;
- }
-
- public void setMoveLabel(boolean moveLabel) {
- this.moveLabel = moveLabel;
+ }
+
+ @EditableProperty(name = "Moveable Label")
+ public boolean getMoveLabel() {
+ return moveLabel;
+ }
+
+ public void setMoveLabel(boolean moveLabel) {
+ this.moveLabel = moveLabel;
}
@EditableProperty
@@ -328,31 +330,31 @@ public abstract class Abstract3LegSymbol extends AbstractComponent {
public void setOrientation(Orientation orientation) {
this.orientation = orientation;
- updateControlPoints();
- // make sure we have a new drawing
+ updateControlPoints();
+ // make sure we have a new drawing
body = null;
- }
-
- protected void applyOrientation(Shape[] body) {
- if (getOrientation() == Orientation.DEFAULT)
- return;
-
- Point2D first = getControlPoints()[0];
- double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
- AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.getX(), first.getY());
-
- if (body != null) {
- for (int i = 0; i < body.length; i++) {
- body[i] = rotate.createTransformedShape(body[i]);
- }
- }
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- if (index >= 3)
- return null;
- return Integer.toString(index + 1);
+ }
+
+ protected void applyOrientation(Shape[] body) {
+ if (getOrientation() == Orientation.DEFAULT)
+ return;
+
+ Point2D first = getControlPoints()[0];
+ double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
+ AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.getX(), first.getY());
+
+ if (body != null) {
+ for (int i = 0; i < body.length; i++) {
+ body[i] = rotate.createTransformedShape(body[i]);
+ }
+ }
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ if (index >= 3)
+ return null;
+ return Integer.toString(index + 1);
}
/**
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractLeadedComponent.java b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractLeadedComponent.java
index d0019b2d..cdb8d891 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractLeadedComponent.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractLeadedComponent.java
@@ -34,6 +34,7 @@ import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.awt.ShadedPaint;
import org.diylc.awt.StringUtils;
import org.diylc.common.Display;
@@ -42,6 +43,7 @@ import org.diylc.common.IPlugInPort;
import org.diylc.common.LineStyle;
import org.diylc.common.ObjectCache;
import org.diylc.common.VerticalAlignment;
+import org.diylc.components.AbstractLabeledComponent;
import org.diylc.core.ComponentState;
import org.diylc.core.IDrawingObserver;
import org.diylc.core.Project;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractMultiPartComponent.java b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractMultiPartComponent.java
index 3a18a4fa..3842338a 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractMultiPartComponent.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractMultiPartComponent.java
@@ -4,7 +4,9 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
+
import org.diylc.common.ObjectCache;
+import org.diylc.components.AbstractLabeledComponent;
import org.diylc.core.ComponentState;
import org.diylc.core.IDrawingObserver;
import org.diylc.core.Project;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractSchematicLeadedSymbol.java b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractSchematicLeadedSymbol.java
index 6577555a..b134b6bc 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/AbstractSchematicLeadedSymbol.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/AbstractSchematicLeadedSymbol.java
@@ -1,33 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components;
-import java.awt.Color;
-import java.awt.FontMetrics;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.common.LabelPosition;
-import org.diylc.core.ComponentState;
-import org.diylc.core.annotations.EditableProperty;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.diylc.common.LabelPosition;
+import org.diylc.core.ComponentState;
+import org.diylc.core.annotations.EditableProperty;
public abstract class AbstractSchematicLeadedSymbol extends AbstractLeadedComponent {
@@ -59,7 +60,7 @@ public abstract class AbstractSchematicLeadedSymbol extends AbstractLeadedCom
@Override
protected float getLeadThickness() {
return 1;
- }
+ }
@Override
protected int calculateLabelYOffset(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics) {
@@ -68,15 +69,15 @@ public abstract class AbstractSchematicLeadedSymbol extends AbstractLeadedCom
} else {
return (int) (shapeRect.getHeight() + textRect.getHeight());
}
- }
-
- @Override
- protected Point2D calculateLabelPosition(Point2D point1, Point2D point2) {
- double x = (point1.getX() + point2.getX()) / 2.0;
- double y = (point1.getY() + point2.getY()) / 2.0;
- double theta = Math.atan2(point2.getY() - point1.getY(), point2.getX() - point2.getX()) - Math.PI / 2;
- double r = width.convertToPixels() / 2 + LABEL_FONT.getSize() / 2;
- return new Point2D.Double(x + Math.cos(theta) * r, y + Math.sin(theta) * r);
+ }
+
+ @Override
+ protected Point2D calculateLabelPosition(Point2D point1, Point2D point2) {
+ double x = (point1.getX() + point2.getX()) / 2.0;
+ double y = (point1.getY() + point2.getY()) / 2.0;
+ double theta = Math.atan2(point2.getY() - point1.getY(), point2.getX() - point2.getX()) - Math.PI / 2;
+ double r = width.convertToPixels() / 2 + LABEL_FONT.getSize() / 2;
+ return new Point2D.Double(x + Math.cos(theta) * r, y + Math.sin(theta) * r);
}
@EditableProperty(name = "Label Position")
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/RoundedPath.java b/diylc/diylc-library/src/main/java/org/diylc/components/RoundedPath.java
index 38a32d10..d03ca6a9 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/RoundedPath.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/RoundedPath.java
@@ -1,24 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components;
import java.awt.geom.GeneralPath;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/autocreate/SolderPadAutoCreator.java b/diylc/diylc-library/src/main/java/org/diylc/components/autocreate/SolderPadAutoCreator.java
index 035030fe..620ad3fe 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/autocreate/SolderPadAutoCreator.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/autocreate/SolderPadAutoCreator.java
@@ -1,32 +1,33 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.autocreate;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.log4j.Logger;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.components.connectivity.SolderPad;
-import org.diylc.core.IDIYComponent;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.log4j.Logger;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.components.connectivity.SolderPad;
+import org.diylc.core.IDIYComponent;
import org.diylc.core.annotations.IAutoCreator;
public class SolderPadAutoCreator implements IAutoCreator {
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractBoard.java
index c0674aec..e64effa2 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractBoard.java
@@ -28,6 +28,7 @@ import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.IPlugInPort;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractVeroBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractVeroBoard.java
index 45f4a26e..b3ef7ea7 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractVeroBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/AbstractVeroBoard.java
@@ -1,6 +1,7 @@
package org.diylc.components.boards;
import java.awt.Color;
+
import org.diylc.common.OrientationHV;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/BlankBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/BlankBoard.java
index 095bf402..5fda6b2c 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/BlankBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/BlankBoard.java
@@ -28,6 +28,7 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+
import org.diylc.common.ObjectCache;
import org.diylc.components.transform.SimpleComponentTransformer;
import org.diylc.core.ComponentState;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/Breadboard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/Breadboard.java
index 00104e2e..2f159311 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/Breadboard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/Breadboard.java
@@ -1,51 +1,52 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.boards;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.RoundRectangle2D;
-import org.diylc.awt.StringUtils;
-import org.diylc.common.HorizontalAlignment;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.VerticalAlignment;
-import org.diylc.components.transform.ProtoBoardTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+
+import org.diylc.awt.StringUtils;
+import org.diylc.common.HorizontalAlignment;
+import org.diylc.common.ObjectCache;
+import org.diylc.common.VerticalAlignment;
+import org.diylc.components.transform.ProtoBoardTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Breadboard", category = "Boards", author = "Branislav Stojkovic",
description = "Prototyping solderless breadboard", instanceNamePrefix = "BB",
@@ -109,7 +110,7 @@ public class Breadboard extends AbstractProtoBoard {
// draw body
g2d.setColor(FILL_COLOR);
int width = (int) (23 * SPACING.convertToPixels());
- int height = (int) ((holeCount + 1) * SPACING.convertToPixels());
+ int height = (int) ((holeCount + 1) * SPACING.convertToPixels());
Shape rect = new RoundRectangle2D.Double(point.getX(), point.getY(), width, height, bodyArc, bodyArc);
g2d.fill(rect);
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
@@ -192,49 +193,49 @@ public class Breadboard extends AbstractProtoBoard {
g2d.drawRoundRect(holeX - holeSize / 2, holeY - holeSize / 2, holeSize, holeSize, holeArc, holeArc);
}
}
- }
-
- // draw transparent connections just to designate connections
- drawingObserver.startTrackingContinuityArea(true);
- Composite oldComposite = g2d.getComposite();
- g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.0f));
-
- for (int section = 0; section <= 1; section++) {
- double offset = section * 18 * spacing;
- for (int x = 0; x < 2; x++) {
- int holeX = (int) (point.getX() + offset + (x + 2) * spacing);
- int holeY1 = (int) (point.getY() + (1 + powerOffset) * spacing);
- int holeY2 = (int) (point.getY() + (psHoleCount -1 + powerOffset) * spacing);
- g2d.setColor(HOLE_COLOR);
- g2d.fillRoundRect(holeX - holeSize / 2, holeY1 - holeSize / 2, holeSize, holeSize + holeY2 - holeY1, holeArc, holeArc);
- }
- }
-
- for (int section = 0; section <= 1; section++) {
- double offset = section * 7 * spacing;
-
- for (int y = 0; y < holeCount; y++) {
- g2d.setColor(COORDINATE_COLOR);
- int coordinateX;
- if (section == 0) {
- coordinateX = (int) (point.getX() + offset + 5.5 * spacing);
- } else {
- coordinateX = (int) (point.getX() + offset + 10.5 * spacing);
- }
- StringUtils.drawCenteredText(g2d, String.valueOf(y + 1), coordinateX, (int) (point.getY() + (y + 1) * spacing),
- section == 0 ? HorizontalAlignment.RIGHT : HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
-// for (int x = 0; x < 5; x++) {
- int holeX1 = (int) (point.getX() + offset + 6 * spacing);
- int holeX2 = (int) (point.getX() + offset + 10 * spacing);
- int holeY = (int) (point.getY() + (y + 1) * spacing);
- g2d.setColor(HOLE_COLOR);
- g2d.fillRoundRect(holeX1 - holeSize / 2, holeY - holeSize / 2, holeSize + holeX2 - holeX1, holeSize, holeArc, holeArc);
-// }
- }
-// }
- }
-
- g2d.setComposite(oldComposite);
+ }
+
+ // draw transparent connections just to designate connections
+ drawingObserver.startTrackingContinuityArea(true);
+ Composite oldComposite = g2d.getComposite();
+ g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.0f));
+
+ for (int section = 0; section <= 1; section++) {
+ double offset = section * 18 * spacing;
+ for (int x = 0; x < 2; x++) {
+ int holeX = (int) (point.getX() + offset + (x + 2) * spacing);
+ int holeY1 = (int) (point.getY() + (1 + powerOffset) * spacing);
+ int holeY2 = (int) (point.getY() + (psHoleCount -1 + powerOffset) * spacing);
+ g2d.setColor(HOLE_COLOR);
+ g2d.fillRoundRect(holeX - holeSize / 2, holeY1 - holeSize / 2, holeSize, holeSize + holeY2 - holeY1, holeArc, holeArc);
+ }
+ }
+
+ for (int section = 0; section <= 1; section++) {
+ double offset = section * 7 * spacing;
+
+ for (int y = 0; y < holeCount; y++) {
+ g2d.setColor(COORDINATE_COLOR);
+ int coordinateX;
+ if (section == 0) {
+ coordinateX = (int) (point.getX() + offset + 5.5 * spacing);
+ } else {
+ coordinateX = (int) (point.getX() + offset + 10.5 * spacing);
+ }
+ StringUtils.drawCenteredText(g2d, String.valueOf(y + 1), coordinateX, (int) (point.getY() + (y + 1) * spacing),
+ section == 0 ? HorizontalAlignment.RIGHT : HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
+// for (int x = 0; x < 5; x++) {
+ int holeX1 = (int) (point.getX() + offset + 6 * spacing);
+ int holeX2 = (int) (point.getX() + offset + 10 * spacing);
+ int holeY = (int) (point.getY() + (y + 1) * spacing);
+ g2d.setColor(HOLE_COLOR);
+ g2d.fillRoundRect(holeX1 - holeSize / 2, holeY - holeSize / 2, holeSize + holeX2 - holeX1, holeSize, holeArc, holeArc);
+// }
+ }
+// }
+ }
+
+ g2d.setComposite(oldComposite);
drawingObserver.stopTrackingContinuityArea();
}
@@ -304,18 +305,18 @@ public class Breadboard extends AbstractProtoBoard {
@Override
public int getControlPointCount() {
return 2;
- }
-
- @Override
- public boolean canPointMoveFreely(int pointIndex) {
- return false;
+ }
+
+ @Override
+ public boolean canPointMoveFreely(int pointIndex) {
+ return false;
}
@SuppressWarnings("incomplete-switch")
@Override
public Point2D getControlPoint(int index) {
if (index == 0)
- return point;
+ return point;
// create a synthetic second control point for clipping check and to make sure that we cannot drag the right side of the board off the screen
double spacing = SPACING.convertToPixels();
int holeCount = getBreadboardSize() == BreadboardSize.Full ? 63 : 30;
@@ -362,18 +363,18 @@ public class Breadboard extends AbstractProtoBoard {
}
@Override
- public void setValue(Void value) {}
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public Rectangle2D getCachingBounds() {
- Point2D finalSecondPoint = getControlPoint(1);
- return new Rectangle2D.Double(Math.min(point.getX(), finalSecondPoint.getX()) - 2, Math.min(point.getY(), finalSecondPoint.getY()) - 2,
- Math.abs(finalSecondPoint.getX() - point.getX()) + 4, Math.abs(finalSecondPoint.getY() - point.getY()) + 4);
+ public void setValue(Void value) {}
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public Rectangle2D getCachingBounds() {
+ Point2D finalSecondPoint = getControlPoint(1);
+ return new Rectangle2D.Double(Math.min(point.getX(), finalSecondPoint.getX()) - 2, Math.min(point.getY(), finalSecondPoint.getY()) - 2,
+ Math.abs(finalSecondPoint.getX() - point.getX()) + 4, Math.abs(finalSecondPoint.getY() - point.getY()) + 4);
}
public enum BreadboardSize {
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/EurorackStripboard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/EurorackStripboard.java
index be101842..5d6f7999 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/EurorackStripboard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/EurorackStripboard.java
@@ -30,6 +30,7 @@ import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.util.ArrayList;
import java.util.List;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.ObjectCache;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/EyeletBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/EyeletBoard.java
index ee34e7a9..4c328163 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/EyeletBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/EyeletBoard.java
@@ -26,6 +26,7 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D;
+
import org.diylc.components.transform.AbstractBoardTransformer;
import org.diylc.core.ComponentState;
import org.diylc.core.IDIYComponent;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/MarshallPerfBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/MarshallPerfBoard.java
index c8777e2e..448e26de 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/MarshallPerfBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/MarshallPerfBoard.java
@@ -26,6 +26,7 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D;
+
import org.diylc.components.transform.AbstractBoardTransformer;
import org.diylc.core.ComponentState;
import org.diylc.core.IDIYComponent;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/PerfBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/PerfBoard.java
index 920cf26a..7792426e 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/PerfBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/PerfBoard.java
@@ -1,45 +1,46 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.boards;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Point2D;
-import org.diylc.components.transform.AbstractBoardTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.ILayeredComponent;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+
+import org.diylc.components.transform.AbstractBoardTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.ILayeredComponent;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Perf Board w/ Pads", category = "Boards", author = "Branislav Stojkovic",
zOrder = IDIYComponent.BOARD, instanceNamePrefix = "Board", description = "Perforated board with solder pads",
@@ -61,8 +62,8 @@ public class PerfBoard extends AbstractBoard implements ILayeredComponent {
@Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
- IDrawingObserver drawingObserver) {
- Point2D finalSecondPoint = getFinalSecondPoint();
+ IDrawingObserver drawingObserver) {
+ Point2D finalSecondPoint = getFinalSecondPoint();
Shape clip = g2d.getClip();
if (checkPointsClipped(clip) && !clip.contains(firstPoint.getX(), finalSecondPoint.getY())
@@ -74,7 +75,7 @@ public class PerfBoard extends AbstractBoard implements ILayeredComponent {
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
}
- double x = firstPoint.getX();
+ double x = firstPoint.getX();
double y = firstPoint.getY();
int diameter = getClosestOdd((int) PAD_SIZE.convertToPixels());
int holeDiameter = getClosestOdd((int) HOLE_SIZE.convertToPixels());
@@ -115,16 +116,16 @@ public class PerfBoard extends AbstractBoard implements ILayeredComponent {
public void setSpacing(Size spacing) {
this.spacing = spacing;
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public int getLayerId() {
- return 1;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public int getLayerId() {
+ return 1;
}
@Override
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard.java
index d34fb7fe..72c739e2 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard.java
@@ -19,14 +19,15 @@
along with DIYLC. If not, see .
*/
-package org.diylc.components.boards;
-
+package org.diylc.components.boards;
+
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.ObjectCache;
@@ -43,30 +44,30 @@ import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.annotations.KeywordPolicy;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
-
-@ComponentDescriptor(name = "P-0+o (Proto) Board", category = "Boards", author = "Branislav Stojkovic",
- description = "A prototyping board for modular synths, central bus with V+ GND and V-", instanceNamePrefix = "BB",
- zOrder = IDIYComponent.BOARD, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
- keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, enableCache = true, transformer = ProtoBoardTransformer.class)
-public class ProtoBoard extends AbstractProtoBoard {
-
- private static final long serialVersionUID = 1L;
-
- public static Color FILL_COLOR = Color.decode("#6B9B6B");
- public static Size SPACING = new Size(0.1d, SizeUnit.in);
- public static Color SELECTION_COLOR = Color.red;
+
+@ComponentDescriptor(name = "P-0+o (Proto) Board", category = "Boards", author = "Branislav Stojkovic",
+ description = "A prototyping board for modular synths, central bus with V+ GND and V-", instanceNamePrefix = "BB",
+ zOrder = IDIYComponent.BOARD, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
+ keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, enableCache = true, transformer = ProtoBoardTransformer.class)
+public class ProtoBoard extends AbstractProtoBoard {
+
+ private static final long serialVersionUID = 1L;
+
+ public static Color FILL_COLOR = Color.decode("#6B9B6B");
+ public static Size SPACING = new Size(0.1d, SizeUnit.in);
+ public static Color SELECTION_COLOR = Color.red;
public static Color PAD_COLOR = COPPER_COLOR;
public static Color TRACE_COLOR = PAD_COLOR.brighter();
public static Color UNDERSIDE_PAD_COLOR = Color.decode("#977DC4");
public static Color UNDERSIDE_TRACE_COLOR = UNDERSIDE_PAD_COLOR.brighter();
- public static Color HOLE_COLOR = Color.white;
-
- public static float COORDINATE_FONT_SIZE = 9f;
+ public static Color HOLE_COLOR = Color.white;
+
+ public static float COORDINATE_FONT_SIZE = 9f;
public static Color COORDINATE_COLOR = Color.decode("#DDDDDD");
public static Color SEPARATOR_COLOR = Color.white;
- public static Color SCREEN_COLOR = Color.decode("#CAD4CA");
-
+ public static Color SCREEN_COLOR = Color.decode("#CAD4CA");
+
public static Size PAD_SIZE = new Size(2d, SizeUnit.mm);
public static int ROW_COUNT = 33;
@@ -76,8 +77,8 @@ public class ProtoBoard extends AbstractProtoBoard {
private static int[] SEGMENTS = new int[] { 2, 3, 3, 3, 3, 2 };
private static int[] SEGMENTS_SUM = new int[] { 0, 2, 5, 8, 11, 14 };
private static int[] GAPS = new int[] { 1, 0, 2, 0, 0, 0 };
- private static int[] SEGMENTS_STARTS = new int[] { 0, 3, 6, 11, 14, 17 };
-
+ private static int[] SEGMENTS_STARTS = new int[] { 0, 3, 6, 11, 14, 17 };
+
protected Point2D point = new Point2D.Double(0, 0);
protected Color boardColor = FILL_COLOR;
@@ -87,51 +88,51 @@ public class ProtoBoard extends AbstractProtoBoard {
protected Color undersideTraceColor = UNDERSIDE_TRACE_COLOR;
protected Color textColor = COORDINATE_COLOR;
- @SuppressWarnings("incomplete-switch")
- @Override
- public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
- IDrawingObserver drawingObserver) {
- if (checkPointsClipped(g2d.getClip())) {
- return;
- }
-
- // adjust the angle
- double theta = 0;
- switch (getOrientation()) {
- case _90:
- theta = Math.PI / 2;
- break;
- case _180:
- theta = Math.PI;
- break;
- case _270:
- theta = Math.PI * 3 / 2;
- break;
- }
- if (theta != 0) {
- g2d.rotate(theta, point.getX(), point.getY());
- }
-
- double spacing = SPACING.convertToPixels();
-
- // draw body
- g2d.setColor(boardColor);
- int width = (int) WIDTH_SIZE.convertToPixels();
+ @SuppressWarnings("incomplete-switch")
+ @Override
+ public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
+ IDrawingObserver drawingObserver) {
+ if (checkPointsClipped(g2d.getClip())) {
+ return;
+ }
+
+ // adjust the angle
+ double theta = 0;
+ switch (getOrientation()) {
+ case _90:
+ theta = Math.PI / 2;
+ break;
+ case _180:
+ theta = Math.PI;
+ break;
+ case _270:
+ theta = Math.PI * 3 / 2;
+ break;
+ }
+ if (theta != 0) {
+ g2d.rotate(theta, point.getX(), point.getY());
+ }
+
+ double spacing = SPACING.convertToPixels();
+
+ // draw body
+ g2d.setColor(boardColor);
+ int width = (int) WIDTH_SIZE.convertToPixels();
int length = (int) LENGTH_SIZE.convertToPixels();
- Shape rect = new Rectangle2D.Double(point.getX(), point.getY(), width, length);
- g2d.fill(rect);
- g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
- : boardColor.darker());
+ Shape rect = new Rectangle2D.Double(point.getX(), point.getY(), width, length);
+ g2d.fill(rect);
+ g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
+ : boardColor.darker());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
drawingObserver.stopTracking();
-
- g2d.draw(rect);
-
+
+ g2d.draw(rect);
+
int padSize = getClosestOdd(PAD_SIZE.convertToPixels());
- int holeSize = getClosestOdd(padSize / 3);
-
+ int holeSize = getClosestOdd(padSize / 3);
+
g2d.setFont(LABEL_FONT.deriveFont(COORDINATE_FONT_SIZE));
int xOffset = 1;
@@ -247,26 +248,26 @@ public class ProtoBoard extends AbstractProtoBoard {
(int)(0.5 * spacing), (int) ((ROW_COUNT + 0.5) * spacing));
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
-
+
// draw main pads
for (int segment = 0; segment < SEGMENTS.length; segment++) {
- for (int y = 0; y < ROW_COUNT; y++) {
- for (int x = 0; x < SEGMENTS[segment]; x++) {
- int padX = (int) (point.getX() + (xOffset + x) * spacing);
+ for (int y = 0; y < ROW_COUNT; y++) {
+ for (int x = 0; x < SEGMENTS[segment]; x++) {
+ int padX = (int) (point.getX() + (xOffset + x) * spacing);
int padY = (int) (point.getY() + (yOffset + y) * spacing);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker("SEGMENT=" + segment + ";ROW=" + y);
-
+
g2d.setColor(padColor);
if ((segment == 2 && x == 2) || (segment == 3 && x == 0))
g2d.fillRect(padX - padSize / 2, padY - padSize / 2, padSize, padSize);
- else
+ else
g2d.fillOval(padX - padSize / 2, padY - padSize / 2, padSize, padSize);
drawingObserver.setContinuityMarker(null);
- drawingObserver.stopTrackingContinuityArea();
+ drawingObserver.stopTrackingContinuityArea();
g2d.setColor(padColor.darker());
if ((segment == 2 && x == 2) || (segment == 3 && x == 0))
@@ -282,11 +283,11 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.setColor(textColor);
StringUtils.drawCenteredText(g2d, Integer.toString(SEGMENTS_SUM[segment] + x + 1), padX, (int) (point.getY() + (yOffset) * spacing) - padSize / 2 - 2,
HorizontalAlignment.CENTER, VerticalAlignment.TOP);
- }
- }
+ }
+ }
}
- xOffset += SEGMENTS[segment] + GAPS[segment];
+ xOffset += SEGMENTS[segment] + GAPS[segment];
}
// Draw top and bottom 3 pads
@@ -466,7 +467,7 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.setColor(textColor);
g2d.setFont(LABEL_FONT.deriveFont(COORDINATE_FONT_SIZE + 2));
- StringUtils.drawCenteredText(g2d, "P-0+o by:\nKristian Blåsol 2019", (int) (point.getX() + width * 0.70d), (int) (point.getY() + (yOffset + ROW_COUNT + 0.9) * spacing),
+ StringUtils.drawCenteredText(g2d, "P-0+o by:\nKristian Bl�sol 2019", (int) (point.getX() + width * 0.70d), (int) (point.getY() + (yOffset + ROW_COUNT + 0.9) * spacing),
HorizontalAlignment.LEFT, VerticalAlignment.TOP);
// draw central mini pads
@@ -512,15 +513,15 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.drawRect((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 1.5) * spacing) - miniPadSize / 2, (int) (point.getY() + (yOffset + y + 0.5d) * spacing - 1 - miniPadSize), miniPadSize, miniPadSize);
g2d.drawRect((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 1.5) * spacing) - miniPadSize * 3 / 2 - 2, (int) (point.getY() + (yOffset + y + 0.5d) * spacing - 1 - miniPadSize), miniPadSize, miniPadSize);
g2d.drawRect((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 1.5) * spacing) + miniPadSize / 2 + 3, (int) (point.getY() + (yOffset + y + 0.5d) * spacing - 1 - miniPadSize), miniPadSize, miniPadSize);
- }
- }
-
- @Override
- public void drawIcon(Graphics2D g2d, int width, int height) {
- int factor = 32 / width;
- g2d.setColor(FILL_COLOR);
- g2d.fillRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
- g2d.setColor(FILL_COLOR.darker());
+ }
+ }
+
+ @Override
+ public void drawIcon(Graphics2D g2d, int width, int height) {
+ int factor = 32 / width;
+ g2d.setColor(FILL_COLOR);
+ g2d.fillRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
+ g2d.setColor(FILL_COLOR.darker());
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
g2d.setColor(PAD_COLOR.brighter());
@@ -532,33 +533,33 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.drawLine(width / 3 - 2 / factor + size / 2, 2 * width / 3 - 2 / factor + size / 2, width, 2 * width / 3 - 2 / factor + size / 2);
- g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
-
- g2d.setColor(PAD_COLOR);
- g2d.fillRect(width / 3 - 2 / factor, 6 / factor, size, size);
- g2d.setColor(PAD_COLOR.darker());
- g2d.drawRect(width / 3 - 2 / factor, 6 / factor, size, size);
-
- g2d.setColor(PAD_COLOR);
- g2d.fillOval(2 * width / 3 - 2 / factor, 6 / factor, size, size);
- g2d.setColor(PAD_COLOR.darker());
- g2d.drawOval(2 * width / 3 - 2 / factor, 6 / factor, size, size);
-
- g2d.setColor(PAD_COLOR);
- g2d.fillRect(width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
- g2d.setColor(PAD_COLOR.darker());
- g2d.drawRect(width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
-
- g2d.setColor(PAD_COLOR);
- g2d.fillOval(2 * width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
- g2d.setColor(PAD_COLOR.darker());
+ g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
+
+ g2d.setColor(PAD_COLOR);
+ g2d.fillRect(width / 3 - 2 / factor, 6 / factor, size, size);
+ g2d.setColor(PAD_COLOR.darker());
+ g2d.drawRect(width / 3 - 2 / factor, 6 / factor, size, size);
+
+ g2d.setColor(PAD_COLOR);
+ g2d.fillOval(2 * width / 3 - 2 / factor, 6 / factor, size, size);
+ g2d.setColor(PAD_COLOR.darker());
+ g2d.drawOval(2 * width / 3 - 2 / factor, 6 / factor, size, size);
+
+ g2d.setColor(PAD_COLOR);
+ g2d.fillRect(width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
+ g2d.setColor(PAD_COLOR.darker());
+ g2d.drawRect(width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
+
+ g2d.setColor(PAD_COLOR);
+ g2d.fillOval(2 * width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
+ g2d.setColor(PAD_COLOR.darker());
g2d.drawOval(2 * width / 3 - 2 / factor, 2 * width / 3 - 2 / factor, size, size);
g2d.setColor(HOLE_COLOR);
g2d.fillOval(width / 3 - 2 / factor + size / 2 - 1, 6 / factor + size / 2 - 1, 3, 3);
g2d.fillOval(width / 3 - 2 / factor + size / 2 - 1, 2 * width / 3 - 2 / factor + size / 2 - 1, 3, 3);
g2d.fillOval(2 * width / 3 - 2 / factor + size / 2 - 1, 6 / factor + size / 2 - 1, 3, 3);
- g2d.fillOval(2 * width / 3 - 2 / factor + size / 2 - 1, 2 * width / 3 - 2 / factor + size / 2 - 1, 3, 3);
+ g2d.fillOval(2 * width / 3 - 2 / factor + size / 2 - 1, 2 * width / 3 - 2 / factor + size / 2 - 1, 3, 3);
}
@EditableProperty(name = "Board Color")
@@ -613,71 +614,71 @@ public class ProtoBoard extends AbstractProtoBoard {
public void setTextColor(Color textColor) {
this.textColor = textColor;
- }
-
- @Override
- public int getControlPointCount() {
- return 2;
+ }
+
+ @Override
+ public int getControlPointCount() {
+ return 2;
}
@Override
public boolean canPointMoveFreely(int pointIndex) {
return false;
- }
-
- @SuppressWarnings("incomplete-switch")
- @Override
- public Point2D getControlPoint(int index) {
- if (index == 0)
+ }
+
+ @SuppressWarnings("incomplete-switch")
+ @Override
+ public Point2D getControlPoint(int index) {
+ if (index == 0)
return point;
- // create a synthetic second control point for clipping check and to make sure that we cannot drag the right side of the board off the screen
-
- // adjust the angle
- double theta = 0;
- switch (getOrientation()) {
- case _90:
- theta = Math.PI / 2;
- break;
- case _180:
- theta = Math.PI;
- break;
- case _270:
- theta = Math.PI * 3 / 2;
- break;
+ // create a synthetic second control point for clipping check and to make sure that we cannot drag the right side of the board off the screen
+
+ // adjust the angle
+ double theta = 0;
+ switch (getOrientation()) {
+ case _90:
+ theta = Math.PI / 2;
+ break;
+ case _180:
+ theta = Math.PI;
+ break;
+ case _270:
+ theta = Math.PI * 3 / 2;
+ break;
}
int width = (int) WIDTH_SIZE.convertToPixels();
- int length = (int) LENGTH_SIZE.convertToPixels();
- Point2D secondPoint = new Point2D.Double(point.getX() + width, point.getY() + length);
- if (theta != 0) {
- AffineTransform tx = AffineTransform.getRotateInstance(theta, point.getX(), point.getY());
- tx.transform(secondPoint, secondPoint);
- }
- return secondPoint;
- }
-
- @Override
- public boolean isControlPointSticky(int index) {
- return false;
- }
-
- @Override
- public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
- return VisibilityPolicy.NEVER;
- }
-
- @Override
- public void setControlPoint(Point2D point, int index) {
- if (index == 0)
- this.point.setLocation(point);
- }
-
- @Override
- public Void getValue() {
- return null;
- }
-
- @Override
+ int length = (int) LENGTH_SIZE.convertToPixels();
+ Point2D secondPoint = new Point2D.Double(point.getX() + width, point.getY() + length);
+ if (theta != 0) {
+ AffineTransform tx = AffineTransform.getRotateInstance(theta, point.getX(), point.getY());
+ tx.transform(secondPoint, secondPoint);
+ }
+ return secondPoint;
+ }
+
+ @Override
+ public boolean isControlPointSticky(int index) {
+ return false;
+ }
+
+ @Override
+ public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
+ return VisibilityPolicy.NEVER;
+ }
+
+ @Override
+ public void setControlPoint(Point2D point, int index) {
+ if (index == 0)
+ this.point.setLocation(point);
+ }
+
+ @Override
+ public Void getValue() {
+ return null;
+ }
+
+ @Override
public void setValue(Void value) {}
@Override
@@ -690,5 +691,5 @@ public class ProtoBoard extends AbstractProtoBoard {
Point2D finalSecondPoint = getControlPoint(1);
return new Rectangle2D.Double(Math.min(point.getX(), finalSecondPoint.getX()), Math.min(point.getY(), finalSecondPoint.getY()),
Math.abs(finalSecondPoint.getX() - point.getX()) + 2, Math.abs(finalSecondPoint.getY() - point.getY()) + 2);
- }
-}
+ }
+}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard780.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard780.java
index 5a80933e..9cd695ab 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard780.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/ProtoBoard780.java
@@ -24,6 +24,7 @@ import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.ObjectCache;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TagStrip.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TagStrip.java
index 7d4f54d1..17eafacd 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TagStrip.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TagStrip.java
@@ -1,54 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.boards;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.common.IPlugInPort;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.Orientation;
-import org.diylc.components.AbstractTransparentComponent;
-import org.diylc.components.transform.TagStripTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IContinuity;
-import org.diylc.core.IDIYComponent;
-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.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.ObjectCache;
+import org.diylc.common.Orientation;
+import org.diylc.components.AbstractTransparentComponent;
+import org.diylc.components.transform.TagStripTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IContinuity;
+import org.diylc.core.IDIYComponent;
+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.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Tag Strip", author = "Branislav Stojkovic", category = "Boards",
instanceNamePrefix = "TS", description = "Row of terminals for point-to-point construction",
@@ -61,8 +62,8 @@ public class TagStrip extends AbstractTransparentComponent implements IC
public static Color TERMINAL_COLOR = Color.lightGray;
public static Color TERMINAL_BORDER_COLOR = TERMINAL_COLOR.darker();
public static int EDGE_RADIUS = 2;
- public static Size MOUNTING_HOLE_SIZE = new Size(0.07d, SizeUnit.in);
- public static Size MOUNTING_HOLE_DISTANCE = new Size(0.25d, SizeUnit.in);
+ public static Size MOUNTING_HOLE_SIZE = new Size(0.07d, SizeUnit.in);
+ public static Size MOUNTING_HOLE_DISTANCE = new Size(0.25d, SizeUnit.in);
public static Size TERMINAL_THICKNESS = new Size(0.04d, SizeUnit.in);
private String value = "";
@@ -71,8 +72,8 @@ public class TagStrip extends AbstractTransparentComponent implements IC
private static Size BOARD_THICKNESS = new Size(0.05d, SizeUnit.in);
private Size terminalSpacing = new Size(0.375d, SizeUnit.in);
private Point2D[] controlPoints = new Point2D[] {new Point2D.Double(0, 0)};
- private Color boardColor = BOARD_COLOR;
-
+ private Color boardColor = BOARD_COLOR;
+
private TagStripMount mount = TagStripMount.Central;
transient private Area[] body;
@@ -196,53 +197,53 @@ public class TagStrip extends AbstractTransparentComponent implements IC
int terminalSpacing = (int) getTerminalSpacing().convertToPixels();
int boardThickness = getClosestOdd(BOARD_THICKNESS.convertToPixels());
int boardLength = (int) ((getTerminalCount() - 0.5) * terminalSpacing + 2 * boardThickness);
- int holeSize = getClosestOdd(MOUNTING_HOLE_SIZE.convertToPixels());
- int terminalThickness = (int) TERMINAL_THICKNESS.convertToPixels();
- int terminalSize = terminalSpacing / 2;
- int holeDistance = terminalSize / 2 + terminalThickness / 2 + 1;
- int terminalWidth;
- int terminalHeight;
- int holeDx;
+ int holeSize = getClosestOdd(MOUNTING_HOLE_SIZE.convertToPixels());
+ int terminalThickness = (int) TERMINAL_THICKNESS.convertToPixels();
+ int terminalSize = terminalSpacing / 2;
+ int holeDistance = terminalSize / 2 + terminalThickness / 2 + 1;
+ int terminalWidth;
+ int terminalHeight;
+ int holeDx;
int holeDy;
switch (orientation) {
case DEFAULT:
width = boardThickness;
- height = boardLength;
- terminalWidth = terminalThickness;
+ height = boardLength;
+ terminalWidth = terminalThickness;
terminalHeight = terminalSize;
x -= boardThickness + terminalThickness / 2;
- y -= terminalSize / 2 + boardThickness;
- holeDx = holeDistance;
+ y -= terminalSize / 2 + boardThickness;
+ holeDx = holeDistance;
holeDy = 0;
break;
case _90:
width = boardLength;
- height = boardThickness;
- terminalWidth = terminalSize;
+ height = boardThickness;
+ terminalWidth = terminalSize;
terminalHeight = terminalThickness;
x += boardThickness - boardLength + terminalSize / 2;
- y -= boardThickness + terminalThickness / 2;
- holeDx = 0;
+ y -= boardThickness + terminalThickness / 2;
+ holeDx = 0;
holeDy = holeDistance;
break;
case _180:
width = boardThickness;
- height = boardLength;
- terminalWidth = terminalThickness;
+ height = boardLength;
+ terminalWidth = terminalThickness;
terminalHeight = terminalSize;
x += terminalThickness / 2;
- y += boardThickness - boardLength + terminalSize / 2;
- holeDx = -holeDistance;
+ y += boardThickness - boardLength + terminalSize / 2;
+ holeDx = -holeDistance;
holeDy = 0;
break;
case _270:
width = boardLength;
- height = boardThickness;
- terminalWidth = terminalSize;
+ height = boardThickness;
+ terminalWidth = terminalSize;
terminalHeight = terminalThickness;
- x -= terminalSize / 2 + boardThickness;
- y -= -terminalThickness / 2;
- holeDx = 0;
+ x -= terminalSize / 2 + boardThickness;
+ y -= -terminalThickness / 2;
+ holeDx = 0;
holeDy = -holeDistance;
break;
default:
@@ -256,12 +257,12 @@ public class TagStrip extends AbstractTransparentComponent implements IC
Area terminal =
new Area(new Rectangle2D.Double(p1.getX() - terminalWidth/ 2, p1.getY() - terminalHeight / 2, terminalWidth, terminalHeight));
- body[1 + i] = terminal;
-
- if ((getMount() == TagStripMount.Central && i == getTerminalCount() / 2) || (getMount() == TagStripMount.Outside && (i == 0 || i == getTerminalCount() - 1))) {
- Area mount = new Area(new Rectangle2D.Double(p1.getX() + holeDx - terminalSize / 2, p1.getY() + holeDy - terminalSize / 2, terminalSize, terminalSize));
- mount.subtract(new Area(new Ellipse2D.Double(p1.getX() + holeDx - holeSize / 2, p1.getY() + holeDy - holeSize / 2, holeSize, holeSize)));
- body[1 + i].add(mount);
+ body[1 + i] = terminal;
+
+ if ((getMount() == TagStripMount.Central && i == getTerminalCount() / 2) || (getMount() == TagStripMount.Outside && (i == 0 || i == getTerminalCount() - 1))) {
+ Area mount = new Area(new Rectangle2D.Double(p1.getX() + holeDx - terminalSize / 2, p1.getY() + holeDy - terminalSize / 2, terminalSize, terminalSize));
+ mount.subtract(new Area(new Ellipse2D.Double(p1.getX() + holeDx - holeSize / 2, p1.getY() + holeDy - holeSize / 2, holeSize, holeSize)));
+ body[1 + i].add(mount);
}
}
}
@@ -273,7 +274,7 @@ public class TagStrip extends AbstractTransparentComponent implements IC
IDrawingObserver drawingObserver) {
if (checkPointsClipped(g2d.getClip())) {
return;
- }
+ }
Area[] area = getBody();
Area mainArea = area[0];
@@ -301,10 +302,10 @@ public class TagStrip extends AbstractTransparentComponent implements IC
g2d.setColor(finalBorderColor);
g2d.draw(mainArea);
- g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : TERMINAL_COLOR);
+ g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : TERMINAL_COLOR);
drawingObserver.startTrackingContinuityArea(true);
- for (int i = 1; i < body.length; i++)
- g2d.fill(body[i]);
+ for (int i = 1; i < body.length; i++)
+ g2d.fill(body[i]);
drawingObserver.stopTrackingContinuityArea();
Color finalTerminalBorderColor;
@@ -321,26 +322,26 @@ public class TagStrip extends AbstractTransparentComponent implements IC
}
g2d.setColor(finalTerminalBorderColor);
- for (int i = 1; i < body.length; i++)
+ for (int i = 1; i < body.length; i++)
g2d.draw(body[i]);
g2d.setComposite(oldComposite);
}
@Override
- public void drawIcon(Graphics2D g2d, int width, int height) {
- g2d.rotate(-Math.PI / 4, width / 2, height / 2);
- g2d.setColor(BOARD_COLOR);
- int thickness = 2 * width / 32;
- g2d.fillRect(0, height / 2 - thickness / 2, width, thickness);
- g2d.setColor(TERMINAL_COLOR.darker());
- int terminalWidth = 7 * width / 32;
- g2d.fillRect(2, height / 2 + thickness / 2, terminalWidth, thickness);
- g2d.fillRect((int) (2 + terminalWidth * 1.5), height / 2 + thickness / 2, terminalWidth, thickness);
- g2d.fillRect((int) (2 + terminalWidth * 3), height / 2 + thickness / 2, terminalWidth, thickness);
- g2d.setColor(TERMINAL_COLOR);
- g2d.fillRect((int) (2 + terminalWidth * 1.5), height / 2 + thickness / 2 + 1, terminalWidth, terminalWidth);
- g2d.setColor(Color.white);
+ public void drawIcon(Graphics2D g2d, int width, int height) {
+ g2d.rotate(-Math.PI / 4, width / 2, height / 2);
+ g2d.setColor(BOARD_COLOR);
+ int thickness = 2 * width / 32;
+ g2d.fillRect(0, height / 2 - thickness / 2, width, thickness);
+ g2d.setColor(TERMINAL_COLOR.darker());
+ int terminalWidth = 7 * width / 32;
+ g2d.fillRect(2, height / 2 + thickness / 2, terminalWidth, thickness);
+ g2d.fillRect((int) (2 + terminalWidth * 1.5), height / 2 + thickness / 2, terminalWidth, thickness);
+ g2d.fillRect((int) (2 + terminalWidth * 3), height / 2 + thickness / 2, terminalWidth, thickness);
+ g2d.setColor(TERMINAL_COLOR);
+ g2d.fillRect((int) (2 + terminalWidth * 1.5), height / 2 + thickness / 2 + 1, terminalWidth, terminalWidth);
+ g2d.setColor(Color.white);
g2d.fillOval((int) (2 + terminalWidth * 1.75), height / 2 + thickness / 2 + 1 + terminalWidth / 2, terminalWidth / 2, terminalWidth / 2);
// int radius = 6 * width / 32;
// int holeSize = 3 * width / 32;
@@ -376,36 +377,36 @@ public class TagStrip extends AbstractTransparentComponent implements IC
public void setBoardColor(Color bodyColor) {
this.boardColor = bodyColor;
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return "TerminalStrip" + index;
- }
-
- @EditableProperty(name = "Mounting Lugs")
- public TagStripMount getMount() {
- return mount;
- }
-
- public void setMount(TagStripMount mount) {
- this.mount = mount;
- updateControlPoints();
- // Reset body shape;
- body = null;
- }
-
- @Override
- public boolean arePointsConnected(int index1, int index2) {
- return false;
- }
-
- @Override
- public boolean canPointMoveFreely(int pointIndex) {
- return false;
- }
-
- public enum TagStripMount {
- Central, Outside;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return "TerminalStrip" + index;
+ }
+
+ @EditableProperty(name = "Mounting Lugs")
+ public TagStripMount getMount() {
+ return mount;
+ }
+
+ public void setMount(TagStripMount mount) {
+ this.mount = mount;
+ updateControlPoints();
+ // Reset body shape;
+ body = null;
+ }
+
+ @Override
+ public boolean arePointsConnected(int index1, int index2) {
+ return false;
+ }
+
+ @Override
+ public boolean canPointMoveFreely(int pointIndex) {
+ return false;
+ }
+
+ public enum TagStripMount {
+ Central, Outside;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TerminalStrip.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TerminalStrip.java
index 8793416f..d3f6f77e 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TerminalStrip.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TerminalStrip.java
@@ -27,6 +27,7 @@ import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.RoundRectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
import org.diylc.common.Orientation;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TriPadBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TriPadBoard.java
index 3c55fc83..e31f2739 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/TriPadBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/TriPadBoard.java
@@ -1,42 +1,43 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.boards;
-import java.awt.AlphaComposite;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Point2D;
-import org.diylc.common.OrientationHV;
-import org.diylc.components.transform.VeroBoardTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.ILayeredComponent;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.utils.Constants;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+
+import org.diylc.common.OrientationHV;
+import org.diylc.components.transform.VeroBoardTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.ILayeredComponent;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "TriPad Board", category = "Boards", author = "Hauke Juhls", zOrder = IDIYComponent.BOARD,
instanceNamePrefix = "Board",
@@ -50,8 +51,8 @@ public class TriPadBoard extends AbstractVeroBoard implements ILayeredComponent
@Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
- IDrawingObserver drawingObserver) {
- Point2D finalSecondPoint = getFinalSecondPoint();
+ IDrawingObserver drawingObserver) {
+ Point2D finalSecondPoint = getFinalSecondPoint();
Shape clip = g2d.getClip();
if (checkPointsClipped(clip) && !clip.contains(firstPoint.getX(), finalSecondPoint.getY())
@@ -64,7 +65,7 @@ public class TriPadBoard extends AbstractVeroBoard implements ILayeredComponent
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
}
- double x = firstPoint.getX();
+ double x = firstPoint.getX();
double y = firstPoint.getY();
int stripSize = getClosestOdd((int) STRIP_SIZE.convertToPixels());
int holeSize = getClosestOdd((int) HOLE_SIZE.convertToPixels());
@@ -84,10 +85,10 @@ public class TriPadBoard extends AbstractVeroBoard implements ILayeredComponent
spacesToDraw = (remainingSpace - stripSize) / spacing;
}
- g2d.setColor(stripColor);
+ g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x + spacing - stripSize / 2), (int)(y - stripSize / 2), (int)(spacing * (spacesToDraw - 1) + stripSize),
- stripSize);
+ stripSize);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
@@ -122,10 +123,10 @@ public class TriPadBoard extends AbstractVeroBoard implements ILayeredComponent
spacesToDraw = (remainingSpace - stripSize) / spacing;
}
- g2d.setColor(stripColor);
+ g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x - stripSize / 2), (int)(y + spacing - stripSize / 2), stripSize, (int)(spacing * (spacesToDraw - 1)
- + stripSize));
+ + stripSize));
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
g2d.drawRect((int)(x - stripSize / 2), (int)(y + spacing - stripSize / 2), stripSize, (int)(spacing * (spacesToDraw - 1)
@@ -198,15 +199,15 @@ public class TriPadBoard extends AbstractVeroBoard implements ILayeredComponent
} else {
this.stripSpan = stripSpan;
}
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public int getLayerId() {
- return 1;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public int getLayerId() {
+ return 1;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/boards/VeroBoard.java b/diylc/diylc-library/src/main/java/org/diylc/components/boards/VeroBoard.java
index 16772a4a..2733e8b9 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/boards/VeroBoard.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/boards/VeroBoard.java
@@ -1,42 +1,43 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.boards;
-import java.awt.AlphaComposite;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Point2D;
-import org.diylc.common.OrientationHV;
-import org.diylc.components.transform.VeroBoardTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.ILayeredComponent;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.utils.Constants;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+
+import org.diylc.common.OrientationHV;
+import org.diylc.components.transform.VeroBoardTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.ILayeredComponent;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Vero Board", category = "Boards", author = "Branislav Stojkovic",
zOrder = IDIYComponent.BOARD, instanceNamePrefix = "Board",
@@ -49,8 +50,8 @@ public class VeroBoard extends AbstractVeroBoard implements ILayeredComponent {
@Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
- IDrawingObserver drawingObserver) {
- Point2D finalSecondPoint = getFinalSecondPoint();
+ IDrawingObserver drawingObserver) {
+ Point2D finalSecondPoint = getFinalSecondPoint();
Shape clip = g2d.getClip();
if (checkPointsClipped(clip) && !clip.contains(firstPoint.getX(), finalSecondPoint.getY())
@@ -63,7 +64,7 @@ public class VeroBoard extends AbstractVeroBoard implements ILayeredComponent {
if (alpha < MAX_ALPHA) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
}
- double x = firstPoint.getX();
+ double x = firstPoint.getX();
double y = firstPoint.getY();
int stripSize = getClosestOdd((int) STRIP_SIZE.convertToPixels());
int holeSize = getClosestOdd((int) HOLE_SIZE.convertToPixels());
@@ -73,9 +74,9 @@ public class VeroBoard extends AbstractVeroBoard implements ILayeredComponent {
while (y < finalSecondPoint.getY() - spacing - stripSize / 2) {
x = firstPoint.getX();
y += spacing;
- g2d.setColor(stripColor);
+ g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(true);
- g2d.fillRect((int)(x + spacing / 2), (int)(y - stripSize / 2), (int)(finalSecondPoint.getX() - spacing - x), stripSize);
+ g2d.fillRect((int)(x + spacing / 2), (int)(y - stripSize / 2), (int)(finalSecondPoint.getX() - spacing - x), stripSize);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
g2d.drawRect((int)(x + spacing / 2), (int)(y - stripSize / 2), (int)(finalSecondPoint.getX() - spacing - x), stripSize);
@@ -91,9 +92,9 @@ public class VeroBoard extends AbstractVeroBoard implements ILayeredComponent {
while (x < finalSecondPoint.getX() - spacing) {
x += spacing;
y = firstPoint.getY();
- g2d.setColor(stripColor);
+ g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(true);
- g2d.fillRect((int)(x - stripSize / 2), (int)(y + spacing / 2), stripSize, (int)(finalSecondPoint.getY() - spacing - y));
+ g2d.fillRect((int)(x - stripSize / 2), (int)(y + spacing / 2), stripSize, (int)(finalSecondPoint.getY() - spacing - y));
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
g2d.drawRect((int)(x - stripSize / 2), (int)(y + spacing / 2), stripSize, (int)(finalSecondPoint.getY() - spacing - y));
@@ -111,14 +112,14 @@ public class VeroBoard extends AbstractVeroBoard implements ILayeredComponent {
}
}
- @Override
- public int getLayerId() {
- return 1;
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
+ @Override
+ public int getLayerId() {
+ return 1;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
}
@Override
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/ChassisPanel.java b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/ChassisPanel.java
index 8a98b19c..906f8e81 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/ChassisPanel.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/ChassisPanel.java
@@ -1,41 +1,42 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.chassis;
-import java.awt.AlphaComposite;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import org.diylc.common.ObjectCache;
-import org.diylc.components.shapes.AbstractShape;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+
+import org.diylc.common.ObjectCache;
+import org.diylc.components.shapes.AbstractShape;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Chassis Panel", author = "Branislav Stojkovic", category = "Electro-Mechanical",
instanceNamePrefix = "CP", description = "One side of a chassis, with or withouth rounded edges",
@@ -45,11 +46,11 @@ public class ChassisPanel extends AbstractShape {
private static final long serialVersionUID = 1L;
- protected Size edgeRadius = new Size(0d, SizeUnit.mm);
-
- public ChassisPanel() {
- this.color = LIGHT_METAL_COLOR;
- this.borderColor = LIGHT_METAL_COLOR.darker();
+ protected Size edgeRadius = new Size(0d, SizeUnit.mm);
+
+ public ChassisPanel() {
+ this.color = LIGHT_METAL_COLOR;
+ this.borderColor = LIGHT_METAL_COLOR.darker();
}
@Override
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/DialScale.java b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/DialScale.java
index 206994c7..ecfdcb29 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/DialScale.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/DialScale.java
@@ -24,6 +24,7 @@ import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.ObjectCache;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/EllipticalCutout.java b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/EllipticalCutout.java
index ad6289a6..340af317 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/EllipticalCutout.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/EllipticalCutout.java
@@ -20,6 +20,7 @@ package org.diylc.components.chassis;
import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.Graphics2D;
+
import org.diylc.common.ObjectCache;
import org.diylc.components.shapes.AbstractShape;
import org.diylc.components.transform.SimpleComponentTransformer;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/PolygonalCutout.java b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/PolygonalCutout.java
index 28103865..2120aa0d 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/PolygonalCutout.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/PolygonalCutout.java
@@ -23,6 +23,7 @@ import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.Arrays;
+
import org.diylc.common.ObjectCache;
import org.diylc.components.shapes.AbstractShape;
import org.diylc.components.transform.SimpleComponentTransformer;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/RectangularCutout.java b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/RectangularCutout.java
index 6bad9a47..4177c398 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/chassis/RectangularCutout.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/chassis/RectangularCutout.java
@@ -20,6 +20,7 @@ package org.diylc.components.chassis;
import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.Graphics2D;
+
import org.diylc.common.ObjectCache;
import org.diylc.components.shapes.AbstractShape;
import org.diylc.components.transform.SimpleComponentTransformer;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/AWG.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/AWG.java
index 65c83095..3320ff03 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/AWG.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/AWG.java
@@ -19,22 +19,22 @@
along with DIYLC. If not, see .
*/
-package org.diylc.components.connectivity;
-
-public enum AWG {
-
- _8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30, _32, _34, _36;
-
- @Override
- public String toString() {
- return "#" + name().replace("_", "") + " / " + String.format("%1$,.2f", diameterIn() * 25.4) + "mm";
+package org.diylc.components.connectivity;
+
+public enum AWG {
+
+ _8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30, _32, _34, _36;
+
+ @Override
+ public String toString() {
+ return "#" + name().replace("_", "") + " / " + String.format("%1$,.2f", diameterIn() * 25.4) + "mm";
}
public double diameterIn() {
return Math.pow(Math.E, -1.12436 - 0.11594 * getValue());
- }
-
- public int getValue() {
- return Integer.parseInt(name().replace("_", ""));
- }
-}
+ }
+
+ public int getValue() {
+ return Integer.parseInt(name().replace("_", ""));
+ }
+}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CopperTrace.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CopperTrace.java
index 5bf73e3a..baff2381 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CopperTrace.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CopperTrace.java
@@ -22,6 +22,9 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.util.EnumSet;
import java.util.Set;
+
+import com.bancika.gerberwriter.GerberFunctions;
+
import org.diylc.common.ObjectCache;
import org.diylc.common.PCBLayer;
import org.diylc.components.AbstractLeadedComponent;
@@ -40,7 +43,6 @@ import org.diylc.core.gerber.GerberRenderMode;
import org.diylc.core.gerber.IGerberComponentSimple;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
-import com.bancika.gerberwriter.GerberFunctions;
@ComponentDescriptor(name = "Copper Trace", author = "Branislav Stojkovic", category = "Connectivity",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "Trace",
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CurvedTrace.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CurvedTrace.java
index 0a82e18a..56a3608a 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CurvedTrace.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CurvedTrace.java
@@ -22,6 +22,9 @@ import java.awt.Graphics2D;
import java.awt.geom.Path2D;
import java.util.EnumSet;
import java.util.Set;
+
+import com.bancika.gerberwriter.GerberFunctions;
+
import org.diylc.common.LineStyle;
import org.diylc.common.ObjectCache;
import org.diylc.common.PCBLayer;
@@ -40,7 +43,6 @@ import org.diylc.core.gerber.GerberRenderMode;
import org.diylc.core.gerber.IGerberComponentSimple;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
-import com.bancika.gerberwriter.GerberFunctions;
@ComponentDescriptor(name = "Curved Trace", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "Trace", description = "Curved copper trace with two control points",
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CutLine.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CutLine.java
index 84b20208..0828fd8c 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CutLine.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/CutLine.java
@@ -22,6 +22,7 @@ import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
+
import org.diylc.common.ObjectCache;
import org.diylc.common.OrientationHV;
import org.diylc.components.AbstractTransparentComponent;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Dot.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Dot.java
index 9d6b85ac..8958fc6c 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Dot.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Dot.java
@@ -1,43 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.Point2D;
-import org.diylc.components.AbstractComponent;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Dot", category = "Connectivity", author = "Branislav Stojkovic",
description = "Connector dot", instanceNamePrefix = "Dot", zOrder = IDIYComponent.COMPONENT,
@@ -126,10 +127,10 @@ public class Dot extends AbstractComponent {
}
@Override
- public void setValue(Void value) {}
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
+ public void setValue(Void value) {}
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Eyelet.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Eyelet.java
index baae3e09..c202a7db 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Eyelet.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Eyelet.java
@@ -1,52 +1,53 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.common.ObjectCache;
-import org.diylc.components.AbstractComponent;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.core.annotations.PositiveMeasureValidator;
-import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.diylc.common.ObjectCache;
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.core.annotations.PositiveMeasureValidator;
+import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Eyelet", category = "Connectivity", author = "Branislav Stojkovic",
description = "Eyelet or turret terminal", instanceNamePrefix = "Eyelet",
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
- keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
+ keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
enableCache = true)
public class Eyelet extends AbstractComponent {
@@ -69,11 +70,11 @@ public class Eyelet extends AbstractComponent {
return;
}
int diameter = getClosestOdd((int) size.convertToPixels());
- int holeDiameter = getClosestOdd((int) holeSize.convertToPixels());
+ int holeDiameter = getClosestOdd((int) holeSize.convertToPixels());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
- g2d.setColor(color);
+ g2d.setColor(color);
drawingObserver.startTrackingContinuityArea(true);
- g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
+ g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: color.darker());
@@ -165,16 +166,16 @@ public class Eyelet extends AbstractComponent {
@Override
public void setValue(String value) {
this.value = value;
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public Rectangle2D getCachingBounds() {
- double size = getSize().convertToPixels();
- return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public Rectangle2D getCachingBounds() {
+ double size = getSize().convertToPixels();
+ return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/GroundFill.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/GroundFill.java
index 9f4dfa72..0db6d4ac 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/GroundFill.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/GroundFill.java
@@ -1,51 +1,53 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.util.Arrays;
-import java.util.EnumSet;
-import java.util.Set;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.PCBLayer;
-import org.diylc.components.AbstractComponent;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.ILayeredComponent;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.gerber.GerberLayer;
-import org.diylc.core.gerber.GerberRenderMode;
-import org.diylc.core.gerber.IGerberComponentSimple;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import com.bancika.gerberwriter.GerberFunctions;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.Set;
+
+import com.bancika.gerberwriter.GerberFunctions;
+
+import org.diylc.common.ObjectCache;
+import org.diylc.common.PCBLayer;
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.ILayeredComponent;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.gerber.GerberLayer;
+import org.diylc.core.gerber.GerberRenderMode;
+import org.diylc.core.gerber.IGerberComponentSimple;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Ground Fill", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "GF", description = "Polygonal ground fill area", zOrder = IDIYComponent.TRACE,
@@ -64,28 +66,28 @@ public class GroundFill extends AbstractComponent implements ILayeredCompo
protected Color color = COLOR;
protected PointCount pointCount = PointCount._4;
- private PCBLayer layer = PCBLayer._1;
-
- @Override
- public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
- Project project, IDrawingObserver drawingObserver) {
- g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
- Color fillColor =
- componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
- : color;
- g2d.setColor(fillColor);
- int[] xPoints = new int[controlPoints.length];
- int[] yPoints = new int[controlPoints.length];
- for (int i = 0; i < controlPoints.length; i++) {
- xPoints[i] = (int)controlPoints[i].getX();
- yPoints[i] = (int)controlPoints[i].getY();
- }
- drawingObserver.startTrackingContinuityArea(true);
- g2d.fillPolygon(xPoints, yPoints, controlPoints.length);
- drawingObserver.stopTrackingContinuityArea();
- // Do not track any changes that follow because the whole board has been
- // tracked so far.
- drawingObserver.stopTracking();
+ private PCBLayer layer = PCBLayer._1;
+
+ @Override
+ public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
+ Project project, IDrawingObserver drawingObserver) {
+ g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
+ Color fillColor =
+ componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
+ : color;
+ g2d.setColor(fillColor);
+ int[] xPoints = new int[controlPoints.length];
+ int[] yPoints = new int[controlPoints.length];
+ for (int i = 0; i < controlPoints.length; i++) {
+ xPoints[i] = (int)controlPoints[i].getX();
+ yPoints[i] = (int)controlPoints[i].getY();
+ }
+ drawingObserver.startTrackingContinuityArea(true);
+ g2d.fillPolygon(xPoints, yPoints, controlPoints.length);
+ drawingObserver.stopTrackingContinuityArea();
+ // Do not track any changes that follow because the whole board has been
+ // tracked so far.
+ drawingObserver.stopTracking();
}
@EditableProperty(name = "Color")
@@ -155,10 +157,10 @@ public class GroundFill extends AbstractComponent implements ILayeredCompo
public void setLayer(PCBLayer layer) {
this.layer = layer;
}
-
- @Override
- public int getLayerId() {
- return getLayer().getId();
+
+ @Override
+ public int getLayerId() {
+ return getLayer().getId();
}
@Deprecated
@@ -169,11 +171,11 @@ public class GroundFill extends AbstractComponent implements ILayeredCompo
@Deprecated
@Override
- public void setValue(Void value) {}
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
+ public void setValue(Void value) {}
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
}
@Override
@@ -191,25 +193,25 @@ public class GroundFill extends AbstractComponent implements ILayeredCompo
public String toString() {
return name().substring(1);
};
- }
-
- @Override
- public Set getGerberRenderModes() {
- return EnumSet.of(GerberRenderMode.Normal);
- }
-
- @Override
- public GerberLayer getGerberLayer() {
- return getLayer().toGerberCopperLayer();
- }
-
- @Override
- public String getGerberFunction() {
- return GerberFunctions.CONDUCTOR;
- }
-
- @Override
- public boolean isGerberNegative() {
- return false;
+ }
+
+ @Override
+ public Set getGerberRenderModes() {
+ return EnumSet.of(GerberRenderMode.Normal);
+ }
+
+ @Override
+ public GerberLayer getGerberLayer() {
+ return getLayer().toGerberCopperLayer();
+ }
+
+ @Override
+ public String getGerberFunction() {
+ return GerberFunctions.CONDUCTOR;
+ }
+
+ @Override
+ public boolean isGerberNegative() {
+ return false;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/HookupWire.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/HookupWire.java
index ee9cab96..9584c10d 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/HookupWire.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/HookupWire.java
@@ -25,6 +25,7 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Path2D;
+
import org.diylc.common.ObjectCache;
import org.diylc.components.AbstractCurvedComponent;
import org.diylc.components.transform.SimpleComponentTransformer;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Jumper.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Jumper.java
index baa6292f..2f69dd61 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Jumper.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Jumper.java
@@ -1,42 +1,43 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import org.diylc.common.Display;
-import org.diylc.common.LineStyle;
-import org.diylc.common.ObjectCache;
-import org.diylc.components.AbstractLeadedComponent;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.CreationMethod;
-import org.diylc.core.IContinuity;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+
+import org.diylc.common.Display;
+import org.diylc.common.LineStyle;
+import org.diylc.common.ObjectCache;
+import org.diylc.components.AbstractLeadedComponent;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.CreationMethod;
+import org.diylc.core.IContinuity;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Size;
@ComponentDescriptor(name = "Jumper", author = "Branislav Stojkovic", category = "Connectivity",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "J", description = "",
@@ -49,7 +50,7 @@ public class Jumper extends AbstractLeadedComponent implements IContinuity
public static Color COLOR = Color.blue;
@Deprecated
- private Color color;
+ private Color color;
protected LineStyle style = LineStyle.SOLID;
public Jumper() {
@@ -80,17 +81,17 @@ public class Jumper extends AbstractLeadedComponent implements IContinuity
this.leadColor = color;
}
return super.getLeadColor();
- }
-
- @EditableProperty(name = "Style")
- public LineStyle getStyle() {
- if (style == null)
- style = LineStyle.SOLID;
- return style;
- }
-
- public void setStyle(LineStyle style) {
- this.style = style;
+ }
+
+ @EditableProperty(name = "Style")
+ public LineStyle getStyle() {
+ if (style == null)
+ style = LineStyle.SOLID;
+ return style;
+ }
+
+ public void setStyle(LineStyle style) {
+ this.style = style;
}
public Color getBodyColor() {
@@ -156,29 +157,29 @@ public class Jumper extends AbstractLeadedComponent implements IContinuity
@Override
public Display getDisplay() {
return super.getDisplay();
- }
-
- @Deprecated
- @Override
- public Integer getFontSizeOverride() {
- // TODO Auto-generated method stub
- return super.getFontSizeOverride();
- }
-
- @Deprecated
- @Override
- public LabelOriantation getLabelOriantation() {
- // TODO Auto-generated method stub
- return super.getLabelOriantation();
- }
-
- @Override
- public boolean arePointsConnected(int index1, int index2) {
- return index1 <= 1 && index2 <= 1 && index1 != index2;
- }
-
- public boolean getMoveLabel() {
- // override to disable edit
- return false;
+ }
+
+ @Deprecated
+ @Override
+ public Integer getFontSizeOverride() {
+ // TODO Auto-generated method stub
+ return super.getFontSizeOverride();
+ }
+
+ @Deprecated
+ @Override
+ public LabelOriantation getLabelOriantation() {
+ // TODO Auto-generated method stub
+ return super.getLabelOriantation();
+ }
+
+ @Override
+ public boolean arePointsConnected(int index1, int index2) {
+ return index1 <= 1 && index2 <= 1 && index1 != index2;
+ }
+
+ public boolean getMoveLabel() {
+ // override to disable edit
+ return false;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Line.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Line.java
index cb240bf0..0b0234d2 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Line.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Line.java
@@ -19,8 +19,8 @@
along with DIYLC. If not, see .
*/
-package org.diylc.components.connectivity;
-
+package org.diylc.components.connectivity;
+
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
@@ -29,6 +29,7 @@ import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
+
import org.diylc.common.Display;
import org.diylc.common.LineStyle;
import org.diylc.common.ObjectCache;
@@ -44,17 +45,17 @@ import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
-
-@ComponentDescriptor(name = "Line", author = "Branislav Stojkovic", category = "Shapes",
- creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "LN", description = "Line with optional arrows",
- zOrder = IDIYComponent.COMPONENT, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
- transformer = SimpleComponentTransformer.class)
-public class Line extends AbstractLeadedComponent {
-
- private static final long serialVersionUID = 1L;
-
- public static Color COLOR = Color.black;
-
+
+@ComponentDescriptor(name = "Line", author = "Branislav Stojkovic", category = "Shapes",
+ creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "LN", description = "Line with optional arrows",
+ zOrder = IDIYComponent.COMPONENT, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
+ transformer = SimpleComponentTransformer.class)
+public class Line extends AbstractLeadedComponent {
+
+ private static final long serialVersionUID = 1L;
+
+ public static Color COLOR = Color.black;
+
private Color color = COLOR;
protected LineStyle style = LineStyle.SOLID;
private Size thickness = new Size(1d, SizeUnit.px);
@@ -66,16 +67,16 @@ public class Line extends AbstractLeadedComponent {
@SuppressWarnings("unused")
@Deprecated
private transient AffineTransform arrowTx;
-
- @Override
- public void drawIcon(Graphics2D g2d, int width, int height) {
- g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
- g2d.setColor(COLOR);
- g2d.drawLine(1, height - 2, width - 2, 1);
- }
-
- @Override
- public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
+
+ @Override
+ public void drawIcon(Graphics2D g2d, int width, int height) {
+ g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
+ g2d.setColor(COLOR);
+ g2d.drawLine(1, height - 2, width - 2, 1);
+ }
+
+ @Override
+ public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
IDrawingObserver drawingObserver) {
float thickness = (float) getThickness().convertToPixels();
Stroke stroke = null;
@@ -90,7 +91,7 @@ public class Line extends AbstractLeadedComponent {
stroke = ObjectCache.getInstance().fetchStroke(thickness, new float[] {thickness, thickness * 5}, 0, BasicStroke.CAP_ROUND);
break;
}
- g2d.setStroke(stroke);
+ g2d.setStroke(stroke);
g2d.setColor(componentState == ComponentState.SELECTED ? SELECTION_COLOR : color);
Point2D first = getControlPoint(0);
@@ -129,7 +130,7 @@ public class Line extends AbstractLeadedComponent {
interpolate(endPoint, startPoint, getArrowSize().convertToPixels() * 0.9 / distance, endPoint);
}
- g2d.drawLine((int)startPoint.getX(), (int)startPoint.getY(), (int)endPoint.getX(), (int)endPoint.getY());
+ g2d.drawLine((int)startPoint.getX(), (int)startPoint.getY(), (int)endPoint.getX(), (int)endPoint.getY());
}
private void interpolate(Point2D p1, Point2D p2, double t, Point2D p) {
@@ -138,12 +139,12 @@ public class Line extends AbstractLeadedComponent {
private double distance(Point2D p1, Point2D p2) {
return Math.sqrt((p1.getX() - p2.getX()) * (p1.getX() - p2.getX()) + (p1.getY() - p2.getY()) * (p1.getY() - p2.getY()));
- }
-
- @Override
- public Color getLeadColorForPainting(ComponentState componentState) {
- return componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
- : color;
+ }
+
+ @Override
+ public Color getLeadColorForPainting(ComponentState componentState) {
+ return componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
+ : color;
}
public Polygon getArrow() {
@@ -178,20 +179,20 @@ public class Line extends AbstractLeadedComponent {
public void setArrowSize(Size arrowSize) {
this.arrowSize = arrowSize;
arrow = null;
- }
-
- @Override
- public Color getLeadColor() {
- return super.getLeadColor();
- }
-
- @EditableProperty
- public Color getColor() {
- return color;
- }
-
- public void setColor(Color color) {
- this.color = color;
+ }
+
+ @Override
+ public Color getLeadColor() {
+ return super.getLeadColor();
+ }
+
+ @EditableProperty
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
}
@EditableProperty(name = "Style")
@@ -205,7 +206,7 @@ public class Line extends AbstractLeadedComponent {
this.style = style;
}
- @EditableProperty(name = "Start Arrow")
+ @EditableProperty(name = "Start Arrow")
public boolean getArrowStart() {
return arrowStart;
}
@@ -223,79 +224,79 @@ public class Line extends AbstractLeadedComponent {
this.arrowEnd = arrowEnd;
}
- public Color getBodyColor() {
- return super.getBodyColor();
- }
-
- @Override
- public Color getBorderColor() {
- return super.getBorderColor();
- }
-
- @Override
- public Byte getAlpha() {
- return super.getAlpha();
- }
-
- @Override
- public Size getLength() {
- return super.getLength();
- }
-
- @Override
- public Size getWidth() {
- return super.getWidth();
- }
-
- @Override
- public Void getValue() {
- return null;
- }
-
- @Override
- public void setValue(Void value) {}
-
- @Override
- protected Shape getBodyShape() {
- return null;
- }
-
- @Override
- protected Size getDefaultWidth() {
- return null;
- }
-
- @Override
- protected Size getDefaultLength() {
- return null;
+ public Color getBodyColor() {
+ return super.getBodyColor();
+ }
+
+ @Override
+ public Color getBorderColor() {
+ return super.getBorderColor();
+ }
+
+ @Override
+ public Byte getAlpha() {
+ return super.getAlpha();
+ }
+
+ @Override
+ public Size getLength() {
+ return super.getLength();
+ }
+
+ @Override
+ public Size getWidth() {
+ return super.getWidth();
+ }
+
+ @Override
+ public Void getValue() {
+ return null;
+ }
+
+ @Override
+ public void setValue(Void value) {}
+
+ @Override
+ protected Shape getBodyShape() {
+ return null;
+ }
+
+ @Override
+ protected Size getDefaultWidth() {
+ return null;
+ }
+
+ @Override
+ protected Size getDefaultLength() {
+ return null;
}
@Override
public String getControlPointNodeName(int index) {
return null;
- }
-
- @Deprecated
- @Override
- public Color getLabelColor() {
- return super.getLabelColor();
- }
-
- @Deprecated
- @Override
- public String getName() {
- return super.getName();
- }
-
- @Deprecated
- @Override
- public Display getDisplay() {
- return super.getDisplay();
+ }
+
+ @Deprecated
+ @Override
+ public Color getLabelColor() {
+ return super.getLabelColor();
+ }
+
+ @Deprecated
+ @Override
+ public String getName() {
+ return super.getName();
+ }
+
+ @Deprecated
+ @Override
+ public Display getDisplay() {
+ return super.getDisplay();
}
@Deprecated
@Override
public org.diylc.components.AbstractLeadedComponent.LabelOriantation getLabelOriantation() {
return super.getLabelOriantation();
- }
-}
+ }
+}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/PCBTerminalBlock.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/PCBTerminalBlock.java
index 5ed5fb41..504b41fe 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/PCBTerminalBlock.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/PCBTerminalBlock.java
@@ -28,6 +28,7 @@ import java.awt.geom.Area;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
import org.diylc.common.Orientation;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderLug.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderLug.java
index 19a8a506..da5225c6 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderLug.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderLug.java
@@ -29,6 +29,7 @@ import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.awt.TwoCircleTangent;
import org.diylc.common.IPlugInPort;
import org.diylc.common.ObjectCache;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderPad.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderPad.java
index 487982c3..e734cca6 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderPad.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/SolderPad.java
@@ -24,6 +24,9 @@ import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.EnumSet;
import java.util.Set;
+
+import com.bancika.gerberwriter.GerberFunctions;
+
import org.diylc.common.PCBLayer;
import org.diylc.components.AbstractComponent;
import org.diylc.components.transform.SimpleComponentTransformer;
@@ -46,7 +49,6 @@ import org.diylc.core.gerber.IGerberDrawingObserver;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
-import com.bancika.gerberwriter.GerberFunctions;
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic",
description = "Copper solder pad, round or square", instanceNamePrefix = "Pad",
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TraceCut.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TraceCut.java
index 891577ff..3bc979a3 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TraceCut.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TraceCut.java
@@ -1,48 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.OrientationHV;
-import org.diylc.components.AbstractComponent;
-import org.diylc.components.boards.AbstractBoard;
-import org.diylc.components.boards.VeroBoard;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.ILayeredComponent;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.diylc.common.ObjectCache;
+import org.diylc.common.OrientationHV;
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.boards.AbstractBoard;
+import org.diylc.components.boards.VeroBoard;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.ILayeredComponent;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Trace Cut", category = "Connectivity", author = "Branislav Stojkovic",
description = "Designates the place where a trace on the vero board needs to be cut", instanceNamePrefix = "Cut",
@@ -59,14 +60,14 @@ public class TraceCut extends AbstractComponent implements ILayeredCompone
public static Color SELECTION_COLOR = Color.red;
public static Size HOLE_SIZE = new Size(0.7d, SizeUnit.mm);
- private Size size = SIZE;
- @SuppressWarnings("unused")
+ private Size size = SIZE;
+ @SuppressWarnings("unused")
@Deprecated
private Color fillColor = FILL_COLOR;
@Deprecated
private Color borderColor = BORDER_COLOR;
private Color boardColor = AbstractBoard.PHENOLIC_COLOR;
- private Boolean cutBetweenHoles = false;
+ private Boolean cutBetweenHoles = false;
private OrientationHV orientation = OrientationHV.VERTICAL;
private Size holeSpacing = VeroBoard.SPACING;
@@ -77,25 +78,25 @@ public class TraceCut extends AbstractComponent implements ILayeredCompone
IDrawingObserver drawingObserver) {
if (checkPointsClipped(g2d.getClip())) {
return;
- }
+ }
g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(1f));
int size = getClosestOdd((int) this.size.convertToPixels());
int cutWidth = getClosestOdd((int) CUT_WIDTH.convertToPixels());
if (getCutBetweenHoles()) {
int holeSpacing = getClosestOdd(getHoleSpacing().convertToPixels());
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
- : getBoardColor());
- drawingObserver.startTrackingContinuityArea(false);
+ : getBoardColor());
+ drawingObserver.startTrackingContinuityArea(false);
if (getOrientation() == OrientationHV.VERTICAL)
- g2d.fillRect((int)(point.getX() - holeSpacing / 2 - cutWidth / 2), (int)(point.getY() - size / 2 - 1), cutWidth, size + 2);
- else
- g2d.fillRect((int)(point.getX() - size / 2 - 1), (int)(point.getY() - holeSpacing / 2 - cutWidth / 2), size + 2, cutWidth);
+ g2d.fillRect((int)(point.getX() - holeSpacing / 2 - cutWidth / 2), (int)(point.getY() - size / 2 - 1), cutWidth, size + 2);
+ else
+ g2d.fillRect((int)(point.getX() - size / 2 - 1), (int)(point.getY() - holeSpacing / 2 - cutWidth / 2), size + 2, cutWidth);
drawingObserver.stopTrackingContinuityArea();
} else {
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
- : getBoardColor());
+ : getBoardColor());
drawingObserver.startTrackingContinuityArea(false);
- g2d.fillRoundRect((int)(point.getX() - size / 2), (int)(point.getY() - size / 2), size, size, size, size);
+ g2d.fillRoundRect((int)(point.getX() - size / 2), (int)(point.getY() - size / 2), size, size, size, size);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(Constants.CANVAS_COLOR);
@@ -225,38 +226,38 @@ public class TraceCut extends AbstractComponent implements ILayeredCompone
public void setHoleSpacing(Size holeSpacing) {
this.holeSpacing = holeSpacing;
- }
-
- @EditableProperty(name = "Cut Orientation")
- public OrientationHV getOrientation() {
- if (orientation == null)
- orientation = OrientationHV.VERTICAL;
- return orientation;
- }
-
- public void setOrientation(OrientationHV orientation) {
- this.orientation = orientation;
+ }
+
+ @EditableProperty(name = "Cut Orientation")
+ public OrientationHV getOrientation() {
+ if (orientation == null)
+ orientation = OrientationHV.VERTICAL;
+ return orientation;
+ }
+
+ public void setOrientation(OrientationHV orientation) {
+ this.orientation = orientation;
}
@Deprecated
@Override
public String getName() {
return super.getName();
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public Rectangle2D getCachingBounds() {
- double size = getSize().convertToPixels();
- return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
- }
-
- @Override
- public int getLayerId() {
- return 1;
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public Rectangle2D getCachingBounds() {
+ double size = getSize().convertToPixels();
+ return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
+ }
+
+ @Override
+ public int getLayerId() {
+ return 1;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Turret.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Turret.java
index ebdc300d..bd5c21f7 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Turret.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/Turret.java
@@ -1,50 +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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.connectivity;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.common.ObjectCache;
-import org.diylc.components.AbstractComponent;
-import org.diylc.components.transform.SimpleComponentTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-import org.diylc.core.IDrawingObserver;
-import org.diylc.core.Project;
-import org.diylc.core.VisibilityPolicy;
-import org.diylc.core.annotations.BomPolicy;
-import org.diylc.core.annotations.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.annotations.KeywordPolicy;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.diylc.common.ObjectCache;
+import org.diylc.components.AbstractComponent;
+import org.diylc.components.transform.SimpleComponentTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+import org.diylc.core.IDrawingObserver;
+import org.diylc.core.Project;
+import org.diylc.core.VisibilityPolicy;
+import org.diylc.core.annotations.BomPolicy;
+import org.diylc.core.annotations.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.annotations.KeywordPolicy;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Turret Lug", category = "Connectivity", author = "Branislav Stojkovic",
description = "Turret terminal lug", instanceNamePrefix = "Turret",
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
- keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
+ keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
enableCache = true)
public class Turret extends AbstractComponent {
@@ -68,10 +69,10 @@ public class Turret extends AbstractComponent {
}
int diameter = getClosestOdd((int) size.convertToPixels());
int holeDiameter = getClosestOdd((int) holeSize.convertToPixels());
- g2d.setColor(color);
- g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(1f));
+ g2d.setColor(color);
+ g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(1f));
drawingObserver.startTrackingContinuityArea(true);
- g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
+ g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: color.darker());
@@ -163,16 +164,16 @@ public class Turret extends AbstractComponent {
@Override
public void setValue(String value) {
this.value = value;
- }
-
- @Override
- public String getControlPointNodeName(int index) {
- return null;
- }
-
- @Override
- public Rectangle2D getCachingBounds() {
- double size = getSize().convertToPixels();
- return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
+ }
+
+ @Override
+ public String getControlPointNodeName(int index) {
+ return null;
+ }
+
+ @Override
+ public Rectangle2D getCachingBounds() {
+ double size = getSize().convertToPixels();
+ return new Rectangle2D.Double(point.getX() - size, point.getY() - size, size * 2, size * 2);
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TwistedWire.java b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TwistedWire.java
index 2f25f46b..c2d1d058 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TwistedWire.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/connectivity/TwistedWire.java
@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
+
import org.diylc.common.LineStyle;
import org.diylc.common.ObjectCache;
import org.diylc.components.AbstractCurvedComponent;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/BatterySnap9V.java b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/BatterySnap9V.java
index af05c5b7..14ca2d8f 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/BatterySnap9V.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/BatterySnap9V.java
@@ -1,53 +1,54 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.electromechanical;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.Polygon;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.common.IPlugInPort;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.Orientation;
-import org.diylc.components.AbstractTransparentComponent;
-import org.diylc.components.transform.BatterySnapTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-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.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Polygon;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.ObjectCache;
+import org.diylc.common.Orientation;
+import org.diylc.components.AbstractTransparentComponent;
+import org.diylc.components.transform.BatterySnapTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+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.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
@ComponentDescriptor(name = "9V Battery Snap", category = "Electro-Mechanical", author = "Branislav Stojkovic",
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_4.java b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_4.java
index 51016cde..87bacfa7 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_4.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_4.java
@@ -1,63 +1,64 @@
-/*
-
- 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 .
-
-*/
+/*
+
+ 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 .
+
+*/
package org.diylc.components.electromechanical;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.RoundRectangle2D;
-import org.diylc.appframework.miscutils.ConfigurationManager;
-import org.diylc.awt.StringUtils;
-import org.diylc.common.HorizontalAlignment;
-import org.diylc.common.IPlugInPort;
-import org.diylc.common.ObjectCache;
-import org.diylc.common.Orientation;
-import org.diylc.common.VerticalAlignment;
-import org.diylc.components.AbstractMultiPartComponent;
-import org.diylc.components.transform.CliffJackTransformer;
-import org.diylc.core.ComponentState;
-import org.diylc.core.IDIYComponent;
-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.ComponentDescriptor;
-import org.diylc.core.annotations.EditableProperty;
-import org.diylc.core.gerber.IGerberComponentSimple;
-import org.diylc.core.measures.Size;
-import org.diylc.core.measures.SizeUnit;
-import org.diylc.utils.Constants;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import org.diylc.appframework.miscutils.ConfigurationManager;
+
+import org.diylc.awt.StringUtils;
+import org.diylc.common.HorizontalAlignment;
+import org.diylc.common.IPlugInPort;
+import org.diylc.common.ObjectCache;
+import org.diylc.common.Orientation;
+import org.diylc.common.VerticalAlignment;
+import org.diylc.components.AbstractMultiPartComponent;
+import org.diylc.components.transform.CliffJackTransformer;
+import org.diylc.core.ComponentState;
+import org.diylc.core.IDIYComponent;
+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.ComponentDescriptor;
+import org.diylc.core.annotations.EditableProperty;
+import org.diylc.core.gerber.IGerberComponentSimple;
+import org.diylc.core.measures.Size;
+import org.diylc.core.measures.SizeUnit;
+import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Cliff 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
description = "Cliff-style closed panel mount 1/4\" phono jack",
- zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J", autoEdit = false, transformer = CliffJackTransformer.class,
+ zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J", autoEdit = false, transformer = CliffJackTransformer.class,
enableCache = true)
public class CliffJack1_4 extends AbstractMultiPartComponent implements IGerberComponentSimple {
@@ -78,8 +79,8 @@ public class CliffJack1_4 extends AbstractMultiPartComponent implement
private JackType type = JackType.MONO;
private Orientation orientation = Orientation.DEFAULT;
transient private Area[] body;
- @SuppressWarnings("unused")
- @Deprecated
+ @SuppressWarnings("unused")
+ @Deprecated
private transient String value = "";
public CliffJack1_4() {
@@ -221,8 +222,8 @@ public class CliffJack1_4 extends AbstractMultiPartComponent implement
finalBorderColor = theme.getOutlineColor();
} else {
finalBorderColor = BORDER_COLOR;
- }
-
+ }
+
drawingObserver.stopTracking();
g2d.setColor(finalBorderColor);
@@ -250,16 +251,16 @@ public class CliffJack1_4 extends AbstractMultiPartComponent implement
: LABEL_COLOR;
}
g2d.setColor(finalLabelColor);
- g2d.setFont(project.getFont());
-
- // Override font size
- if (getFontSizeOverride() != null)
- g2d.setFont(g2d.getFont().deriveFont(1f * getFontSizeOverride()));
+ g2d.setFont(project.getFont());
+
+ // Override font size
+ if (getFontSizeOverride() != null)
+ g2d.setFont(g2d.getFont().deriveFont(1f * getFontSizeOverride()));
double centerX = (controlPoints[0].getX() + controlPoints[3].getX()) / 2;
double centerY = (controlPoints[0].getY() + controlPoints[3].getY()) / 2;
- StringUtils.drawCenteredText(g2d, name, centerX, centerY, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
-
+ StringUtils.drawCenteredText(g2d, name, centerX, centerY, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
+
drawSelectionOutline(g2d, componentState, outlineMode, project, drawingObserver);
}
@@ -291,16 +292,16 @@ public class CliffJack1_4 extends AbstractMultiPartComponent implement
g2d.drawLine(pinX1, width * 2 / 8, pinX1, width * 3 / 8);
g2d.drawLine(pinX1, width * 5 / 8, pinX1, width * 6 / 8);
g2d.drawLine(pinX2, width * 2 / 8, pinX2, width * 3 / 8);
- g2d.drawLine(pinX2, width * 5 / 8, pinX2, width * 6 / 8);
-
- g2d.setColor(LABEL_COLOR);
- g2d.setFont(LABEL_FONT.deriveFont(width / 3.5f));
-
- RenderingHints rh = new RenderingHints(
- RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
- g2d.setRenderingHints(rh);
-
+ g2d.drawLine(pinX2, width * 5 / 8, pinX2, width * 6 / 8);
+
+ g2d.setColor(LABEL_COLOR);
+ g2d.setFont(LABEL_FONT.deriveFont(width / 3.5f));
+
+ RenderingHints rh = new RenderingHints(
+ RenderingHints.KEY_TEXT_ANTIALIASING,
+ RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
+ g2d.setRenderingHints(rh);
+
StringUtils.drawCenteredText(g2d, "6.3", width / 2 - 1, height / 2, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
@@ -348,10 +349,10 @@ public class CliffJack1_4 extends AbstractMultiPartComponent implement
public void setOrientation(Orientation orientation) {
this.orientation = orientation;
updateControlPoints();
- }
-
- @Override
- public boolean canPointMoveFreely(int pointIndex) {
- return false;
+ }
+
+ @Override
+ public boolean canPointMoveFreely(int pointIndex) {
+ return false;
}
}
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_8.java b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_8.java
index 053ffd25..207cafc9 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_8.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/CliffJack1_8.java
@@ -30,6 +30,7 @@ import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import org.diylc.appframework.miscutils.ConfigurationManager;
+
import org.diylc.awt.StringUtils;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.IPlugInPort;
diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/ClosedJack1_4.java b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/ClosedJack1_4.java
index 1555f9df..3e11ef7a 100644
--- a/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/ClosedJack1_4.java
+++ b/diylc/diylc-library/src/main/java/org/diylc/components/electromechanical/ClosedJack1_4.java
@@ -1,60 +1,61 @@
-/*
-
- 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