Perforce JViews Framework sample gallery
How to run the samples is explained in the starting the samples page.
Basic Samples (SDK)
Creating Graphics Objects
This sample shows a view containing one instance of each class in the
JViews graphic package. The class name for each object type is listed next
to the object.
To make code more readable, most JViews samples read the data necessary
to create graphers from JViews .ivl files.
This sample shows the Java code necessary to create JViews graphics
objects. In this sample graphic objects are created by calling the
NewGraphics.addGraphicObjects()
method.
In addition to standard JViews graphics types, a custom graphic object
is defined and displayed in this sample. The
MyZoomableReliefLabel
class demonstrates how to create
your own unique graphics types.
Swing Components in a Manager
This sample shows the integration of Swing JComponent
objects into a JViews manager. Components are embedded in a
IlvJComponentGraphic
graphic object.
Drag and Drop
This sample includes the code to drag and drop an IlvGraphic
object from one IlvManager
to another. You are shown how
to incorporate the Java 2 drag-and-drop mechanism with JViews to add
drag-and-drop capabilities in your custom applications.
Extending Java 2D Primitives
This sample contains code showing how to extend Java 2D objects such as
Paint
and Stroke
, add new drawing capabilities
to Java 2D objects, integrate new Java 2D objects into Perforce JViews code and
manage object persistency.
Grapher Samples
Connection Points
This simple sample shows the following:
- How to create a grapher and define connection points
for node links using
IlvGrapherPin
objects. - How to create a link between two nodes and edit grapher pins.
IlvGrapher
instance or grapher is a data structure
used to display any type of network.
Accessibility
Accessibility
This sample shows how to implement various accessibility features when displaying a manager.
Performance
Animation and Triple Buffering
This sample displays a manager with a background map of the world.
On top of the map, animated objects representing planes journeys
are displayed. Above the plans, there are also semi-transparent
clouds.
The background map is drawn using triple buffering. The cloud
layer is cached in this demo. Using these techniques the complexity
of the map and the clouds does not affect the redrawing time.
Integration
SVG and IVL Format Converters
This sample shows how to save a Perforce JViews display to a Scalable
Vector Graphic (SVG) file, and how recognized elements of a SVG file are
translated into Perforce JViews graphic objects.
SVG is a language for describing two-dimensional graphics in XML. The
W3C Recommendation of the SVG language specification can be found at
http://www.w3.org/TR/SVG/.
Reading a DXF File
This sample shows how to read DXF files in Perforce JViews.
Reading an SVG File
This simple sample shows how to use the IlvMagnifyInteractor
class to magnify an area of a Perforce JViews IlvManager
instance that has been filled with contents imported from a file in
Scalable Vector Graphic (SVG)
format.
Web Deployment with JavaServer Faces
Basic Manager (JSF and JavaScript)
This sample shows how to bind a manager view to a Perforce JViews JSF component.
Other Web Deployment
Basic Grapher (Servlet & DHTML)
The "XML Grapher" sample shows how to build a Thin Client web application.
Some web applications require that client applications in the web browser stay very light, and that most of the functionality is implimented in the server. The SVG thin-client support in Perforce JViews allows you to create such light web client applications easily.
Use the power of the Perforce JViews class library to build complex two-dimensional representations running on the Web server and Perforce JViews SVG thin-client support to display and interact with images created by the server on your web browser.