Java Doc for Panner.java in  » Science » jcm1-source » edu » hws » jcm » draw » 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 » Science » jcm1 source » edu.hws.jcm.draw 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.hws.jcm.draw.Drawable
      edu.hws.jcm.draw.Panner

Panner
public class Panner extends Drawable implements MouseListener,MouseMotionListener(Code)
When a Panner object is added to a CoordinateRect, it becomes possible to "grab" the coordinate rectangle and pan it (that is, slide it around by moving it with the mouse). By default, the user must right-click-and-drag to pan the coordinates, but this can be changed by providing an argument to the constructor. It is possible to set a Controller to be notified each time the mouse moves while the user is dragging. Alternatively, or in addition, you can set a Controller to be notified when the user finishes dragging. However, for the most part this is unnecessary, since the Drawables in the CoordinateRect will for the most part redraw themselves properly when the limits on the CoordinateRect change. However, if you have Computable objects that depend on the coordinate limits, then they will need to be recomputed. (This will be the case if you use value objects returned by the getValueObject() method in the CoordinateRect class.)

A Panner, p, is inactive if its "visible" property has been set to false. (This is done by calling p.setVisible(false).)




Constructor Summary
public  Panner()
     Create a Panner object that will let the user pan the CoordinateRect that contains the Panner by right-clicking and dragging (or, on Macintosh, command-clicking).
public  Panner(int modifierSet)
     Create a Panner object that will let the user click-and-drag to pan the CoordinateRect that contains the Panner.

Method Summary
public  voiddraw(Graphics g, boolean coordsChanged)
     Override the abstract draw() method from the Drawable class.
public  ControllergetOnFinishDrag()
     Get the Controller that is notified when the user finishs a drag.
public  ControllergetOnUserAction()
     Get the Controller that is notified when the user moves the mouse during a drag.
public  voidmouseClicked(MouseEvent evt)
     Responds to a mouse-click.
public  voidmouseDragged(MouseEvent evt)
     Responds to a mouse-drag.
public  voidmouseEntered(MouseEvent evt)
     Responds to a mouse-enter event.
public  voidmouseExited(MouseEvent evt)
     Responds to a mouse-exit event.
public  voidmouseMoved(MouseEvent evt)
     Responds when mouse moves.
public  voidmousePressed(MouseEvent evt)
     Responds to a mouse-press.
public  voidmouseReleased(MouseEvent evt)
     Responds to a mouse-release.
public  voidsetOnFinishDrag(Controller c)
     Set a Controller that will be notified (by calling its compute method) whenever the user finishes a drag operation.
public  voidsetOnUserAction(Controller c)
     Set a Controller that will be notified (by calling its compute method) whenever the user moves the mouse during a drag.
protected  voidsetOwnerData(DisplayCanvas canvas, CoordinateRect coords)
     Called when this object is added to a DisplayCanvas.


Constructor Detail
Panner
public Panner()(Code)
Create a Panner object that will let the user pan the CoordinateRect that contains the Panner by right-clicking and dragging (or, on Macintosh, command-clicking).



Panner
public Panner(int modifierSet)(Code)
Create a Panner object that will let the user click-and-drag to pan the CoordinateRect that contains the Panner. The mouse-pressed event must have the specfied set of modifiers set.
Parameters:
  modifiers - If the value is zero, the user drags the CoordinateRect by clicking withoutpressing any modifier keys. Otherwise, the value should be a combination ofone or more of the constants MouseEvent.SHIFT_MASK, MouseEvent.CTRL_MASK,MouseEvent.META_MASK, and MouseEvent.ALT_MASK, or'ed together. (Rememberthat right-clicking sets META_MASK and clicking with a middle mouse buttonsets ALT_MASK.)




Method Detail
draw
public void draw(Graphics g, boolean coordsChanged)(Code)
Override the abstract draw() method from the Drawable class. This is defined to be empty since a Panner object has no visible representation.



getOnFinishDrag
public Controller getOnFinishDrag()(Code)
Get the Controller that is notified when the user finishs a drag. Returns null if no Controller is notified.



getOnUserAction
public Controller getOnUserAction()(Code)
Get the Controller that is notified when the user moves the mouse during a drag. Returns null if no Controller is notified.



mouseClicked
public void mouseClicked(MouseEvent evt)(Code)
Responds to a mouse-click. Not meant to be called directly. Defined to be empty in this class.



mouseDragged
public void mouseDragged(MouseEvent evt)(Code)
Responds to a mouse-drag. Not meant to be called directly.



mouseEntered
public void mouseEntered(MouseEvent evt)(Code)
Responds to a mouse-enter event. Not meant to be called directly. Defined to be empty in this class.



mouseExited
public void mouseExited(MouseEvent evt)(Code)
Responds to a mouse-exit event. Not meant to be called directly. Defined to be empty in this class.



mouseMoved
public void mouseMoved(MouseEvent evt)(Code)
Responds when mouse moves. Not meant to be called directly. Defined to be empty in this class.



mousePressed
public void mousePressed(MouseEvent evt)(Code)
Responds to a mouse-press. Not meant to be called directly.



mouseReleased
public void mouseReleased(MouseEvent evt)(Code)
Responds to a mouse-release. Not meant to be called directly.



setOnFinishDrag
public void setOnFinishDrag(Controller c)(Code)
Set a Controller that will be notified (by calling its compute method) whenever the user finishes a drag operation. If the value is null, no Controller is notified. You only need to do this if you have to recompute some object that depends on the coordinate limits of the CoordinateRect that contains this Panner object. Presumably, this will be an object that depends on one if the Value objects returned by the getValueObject() method in the CoordinatRect class.



setOnUserAction
public void setOnUserAction(Controller c)(Code)
Set a Controller that will be notified (by calling its compute method) whenever the user moves the mouse during a drag. If the value is null, no Controller is notified. Note that Drawables generally redraw themselvs correctly during the drag anyway, without any Controller being involved. Even if there are other things that need to be computed, it's probably better to compute them only once at the end of the drag. Do this by calling setOnFinishDrag() instead of this method.



setOwnerData
protected void setOwnerData(DisplayCanvas canvas, CoordinateRect coords)(Code)
Called when this object is added to a DisplayCanvas. Not meant to be called directly.



Fields inherited from edu.hws.jcm.draw.Drawable
protected DisplayCanvas canvas(Code)(Java Doc)
protected CoordinateRect coords(Code)(Java Doc)

Methods inherited from edu.hws.jcm.draw.Drawable
abstract public void draw(Graphics g, boolean coordsChanged)(Code)(Java Doc)
public boolean getVisible()(Code)(Java Doc)
public void needsRedraw()(Code)(Java Doc)
protected void setOwnerData(DisplayCanvas canvas, CoordinateRect coords)(Code)(Java Doc)
public void setVisible(boolean show)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.