Skip to content

Commit

Permalink
Merge pull request #38 from LucaCaruso-dev/master
Browse files Browse the repository at this point in the history
General improvements and bug fixes
  • Loading branch information
AndreaAlbanese authored Dec 11, 2024
2 parents 7567a37 + 0d482b6 commit cc0e992
Show file tree
Hide file tree
Showing 37 changed files with 155 additions and 232 deletions.
Binary file modified Compiled/Logisim-ITA.exe
100644 → 100755
Binary file not shown.
Binary file modified Compiled/Logisim-ITA.jar
Binary file not shown.
28 changes: 0 additions & 28 deletions Logisim-Fork/.classpath

This file was deleted.

6 changes: 5 additions & 1 deletion Logisim-Fork/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/module-info.class
/KAppemblerListener.class
/bin/
target/
target/
/.settings/
/.classpath
/.vscode/
/.idea/
106 changes: 0 additions & 106 deletions Logisim-Fork/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions Logisim-Fork/.settings/org.eclipse.m2e.core.prefs

This file was deleted.

29 changes: 29 additions & 0 deletions Logisim-Fork/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
Expand Down Expand Up @@ -63,6 +64,34 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>2.0.1</version>
<executions>
<execution>
<id>generate-exe</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
</execution>
</executions>
<configuration>
<outfile>${project.build.directory}/${project.artifactId}-ITA.exe</outfile>
<jar>${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar</jar>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<icon>src/main/java/resources/logisim/img/logisim-icon.ico</icon>
<jre>
<minVersion>1.8.0</minVersion>
</jre>
<classPath>
<mainClass>com.cburch.logisim.Main</mainClass>
</classPath>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion Logisim-Fork/src/main/java/com/cburch/logisim/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class Main {
// current version
public static final LogisimVersion VERSION = LogisimVersion.get(2, 16, 1, 4, LogisimVersion.getVariantFromFile());
public static final LogisimVersion VERSION = LogisimVersion.get(2, 16, 2, 0, LogisimVersion.getVariantFromFile());
// the version of the file you're using, equals to current version if new file
public static LogisimVersion FILE_VERSION;

Expand Down
44 changes: 12 additions & 32 deletions Logisim-Fork/src/main/java/com/cburch/logisim/circuit/Analyze.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;

import com.cburch.logisim.analyze.model.AnalyzerModel;
import com.cburch.logisim.analyze.model.Entry;
Expand All @@ -21,6 +22,7 @@
import com.cburch.logisim.instance.StdAttr;
import com.cburch.logisim.proj.Project;
import com.cburch.logisim.std.wiring.Pin;
import com.cburch.logisim.util.StringUtil;

public class Analyze {

Expand Down Expand Up @@ -298,43 +300,21 @@ public int compare(Instance ac, Instance bc) {
* throw new AnalyzeException.Conflict(); } } expressionMap.put(p2, e); } } } }
*/

// This function check label name
private static String toValidLabel(String label) {
if (label == null)
return null;
StringBuilder end = null;
StringBuilder ret = new StringBuilder();
boolean afterWhitespace = false;
for (int i = 0; i < label.length(); i++) {
StringBuilder buildLabel = new StringBuilder(); //StringBuilder for hold string in building
for(int i = 0; i < label.length(); i++) {
char c = label.charAt(i);
if (Character.isJavaIdentifierStart(c)) {
if (afterWhitespace) {
// capitalize words after the first one
c = Character.toTitleCase(c);
afterWhitespace = false;
}
ret.append(c);
} else if (Character.isJavaIdentifierPart(c)) {
// If we can't place it at the start, we'll dump it
// onto the end.
if (ret.length() > 0) {
ret.append(c);
} else {
if (end == null)
end = new StringBuilder();
end.append(c);
}
afterWhitespace = false;
} else if (Character.isWhitespace(c)) {
afterWhitespace = true;
} else {
; // just ignore any other characters
int unicode = label.codePointAt(i); // Get character unicode
if((unicode < 8192 || unicode > 8207) && (unicode < 8234 || unicode > 8239) && (unicode < 8298 || unicode > 8303)) { // Check that it is not a prohibited Unicode
buildLabel.append(c); // Add character on final string
}
}
if (end != null && ret.length() > 0)
ret.append(end.toString());
if (ret.length() == 0)
String newLabel = buildLabel.toString().trim();
if(newLabel.length() > 0) // If is find a character or number
return newLabel; // Return a final string
else
return null;
return ret.toString();
}

private Analyze() {
Expand Down
20 changes: 10 additions & 10 deletions Logisim-Fork/src/main/java/com/cburch/logisim/circuit/Splitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ private synchronized void configureComponent() {
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
menu.addSeparator();
menu.add(new SplitterDistributeItem(proj, this, 1));
menu.add(new SplitterDistributeItem(proj, this, -1));
menu.add(new SplitterDistributeItem(proj, this, 1));
}

@Override
Expand Down Expand Up @@ -195,15 +195,15 @@ public String getToolTip(ComponentUserEvent e) {
appendBuf(buf, beginString, bit_end.length - 1);
String base;
switch (bits) {
case 0:
base = Strings.get("splitterSplit0Tip");
break;
case 1:
base = Strings.get("splitterSplit1Tip");
break;
default:
base = Strings.get("splitterSplitManyTip");
break;
case 0:
base = Strings.get("splitterSplit0Tip");
break;
case 1:
base = Strings.get("splitterSplit1Tip");
break;
default:
base = Strings.get("splitterSplitManyTip");
break;
}
return StringUtil.format(base, buf.toString());
} else {
Expand Down
Loading

0 comments on commit cc0e992

Please sign in to comment.