Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesBeyond GUI Graphics


June 1997 / Javatalk / Beyond GUI Graphics

ObjectGraphics delivers true object-oriented graphics programming.

Rick Grehan

There is more to Java and graphics than just building GUIs for clients. Offerings from the likes of Microsoft, Powersoft/Sybase, and Symantec provide a wealth of visual Java development systems that are well suited for creating GUI-style graphics. However, Java can do much more than act as a client-side framework on which to hang buttons, text boxes, and scroll bars. And as more developers use Java as a general-purpose language, there will be an increased need for packages like ObjectGraphics, from Applied Visions.

ObjectGraphics comprises a set of class libraries and attendant help files. These cla ss libraries encompass a collection of graphical objects that let you build 2-D graphical Java applications and applets in truly object-oriented fashion. With the libraries, you can create paint/draw, CAD/CAM, graphical-financial-analysis, and similar types of applications.

ObjectGraphics comes from a proud heritage. The algorithms that sit at the heart of the package, incarnate in C++ and Pascal, have already been used. For instance, Pascal versions of ObjectGraphics were used in two versions of Imsi's well-known TurboCAD product.

Object-Oriented Graphics

You can think of ObjectGraphics as a toolbox of classes for instantiating graphical objects. Classes for rectangles, ellipses, polygons, pie charts, and Bézier curves are included.

The classes provided by ObjectGraphics implement objects that, simply put, do what objects were meant to do. That is, they know how to draw and scale themselves, and they can determine whether they have been touched by a mouse-click. Furthermore, the graphical objects come with methods for altering their appearance (e.g., you can specify the arc width and height of the corners of a rounded rectangle). The objects also have graphics utility methods (e.g., a rectangle can tell you whether a point is within its bounding region).

Drawable objects are not the only entities in ObjectGraphics. You'll also find a set of drawing tools, such as a brush object (for filling shapes), a pen object (for drawing shape outlines), and a font object (for text).

The programming environment of ObjectGraphics is a kind of 2-D world, implemented in a GCanvas object. The GCanvas object is actually a container that carries (among other things) a GSpace object, which understands coordinate systems. The GCanvas object also carries a GPicture object that contains all the rectangles, circles, and polygons that your program draws.

This is less complicated than it sounds. Obj ectGraphics extends fundamental applet and application classes ( applet and frame , respectively) to contain member Canvas objects. Consequently, little code is required to imbue your Java applet or application with object-oriented graphics capabilities. Once you've initialized the Canvas object, you can begin dropping graphical objects into it. ObjectGraphics automatically does all the real work for you.

Nice View

For a package like ObjectGraphics to be useful, it must be accompanied by copious source-code examples. Fortunately, it is. The ObjectDraw sample application is the most instructive. It implements a moderately complex drawing application (or applet) that lets you create and manipulate any of the graphical objects supported by ObjectGraphics.

I discovered ObjectGraphics' mouse support while experimenting with ObjectDraw; you can, for example, pick a rectangle up, move it to a new location, and drop it. ObjectGraph ics handles the operation smoothly.

Currently, ObjectGraphics is compatible only with Java systems based on version 1.0.2 of JavaSoft's JDK command-line development environment. (I used ObjectGraphics successfully with version 1.0 of Symantec's Visual Café.) At the time of this writing, a spokesman for Applied Visions told me that the company was watching the market's acceptance of JDK 1.1 closely and would consider updating to the new version if circumstances warranted. This is reasonable: Making ObjectGraphics dependent on JDK 1.1 features would make it unusable in virtually all current browsers.

I found working with ObjectGraphics to be straightforward, even though I experimented with a late beta version of the package. Its price of $249.95 (with source code; $99.95 without) definitely makes it worth your attention if your graphics development goes beyond text boxes and buttons.


Product Information


Applied
 Visions, Inc.

Northport, NY
Phone:    516-754-4920
Fax:      516-754-1721
Internet: 
http://www.avi.com


HotBYTEs
 - information on products covered or advertised in BYTE


Fully Sourced Code

screen_link (25 Kbytes)

ObjectGraphics includes the full source code to ObjectDraw, and object-oriented, graphics-based drawing package.


Rick Grehan i s a senior editor at Computer Design magazine and coauthor of The Client/Server Toolkit (NobleNet 1996). You can contact him at rickg@pennwell.com .

Up to the Javatalk section contentsGo to next article: Life in the BeanBoxSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network