Skip to content

seoProductions/TemplateGeneration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Template Generation made in JAVA!

Template generation maps a 2D vector field of integers onto the JavaFX application and its grid. Many settings are provided for tweaking and expiriementing, Along with some pre-made "Templates" that modify the 2D vector field directly. Please note that this project is aimed towards creativity :). Have some fun!

Features

Here is my project!

first

The templates I have created are the Following:

Diagnal

diagnal

Curves

Here I implimented some sinusoidal behavior

curves

Spiral

swirl

ZigZags

zigzag

C

Heres another interesting one:

C

Lightning!

My Favorite! This one's quite fun to play with

lightning_magnitude

Here it is again with: random magnitude [checked]

lightning_random

Settings!

Here is a close up of my Setting's Implentation:

Kooha-2024-04-18-13-07-03

You can modify the sinusoidal behavior

degrees

You can also change the grid size

grid_size

A visual play back speed could come in handy :)

playbackspeed

More!

I created a Highlighting effect on the Tiles (or Rectangles). With this, you can acually see mouse in these demonstrations :)

highlighting

I also created a Console that responds to any changes in the Application!

console

Algorithm 2?

Yes I noted that too, dont worry its ๐Ÿšฆ๐Ÿšง๐Ÿ”ถ under construction ๐Ÿšฆ๐Ÿšง๐Ÿ”ถ :)

Behind the Scenes - Visualy

My project heavily utilizes the concepts of Object Oriented Programing. Here is a class diagram of my project:

image

as usual, Each class has its own functionality and behavior. Take a look:

image

This is the advantage of Object Oriented programming! I am able to create different classes and organize them for specific needs.

Project Design

At the center of it all is the APP. Its responsible for

  • Creating window (using JavaFX)
  • Loading FXML file onto the application (Similar to HTML)
  • Setting application Controller & Initializing some Event listeners for FXML components
  • Setting window as draggable
  • Instantiating all other classes (TileManager, AppController, ect...)

The AppController class an extention (subclass) of JavaFX's Initializable class. Essencially, it's what "makes the application alive". Its responsible for

  • Initializing Events listeners for FXML components. (sliders, boxes, ect...)
  • Applying inline CSS style to FXML components.
  • Handling behavior and selection options from the GUI components.

The TileManager handles the "Tiles/Rectangles" on the screen. Its responsiblity is to

  • Retrieve values from FXML components
  • Initialize & manage 2D Vector field of integers (IntField)
  • Initialize & manage grid of "FancyRectangles" (the one you see on screen)
  • Animate "FancyRectangles" according to the rendering algorithm
  • Handle Animations using JavaFX's TimeLine class

The FancyRectange class uses composition of JavaFX's Rectangle class. It is responsible for

  • Highlighting Tiles/Rectangles when the user's mouse is hovering over
  • Modifying CSS properties
  • Storing current color and refrence to its Rectangle object

The DraggableMaker class simply makes the window draggable by your mouse.

  • The App is responsible for initializing DraggableMaker, and with this -> it waits for a mouse' click and runs some calculations.

The IntField class holds the 2D vector/array of integers I have been talking about. It

  • Initializes 2D vector
  • Holds the backbone for modifying these integer values
  • Houses a few additional helper "Templates"
  • handles many calculations and inbound checks It also Supports the toString() funtion for debugging (This was my original prototype)

Finally, the GenerationTemplates class is a large collection of user-made "Templates". It has many expiriemental templates that I made during developement, aswell as some other interesting additions. The lightning Template was by far the most challenging to create, but is by far my favorite.

Member Variables

For more insight, take a look at the member variables for each class. It really highlight the "Behind the Scenes"

image

Context

This application was my end of year project that I built my 11'th grade year of Highschool! I had just finished up Object Oriented Programing in Java and I felt that I was ready to build something! ...

This project started off from simply printing a 2D array onto the terminal -> and it turned into me creating a small scale application. Honestly I was a complete beginer with everything: java features, IDE's, git, debugging, Frameworks, Project Design (A big one!!!), and soo many more. All these I learned throught my deveopement of this App, I even had to redesign this project half way in - before I got my final product.

Shout out to my Pre-Cal teacher! She inspired me to make this!

If you have any advice or questions, please feel free to reach out to me:

About

2D grid template generation and playground. Made with JavaFx + Maven

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors