Coder Social home page Coder Social logo

processjfx's Introduction

ProcessJFX

This is a school OOP project using javafx made with eclipse, I'm trying to remake processing's functionment with javafx. The auto (compile/run) only works on windows for now It can currently run really simple 2D processing sketch without much work. For this to work, you need to copy your processing's Sketch folder and then change the extension to .pjfx. Finally you have to change the following:

  • int(x) -> _int(x)
  • float(x) -> _float(x)
  • float g = 12.6 -> float g = 12.6f
  • Add public keyword to the following function
    • setup()
    • draw()
    • mousePressed()
    • mouseReleased()
    • mouseDragged()
    • mouseMoved()
    • keyPressed()
    • keyReleased()
    • keyTyped()

Compile and run Manually

Move to the correct directory

cd ProcessJFX

Only once

Compile the ProssecFX with the following lines.

(windows)

javac -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib -d bin --add-modules javafx.controls, src/engine/Core.java
javac -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib --add-modules javafx.controls, preCompiler/precompiler/PreCompiler.java
javac -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib -d bin --add-modules javafx.controls, preCompiler/precompiler/PreCompiler.java

(linux)

javac -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib -d bin --add-modules javafx.controls, src/engine/Core.java
javac -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib --add-modules javafx.controls, preCompiler/precompiler/PreCompiler.java
javac -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib -d bin --add-modules javafx.controls, preCompiler/precompiler/PreCompiler.java

To Run your code you need to follow these 3 step:

  • For a project called MySketch inside the default sketchBook directory.

    • The sketchBook is the parent directory of your sketch folder.
    • MySketch is the Name of the directory where all your .pjfx files for a project are stored.

    (windows)

java -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib --add-modules javafx.controls, precompiler.PreCompiler --project-name MySketch

(linux)

java -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib --add-modules javafx.controls, precompiler.PreCompiler --project-name MySketch
  • For a project called MySketch not in the default sketchBook directory.

    (windows)

java -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib --add-modules javafx.controls, precompiler.PreCompiler --project-name MySketch --project-path \path\to\the\other\sketchBook

(linux)

java -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib --add-modules javafx.controls, precompiler.PreCompiler --project-name MySketch --project-path /path/to/the/other/sketchBook
  • Compile your project with

(windows)

javac -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib -d bin --add-modules javafx.controls, .\src\sketch\template\__UserDefault.java

(linux)

javac -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib -d bin --add-modules javafx.controls, src/sketch/template/__UserDefault.java
  • Run your project with

(windows)

java -cp ".\bin\;libs\com\json.jar:libs\window\javafx\lib" --module-path .\libs\window\javafx\lib --add-modules javafx.controls, engine.Core

(linux)

java -cp "bin/:libs/com/json.jar:libs/linux/javafx/lib" --module-path libs/linux/javafx/lib --add-modules javafx.controls, engine.Core

Auto Compile/Run your project (windows only)

  1. Move to project directory
  2. java -cp .\bin compiler.Projfx SketchFolderName

To specify the directory in wich your sketch forlder is located add the absolute path from the parent directory of the sketch as second argument.

  • java -cp .\bin compiler.Projfx SketchFolderName AbsolutePathToSketchParentFolder

processjfx's People

Contributors

zevest avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.