Java Doc for PopupManager.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » fw » completion » 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 » Database Client » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.fw.completion 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.squirrel_sql.fw.completion.PopupManager

PopupManager
public class PopupManager (Code)
Popup manager allows to display an arbitrary popup component over the underlying text component.
author:
   Martin Roskanin, Miloslav Metelka
since:
   03/2002

Inner Class :final public static class Placement

Field Summary
final public static  PlacementAbove
    
final public static  PlacementAbovePreferred
     Place popup above cursor.
final public static  PlacementBelow
    
final public static  PlacementBelowPreferred
     Place popup below cursor.
final public static  PlacementLargest
     Place popup to larger area.

Constructor Summary
public  PopupManager(JTextComponent textComponent)
    

Method Summary
protected static  RectanglecomputeBounds(JComponent popup, JComponent view, Rectangle cursorBounds, Placement placement)
     Variation of the method for computing the bounds for the concrete view component.
protected static  RectanglecomputeBounds(JComponent popup, int viewWidth, int viewHeight, Rectangle cursorBounds, Placement placement)
     Computes a best-fit bounds of popup panel according to available space in the underlying view (visible part of the pane). The placement is first evaluated and put into the popup's client property by popup.putClientProperty(Placement.class, actual-placement). The actual placement is
  • Above if the original placement was Above. Or if the original placement was AbovePreferred or Largest and there is more space above the cursor than below it.
  • Below if the original placement was Below. Or if the original placement was BelowPreferred or Largest and there is more space below the cursor than above it.
  • AbovePreferred if the original placement was AbovePreferred and there is less space above the cursor than below it.
  • BelowPreferred if the original placement was BelowPreferred and there is less space below the cursor than above it.

    Once the placement client property is set the popup.setSize() is called with the size of the area above/below the cursor (indicated by the placement). The popup responds by updating its size to the equal or smaller size.

public  JComponentget()
    
public  voidinstall(JComponent popup)
     Install popup component to textComponent root pane based on caret coordinates with the Largest placement.
public  voidinstall(JComponent popup, Rectangle cursorBounds, Placement placement)
    

Field Detail
Above
final public static Placement Above(Code)
Place popup always above cursor



AbovePreferred
final public static Placement AbovePreferred(Code)
Place popup above cursor. If a place above cursor is insufficient, then popup will be placed below cursor.



Below
final public static Placement Below(Code)
Place popup always below cursor



BelowPreferred
final public static Placement BelowPreferred(Code)
Place popup below cursor. If a place below cursor is insufficient, then popup will be placed above cursor.



Largest
final public static Placement Largest(Code)
Place popup to larger area. i.e. if place below cursor is larger than place above, then popup will be placed below cursor.




Constructor Detail
PopupManager
public PopupManager(JTextComponent textComponent)(Code)
Creates a new instance of PopupManager




Method Detail
computeBounds
protected static Rectangle computeBounds(JComponent popup, JComponent view, Rectangle cursorBounds, Placement placement)(Code)
Variation of the method for computing the bounds for the concrete view component. As the component can possibly be placed in a scroll pane it's first necessary to translate the cursor bounds and also translate back the resulting popup bounds.
Parameters:
  popup - popup panel to be displayed
Parameters:
  view - component over which the popup is displayed.
Parameters:
  cursorBounds - the bounds of the caret or mouse cursorrelative to the upper-left corner of the visible view.
Parameters:
  placement - where to place the popup panel according tothe cursor position. bounds of popup panel relative to the upper-left cornerof the underlying view component.null if there is no place to display popup.



computeBounds
protected static Rectangle computeBounds(JComponent popup, int viewWidth, int viewHeight, Rectangle cursorBounds, Placement placement)(Code)
Computes a best-fit bounds of popup panel according to available space in the underlying view (visible part of the pane). The placement is first evaluated and put into the popup's client property by popup.putClientProperty(Placement.class, actual-placement). The actual placement is
  • Above if the original placement was Above. Or if the original placement was AbovePreferred or Largest and there is more space above the cursor than below it.
  • Below if the original placement was Below. Or if the original placement was BelowPreferred or Largest and there is more space below the cursor than above it.
  • AbovePreferred if the original placement was AbovePreferred and there is less space above the cursor than below it.
  • BelowPreferred if the original placement was BelowPreferred and there is less space below the cursor than above it.

    Once the placement client property is set the popup.setSize() is called with the size of the area above/below the cursor (indicated by the placement). The popup responds by updating its size to the equal or smaller size. If it cannot physically fit into the requested area it can call putClientProperty(Placement.class, null) on itself to indicate that it cannot fit. The method scans the content of the client property upon return from popup.setSize() and if it finds null there it returns null bounds in that case. The only exception is if the placement was either AbovePreferred or BelowPreferred. In that case the method gives it one more try by attempting to fit the popup into (bigger) complementary Below and Above areas (respectively). The popup either fits into these (bigger) areas or it again responds by returning null in the client property in which case the method finally gives up and returns null bounds.
    Parameters:
      popup - popup panel to be displayed
    Parameters:
      viewWidth - width of the visible view area.
    Parameters:
      viewHeight - height of the visible view area.
    Parameters:
      cursorBounds - the bounds of the caret or mouse cursorrelative to the upper-left corner of the visible view
    Parameters:
      placement - where to place the popup panel according tothe cursor position bounds of popup panel relative to the upper-left cornerof the underlying view.null if there is no place to display popup.




get
public JComponent get()(Code)
Returns installed popup panel component



install
public void install(JComponent popup)(Code)
Install popup component to textComponent root pane based on caret coordinates with the Largest placement.
Parameters:
  popup - popup component to be installed intoroot pane of the text component.



install
public void install(JComponent popup, Rectangle cursorBounds, Placement placement)(Code)



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.