Kirill Grouchnikov legt Substance, Flamingo, (Java) Trident auf Eis

Aus http://old.nabble.com/Continuing-development-of-substance,-flamingo-and-others-td29568644.html:

I am currently suspending support for Substance, Flamingo, Trident and related plugins / demo projects.  I do not have any plans to delete any downloadable binaries, change the licensing terms or delete the projects themselves, or to allow others to take ownership of the original projects.  Please respect the licensing terms.
Thanks, Kirill

Sehr schade.

Jetty 7.x und meine leichte Abneigung

Jetzt wo Jetty 7 zu Eclipse gewandert ist und auch immer modularer wird, schwindet meine Euphorie gegenüber dem Projekt. Das liegt an drei Gründen.

  1. Viele Jars. Um nur ein einfaches Servlet servieren zu können sind nötig: jetty-continuations (warum es hie eine Abhängigkeit gibt ist mir Schleierhaft), jetty-http, jetty-io, jetty-security, jetty-server, jetty-servlet, jetty-util. (Man kann das auch als ein großes Jar auch den Maven Rep. holen.)
  2. Umzug nach Eclipse. Durch den Umzug nach Eclipse befinden sich Dokus aus verschiedenen Servern. Es fehlt eine klare Anlaufstelle mit und vollständiger Doku.
  3. API-Änderungen. Nicht nur der Paketnamen ändert sich, sondern auch ein paar Methoden. Das ist an sich nichts problematisch, ab wenn eben mit Punkt 2 die Dokus nicht immer auf dem neusten Stand sind, nervt das.

Zusammenfassend für ein Servlet:

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.*;

public class StartJetty
{
  public static void main( String[] args ) throws Exception
  {
    Server server = new Server( 8080 );

    ServletContextHandler context = new ServletContextHandler( server, "/" );
    context.addServlet( new ServletHolder( new HiServlet() ), "/*" );
    server.start();
    server.join();
  }
}

class HiServlet extends HttpServlet
{
  protected void doGet( HttpServletRequest request, HttpServletResponse response )
      throws ServletException, IOException
  {
    response.setContentType( "text/html" );
    response.setStatus( HttpServletResponse.SC_OK );
    response.getWriter().println( "Hi" );
  }
}

GWT 2.1 M3 verfügbar

Ankündigung siehe hier: http://googlewebtoolkit.blogspot.com/2010/08/gwt-21-milestone-3-is-now-available.html, download unter http://code.google.com/p/google-web-toolkit/downloads/detail?name=gwt-2.1.0.m3.zip.

Some key features included in this release are built-in history
support in Activities and Places, relationship management within
RequestFactory, and the ability to call instance methods on entities
themselves. The overarching goal was to nail down the API and deliver
on features and functionality that are vital to creating industry-
grade business apps.

Bei M2 gab es eine Reihe von Änderungen, die viele Komponenten deprecated machte – ohne wirklichen Ersatz. M3 werde ich aufspielen und schauen, wie es damit weitergeht. Die Doku für Activities/Places ist für M2 erbärmlich; hier kann Google noch nachbessern. Die Verknüpfung mit Roo ist mir auch noch schleierhaft, mal sehen, wie sich das entwickelt.

Text-Extraktion aus PDF-Dokumenten

Lösung mit iText:

String path = "lala.pdf";
PdfReader pdfReader = new PdfReader( path );

for ( int page = 1; page <= pdfReader.getNumberOfPages(); page++ )
{
  String textFromPage = PdfTextExtractor.getTextFromPage( pdfReader, page );
}

 

Lösung mit PDFBox:

String path = "lala.pdf";
PDDocument pdfDocument = PDDocument.load( path );
String textFromPage = new PDFTextStripper().getText( pdfDocument );
pdfDocument.close();

 

Das Ergebnis unterscheidet sich deutlich, die PDFBox gibt bessere Ergebnisse.

Sehr hübsche Swing Gauge und LCD-Komponenten

Gerrit Grunwald schrieb mit eine kurze EMail und machte mich auf seine Komponenten aufmerksam, die absolut heiß sind.

ishot-1.png ishot-3.png

ishot-2.png ishot-5.png

ishot-4.png ishot-10.png

ishot-11.png ishot-8.png

ishot-9.png Radar.png

ishot-6.png ishot-7.png

ishot-12.png

ishot-13.png

Altimeter.png Clock.png

Compass.pngLevel.png

 

 

Eine großartige Arbeit mit viele Liebe zum Detail. Was mir auch gefällt ist ein Konverter von Fireworks-Dateien in Java 2D Zeichenanweisungen.

PS: Wer noch weitere tolle Swing Bibs kennt, bitte vorstellen und teilen. Weitere von mir gibt es hier: http://www.tutego.de/java/additional-java-swing-components.htm

Oracle klagt gegen Google wegen Copyright- und Patentverletzungen in Android

Irgendwie hat man das schon geahnt, dass nach dem Sun zu Oracle geht, sich das Klima im Unternehmen ändern könnte. Nun ist es soweit und Oracle klagt wegen Copyright und Patentverletzungen.

Die Anklageschrift ist zu lesen unter http://www.scribd.com/doc/35811761/Oracle-s-complaint-against-Google-for-Java-patent-infringement. Irgendwie bekommt man den Eindruck, dass Oracle hier rumheult und jammert, dass Google mit Android Geld macht und das arme Oraclelein nichts davon abbekommt. Das ignoriert die Tatsache, dass das ganze System Open-Source ist und Google — hier müssen wir den Aussagen von Google glauben — auch überhaupt nichts an Android verdient. (Eric Schmidt erwähnte das letzte Woche in einem Interview.)

Mehr:

Commons Lang 3.0 in Beta und (endlich) angepasst auf Java 5

Aus http://commons.apache.org/lang/article3_0.html:

What’s new in Commons Lang 3.0?

Commons Lang 3.0 is (not yet) out, and the obvious question is: "So what? What’s changed?".

The big story

Lang is now Java 5 based. We’ve generified the API, moved certain APIs to support varargsand thrown out any features that are now supported by Java itself. We’ve removed the deprecated parts of the API and have also removed some features that were deemed weak or unnecessary. All of this means that Lang 3.0 is not backwards compatible.

To that end we have changed the package name, allowing Lang 3.0 to sit side-by-side with your previous version of Lang without any bad side effects. The new package name is the exciting and original org.apache.commons.lang3.

There are also, as you’d expect, new features, enhancements and bugs fixed.

The build

We built 3.0 using Maven 2.2.1 and Java 1.5. Needs confirmation before release of actual build details

Migrating from 2.x

Despite the label of backwards incompatibility, in the vast majority of cases the simple addition of a '3' to an import statement will suffice for your migration. For example, using Perl:

find . -type f -name ‚*.java‘ | xargs perl -pi -e ’s/org\.apache\.commons\.lang\./org.apache.commons.lang3./g‘

Maven users will need to update the groupId from commons-lang to org.apache.commons, and the artifactId from commons-lang to commons-lang3.

What’s gone?

Enum package – Java 5 provided enums out of the box, therefore we dispensed with both the deprecated enum package, and the enums package. Instead you should migrate over to the standard Java enum. An EnumUtils class has been born from the ashes of the old code, focused on providing additional functionality to the standard Java enum API.

NestedExceptions – In Java 1.4, the notion that all Throwables could be linked to a cause was introduced. In Lang we had provided a NestedException framework to support the same feature, and now that we’re jumping from Java 1.3 to Java 5 we are remove this feature. The deprecation section below covers one part of ExceptionUtils that remains until we are on Java 6, where the last remaining parts of the JDK appear to have embraced the new cause API.

JVMRandom – This class was introduced in Lang 2.0 to support a Random object built around the system seed. This proved to be both an uncommon use case and one with bugs and so was dropped.

StringEscapeUtils.escapeSql – This was a misleading method, only handling the simplest of possible SQL cases. As SQL is not Lang’s focus, it didn’t make sense to improve this method.

Various Exception classes were removed – the lesson in defining more semantically relevant exception classes is that you can keep on coming up with more and more new classes. Simpler to focus on using the main JDK classes.

The various Range classes in the math package were removed in favour of a new Range class.

All deprecated fields/methods/classes – with a new major version, all of the previously deprecated parts of the API could finally go away.

If you feel that something was unfairly taken away, please feel free to contact the list. In many cases the possibility exists to reintroduce code.

Deprecations

The lone deprecation in 3.0 is that of the notion of ‚cause method names‘ in ExceptionUtils. In Java 5.0 it is still just about needed to handle some JDK classes that have not been migrated to the getCause API. In Java 6.0 things appear to be resolved and we will remove the related methods in Lang 4.0.

New packages

Two new packages have shown up. org.apache.commons.lang3.concurrent, which unsurprisingly provides support classes for multi-threaded programming, and org.apache.commons.lang3.text.translate, which provides a pluggable API for text transformation.

TODO: Add examples

New classes

CharSequenceUtils

EnumUtils

Pair

Range

builder.Builder

exception.ContextedException

exception.CloneFailedException

reflect.ConstructorUtils

reflect.FieldUtils

reflect.MethodUtils

reflect.TypeUtils

text.WordUtils

New methods

What’s fixed in Lang 3.0?

Weitere Änderungen: http://commons.apache.org/lang/upgradeto3_0.html.

So und wann kommt nun Common Collections für Java 5?

Eclipse WTP 3.2.1 Update mit JAXB Generator und vielen weiteren Neuerungen

Die Eclipse Web Tools Platform ist in der Version 3.2.1. Neben den Java EE , JSF 2.0 Updates, Tomcat 7 Support, JAX-RS Wizards, XPath-View ist auch ein JAXB Schema Generator mit dabei:

JAXB XML Schema Generation
    Dali has added JAXB Schema Generation support to WTP. You can now generate an XML Schema (XSD) for a chosen set of JAXB mapped Java classes in your workspace. Use the "New" wizard at the Workspace, Project, or Package level to access the "JAXB->Schema from JAXB Classes" wizard.
    JAXB Schema Gen
    Select the classes that you want to use for schema generation. Select a project, package, or just individual classes.
    JAXB Schema Gen2
JAXB Class Generation
    Dali has added JAXB class generation support to WTP. Users can now generate classes for a given XML schema (XSD) in their workspace. Use the "Generate" context menu on any schema in a Java project to invoke the wizard.
    JAXB Gen
    JAXB Gen2

Nette Sachen dabei, schaut rein:

Lebenszyklus in Google Guice einführen

Wenn man von Spring kommt ist man gewöhnt, dass es ein Lebenszyklus gibt insbesondere mit

  • @PostConstruct

Standardmäßig gibt es das mit Guice nicht und das ist ziemlich ungünstig, insbesondere wenn man Spring-Projekte migrieren möchte. (Siehe Diskussion http://code.google.com/p/google-guice/issues/detail?id=62)

Allerdings gibt es http://code.google.com/p/guiceyfruit/. Das bildet den Lebenszkylus, vorgeschrieben durch Annotationen (http://code.google.com/p/guiceyfruit/wiki/Annotations), nach. Es wird einfach als Modul mit hinzugenommen, etwa so:

Injector injector = Guice.createInjector( new Jsr250Module(), new MEINModule() );

Mit paketsichtbaren Methoden gibt es aber Probleme: Sie müssen public sein.