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


java.lang.Object
   net.refractions.udig.style.IStyleConfigurator

All known Subclasses:   net.refractions.udig.printing.ui.ScalebarStyleConfigurator,  net.refractions.udig.legend.ui.LegendGraphicStyleConfigurator,  net.refractions.udig.mapgraphic.scalebar.ScalebarStyleConfigurator,  net.refractions.udig.mapgraphic.scalebar.LocationStyleConfigurator,  net.refractions.udig.mapgraphic.grid.GridStyleConfigurator,  net.refractions.udig.printing.ui.LocationStyleConfigurator,  net.refractions.udig.style.sld.SLDConfigurator,  net.refractions.udig.style.sld.AbstractSimpleConfigurator,
IStyleConfigurator
abstract public class IStyleConfigurator (Code)
Configures a style object.

Responsibilities:

  • Creating a ui to allow user configuration of a style object.
  • Placing style object information onto the style blackboard of a layer.
  • Determining if a style configurator can be used to configure the style of a particular layer.

Style objects are stored a StyleBlackboard. Configurators use the blackboard to collaborate. Objects are stored on the blackboard by id. When a configurator queries the blackboard for an object and it does not exist, a default object should be created and placed on the blackboard. The following is an example: ... StyleBlackboard styleBlackboard = getStyleBlackboard(); Point style = styleBlackboard.lookup("point.style"); if (style == null) { style = new Point(); style.setX(0); style.setY(0); styleBlackboard.put("point.style", style); } ...

Each Layer has a StyleBlackboard. Configurators should not write to this blackboard directly. Each configurator is supplied with a copy of the actual layer blackboard.

Note:Each time a style object is changed, it must be replaced onto the blackboard for persistance reasons. StyleBlackboard styleBlackboard = getStyleBlackboard(); Point style = styleBlackboard.lookup("point.style"); ... style.setX(10); style.setY(10); styleBlackboard.put("point.style", style);

The StyleConfigurator should store no state. All state should be stored in the style objects on the style blackboard. When a ui widget changes state, the style object should be written to immediately to reflect the change. When the configurator becomes active, the ui widgets should be initialized from the values of style objects on the blackboard. This should be performed every time refresh() is called.

Whenever style objects are read from the blackboard,

void apply() { StyleBlackboard styleBlackboard = getStyleBlackboard(); Point style = styleBlackboard.lookup("point.style"); if (style == null) { style = new Point(); styleBlackboard.put("point.style", style); } style.setX(...) //set to some value from ui style.setY(...) //set to some value from ui } void init() { StyleBlackboard styleBlackboard = getStyleBlackboard(); Point style = styleBlackboard.lookup("point.style"); if (style != null) { //set some ui widget to value of style.getX(); //set some ui widget to value of style.getY(); } }

A StyleConfigurator is not considered active until its ui has been created.


author:
   Justin Deoliveira
since:
   0.6.0


Field Summary
final public static  StringXPID
    


Method Summary
abstract public  booleancanStyle(Layer aLayer)
     Determines if the configurator can be used to configure the style for a specified layer.
Parameters:
  aLayer - The layer to be styled.
abstract public  voidcreateControl(Composite parent)
     Creates the control that is to be used to configure the style.

This method uses a template pattern to get the subclass to create the control.

public  voiddispose()
     Cleans up any resources (like icons) held by this StyleConfigurator.
public  voidfocus(Layer layer1)
     Sets the layer and style blackboard that the configurator can populate with style.
protected  IActiongetApplyAction()
    
final public  StringgetLabel()
     Returns the label describing the configurator.
final public  LayergetLayer()
     Gets the current layer to which the current style being configured is to be applied to.

The layer can be null while the view is being initialized or created.

final public  IBlackboardgetStyleBlackboard()
     Returns the style blackboard that the configurator is populating with style information.

The blackboard can be null while the view is being initialized or created.

final public  StringgetStyleId()
     Returns the declared style id of the style the configurator depends on.

This is provided by SetStyleId by the extention point.

When keeping information associated with a IStyleConfigurator (in a Map, or Memento) use this as a KEY.

public  IViewSitegetViewSite()
     Returns the site for this view.
public  voidinit(IViewSite viewSite)
     Initializes this view with the given view site.
protected  voidinit()
     Initialize this style configurator.
protected  voidmakeActionDoStuff()
     Runs the apply action.
public  voidpreApply()
     Called after apply action has been triggeredbefore apply is executed.
abstract protected  voidrefresh()
     Called when new layer and blackbard values are available.
final public  voidsetAction(IAction applyAction1)
     Sets the apply action.
public  voidsetLabel(String label)
     Sets the label describing the configurator.
final public  voidsetStyleId(String id)
     Sets the declared style id of the style the configurator depends on.

Field Detail
XPID
final public static String XPID(Code)
extension point id *





Method Detail
canStyle
abstract public boolean canStyle(Layer aLayer)(Code)
Determines if the configurator can be used to configure the style for a specified layer.
Parameters:
  aLayer - The layer to be styled. true if the configurator can work with the layer, otherwise false.



createControl
abstract public void createControl(Composite parent)(Code)
Creates the control that is to be used to configure the style.

This method uses a template pattern to get the subclass to create the control. This method will not be called until after init and setViewPart. The parent container (composite) passed in is for the explicit use of the configurator, this method must set a layout for the container.

You can set the layout to the parent to be whatever you want.


Parameters:
  parent -



dispose
public void dispose()(Code)
Cleans up any resources (like icons) held by this StyleConfigurator.

You should not assume that create, or even init has been called. You must call super.dispose();




focus
public void focus(Layer layer1)(Code)
Sets the layer and style blackboard that the configurator can populate with style. information. Upon this method, ui state should be reinitialized against the new layer and blackboard.

When changing layers:

  • setLayer( newLayer ) is called
  • setBlackboard( newBlackboard )
  • refresh()


    Parameters:
      layer1 - The layer being styled.



getApplyAction
protected IAction getApplyAction()(Code)



getLabel
final public String getLabel()(Code)
Returns the label describing the configurator. Used mainly for ui purposes. A short description of the configurator.



getLayer
final public Layer getLayer()(Code)
Gets the current layer to which the current style being configured is to be applied to.

The layer can be null while the view is being initialized or created. This value must be non-null when the IStyleConfigurator.getControl() is visiable.

Layer being edited at the moment



getStyleBlackboard
final public IBlackboard getStyleBlackboard()(Code)
Returns the style blackboard that the configurator is populating with style information.

The blackboard can be null while the view is being initialized or created. This value must be non-null when the IStyleConfigurator.getControl() is visiable.

A style blackboard.



getStyleId
final public String getStyleId()(Code)
Returns the declared style id of the style the configurator depends on.

This is provided by SetStyleId by the extention point.

When keeping information associated with a IStyleConfigurator (in a Map, or Memento) use this as a KEY. Don't use label, two IStyleConfigurator may have the same label.

styleId The style id.



getViewSite
public IViewSite getViewSite()(Code)
Returns the site for this view. This method is equivalent to (IViewSite) getSite().

The site can be null while the view is being initialized. After the initialization is complete, this value must be non-null for the remainder of the view's life cycle.

the view site; this value may be null if the viewhas not yet been initialized



init
public void init(IViewSite viewSite) throws PartInitException(Code)
Initializes this view with the given view site.

This method is automatically shortly after the part is instantiated. It marks the start of the views's lifecycle. Clients must not call this method.


Parameters:
  viewSite - the view site
throws:
  PartInitException -



init
protected void init() throws PartInitException(Code)
Initialize this style configurator.

You must call super.init();


throws:
  PartInitException -



makeActionDoStuff
protected void makeActionDoStuff()(Code)
Runs the apply action.



preApply
public void preApply()(Code)
Called after apply action has been triggeredbefore apply is executed.



refresh
abstract protected void refresh()(Code)
Called when new layer and blackbard values are available.

This provides update information as a callback (rather than an event listener).

This should only be called after create part control has had a chance to be called.



setAction
final public void setAction(IAction applyAction1)(Code)
Sets the apply action.
Parameters:
  applyAction1 -



setLabel
public void setLabel(String label)(Code)
Sets the label describing the configurator. Used mainly for ui purposes.
Parameters:
  label - A short description of the configurator.



setStyleId
final public void setStyleId(String id)(Code)
Sets the declared style id of the style the configurator depends on.

Called by the extention point processor.


Parameters:
  id - The style id.



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.