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


java.lang.Object
   net.refractions.udig.project.ui.internal.LayerGeneratedGlyphDecorator

LayerGeneratedGlyphDecorator
public class LayerGeneratedGlyphDecorator implements ILabelDecorator(Code)
Generate glyph/title - fetch from WMS or derrive from StyleBlackboard.

This is a complete heavyweight decorator - there is no messing around with this one. It has its own thread, and will pay attention to events.

Generated Content is placed in layer properties:

  • displayName:
  • displayGlyph:

Generation only kicks in if getGlyph or getName return null.


author:
   jgarnett
since:
   0.7.0


Field Summary
static  ImageCachecache
    
 Adapterhack
    
 Set<ILabelProviderListener>listeners
    
 Jobpicasso
     Piccaso generates pcitures for layers in the queue.

This is the sole provider of dynamic artwork for layers.

 LinkedList<Layer>queue
     Queue of layers needing to be refreshed.

Constructor Summary
public  LayerGeneratedGlyphDecorator()
    

Method Summary
public  voidaddListener(ILabelProviderListener listener)
    
public  ImagedecorateImage(Image origionalImage, Object element)
     We are not allowed to block, test if generation is needed and start up the queue.

State Table of Image \ Image Descriptor:


 | null         | icon                
 ---------+--------------+---------------------+
 disposed | queue        | image =             |
 or null |   layer      |  icon.createImage() |
 ---------+--------------+---------------------+
 image    | both         | image               |
 +--------------+---------------------+
 
This attempts to reduce the amount of flicker experienced as the layer figures out its glyph in the face of many events.

Everyone gives us events - who gives us icons?

  • If the user has given the layer an icon we don't need to generate anything.
  • piccaso will wait on the queue and generate icons, and refresh the decorator.
  • We will get the refresh and generate an Image from the Icon, we can use this image when we are nexted refreshed.
  • A random eclipse code will dispose our Images, and refrsh us (We can still generate our images from the saved icon).
  • The listener *hack* will watch for changes to layer,if any look interesting the icon will be cleared and we will be refreshed.
public  StringdecorateText(String text, Object element)
    
public  voiddispose()
    
static  ImageDescriptorgenerateDefaultIcon(Layer layer)
     Generate icon based on simple layer type information without style.
public static  ImageDescriptorgenerateIcon(Layer layer)
     Genearte label and place in label.getProperties().getSTring( GENERATED_NAME ).
public static  StringgenerateLabel(Layer layer)
     Genearte label.

This is used to generate a value for layer.getProperties().getString( GENERATED_NAME ).

The generated label from Resource.getInfo().getTitle().

public static  ImageDescriptorgenerateStyledIcon(Layer layer)
     Generate icon based on style information.

Will return null if an icom based on the current style could not be generated.

public static  ImageDescriptorgenerateStyledIcon(Layer layer, Rule rule)
    
public static  LayerGeneratedGlyphDecoratorgetInstance()
    
public  booleanisLabelProperty(Object element, String property)
    
static  Stringlabel(Layer layer)
     A non null answer when layer has a good label.

Where a good/real means:

  • label.getLabel() != null
  • label.getProperties().getSTring( GENERATED_NAME ) != null

    This method does not block and used used by the decorateText and our thread to test/acquire the right text.

 voidrefresh(Layer layer)
    
public  voidremoveListener(ILabelProviderListener listener)
    

Field Detail
cache
static ImageCache cache(Code)
Cache of images by resource id



hack
Adapter hack(Code)



listeners
Set<ILabelProviderListener> listeners(Code)



picasso
Job picasso(Code)
Piccaso generates pcitures for layers in the queue.

This is the sole provider of dynamic artwork for layers. Piccaso will block contacting external servers and so on.

If this gets to be a pain we may switch to the dutch school model, perhaps even impressionests based on a sample feature.

Any artwork is provided as an ImageDescriptor using the key GENERATED_ICON. This will be turned into an Image by the decorateImage method as required.




queue
LinkedList<Layer> queue(Code)
Queue of layers needing to be refreshed.

Does not allow duplicates to be added.





Constructor Detail
LayerGeneratedGlyphDecorator
public LayerGeneratedGlyphDecorator()(Code)




Method Detail
addListener
public void addListener(ILabelProviderListener listener)(Code)

See Also:   org.eclipse.jface.viewers.IBaseLabelProvider.addListener(org.eclipse.jface.viewers.ILabelProviderListener)



decorateImage
public Image decorateImage(Image origionalImage, Object element)(Code)
We are not allowed to block, test if generation is needed and start up the queue.

State Table of Image \ Image Descriptor:


 | null         | icon                
 ---------+--------------+---------------------+
 disposed | queue        | image =             |
 or null |   layer      |  icon.createImage() |
 ---------+--------------+---------------------+
 image    | both         | image               |
 +--------------+---------------------+
 
This attempts to reduce the amount of flicker experienced as the layer figures out its glyph in the face of many events.

Everyone gives us events - who gives us icons?

  • If the user has given the layer an icon we don't need to generate anything.
  • piccaso will wait on the queue and generate icons, and refresh the decorator.
  • We will get the refresh and generate an Image from the Icon, we can use this image when we are nexted refreshed.
  • A random eclipse code will dispose our Images, and refrsh us (We can still generate our images from the saved icon).
  • The listener *hack* will watch for changes to layer,if any look interesting the icon will be cleared and we will be refreshed. We still have our image so their will be no downtime while waiting for piccaso to make us a new Icon.
So what happens for a layer that we cannot generate a icon for? We will place it in the queue every* time. Who knows maybe style or something will change and we can do better then the default.


See Also:   org.eclipse.jface.viewers.ILabelDecorator.decorateImage(org.eclipse.swt.graphics.Imagejava.lang.Object)



decorateText
public String decorateText(String text, Object element)(Code)

See Also:   org.eclipse.jface.viewers.ILabelDecorator.decorateText(java.lang.Stringjava.lang.Object)



dispose
public void dispose()(Code)

See Also:   org.eclipse.jface.viewers.IBaseLabelProvider.dispose



generateDefaultIcon
static ImageDescriptor generateDefaultIcon(Layer layer)(Code)
Generate icon based on simple layer type information without style.

The following information is checked:

  • All WMS resources known to the layer - they often have default icon
  • FeatureSoruce known to the layer - icon can be based on FeatureType
  • IGeoResourceInfo type information


Parameters:
  layer - Icon based on layer, null if unavailable



generateIcon
public static ImageDescriptor generateIcon(Layer layer)(Code)
Genearte label and place in label.getProperties().getSTring( GENERATED_NAME ).

Label is genrated from Resource.

gernated layer



generateLabel
public static String generateLabel(Layer layer)(Code)
Genearte label.

This is used to generate a value for layer.getProperties().getString( GENERATED_NAME ).

The generated label from Resource.getInfo().getTitle(). This method will block and should not be called from the event thread.

gernated layer, or null if none can be determined



generateStyledIcon
public static ImageDescriptor generateStyledIcon(Layer layer)(Code)
Generate icon based on style information.

Will return null if an icom based on the current style could not be generated. You may consult generateDefaultIcon( layer ) for a second opionion based on just the layer information.
Parameters:
  layer - ImageDecriptor for layer, or null in style could not be indicated




generateStyledIcon
public static ImageDescriptor generateStyledIcon(Layer layer, Rule rule)(Code)



getInstance
public static LayerGeneratedGlyphDecorator getInstance()(Code)



isLabelProperty
public boolean isLabelProperty(Object element, String property)(Code)

See Also:   org.eclipse.jface.viewers.IBaseLabelProvider.isLabelProperty(java.lang.Objectjava.lang.String)



label
static String label(Layer layer)(Code)
A non null answer when layer has a good label.

Where a good/real means:

  • label.getLabel() != null
  • label.getProperties().getSTring( GENERATED_NAME ) != null

    This method does not block and used used by the decorateText and our thread to test/acquire the right text. If null is returned the thread will be started in the hopes of producing something.




refresh
void refresh(Layer layer)(Code)



removeListener
public void removeListener(ILabelProviderListener listener)(Code)

See Also:   org.eclipse.jface.viewers.IBaseLabelProvider.removeListener(org.eclipse.jface.viewers.ILabelProviderListener)



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.