1. Trang chủ
  2. » Công Nghệ Thông Tin

Filthy rich clients

602 206 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 602
Dung lượng 14,69 MB

Nội dung

www.it-ebooks.info Filthy Rich Clients www.it-ebooks.info The Java™ Series Ken Arnold, James Gosling, David Holmes The Java™ Programming Language, Fourth Edition Eric Jendrock, Jennifer Ball The Java™ EE Tutorial, Third Edition Joshua Bloch Effective Java™ Programming Language Guide Jonni Kanerva The Java™ FAQ Stephanie Bodoff, Dale Green, Kim Haase, Eric Jendrock The J2EE™ Tutorial, Second Edition Doug Lea Concurrent Programming in Java™, Second Edition: Design Principles and Patterns Mary Campione, Kathy Walrath, Alison Huml The Java™ Tutorial, Third Edition: A Short Course on the Basics Mary Campione, Kathy Walrath, Alison Huml, The Tutorial Team The Java™ Tutorial Continued: The Rest of the JDK™ Patrick Chan The Java™ Developers Almanac 1.4, Volume Rosanna Lee, Scott Seligman JNDI API Tutorial and Reference: Building DirectoryEnabled Java™ Applications Sheng Liang The Java™ Native Interface: Programmer’s Guide and Specification Tim Lindholm, Frank Yellin The Java™ Virtual Machine Specification, Second Edition Patrick Chan The Java™ Developers Almanac 1.4, Volume Patrick Chan, Rosanna Lee The Java™ Class Libraries, Second Edition, Volume 2: java.applet, java.awt, java.beans Patrick Chan, Rosanna Lee, Doug Kramer The Java Class Libraries, Second Edition, Volume 1: Supplement for the Java™ Platform, Standard Edition, v1.2 ™ Kirk Chen, Li Gong Programming Open Service Gateways with Java™ Embedded Server Zhiqun Chen Java Card™ Technology for Smart Cards: Architecture and Programmer’s Guide Maydene Fisher, Jon Ellis, Jonathan Bruce JDBC™ API Tutorial and Reference, Third Edition Eric Freeman, Susanne Hupfer, Ken Arnold JavaSpaces™ Principles, Patterns, and Practice Li Gong, Gary Ellison, Mary Dageforde Inside Java™ Platform Security, Second Edition: Architecture, API Design, and Implementation James Gosling, Bill Joy, Guy Steele, Gilad Bracha The Java™ Language Specification, Third Edition Roger Riggs, Antero Taivalsaari, Jim Van Peursem, Jyri Huopaniemi, Mark Patel, Aleksi Uotila Programming Wireless Devices with the Java™ Platform, Micro Edition, Second Edition Rahul Sharma, Beth Stearns, Tony Ng J2EE™ Connector Architecture and Enterprise Application Integration Inderjeet Singh, Beth Stearns, Mark Johnson, Enterprise Team Designing Enterprise Applications with the J2EE™ Platform, Second Edition Inderjeet Singh, Sean Brydon, Greg Murray, Vijay Ramachandran, Thierry Violleau, Beth Stearns Designing Web Services with the J2EE™ 1.4 Platform: JAX-RPC, SOAP, and XML Technologies Kathy Walrath, Mary Campione, Alison Huml, Sharon Zakhour The JFC Swing Tutorial, Second Edition: A Guide to Constructing GUIs Steve Wilson, Jeff Kesselman Java™ Platform Performance: Strategies and Tactics Sharon Zakhour, Scott Hommel, Jacob Royal, Isaac Rabinovitch, Tom Risser, Mark Hoeber The Java™ Tutorial, Fourth Edition: A Short Course on the Basics Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform www.it-ebooks.info Filthy Rich Clients Developing Animated and Graphical Effects for Desktop Java™ Applications Chet Haase Romain Guy Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City www.it-ebooks.info Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals Sun Microsystems, Inc has intellectual property rights relating to implementations of the technology described in this publication In particular, and without limitation, these intellectual property rights may include one or more U.S patents, foreign patents, or pending applications Sun, Sun Microsystems, the Sun logo, J2ME, J2EE, Java Card, and all Sun and Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION SUN MICROSYSTEMS, INC MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests For more information, please contact: U.S Corporate and Government Sales, (800) 382-3419, corpsales@pearsontechgroup.com For sales outside the United States please contact: International Sales, international@pearsoned.com Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Haase, Chet Filthy rich clients : developing animated and graphical effects for desktop Java applications / Chet Haase, Romain Guy p cm Includes index ISBN 978-0-13-241393-0 (pbk : alk paper) Object-oriented programming (Computer science) Java (Computer program language) I Guy, Romain II Title QA76.73.C153H33 2007 005.1'17—dc22 2007019818 Cover Illustration: Nathan Clement Copyright © 2008 Sun Microsystems, Inc 4150 Network Circle, Santa Clara, California 95054 U.S.A All rights reserved Printed in the United States of America This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise For information regarding permissions, write to: Pearson Education, Inc., Rights and Contracts Department, 75 Arlington Street, Suite 300, Boston, MA 02116, Fax: (617) 848-7047 ISBN-13: 978-0-13-241393-0 ISBN-10: 0-13-241393-0 Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts First printing, August 2007 www.it-ebooks.info For Kris I never quite understood book dedications to spouses/partners/families I mean, it always seemed like the polite thing to do, but not really necessary Even while I was writing the bulk of my chapters, it just seemed like something I happened to be doing as part of my work life, completely separate from my home life Then came the mad, unending rush at the end and the ensuing review and editing phase I basically disappeared from home life entirely for about three months Now, I get it Thank you, Kris, for supporting me in this project; for dealing with the house, the kids, and everything else when I was nonexistent; and for still being here when I finally reappeared ––Chet For All of My Friends You heard me complain one too many times about this book, but you kept listening to me Such a load of work could not have come at a worse time Thank you for helping me keep what was left of my sanity For Chet Thank you for remaining calm and polite even though you were dying to see me write my chapters For the Swing Team I Knew Thank you for having faith in me and offering me so many great opportunities ––Romain www.it-ebooks.info This page intentionally left blank www.it-ebooks.info Contents Foreword xvii Preface xix Acknowledgments xxv About the Authors xxvii Introduction PART I GRAPHICS AND GUI FUNDAMENTALS Chapter Desktop Java Graphics APIs: Swing, AWT, and Java 2D 11 Abstract Window Toolkit (AWT) Java 2D Swing Chapter 12 13 13 Swing Rendering Fundamentals 15 Events Swing Painting Asynchronous Repaint Requests Synchronous Paint Requests Swing Rendering paintComponent() paint() setOpaque() 16 17 17 19 20 21 24 27 vii www.it-ebooks.info viii CONTENTS Double-Buffering Threading Threading Model Timers and the Event Dispatch Thread Painless Threading through SwingWorker Threading Summary Chapter Graphics Fundamentals 43 Java 2D Rendering Getting the Graphics Object Graphics State Graphics Primitives Chapter 43 45 46 48 73 Images 91 Image Types BufferedImage Image Scaling Quality versus Performance getFasterScaledInstance(): Utility for Faster, Better Scaled Images Chapter 28 31 33 37 38 42 92 95 98 101 111 Performance 115 Use the Clip Compatible Images Why You Should Care What about Managed Images? Make Mine Compatible Managed Images Grabbing the DataBuffer Frequent Rendering to the Image Intermediate Images The Big Idea How It’s Done Notes Summary Optimal Primitive Rendering Benchmark www.it-ebooks.info 115 121 122 123 124 126 129 132 134 135 135 141 142 143 144 ix CONTENTS Command-Line Flags Rendering Debugging Performance PART II 145 146 148 ADVANCED GRAPHICS RENDERING 151 Chapter Composites 153 AlphaComposite AlphaComposite: The 12 Rules Clear Dst DstAtop DstIn DstOut DstOver Src SrcAtop SrcIn SrcOut SrcOver Xor Creating and Setting Up an AlphaComposite Common Uses of AlphaComposite Using Clear Using SrcOver Using SrcIn Issues with AlphaComposite Create Your Own Composite The Add Composite Implementing the CompositeContext Composing the Pixels Summary Chapter 153 155 157 157 158 158 159 159 160 160 161 161 162 162 163 164 165 165 166 168 170 171 174 175 177 Gradients 179 Two-Stops Linear Gradient Special Effects with Regular Gradients Multistops Linear Gradient Radial Gradient www.it-ebooks.info 179 182 187 189 ... This is not a book on data binding.1 Rich Clients We should describe what we mean by Filthy Rich Clients But first, we need to describe what rich clients are Rich clients is a phrase commonly associated... his filthyrichclients.com domain name so that life would be less confusing for people who went looking for the Web site associated with this book Both filthyrichclients.com and filthyrichclients.org... the earlier parts of the book Effects are at the core of Filthy Rich Clients, making the difference between a mere rich client and a Filthy Rich Client The effects are grouped into two categories

Ngày đăng: 19/04/2019, 16:55

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN