Add logging

This commit is contained in:
Bane Stojkovic
2022-04-23 20:13:42 +02:00
parent c24187eeb6
commit 5605becb98
2 changed files with 41 additions and 31 deletions
@@ -1,24 +1,21 @@
/* /*
*
DIY Layout Creator (DIYLC). * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
Copyright (c) 2009-2018 held jointly by the individual authors. *
* This file is part of DIYLC.
This file is part of DIYLC. *
* DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU
DIYLC is free software: you can redistribute it and/or modify * General Public License as published by the Free Software Foundation, either version 3 of the
it under the terms of the GNU General Public License as published by * License, or (at your option) any later version.
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
DIYLC is distributed in the hope that it will be useful, * Public License for more details.
but WITHOUT ANY WARRANTY; without even the implied warranty of *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * You should have received a copy of the GNU General Public License along with DIYLC. If not, see
GNU General Public License for more details. * <http://www.gnu.org/licenses/>.
*
You should have received a copy of the GNU General Public License */
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.netlist; package org.diylc.netlist;
import java.util.ArrayList; import java.util.ArrayList;
@@ -29,7 +26,7 @@ import java.util.Set;
import org.diylc.core.IDIYComponent; import org.diylc.core.IDIYComponent;
public class Netlist implements Comparable<Netlist> { public class Netlist implements Comparable<Netlist> {
private List<IDIYComponent<?>> components; private List<IDIYComponent<?>> components;
private Set<Group> groups = new HashSet<Group>(); private Set<Group> groups = new HashSet<Group>();
private List<SwitchSetup> switchSetup = new ArrayList<SwitchSetup>(); private List<SwitchSetup> switchSetup = new ArrayList<SwitchSetup>();
@@ -41,26 +38,26 @@ public class Netlist implements Comparable<Netlist> {
public Set<Group> getGroups() { public Set<Group> getGroups() {
return groups; return groups;
} }
public Netlist add(Group g) { public Netlist add(Group g) {
groups.add(g); groups.add(g);
return this; return this;
} }
public List<IDIYComponent<?>> getComponents() { public List<IDIYComponent<?>> getComponents() {
return components; return components;
} }
public List<Group> getSortedGroups() { public List<Group> getSortedGroups() {
List<Group> list = new ArrayList<Group>(groups); List<Group> list = new ArrayList<Group>(groups);
Collections.sort(list); Collections.sort(list);
return list; return list;
} }
public List<SwitchSetup> getSwitchSetup() { public List<SwitchSetup> getSwitchSetup() {
return switchSetup; return switchSetup;
} }
public void done() { public void done() {
Collections.sort(switchSetup); Collections.sort(switchSetup);
} }
@@ -93,6 +90,7 @@ public class Netlist implements Comparable<Netlist> {
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Switch setup: ").append(getSwitchSetup()).append("\n\n");
List<Group> list = getSortedGroups(); List<Group> list = getSortedGroups();
for (Group g : list) { for (Group g : list) {
sb.append("\t").append(g).append("\n"); sb.append("\t").append(g).append("\n");
@@ -3804,15 +3804,27 @@
<org.diylc.appframework.update.Version> <org.diylc.appframework.update.Version>
<versionNumber> <versionNumber>
<major>4</major> <major>4</major>
<minor>22</minor> <minor>23</minor>
<build>3</build> <build>0</build>
</versionNumber> </versionNumber>
<releaseDate>2022-03-18 00:00:00.000 CET</releaseDate> <releaseDate>2022-04-23 00:00:00.000 CET</releaseDate>
<name></name> <name></name>
<changes> <changes>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Improved rendering performance</description> <description>Fixed the issue with the application not starting under Windows</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Added 'Slide Switch' component</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Improved rendering performance significantly</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Include JRE in the universal ZIP package (the embedded JRE is only for Windows)</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
</changes> </changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url> <url>https://github.com/bancika/diy-layout-creator/releases</url>