Skip to content

Shryne/goop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goop

EO principles respected here DevOps By Rultor.com

Sonar coverage PDD status Known Vulnerabilities Reviewed by Hound

codebeat badge CodeFactor Mutation tested with PIT

** This project is an experiment. **

Goop is an object oriented graphics library. It uses LWJGL to create the windows and draw the shapes. The advantages over plain Java2D/Swing/JavaFX are:

  • It is based on decorators
  • The state of every object is set by the call of the constructor
  • No setters/getters
  • Small classes and interfaces
  • Every method is defined by an interface
    And most important: The object knows what happens to him.
    Here is an example to visualize how it will look:
new Window(
  "I am a window",
  new Area2D(
    new Pos2D(0, 0),
    new Size2D(500, 500)
  ),
  new Rect(
    new Area2D(
      new Pos2D(0, 0),
      new Size2D(500, 500)
    ),
    new Black()
  )
).show();

Or using the defaults and assuming that the size of the rectangle is equal to the size of the window:

new Window(
  "I am a window",
  new Rect(
    new Size2D(500, 500)
  )
).show();

This is how a moving rect would look like:

new Window(
  "I am a window with a moving rect",
  new Size(500, 500),
  new Rect(
    new Moving(
      new Pos2D(0, 0), // from
      new Pos2D(100, 100), // to
      10_000 // ms needed
    ),
    new Size2D(200, 200)
  )
).show();

The class Moving implements Pos and Rect takes a Pos - no getter/setter needed, because the object itself is in control.

About

A decorator based high level library to create windows and draw shapes on it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •