Java Doc for ModelViewMapper.java in  » IDE-Netbeans » visualweb.api.designer » org » netbeans » modules » visualweb » css2 » 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 » IDE Netbeans » visualweb.api.designer » org.netbeans.modules.visualweb.css2 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.visualweb.css2.ModelViewMapper

ModelViewMapper
final public class ModelViewMapper (Code)
Class responsible for mapping between the DOM (jsp document and rendered html fragments) and the view (boxes and pixel coordinates). It also handles caret motion. Note that methods which return positions never return null, they return Position.NONE in that case.
author:
   Tor Norbye




Method Summary
public static  DomPositioncomputeArrowDown(WebForm webform, DomPosition sourcePos)
     Given a caret position, return the caret position to "below" it; e.g.
public static  DomPositioncomputeArrowLeft(WebForm webform, DomPosition sourcePos)
     Given a caret position, return the caret position to its left.
public static  DomPositioncomputeArrowRight(WebForm webform, DomPosition sourcePos)
     Given a caret position, return the caret position to its right.
public static  DomPositioncomputeArrowUp(WebForm webform, DomPosition sourcePos)
     Given a caret position, return the caret position to "above" it; e.g.
public static  CssBoxfindBox(CssBox root, Node target, int offset)
     Find the box whose corresponding node matches the given node, starting at the given root box.
public static  CssBoxfindBox(PageBox pageBox, Element element)
     Try to find the box corresponding to the given element.
public static  CssBoxfindBox(PageBox pageBox, int x, int y)
    
public static  CssBoxfindBoxForComponentRootElement(PageBox pageBox, Element componentRootElement)
    
public static  ElementfindClosestComponentRootElement(WebForm webForm, Node node)
     Finds closes parent (including itself) component root element.
public static  ElementfindComponentRootElement(CssBox box)
     Locates component root element in the visible view given the box.
public static  ElementfindElement(CssBox box)
     Locates element in the visible view given the box.
public static  ElementfindElement(PageBox pageBox, int x, int y)
    
public static  RectanglefindShape(PageBox pageBox, Element componentRootElement)
    
public static  DomPositionfindValidPosition(WebForm webForm, DomPosition pos, boolean adjust, InlineEditor inline)
     Given a position in the DOM, find the closest valid position. In particular, the position is not allowed to be inside any "renders children" nodes.
public static  RectanglegetComponentBounds(PageBox pageBox, Element componentRootElement)
    
public static  List<Rectangle>getComponentRectangles(PageBox pageBox, Element componentRootElement)
    
public static  DomPositiongetFirstDocumentPosition(WebForm webform, boolean create)
     Return the first caret position in the document.
public static  DomPositiongetLastDocumentPosition(WebForm webform, boolean create)
     Return the last caret position in the document.
public static  DomPositiongetLineBegin(WebForm webform, DomPosition sourcePos)
    
public static  DomPositiongetLineEnd(WebForm webform, DomPosition sourcePos)
    
public static  DomPositiongetWordEnd(PageBox pageBox, DomPosition sourcePos)
    
public static  DomPositiongetWordStart(PageBox pageBox, DomPosition sourcePos)
    
public static  booleanisValidPosition(WebForm webForm, DomPosition pos, boolean adjust, InlineEditor inline)
    
public static  RectanglemodelToView(PageBox pageBox, DomPosition sourcePos)
     For the given caret position, compute the visible caret rectangle on the screen.
public static  DomPositionviewToModel(WebForm webform, int x, int y)
     Provides a mapping from the view coordinate space to the logical coordinate space of the model.



Method Detail
computeArrowDown
public static DomPosition computeArrowDown(WebForm webform, DomPosition sourcePos)(Code)
Given a caret position, return the caret position to "below" it; e.g. the position we should move the caret to if the user presses the down arrow key.
Parameters:
  pos - The caret position in the DOM The next visual position below the given pos, or Position.NONE ifthere is no such position in the document (e.g. when you're on the last linein the document.)



computeArrowLeft
public static DomPosition computeArrowLeft(WebForm webform, DomPosition sourcePos)(Code)
Given a caret position, return the caret position to its left. This may not actually be the left on the screen, e.g. if you press left at the beginning of a line you may end up on the right side of the previous line.
Parameters:
  pos - The caret position in the DOM The next visual position to the "left" of pos, or Position.NONE ifthere is no such position in the document (e.g. when you're at thefirst visual position in the document.)



computeArrowRight
public static DomPosition computeArrowRight(WebForm webform, DomPosition sourcePos)(Code)
Given a caret position, return the caret position to its right. This may not actually be the right on the screen, e.g. if you press right at the end of a line you may end up on the left side of the next line.
Parameters:
  pos - The caret position in the DOM The next visual position to the "right" of pos, or Position.NONE ifthere is no such position in the document (e.g. when you're at thelast visual position in the document.)



computeArrowUp
public static DomPosition computeArrowUp(WebForm webform, DomPosition sourcePos)(Code)
Given a caret position, return the caret position to "above" it; e.g. the position we should move the caret to if the user presses the up arrow key.
Parameters:
  pos - The caret position in the DOM The next visual position above the given pos, or Position.NONE ifthere is no such position in the document (e.g. when you're on the first linein the document.)



findBox
public static CssBox findBox(CssBox root, Node target, int offset)(Code)
Find the box whose corresponding node matches the given node, starting at the given root box. The offset is only relevant when we're dealing with a text box, where the node is split into many boxes.



findBox
public static CssBox findBox(PageBox pageBox, Element element)(Code)
Try to find the box corresponding to the given element.



findBox
public static CssBox findBox(PageBox pageBox, int x, int y)(Code)



findBoxForComponentRootElement
public static CssBox findBoxForComponentRootElement(PageBox pageBox, Element componentRootElement)(Code)



findClosestComponentRootElement
public static Element findClosestComponentRootElement(WebForm webForm, Node node)(Code)
Finds closes parent (including itself) component root element.



findComponentRootElement
public static Element findComponentRootElement(CssBox box)(Code)
Locates component root element in the visible view given the box. Element or null if there is not such



findElement
public static Element findElement(CssBox box)(Code)
Locates element in the visible view given the box. Element or null if there is not such



findElement
public static Element findElement(PageBox pageBox, int x, int y)(Code)



findShape
public static Rectangle findShape(PageBox pageBox, Element componentRootElement)(Code)



findValidPosition
public static DomPosition findValidPosition(WebForm webForm, DomPosition pos, boolean adjust, InlineEditor inline)(Code)
Given a position in the DOM, find the closest valid position. In particular, the position is not allowed to be inside any "renders children" nodes. It also doesn't allow positions that are "adjacent" (before, after) an absolutely positioned element.
Parameters:
  pos - Position to be checked
Parameters:
  adjust - If true, adjust the position to the nearest (above)position that is valid.
Parameters:
  inline - inlineEditor which is in the game in the designer or null.
Parameters:
  dom - The JSPX document DOM



getComponentBounds
public static Rectangle getComponentBounds(PageBox pageBox, Element componentRootElement)(Code)



getComponentRectangles
public static List<Rectangle> getComponentRectangles(PageBox pageBox, Element componentRootElement)(Code)



getFirstDocumentPosition
public static DomPosition getFirstDocumentPosition(WebForm webform, boolean create)(Code)
Return the first caret position in the document. If create is true, create one if necessary.



getLastDocumentPosition
public static DomPosition getLastDocumentPosition(WebForm webform, boolean create)(Code)
Return the last caret position in the document. If create is true, create one if necessary.



getLineBegin
public static DomPosition getLineBegin(WebForm webform, DomPosition sourcePos)(Code)
Return the position at the beginning of the line containing the given position



getLineEnd
public static DomPosition getLineEnd(WebForm webform, DomPosition sourcePos)(Code)
Return the position at the end of the line containing the given position



getWordEnd
public static DomPosition getWordEnd(PageBox pageBox, DomPosition sourcePos)(Code)
Find the end of the word from the given position



getWordStart
public static DomPosition getWordStart(PageBox pageBox, DomPosition sourcePos)(Code)
Find the beginning of the word from the given position



isValidPosition
public static boolean isValidPosition(WebForm webForm, DomPosition pos, boolean adjust, InlineEditor inline)(Code)



modelToView
public static Rectangle modelToView(PageBox pageBox, DomPosition sourcePos)(Code)
For the given caret position, compute the visible caret rectangle on the screen. Note that the position must fit certain criteria: it needs to point inside a LineBox (e.g. be a valid caret position).
Parameters:
  A - position in the source dom (where carets live for example)



viewToModel
public static DomPosition viewToModel(WebForm webform, int x, int y)(Code)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. The returned position is always a position in the source DOM, not a position in the rendered DOM (unless it is Position.NONE which means the position does not correlate to a position in the document.)
Parameters:
  x - the X coordinate >= 0
Parameters:
  y - the Y coordinate >= 0 the location within the model that best represents thegiven point in the view >= 0.



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.