Giter VIP home page Giter VIP logo

sgf-animation's Introduction

SGF Animation

Introduction

SGF is an acronym for "Simple game format". This game format was first developed for the game of Go, and later extended to encompase other board games. Here's the official specification of the SGF format.

I thought it would be an interesting project to create a Java Swing GUI to animate an SGF Go game file. In other words, play though a game at a steady pace to allow a person to appreciate or comment on the moves of a particular game.

I encountered one major problem. SGF files from various Go servers vary wildly in their actual format.

This is an unfinished project at this time.

Here's the Swing GUI when you start the application.

start

The first step is to either browse your hard drive for a specific SGF file, or type in a URL that points to an SGF file.

Next, you left click on the "Load SGF file" button to load and parse the SGF file. You can also change the time between moves (in seconds) to whatever value you want. The shortest value is 3 seconds.

Finally, you left click on the "Start Animation" button to start the animation. When the animation is running, you can left click on the "Pause Animation" button to pause the animation.

Here's the Swing GUI after a few moves have been played.

paused

I have included the two SGF files that I tested this Java application with. I make no assurances that this code will work with any other SGF file.

Explantion

Oracle has a helpful tutorial, Creating a GUI With Swing. Skip the Learning Swing with the NetBeans IDE section.

When I create a Swing GUI, I use the model-view-controller (MVC) pattern. This pattern allows me to separate my concerns and focus on one part of the application at a time.

A Swing model consists of one or more plain Java getter/setter classes.

A Swing view consists of one JFrame and as many JPanels and JDialogs as you need.

Each Swing Action or Listener is its own controller. There's usually not one controller to "rule them all".

This Java Swing application contains a parser and a parser model as well as the Swing model, view, and controllers.

sgf-animation's People

Contributors

ggleblanc2 avatar

Watchers

 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.