Zoom
by rectangle is marking a rectangular region over the image when dragging
the mouse. The raster and vector data within this rectangular region is then
zoomed onto the viewport. ZoomOut is shrinking the viewport into the rectangle
box.
//Draw a green rectangle
for zoom when activated
if (zoomRect) {
g.setColor(Color.green);
g.drawRect(xDown, yDown, xDrag, yDrag);
}
zoomFactor = (double)(canvas.getSize().width)/(double)(xDrag);
//Zoom Raster Data
picX = (picX
- xDown)*zoomFactor;
picY = (picY - yDown)*zoomFactor;
imageWidth *= zoomFactor;
imageHeight *= zoomFactor;
//Zoom Vector data too
pointX[i] = (pointX[i] - xDown) * zoomFactor;
pointY[i] = (pointY[i] - yDown) * zoomFactor;
Real-time zoom is a scale dependent automatic zooming. It is a new navigation technique that allows the user to smoothly locate a distant target in a large map without having to manually interweaving zooming and panning.
if (zooming) {
try {
Thread.sleep(20);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
zoomFactor =(double)(1.0+0.001*(double)(xDrag-xDown));
}
});
} catch (InterruptedException e) {
zooming = false;
}
}
ACADEMIC and NONCOMMERCIAL USE LICENSE AGREEMENT
1. LICENSE GRANT. Licensor grants Licensee a non-exclusive and non-transferable perpetual license to reproduce, use, modify and distribute the executable code version of SOFTWARE and related documentation for any purpose other than its incorporation in a commercial product or its commercial distribution or redistribution. This License does not entitle Licensee to technical support, telephone assistance, or enhancements or updates to the SOFTWARE.
2. RESTRICTIONS. Except as otherwise expressly permitted in this Agreement, Licensee may not (i) sell, rent, lease or sublicense rights in SOFTWARE; (ii) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels in SOFTWARE or (iii) use the name of Licensor or the authors of SOFTWARE in any manner related to SOFTWARE without their prior written permission.
3. FEES. There is no license fee for SOFTWARE provided Licensees use is limited to that specified in the License Grant. If Licensee wishes to incorporate SOFTWARE in a commercial product or distribute or redistribute SOFTWARE commercially, there will be a one-time license fee.
4. TERMINATION. Licensor may terminate this Agreement if Licensee breaches any of its terms and conditions. Upon termination, Licensee shall destroy all copies of SOFTWARE.
5. PROPRIETARY RIGHTS. All rights, title to and ownership interest in SOFTWARE, including all intellectual property rights therein, shall remain in Licensor. Licensee acknowledges such ownership and intellectual property rights and will not take any action that jeopardizes, limits, undermines or interferes with in any manner Licensors ownership and intellectual property rights with respect to SOFTWARE. SOFTWARE constitutes a published work and is protected by copyright and other intellectual property laws and by international treaties.
6. MANDATORY NOTICE. The notice of copyright shall be loaded in the computer memory for use, display or reproduction and shall be embedded in any location or object on which SOFTWARE, online documentation or paper is stored or reproduced. The notice shall state:
"The
author of the software and Source Code is Liang
Guo(guo@rohan.sdsu.edu)
Copyright © 2003 SDSU All Rights Reserved"
Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that this copyright notice and disclaimer appear in all copies of this software.
This software and documentation constitute a published work, published at http://map.sdsu.edu/mobilegis/viewer5/help/develop.htm
Licensee shall not remove or obscure this copyright notice anywhere it appears. UNDER NO CIRCUMSTANCES SHALL THE LICENSOR BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS, INTERRUPTION OF BUSINESS OR ANY OTHER RELATED EXPENSES WHICH MAY ARISE FROM ANY USE OF THE SOFTWARE, PAPER AND/OR RELATED DOCUMENTATION. LICENSOR EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, RELATING TO THE SOFTWARE, PAPER AND/OR DOCUMENTATION, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR USE FOR A PARTICULAR PURPOSE AND/OR ANY OTHER WARRANTY THAT MAY ARISE FROM COURSE OF DEALING OR USAGE OF TRADE."
7. DISCLAIMER OF WARRANTY. SOFTWARE IS PROVIDED IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF THIS AGREEMENT ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES THAT SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. LICENSEE BEARS THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SOFTWARE. SHOULD SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, LICENSEE ASSUMES SOLE RESPONSIBILITY AND LIABILITY FOR THE ENTIRE COST OF ANY SERVICE AND REPAIR IN CONNECTION THEREWITH. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS AGREEMENT. NO USE OF SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. LIMITATION OF LIABILITY. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND WITHOUT REGARD TO WHETHER SUCH CLAIM OR ALLEGATION IS BASED IN CONTRACT, TORT OR ANY OTHER LEGAL OR EQUITABLE THEORY. TO THE EXTENT PERMITTED UNDER APPLICABLE LAW, LICENSOR'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS AGREEMENT SHALL NOT EXCEED IN THE AGGREGATE THE SUM OF THE FEES LICENSEE PAID FOR THIS LICENSE (IF ANY).
9. EXPORT CONTROL. Licensee agrees to comply with all export laws and restrictions and regulations of the United States or foreign agencies or authorities, and not to export or re-export SOFTWARE or any product incorporating some or all of SOFTWARE in violation of any such restrictions, laws or regulations, or without all necessary approvals. Licensee shall be solely responsible for obtaining all necessary licenses and approvals with respect to its export of SOFTWARE from the U.S. and for payment of any and all associated costs. By downloading or using SOFTWARE, Licensee agrees to the foregoing and represents and warrants that it complies with these conditions. If SOFTWARE is identified as being not-for-export and Licensee does not have an appropriate exemption from the United States government, EXCEPT FOR EXPORT TO CANADA FOR USE IN CANADA BY CANADIAN CITIZENS, SOFTWARE AND ANY UNDERLYING ENCRYPTION TECHNOLOGY MAY NOT BE EXPORTED OUTSIDE THE UNITED STATES OR TO ANY FOREIGN ENTITY OR "FOREIGN PERSON" AS DEFINED BY U.S. GOVERNMENT REGULATIONS, INCLUDING WITHOUT LIMITATION, ANYONE WHO IS NOT A CITIZEN, NATIONAL OR LAWFUL PERMANENT RESIDENT OF THE UNITED STATES. BY DOWNLOADING OR USING SOFTWARE, LICENSEE AGREES TO THE FOREGOING AND WARRANTS THAT IT IS NOT A "FOREIGN PERSON" OR UNDER THE CONTROL OF A "FOREIGN PERSON."
10.
MISCELLANEOUS. (a) This Agreement constitutes the entire Agreement between
the parties concerning the subject matter hereof. (b) This Agreement may be
amended only by a writing signed by both parties. (c) Except to the extent
applicable law, if any, provides otherwise, this Agreement shall be governed
by the laws of the State of Maryland, U.S.A., excluding its conflict of law
provisions. (d) This Agreement shall not be governed by the United Nations
Convention on Contracts for the International Sale of Goods. (e) If any provision
in this Agreement should be held illegal or unenforceable by a court having
jurisdiction, such provision shall be modified to the extent necessary to
render it enforceable without losing its intent, or severed from this Agreement
if no such modification is possible, and other provisions of this Agreement
shall remain in full force and effect. (f) A waiver by either party of any
term or condition of this Agreement or any breach thereof, in any one instance,
shall not waive such term or condition or any subsequent breach thereof. (g)
The provisions of this Agreement which require or contemplate performance
after the expiration or termination of this Agreement shall be enforceable
notwithstanding said expiration or termination. (h) Licensee may not assign
or otherwise transfer by operation of law or otherwise this Agreement or any
rights or obligations herein except in the case of a merger or the sale of
all or substantially all of Licensee's assets to another entity. (i) This
Agreement shall be binding upon and shall inure to the benefit of the parties,
their successors and permitted assigns. (j) Neither party shall be in default
or be liable for any delay, failure in performance (excepting the obligation
to pay) or interruption of service resulting directly or indirectly from any
cause beyond its reasonable control. (k) The relationship between Licensor
and Licensee is that of independent contractors and neither Licensee nor its
agents shall have any authority to bind Licensor in any way. (l) The headings
to the sections of this Agreement are used for convenience only and shall
have no substantive meaning.
COMMERCIAL USE
The license agreement above is solely for noncommercial use of SOFTWARE. Any entity that wishes to incorporate SOFTWARE in a commercial product or to distribute or redistribute SOFTWARE commercially should contact the university regarding a nonexclusive commercial use license agreement. Modifications of the software might also be possible for a fee, or through support for continued research.
Smooth
Panning/Roaming
Smooth
panning/roaming is to change the initial point of the scene and moves it to
the spot where the drag is released.
// keep track of on-screen
movement for both vector and raster data
pointX[i] += xDrag - xDown;
pointY[i] += yDrag - yDown;
picX += xDrag - xDown;
picY += yDrag - yDown;
Full
Extent
Full
Extent is to fit the component within the current window size, and set the
variables of raster and vector data to the default size.