Meeting 1

Aus Java Student User Group Austria - Java + JVM in Wien Österreich / Vienna Austria
Wechseln zu: Navigation, Suche

When: Monday, May 26th, 2008 - 19:00

Where: Freihaus HS4


Maven - An Introduction

First of all Florian Motlik introduced the JSUG, who we are, what we do and where we want to go.

Afterwards he gave a short introduction to maven.

Links


OurMovies - Yet another MovieManager

Logo

Download the slides (pdf, 2.6MB).
You can also view the slides online.


Preface

This presentation was about the open source project OurMovies by Christoph Pickl. Beside an introduction to the application itself, some of the core technologies were introduced, e.g.:

  • db4o - A fully object oriented database management system for Java
  • QTJ - Quicktime for Java; used for playing videos embedded within a Java GUI
  • SwingX - Enhanced components for Swing


Content

OurMovies

  • Yet another tool to manage your movies stored on harddisk
  • Plays videos within the application (Quicktime necessary)
  • Hosted on SourceForge (GPL)
  • Look&Feel of iTunes (most of the code for gui stuff)
  • Features: metadata fetching, smartfolder, smartcopy, quickview

SwingX

  • Enhanced widget functionality: find/search, auto-completion
  • Sorting and filtering for tables, trees and lists
  • Provides a login/authentication framework
  • drop shadows, translucency, ...

QTJ

  • Manipulation of Images/Audio/Video
  • Creation of 2D/3D-Animations
  • Get power of full QuickTime functionality (not only API for application itself)

A simple example of how to use QTJ: <source lang="java"> // open a quicktime session QTSession.open();

// open the movie file File file = new File("/some_movie.mpg"); OpenMovieFile openMovieFile = OpenMovieFile.asRead(new QTFile(file)); Movie movie = Movie.fromFile(openMovieFile);

// create a standard player for your movie MoviePlayer player = new MoviePlayer(movie); QTJComponent qtjPlayer = QTFactory.makeQTJComponent(player);

// convert the qtjPlayer to a swing conform component (awt would be possible too) JComponent playerComponent = qtjPlayer.asJComponent();

// finally use the playerComponent in your common swing components JPanel somePanel = new JPanel(); somePanel.add(playerComponent);

// [...]

// finally close the session to free the resources QTSession.close(); </source>


db4o

  • OpenSource plus commercially licensed
  • available not only for Java, but also for .Net (C#) developer
  • very simple usage:

<source lang="java"> import com.db4o.*;

public class Db4oFirstSteps {

 public static void main(String[] args) {
   ObjectContainer db = Db4o.openFile("db.yap");
   try {
     // database operations
   } finally {
     db.close();
   }
 }

} </source>

  • CRUD operations made easy:

<source lang="java"> // insert Person person = new Person("Anna", "Nym"); db.set(person);

// update person.setLastName("Nuem"); db.set(person);

// delete db.delete(person); </source>

  • three different query languages available: QbE (Query by Example), SODA (Simple Object Database Access) and NQ (Native Queries)


QbE example: <source lang="java"> // default values (null, false, 0, 0.0) will be ignored Person prototype = new Person("Anna", null);

// pass example to the ObjectContainer ObjectSet<Person> result = db.get(prototype);

while(result.hasNext()) {

 Person p = result.next();
 // process every person with firstName equals "Anna"

} </source>


SODA example: <source lang="java"> Query query = db.query(); query.constrain(Student.class);

// no getters necessary (private variables are accessible) query.descend("firstName").constrain("Anna");

// will be and-connected with previous constrain (default) query.descend("matrNr").constrain(525580).or(

query.descend("matrNr").constrain(525581)

);

ObjectSet<Student> result = query.execute(); </source>


NQ example: <source lang="java"> ObjectSet<Person> result = db.query(

 // pass an anonymous Predicate implementation
 new Predicate<Person>() {
   public boolean match(Person candidate) {
     // fetch all persons where first name is "A*"
     return candidate.getFirstName().startsWith("A");
   }
 }

); </source>

Links