Perforce JViews Framework Code Example: Blinking
Description
This sample shows how to use blinking colors, blinking paints,
blinking actions and visibility blinking on IlvGraphic
objects.
How to Use the Code Example
- The application displays a manager containing various graphic objects that have blinking effects enabled.
- On the left side is the main view of the graph. On the right side is an overview of the graph. Below the overview is a performance history indicator.
- When objects are blinking, they are continuously redrawn. The performance history indicator calculates the percentage of the drawing time relative to the overall real time. If the percentage is small, lots of time is available for other operations. If the percentage becomes too high, no time is available for other operations and interactions may become too slow.
- The graphic objects of this demo use many different blinking timings. In a real application, you should try to use the same timings always, because it improves the overall performance.
- The combo box "Blinking Speed" allows you to adjust the blinking speed. The faster the blinking speed, the higher the redraw percentage, that is, the worse the overall performance.
- The check boxes "Blinking on" allow you to disable blinking for the main view and/or the overview. If blinking is disabled for both views, the percentage of the drawing time becomes 0, because continuous redraw is no longer needed.
- The top left marker has a blinking action that changes the marker type, and a blinking color that switches between red, green and blue.
- One of the text elements near the marker has a visibility blinking effect, that is, it is alternately shown and hidden.
- The label "Blinking action on text" has a blinking action that periodically changes the text. This blinking action is implemented as a persistent object, that is, it can be stored in IVL files.
- The composite graphic consists of several parts that have various blinking effects.
- The 3 columns of objects use various blinking paints, blinking colors, and visibility blinking.
- The objects in the first column use a blinking action that changes the shape periodically. They are encapsulated into half zooming graphics.
-
Buttons at the top of the sample are used for the following:
- Set Pan mode. In Pan mode you can pan the view by dragging the image.
- Set Selection mode. In Selection mode, you can select, move, and edit objects.
- Zoom in on an area. You can select the area to magnify.
- Zoom in.
- Zoom out.
- Make the entire image visible.
How to Run the Code Example as an Application
This code example can
be run as an application.
The installation directory contains
an executable JAR file,
blinkingEffects.jar
,
that allows you to execute the code example with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the code example application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the code example and type:
ant run
Topics Covered
- Using blinking effects such as blinking colors, paints, or actions
Installation Directory
The Blinking code example is installed here.
Classes Involved
- ilog.views.java2d.IlvBlinkingAction
- ilog.views.java2d.IlvBlinkingMultiAction
- ilog.views.util.java2d.IlvBlinkingColor
- ilog.views.util.java2d.IlvBlinkingMultiColor
- ilog.views.util.java2d.IlvBlinkingPaint
- ilog.views.util.java2d.IlvBlinkingMultiPaint
- ilog.views.interactor.IlvManagerMagViewInteractor
- ilog.views.graphic.IlvText
- ilog.views.graphic.IlvMarker
- ilog.views.graphic.IlvGeneralPath
- ilog.views.graphic.IlvZoomableLabel
- ilog.views.graphic.IlvRectangle
- ilog.views.graphic.IlvHalfZoomingGraphic
- ilog.views.graphic.composite.IlvCompositeGraphic
- ilog.views.graphic.composite.decoration.IlvRoundRectBalloon
- ilog.views.IlvManager
- ilog.views.IlvManagerView
- ilog.views.swing.IlvJScrollManagerView
- ilog.views.swing.IlvJManagerViewControlBar