Giter Site home page Giter Site logo

kanvas's Introduction

JKanvas

An easy-to-use ZUI (Zoomable User Interface) implementation for Java. In order to create a ZUI component you can use the following snippet:

Renderpass renderpass = new RenderpassAdapter() {

  @Override
  public void draw(final Graphics2D gfx, final KanvasContext ctx) {
    // draw here
    // ctx can be used to convert between canvas and component coordinates
  }

  @Override
  public boolean click(final Point2D p, final MouseEvent e) {
    // react to events
  }

  @Override
  public Rectangle2D getBoundingBox() {
    // optionally return a bounding-box
  }

};
RenderpassPainter painter = new RenderpassPainter();
painter.addPass(renderpass);
Canvas canvas = new Canvas(painter, width, height);
// ...
parent.add(canvas); // adds the canvas to the parent component
canvas.reset(); // scrolls the bounding-box of the painter into view

In the package jkanvas.examples are examples that further show how to use the canvas for various tasks.

Maven Integration

In order to use JKanvas within a Maven project you can use the following dependency (in the <dependencies> section):

<dependency>
  <groupId>joschi-mvn</groupId>
  <artifactId>JKanvas</artifactId>
  <version>0.0.1</version>
</dependency>

However, this requires an additional repository in the repositories section (<repositories>) of the pom.xml file:

<repository>
  <id>joschi</id>
  <url>http://merkur57.inf.uni-konstanz.de/~krause/mvn/releases</url>
</repository>

kanvas's People

Contributors

enplotz avatar josuakrause 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.