Source Code Cross Referenced for LegendArea.java in  » Chart » Chart2D_1.9.6k » net » sourceforge » chart2d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chart » Chart2D_1.9.6k » net.sourceforge.chart2d 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Chart2D, a java library for drawing two dimensional charts.
003:         * Copyright (C) 2001 Jason J. Simas
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         *
018:         * The author of this library may be contacted at:
019:         * E-mail:  jjsimas@users.sourceforge.net
020:         * Street Address:  J J Simas, 887 Tico Road, Ojai, CA 93023-3555 USA
021:         */package net.sourceforge.chart2d;
022:
023:        import java.awt.*;
024:
025:        /**
026:         * A customizable legend for a chart, enabling charting of multiple data sets.
027:         * <p><b>Features:</b><br>
028:         * Supports any number of text labels, allows for associating of any color with
029:         * any text label.  Includes bordering, gapping, auto and manual resizing
030:         * and locating, and growing and shrinking components.  The only shape of bullet
031:         * that is available is a rectangle, however.
032:         */
033:        final class LegendArea extends VerticalTextListArea {
034:
035:            private boolean needsUpdate;
036:
037:            /**
038:             * Creates a legend area using all the defaults of vertical text list area.
039:             * Defaults:<br>
040:             * setAutoSizes (false, false);<br>
041:             * setAutoJustifys (false, false);<br>
042:             * resetLegendAreaModel (true);<br>
043:             */
044:            LegendArea() {
045:
046:                setAutoSizes(false, false);
047:                setAutoJustifys(false, false);
048:                resetLegendAreaModel(true);
049:                needsUpdate = true;
050:            }
051:
052:            /**
053:             * Specifies which colors to use for the label's bullets.  Each label has
054:             * a bullet to its left.  This method sets the colors for these bullets.
055:             * The uppermost label will get the lowest order array member.
056:             * @param colors The bullet colors.
057:             */
058:            final void setColors(Color[] colors) {
059:
060:                needsUpdate = true;
061:                setBulletColors(colors);
062:            }
063:
064:            /**
065:             * Resets the model for this class.  The model is used for shrinking and
066:             * growing of its components based on the maximum size of this class.  If this
067:             * method is called, then the next time the maximum size is set, this classes
068:             * model maximum size will be made equal to the new maximum size.  Effectively
069:             * what this does is ensure that whenever this objects maximum size is equal
070:             * to the one given, then all of the components will take on their default
071:             * model sizes.  Note:  This is only useful when auto model max sizing is
072:             * disabled.
073:             * @param reset True causes the max model size to be set upon the next max
074:             * sizing.
075:             */
076:            final void resetLegendAreaModel(boolean reset) {
077:
078:                needsUpdate = true;
079:                resetVerticalTextListAreaModel(reset);
080:            }
081:
082:            /**
083:             * Indicates whether some property of this class has changed.
084:             * @return True if some property has changed.
085:             */
086:            final boolean getLegendAreaNeedsUpdate() {
087:
088:                return (needsUpdate || getVerticalTextListAreaNeedsUpdate());
089:            }
090:
091:            /**
092:             * Updates all variables.  First updates the variables of its parent class,
093:             * then updates its own variables.
094:             * @param g2D The graphics context used for calculations.
095:             */
096:            final void updateLegendArea(Graphics2D g2D) {
097:                if (getLegendAreaNeedsUpdate()) {
098:                    updateVerticalTextListArea(g2D);
099:                }
100:                needsUpdate = false;
101:            }
102:
103:            /**
104:             * Paints all the components of this class.  First all variables are updated.
105:             * @param g2D  The graphics context for calculations and painting.
106:             */
107:            void paintComponent(Graphics2D g2D) {
108:
109:                updateLegendArea(g2D);
110:                super.paintComponent(g2D);
111:            }
112:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.