The package openfuture.legend and all its sub-packages and extensions is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330, Boston,
Or visit http://www.gnu.org/copyleft/lesser.html.
The OpenFuture component JLegend provides a simple legend for business graphics. It was developed to place a legend somewhere in the application. This solves the problem, that several graphic libraries prefer the display of a legend within the same panel as the chart itself. With JLegend you have the freedom to place it anywhere you want.
Additional requirements realised in this bean where:
The class JLegend was implemented as a subclass of java.awt.Canvas in order to use it with several JDK releases. It is designed as JavaBean with some special properties:
|colors||Array of Colors for the boxes. If not set, default colors are used.|
|labels||Array of Strings for the labels.|
|orientation||Define orientation of the legend:
|borderVisible||indicate if border of the boxes is drawn or not.|
A simple test frame was provided within the package openfuture.legend.test. This frame is embedding an instance of the legend to demonstrate the behavior on size and/or property change.
The widgets on the south side of the frame can be used to demonstrate the above behavior:
[R1] GNU Lesser General Public License
[R2] Download Sources here.