Java Doc for ViewportGraphics.java in  » GIS » udig-1.1 » net » refractions » udig » ui » graphics » 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 » GIS » udig 1.1 » net.refractions.udig.ui.graphics 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.refractions.udig.ui.graphics.ViewportGraphics

All known Subclasses:   net.refractions.udig.ui.graphics.SWTGraphics,  net.refractions.udig.ui.graphics.AWTGraphics,  net.refractions.udig.ui.graphics.NonAdvancedSWTGraphics,
ViewportGraphics
public interface ViewportGraphics (Code)
An adapter that allows uDig and plugin writers to write to AWT components and images or SWT Drawable objects by using this common interface.
author:
   jeichar


Field Summary
final public static  intALIGN_BOTTOM
    
final public static  intALIGN_LEFT
    
final public static  intALIGN_MIDDLE
    
final public static  intALIGN_RIGHT
    
final public static  intALIGN_TOP
    
final public static  intLINE_DASH
     Line drawing style for dashed lines (value is 2).
final public static  intLINE_DASHDOT
     Line drawing style for alternating dash-dot lines (value is 4).
final public static  intLINE_DASHDOTDOT
     Line drawing style for dash-dot-dot lines (value is 5).
final public static  intLINE_DOT
     Line drawing style for dotted lines (value is 3).
final public static  intLINE_SOLID
     Line drawing style for solid lines (value is 1).


Method Summary
public  voidclearRect(int x, int y, int width, int height)
     Fills the specified rectangle with the background color.
public  voiddispose()
     Disposes of any resources the graphics might be hanging on to.
public  voiddraw(Shape s)
     Draws the outline of shape using the color, clip & transform.

Reference description from Graphics2d: Strokes the outline of a Shape using the settings of the current Graphics2D context.

public  voiddrawImage(RenderedImage renderedImage, int x, int y)
     Draws an image.
public  voiddrawImage(Image awtImage, int x, int y)
     Draws an Image .
public  voiddrawImage(Image awtImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
     Draws a portion of the image to the target location on the viewport graphics.
public  voiddrawImage(org.eclipse.swt.graphics.Image swtImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
     Copies a rectangular area from the source image into a (potentially different sized) rectangular area in the receiver.
public  voiddrawImage(org.eclipse.swt.graphics.Image swtImage, int x, int y)
     Draws an org.eclipse.swt.graphics.Image .
public  voiddrawLine(int x1, int y1, int x2, int y2)
    
public  voiddrawOval(int x, int y, int width, int height)
    
public  voiddrawPath(Path path)
     Draws the outline of the path using the color, clip and transform.
public  voiddrawRect(int x, int y, int width, int height)
     Draws a rectangle - only the boundary.
public  voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    
public  voiddrawString(String string, int x, int y, int alignx, int aligny)
     Draws a string.
public  voidfill(Shape s)
     Fills the interior of a Shape using the foreground color, clip & transform.

Reference description from Graphics2d: Fills the interior of a Shape using the settings of the Graphics2D context.

public  voidfillOval(int x, int y, int width, int height)
    
public  voidfillPath(Path path)
     Fills the interior of the path with the forground color.
public  voidfillRect(int x, int y, int width, int height)
     Fills a rectangle.
public  voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    
 ColorgetBackgroundColor()
    
 ShapegetClip()
     Gets the area that can be drawn in.
 ColorgetColor()
    
public  intgetFontAscent()
     Gets the ascent of the current font, which is the distance the font rises above its baseline.
public  intgetFontHeight()
     Gets the height of the current font TODO at some point maybe this could be broken out to getFontMetrics(), and a create FontMetrics object that maps between SWT and AWT.
public  Rectangle2DgetStringBounds(String str)
     Returns the bounds of a String.
public  AffineTransformgetTransform()
    
public  voidsetBackground(Color c)
     Sets the background color to draw with.
public  voidsetClip(Rectangle r)
     Sets the clip.
 voidsetClipBounds(Rectangle newBounds)
     Sets the clip area.
public  voidsetColor(Color c)
     Sets the foreground color to draw with.
public  voidsetStroke(int strokeStyle, int strokeWidth)
     Sets the stroke color to draw with.
public  voidsetTransform(AffineTransform transform)
     Modifies the graphics so that further draws us minX,minY as the origin and maxX and maxY as the width and height of the display area.
public  intstringWidth(String str)
     Returns the length in pixels of the given string, or -1 if this operation is not available.
public  voidtranslate(Point offset)
     Sets the draw offset.

Field Detail
ALIGN_BOTTOM
final public static int ALIGN_BOTTOM(Code)
ALIGN_BOTTOM field used to align text



ALIGN_LEFT
final public static int ALIGN_LEFT(Code)
ALIGN_LEFT field used to align text



ALIGN_MIDDLE
final public static int ALIGN_MIDDLE(Code)
ALIGN_MIDDLE field used to align text



ALIGN_RIGHT
final public static int ALIGN_RIGHT(Code)
ALIGN_RIGHT field used to align text



ALIGN_TOP
final public static int ALIGN_TOP(Code)
ALIGN_TOP field used to align text



LINE_DASH
final public static int LINE_DASH(Code)
Line drawing style for dashed lines (value is 2).



LINE_DASHDOT
final public static int LINE_DASHDOT(Code)
Line drawing style for alternating dash-dot lines (value is 4).



LINE_DASHDOTDOT
final public static int LINE_DASHDOTDOT(Code)
Line drawing style for dash-dot-dot lines (value is 5).



LINE_DOT
final public static int LINE_DOT(Code)
Line drawing style for dotted lines (value is 3).



LINE_SOLID
final public static int LINE_SOLID(Code)
Line drawing style for solid lines (value is 1).





Method Detail
clearRect
public void clearRect(int x, int y, int width, int height)(Code)
Fills the specified rectangle with the background color.
Parameters:
  x - The starting corner's x-coordinate.
Parameters:
  y - The starting corner's y-coordinate.
Parameters:
  width - the width of the rectangle
Parameters:
  height - the height of the rectangle



dispose
public void dispose()(Code)
Disposes of any resources the graphics might be hanging on to.



draw
public void draw(Shape s)(Code)
Draws the outline of shape using the color, clip & transform.

Reference description from Graphics2d: Strokes the outline of a Shape using the settings of the current Graphics2D context. The rendering attributes applied include the Clip, Transform, Paint, Composite and Stroke attributes.


Parameters:
  s - the Shape to be rendered
See Also:   fill



drawImage
public void drawImage(RenderedImage renderedImage, int x, int y)(Code)
Draws an image.
Parameters:
  image - The image to draw.
Parameters:
  x - The x coordinate of the image top left corner of the image.
Parameters:
  y - The y coordinate of the image top left corner of the image.



drawImage
public void drawImage(Image awtImage, int x, int y)(Code)
Draws an Image .
Parameters:
  image - The Image to draw.
Parameters:
  x - The x coordinate of the image top left corner of the image.
Parameters:
  y - The y coordinate of the image top left corner of the image.



drawImage
public void drawImage(Image awtImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)(Code)
Draws a portion of the image to the target location on the viewport graphics.
Parameters:
  image - Image to draw
Parameters:
  dx1 - - the x coordinate of the first corner of the destination rectangle.
Parameters:
  dy1 - - the y coordinate of the first corner of the destination rectangle.
Parameters:
  dx2 - - the x coordinate of the second corner of the destination rectangle.
Parameters:
  dy2 - - the y coordinate of the second corner of the destination rectangle.
Parameters:
  sx1 - - the x coordinate of the first corner of the source rectangle.
Parameters:
  sy1 - - the y coordinate of the first corner of the source rectangle.
Parameters:
  sx2 - - the x coordinate of the second corner of the source rectangle.
Parameters:
  sy2 - - the y coordinate of the second corner of the source rectangle.



drawImage
public void drawImage(org.eclipse.swt.graphics.Image swtImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)(Code)
Copies a rectangular area from the source image into a (potentially different sized) rectangular area in the receiver. If the source and destination areas are of differing sizes, then the source area will be stretched or shrunk to fit the destination area as it is copied. The copy fails if any part of the source rectangle lies outside the bounds of the source image, or if any of the width or height arguments are negative.
Parameters:
  image - the source image
Parameters:
  dx1 - - the x coordinate of the first corner of the destination rectangle.
Parameters:
  dy1 - - the y coordinate of the first corner of the destination rectangle.
Parameters:
  dx2 - - the x coordinate of the second corner of the destination rectangle.
Parameters:
  dy2 - - the y coordinate of the second corner of the destination rectangle.
Parameters:
  sx1 - - the x coordinate of the first corner of the source rectangle.
Parameters:
  sy1 - - the y coordinate of the first corner of the source rectangle.
Parameters:
  sx2 - - the x coordinate of the second corner of the source rectangle.
Parameters:
  sy2 - - the y coordinate of the second corner of the source rectangle.



drawImage
public void drawImage(org.eclipse.swt.graphics.Image swtImage, int x, int y)(Code)
Draws an org.eclipse.swt.graphics.Image .
Parameters:
  image - The org.eclipse.swt.graphics.Image to draw.
Parameters:
  x - The x coordinate of the image top left corner of the image.
Parameters:
  y - The y coordinate of the image top left corner of the image.



drawLine
public void drawLine(int x1, int y1, int x2, int y2)(Code)
Draws a line from x1,y1 to x2,y2
Parameters:
  x1 -
Parameters:
  y1 -
Parameters:
  x2 -
Parameters:
  y2 -



drawOval
public void drawOval(int x, int y, int width, int height)(Code)
Draws an Oval - only the boundary
Parameters:
  x - the starting x coordinate
Parameters:
  y - the starting y coordinate
Parameters:
  width - the width of the Oval.
Parameters:
  height - the height of the Oval.



drawPath
public void drawPath(Path path)(Code)
Draws the outline of the path using the color, clip and transform.



drawRect
public void drawRect(int x, int y, int width, int height)(Code)
Draws a rectangle - only the boundary.
Parameters:
  x - the starting x coordinate
Parameters:
  y - the starting y coordinate
Parameters:
  width - the width of the rectangle.
Parameters:
  height - the height of the rectangle.



drawRoundRect
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)
Draws a round cornered rectangle
Parameters:
  x - the x component of the upper left corner
Parameters:
  y - the y component of the upper left corner
Parameters:
  width - the width of the rectangle
Parameters:
  height - the height of the rectangle
Parameters:
  arcWidth - the horizontal diameter of the arc at the four corners.
Parameters:
  arcHeight - the vertical diameter of the arc at the four corners



drawString
public void drawString(String string, int x, int y, int alignx, int aligny)(Code)
Draws a string. Alignment parameters specify where the string should be located relative to coordinate (x,y).
Parameters:
  string - The string to draw.
Parameters:
  x - the x coordinate of the location where the of the string will be placed.
Parameters:
  y - the y coordinate of the location where the of the string will be placed.
Parameters:
  alignx - horizontal alignment, ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_MIDDLE or ViewportGraphics.ALIGN_RIGHT
Parameters:
  aligny - vertical alignment, ViewportGraphics.ALIGN_BOTTOM, ViewportGraphics.ALIGN_MIDDLE or ViewportGraphics.ALIGN_TOP



fill
public void fill(Shape s)(Code)
Fills the interior of a Shape using the foreground color, clip & transform.

Reference description from Graphics2d: Fills the interior of a Shape using the settings of the Graphics2D context. The rendering attributes applied include the Clip, Transform, Paint, and Composite.
Parameters:
  s - the Shape to be filled


Parameters:
  s - the Shape to be rendered
See Also:   fill



fillOval
public void fillOval(int x, int y, int width, int height)(Code)
Fills an Oval
Parameters:
  x - the starting x coordinate
Parameters:
  y - the starting y coordinate
Parameters:
  width - the width of the Oval.
Parameters:
  height - the height of the Oval.



fillPath
public void fillPath(Path path)(Code)
Fills the interior of the path with the forground color.
Parameters:
  path - the path to fill.



fillRect
public void fillRect(int x, int y, int width, int height)(Code)
Fills a rectangle.
Parameters:
  x - the starting x coordinate
Parameters:
  y - the starting y coordinate
Parameters:
  width - the width of the rectangle.
Parameters:
  height - the height of the rectangle.



fillRoundRect
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)
Fills a round cornered rectangle using the foreground color
Parameters:
  x - the x component of the upper left corner
Parameters:
  y - the y component of the upper left corner
Parameters:
  width - the width of the rectangle
Parameters:
  height - the height of the rectangle
Parameters:
  arcWidth - the horizontal diameter of the arc at the four corners.
Parameters:
  arcHeight - the vertical diameter of the arc at the four corners



getBackgroundColor
Color getBackgroundColor()(Code)
Gets the current background color value the current background color value



getClip
Shape getClip()(Code)
Gets the area that can be drawn in. the area that can be drawn in.



getColor
Color getColor()(Code)
Gets the current Color value the current Color value



getFontAscent
public int getFontAscent()(Code)
Gets the ascent of the current font, which is the distance the font rises above its baseline.



getFontHeight
public int getFontHeight()(Code)
Gets the height of the current font TODO at some point maybe this could be broken out to getFontMetrics(), and a create FontMetrics object that maps between SWT and AWT. the height of the current font



getStringBounds
public Rectangle2D getStringBounds(String str)(Code)
Returns the bounds of a String. Does not expand tabs or newlines
Parameters:
  str -



getTransform
public AffineTransform getTransform()(Code)



setBackground
public void setBackground(Color c)(Code)
Sets the background color to draw with.
Parameters:
  c - The new color.



setClip
public void setClip(Rectangle r)(Code)
Sets the clip.
Parameters:
  r - the rectangle to clip to.



setClipBounds
void setClipBounds(Rectangle newBounds)(Code)
Sets the clip area.
Parameters:
  newBounds - new clip area



setColor
public void setColor(Color c)(Code)
Sets the foreground color to draw with.
Parameters:
  c - The new color.



setStroke
public void setStroke(int strokeStyle, int strokeWidth)(Code)
Sets the stroke color to draw with.
Parameters:
  strokeStyle - The style of line to draw.
Parameters:
  strokeWidth - the width, in pixels, to draw lines with.



setTransform
public void setTransform(AffineTransform transform)(Code)
Modifies the graphics so that further draws us minX,minY as the origin and maxX and maxY as the width and height of the display area.
Parameters:
  minX - The x-coord that will be used as the origin.
Parameters:
  minY - The y-coord that will be used as the origin.
Parameters:
  width - The width that will be used to draws.
Parameters:
  height - The height that will be used to draws.



stringWidth
public int stringWidth(String str)(Code)
Returns the length in pixels of the given string, or -1 if this operation is not available.
Parameters:
  str -



translate
public void translate(Point offset)(Code)
Sets the draw offset.
Parameters:
  offset - The amount the draw is offset in the graphics.



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