|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Product Reviews JViews by ILOG, Inc
JViews by ILOG, Inc
By: Ed Zebrowski
May. 1, 1998 12:00 AM
Once upon a time, it looked as though I was set for a while on software. I had L-View, the new picture editing shareware everyone was talking about. I had Microsoft Paint, a pretty good graphics creation program (if you didn't mind your graphics looking like a child in first grade had drawn them). I had HTML Notepad and a full head of hair. What more could a budding young Web developer ask for to guarantee success in this brand new industry? As we all know, a lot has changed since then. The passing of time, as well as the dawning of new technologies, has led to the obsolescence of all of the aforementioned. (It's my hair I miss the most!) By the time the Java revolution exploded, the deck had been re-shuffled and graphics development was no exception to this rule. I've always tried to keep up with the latest developments in graphics, so I was anxious to try JViews, a new Java graphics development class library from ILOG. I've seen Java graphics packages before, many of which were not very impressive. They offered nothing more than a sparse menu of simple shapes, forms and limited choices of ways the graphics can interact with objects. JViews is different, however.
Installation It Inherits its Power from C++ ILOG took what they had learned from developing their C++ graphics library and applied it to Java. The result is a library of Java classes that can be used in the development of high performance graphics displays. It is especially useful for network layout displays, map displays (even if the end user wants to overlay these maps with their own customized objects) and customized editors. The displays that can be built with JViews can contain a very large number of graphics, upwards of tens of thousands of objects. This allows JViews to shine for those industrial-strength apps. Another benefit is the separation of presentation from behavior. While one set of pre-defined objects are graphics that know how to draw themselves, another set represents behaviors, such as selection, drag/drop and resizing. This separation has a few big advantages. Developers can assign any behavior to a graphic object to change its function. Pre-defined behavior objects can be subclassed so end users can fine-tune it to their exact needs. Although JViews is based on C++, it has the completely open architecture that is the cornerstone of Java development. Any Java lightweight component can be taken and used as a node on a network. Some of the JViews classes can even be wrapped as beans and placed on a GUI builder palette alongside other beans. JViews is built in two levels: The 2D graphics level, and the manager level.
Create Basic or Complex Graphics with JViews' Huge Library The manager level of JViews organizes sets of graphic objects into multiple views and layers with higher order interactions. All of these aspects are grouped together by an object called a manager. The grapher, a class that organizes certain objects into nodes and links, is included among the manager class hierarchy. JViews comes equipped with IlvEdit, a handy editor that is provided with source code. It allows you to easily create and edit graphic objects. The starting point for these objects is the class IlvGraphic. This class allows the graphic object to draw itself at any given destination port. If necessary, an associated object of the IlvTransformer class may be used to change the coordinates of the graphic object. IlvGraphic also has member functions that allow you to set and change geometric dimensions. Various member functions are provided to implement user properties that can be associated with an object for application-specific purposes.
It Doesn't Just Create Graphics - It Interfaces them as Well An application-programming interface (API)--a library of Java classes which contains pre-defined graphic objects and various behaviors which can be applied to these objects--is also included. The result is an easy, no-nonsense approach to interfacing graphic objects to applications. A friend of mine who is in the process of interfacing all of his household lighting through his computer was so impressed with this software that he wants to try to use it to make a GUI interface for his system. Turning on a light or the stereo was never this exciting!
A Basic Example Here¹s some of the code used to create this applet: First, the library must be imported: import ilog.views.*; The applet and AWT packages must also be imported:
import java.applet.*; If the file is going to be loaded through a URL, the java.net package must be used: import java.net.*; The applet class named sample1 is now created. This applet has two fields: The manager (class IlvManager) that stores the objects and the viewer (class IlvManagerView), which displays the content of the manager.
public class Sample1 extends Applet
{ For the initialization of the applet, the manager is created:
public void init() { The second example provided, sample2.java, shows the use of selection interactor. In this example, a button has been added to the applet. Once the button has been clicked on, graphic objects can be selected, moved and it is even possible to modify their shape. A field named selectInteractor has been added in the class:
void createInteractorButtons() It might be worth noting that the SelectInteractor is a pre-defined behavior that controls the selection of an object, the ³resize handles² that indicate that an object is selected, moved and resized, etc. Developers can choose to use this behavior ³as is², or subclass to modify just those parts of it that they want to tailor.
Other Features All in all, JViews is an excellent library from which really cool apps can be built. It enables developers to quickly and easily produce clean, crisp graphics that can be used for demonstration purposes or to be interfaced with more complex applications. It offers compatibility with other applications and, best of all, it¹s Pure Java, which means total platform independence. If you are in a position where you need a no-nonsense, hard hitting application to develop GUI interfaced graphics, give it a try. I did, and I loved it. Now if I could just find a way to get it to grow hair! Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||