Perforce JViews Framework Code Example: Rotate Align IlvText
Description
This sample shows how to align rotated multiline text to rotated alignment axes.
How to Use the Code Example
-
This application displays an
IlvManagerView
containing a multilineIlvText
object. Around the view there are three rings that are GUI controls to specify various angles. - The outermost ring allows you to control the rotation of the text object. This ring has a green angle indicator.
- The middle ring allows you to control the rotation of alignment axes of the text object. This ring has a blue angle indicator.
- The innermost ring allows you to control the rotation threshold that specifies which alignment axis is chosen. This ring has a red angle indicator.
- If the rotation threshold is 0, the rotated text is not aligned to the alignment axes. If the rotation threshold is larger than 0, the rotated text is aligned to the red alignment axis, if the rotation of the text (the green angle indicator of the outermost ring) is inside the red area indicated on the innermost ring, otherwise the rotated text is aligned to the green alignment axis.
- You can click the rings and drag to change the angles. You can also use the mouse wheel or single clicks with the left or right mouse button to change the angles.
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,
rotatealigntext.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
- How to rotate and align text
Installation Directory
The Rotate Align IlvText code example is installed here.
Classes Involved
- ilog.views.graphic.IlvText
- ilog.views.graphic.IlvLine
- ilog.views.IlvApplyObject
- ilog.views.IlvTransformer
- ilog.views.IlvManager
- ilog.views.IlvManagerView