Skip to content

Commit

Permalink
Fix ant build and 3D support
Browse files Browse the repository at this point in the history
  • Loading branch information
jblang committed Feb 15, 2022
1 parent 4996458 commit 32f0a38
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 49 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
bin
deploy
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
1 change: 1 addition & 0 deletions .idea/runConfigurations/Logo.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions DEVNOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ I'm using the free community edition of [IntelliJ IDEA](https://www.jetbrains.co

There are also Eclipse project files, but beyond importing them into IntelliJ, I haven't tested them. The project contains an Ant build script but again, I have not tested it. Dependency management is currently manual.

## Required Libraries
- For now, I just downloaded the dependencies from Maven Central:
- [flatlaf-2.0.1.jar](https://search.maven.org/artifact/com.formdev/flatlaf/2.0.1/jar)
- [flatlaf-extras-2.0.1.jar](https://search.maven.org/artifact/com.formdev/flatlaf-extras/2.0.1/jar)
- [svgSalamander-1.1.3.jar](https://search.maven.org/artifact/com.formdev/svgSalamander/1.1.3/jar)
- The Java 3D jars and native libraries already in the repo are untested.
## Dependencies

## Currently Untested
- Linux, macOS, and older Windows versions
- Java 9 through 16
- Java 8 (expect problems with HiDPI displays)
- Building an executable jar
- 3D support
- Networking
- Sound support
Until the ant build system is replaced with something supporting dependency management, the dependencies
are stored in the repo.

I downloaded the jars for dependencies I added from maven.org:
- [flatlaf-2.0.1.jar](https://search.maven.org/artifact/com.formdev/flatlaf/2.0.1/jar)
- [flatlaf-extras-2.0.1.jar](https://search.maven.org/artifact/com.formdev/flatlaf-extras/2.0.1/jar)
- [svgSalamander-1.1.3.jar](https://search.maven.org/artifact/com.formdev/svgSalamander/1.1.3/jar)

The remaining jars were already in the subversion repo when it was imported:
- jh.jar: JavaHelp
- j3dcore.jar: Java3D core
- j3dutils.jar: Java3D utilities
- vecmath.jar: Java3D vector math
- jl1.0.1.jar: JavaZOOM JLayer MP3 library

## Known Bugs
- Zooming and clipboard selection on images don't work right
- Fill commands currently don't work right on high resolution displays
- Rendering animations in high quality sometimes leaves artifacts
- Rendering in high quality sometimes leaves artifacts
- The scroll area for the graphics display doesn't size to properly fit
- The turtle PNGs need to be replaced with SVGs so they aren't pixelated
- Save, new, stop, and play commands don't always disable when they should
Expand Down
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ Here is a simple example that produces the image in [this screenshot](xlogo.png)

This very intuitive graphical approach makes Logo an ideal language for beginners, including children.

## Current Status

This is a development version of XLogo. I plan to release a new version it's ready, but if you want a pre-built version right now, you are better off downloading the [old version](http://xlogo.tuxfamily.org/en/download-en.html) from the XLogo website.
## Download

XLogo's development ceased in 2012. I tried to contact the original author in 2022 but got no response. I migrated the Subversion repository to GitHub and started working on some improvements:
Pre-compiled jars available on the [Releases](https://github.com/jblang/xlogo/releases) page.

- Fix blurry/pixelated scaling on high resolution displays
- Make a nice looking themeable UI using FlatLaf
- Fix bugs and improve code quality
You can also still download the [old version](http://xlogo.tuxfamily.org/en/download-en.html) from the XLogo website.

If you're not afraid to compile your own software and deal with some bugs, then read the [DEVNOTES](DEVNOTES.md) to get started.
Note: You will need Java on your computer to run XLogo. Java 11 or Java 17 is recommended. Java 8 may also work but has scaling issues on high resolution displays. If you don't already have a JDK installed, [Microsoft](https://docs.microsoft.com/en-us/java/openjdk/download) offers free OpenJDK downloads for Windows, Mac, and Linux.

## Documentation

Expand Down Expand Up @@ -50,6 +46,16 @@ Guy Walker's wonderful [Logo Arts](http://www.cr31.co.uk/logoarts/index.html) we
- Comprehensive [Primitive Reference](http://www.cr31.co.uk/logoarts/ipt/top/prim.html)
- Excellent [Book Recommendations](http://www.cr31.co.uk/logoarts/ipt/info/books.html)

## Current Status

XLogo's development ceased in 2012. I tried to contact the original author in 2022 but got no response. I migrated the Subversion repository to GitHub and started working on some improvements:

- Fix blurry/pixelated scaling on high resolution displays
- Make a nice looking themeable UI using FlatLaf
- Fix bugs and improve code quality

If you want to help improve the code, check out the [Developer Notes](DEVNOTES.md) to get started.

## Credits

### Developers
Expand All @@ -72,7 +78,10 @@ Guy Walker's wonderful [Logo Arts](http://www.cr31.co.uk/logoarts/index.html) we
- David Arso: Catalan
- Jozsef Varga: Hungarian

### Libraries
### Third-party

- [FlatLaf](https://www.formdev.com/flatlaf/): GUI Components [Apache Licensed]
- [IntelliJ Community Edition](https://jetbrains.design/intellij/resources/icons_list/): SVG Icons [Apache Licensed]
- [FlatLaf](https://www.formdev.com/flatlaf/): GUI Components (Apache license)
- [IntelliJ IDEA](https://jetbrains.design/intellij/resources/icons_list/): SVG Icons (Apache license)
- [Java3D](https://github.com/hharrison/java3d-core): OpenGL libraries (GPL license)
- [JavaHelp](https://github.com/javaee/javahelp): Help library (GPL license)
- [JLayer](https://github.com/umjammer/jlayer): MP3 library (LGPL license)
23 changes: 16 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Does the Jar has to be signed ?
================================-->

<property name="signJar" value="true" />
<property name="signJar" value="false" />

<!-- Property platform:
================================================
Expand All @@ -35,7 +35,7 @@

<!-- Version for this Build -->

<property name="version" value="0.9.94beta-2008-08-02"/>
<property name="version" value="1.0.0beta1"/>


<!-- =================================
Expand Down Expand Up @@ -147,17 +147,22 @@

<target name="compile" depends="copy.static.files">
<!-- <echo> ${ant.java.version}</echo> -->
<javac
source="1.5" encoding="utf8"
target="1.5"
<javac
source="1.8"
target="1.8"
encoding="utf8"
srcdir="src" destdir="deploy/">
<classpath>
<pathelement location="vecmath.jar"/>
<pathelement location="j3dcore.jar"/>
<pathelement location="j3dutils.jar"/>
<pathelement location="jh.jar"/>
<pathelement location="jl1.0.1.jar"/>
</classpath>
<pathelement location="jl1.0.1.jar"/>
<pathelement location="flatlaf-2.0.1.jar"/>
<pathelement location="flatlaf-extras-2.0.1.jar"/>
<pathelement location="svgSalamander-1.1.3.jar"/>

</classpath>
</javac>
</target>

Expand All @@ -172,10 +177,14 @@
<include name="j3dutils.jar"/>
<include name="jl1.0.1.jar"/>
<include name="jh.jar"/>
<include name="flatlaf-2.0.1.jar"/>
<include name="flatlaf-extras-2.0.1.jar"/>
<include name="svgSalamander-1.1.3.jar"/>
</fileset>
<fileset dir="src/">
<include name="**.properties"/>
<include name="**/*.png"/>
<include name="**/*.svg"/>
<include name="**/*.html"/>
<include name="**/genericPrimitive"/>
</fileset>
Expand Down
2 changes: 1 addition & 1 deletion manifest_xlogo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Main-Class: xlogo.Logo
Class-Path: jh.jar vecmath.jar j3dcore.jar j3dutils.jar jl1.0.1.jar
Class-Path: jh.jar vecmath.jar j3dcore.jar j3dutils.jar jl1.0.1.jar flatlaf-2.0.1.jar flatlaf-extras-2.0.1.jar svgSalamander-1.1.3.jar

31 changes: 25 additions & 6 deletions src/Lanceur.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Lanceur {
* The temporary folder which contains all files to start XLogo
*/
private File tmpFolder = null;
private final File[] files = new File[10];
private final File[] files = new File[13];
private int memoire = 64;

/**
Expand All @@ -61,20 +61,31 @@ public class Lanceur {
// Bug when launching under Windows with java webstart
javaLibraryPath = javaLibraryPath.replaceAll("\"", "");
System.out.println("Path: " + javaLibraryPath + "\n");
String[] commande = new String[5 + args.length];
int len = System.getProperty("java.version").startsWith("1.8") ? 5 : 8;
String[] commande = new String[len + args.length];
commande[0] = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
commande[1] = "-jar";
commande[2] = "-Xmx" + memoire + "m";
commande[3] = "-Djava.library.path=" + javaLibraryPath;
commande[4] = files[0].getAbsolutePath();
if (System.getProperty("java.version").startsWith("1.8")) {
commande[4] = files[0].getAbsolutePath();
} else {
// Workaround for Java3D incompatibility with Java 9+
// see: https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c9
commande[4] = "--add-exports=java.base/java.lang=ALL-UNNAMED";
commande[5] = "--add-exports=java.desktop/sun.awt=ALL-UNNAMED";
commande[6] = "--add-exports=java.desktop/sun.java2d=ALL-UNNAMED";
commande[7] = files[0].getAbsolutePath();
}
for (int i = 0; i < args.length; i++) {
commande[i + 5] = args[i];
commande[i + 7] = args[i];
// System.out.println("Argument "+i+" "+args[i]);
}
System.out.println("<----- Starting XLogo ---->");
String cmd = "";
for (int i = 0; i < commande.length; i++) {
cmd += commande[i] + " ";
if (commande[i] != null)
cmd += commande[i] + " ";
}
System.out.println(cmd + "\n\n");
p = Runtime.getRuntime().exec(commande);
Expand Down Expand Up @@ -296,7 +307,15 @@ else if (os.indexOf("sunos") != -1) {
}
}


String[] jars = new String[] {"flatlaf-2.0.1.jar", "flatlaf-extras-2.0.1.jar", "svgSalamander-1.1.3.jar"};
int f = 10;
for (String jar: jars) {
src = Lanceur.class.getResourceAsStream(jar);
File file = new File(tmpFolder.getAbsolutePath() + File.separator + jar);
files[f++] = file;
b = copier(src, file);
System.out.println("Copying " + jar + " - success: " + b);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/xlogo/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class Config {
*/
public static final int PEN_SHAPE_OVAL = 1;
/** Version number**/
static final String version = "0.9.96pre 27/06/12";
static final String version = "1.0.0 beta 1";
/** Drawing Quality **/
public static int quality = 0;
/**
Expand Down
7 changes: 3 additions & 4 deletions src/xlogo/Logo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
import org.xml.sax.helpers.XMLReaderFactory;
import xlogo.gui.Selection_Langue;
import xlogo.kernel.Affichage;
import xlogo.kernel.DrawPanel;
import xlogo.utils.SimpleContentHandler;
import xlogo.utils.Utils;

import javax.media.j3d.VirtualUniverse;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Calendar;
Expand Down Expand Up @@ -146,8 +145,8 @@ public static void main(String[] args) {

try {
// Display the java3d version
//java.util.Map<String,String> map=VirtualUniverse.getProperties();
//System.out.println("Java3d :"+map.get("j3d.version"));
java.util.Map<String,String> map= VirtualUniverse.getProperties();
System.out.println("Java3d :"+map.get("j3d.version"));
} catch (Exception e) {
System.out.println("Java3d problem");
e.printStackTrace();
Expand Down
5 changes: 2 additions & 3 deletions src/xlogo/MenuListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public class MenuListener extends JDialog implements ActionListener {
protected static final String HELP_TRANSLATE_XLOGO = "translate_xlogo";
protected static final String HELP_ABOUT = "about";
private static final long serialVersionUID = 1L;
private static final String WEB_SITE = "http://xlogo.tuxfamily.org";
private static final String MAIL = "loic@xlogo.tuxfamily.org";
private static final String WEB_SITE = "github.com/jblang/xlogo";
private final double zoomfactor = 1.25;
private final Application cadre;
private final Workspace wp;
Expand Down Expand Up @@ -253,7 +252,7 @@ public void actionPerformed(ActionEvent e) {
}
} else if (MenuListener.HELP_ABOUT.equals(cmd)) { //Boite de dialogue A propos
String message = Logo.messages.getString("message_a_propos1") + Config.version + "\n\n"
+ Logo.messages.getString("message_a_propos2") + " " + MenuListener.WEB_SITE + "\n\n" + Logo.messages.getString("message_a_propos3") + "\n " + MenuListener.MAIL;
+ Logo.messages.getString("message_a_propos2") + " " + MenuListener.WEB_SITE;
MyTextAreaDialog jt = new MyTextAreaDialog(message);
ImageIcon icone = new ImageIcon(Utils.class.getResource("icone.png"));
JOptionPane.showMessageDialog(null, jt, Logo.messages.getString("menu.help.about"), JOptionPane.INFORMATION_MESSAGE, icone);
Expand Down

0 comments on commit 32f0a38

Please sign in to comment.