Gephi Toolkit Javadoc

org.gephi.filters.spi
Class FilterProperty

java.lang.Object
  extended by org.gephi.filters.spi.FilterProperty

public final class FilterProperty
extends java.lang.Object

Properties for filters. All editable properties of a filter must be used through this class, especially setting value should be done by using setValue(java.lang.Object).

The role of this class is to define filter's properties in order value changes can be tracked by the system, UI can be generated and values correctly saved in projects file.

Author:
Mathieu Bastian

Field Summary
protected  Filter filter
           
protected  PropertySupport.Reflection property
           
protected  PropertyExecutor propertyExecutor
           
 
Method Summary
static FilterProperty createProperty(Filter filter, java.lang.Class valueType, java.lang.String fieldName)
          Create a property.
static FilterProperty createProperty(Filter filter, java.lang.Class valueType, java.lang.String propertyName, java.lang.String getMethod, java.lang.String setMethod)
          Create a property.
 Filter getFilter()
          Returns the filter instance this property is associated to.
 java.lang.String getName()
          Returns property's name
 java.beans.PropertyEditor getPropertyEditor()
          Returns the PropertyEditor associated to the property value.
 java.lang.Object getValue()
          Returns property's value, can be null
 java.lang.Class getValueType()
          Returns the property's value type.
 void setPropertyEditorClass(java.lang.Class<? extends java.beans.PropertyEditor> clazz)
          Sets the property editor class.
 void setValue(java.lang.Object value)
          Set property's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

property

protected PropertySupport.Reflection property

filter

protected Filter filter

propertyExecutor

protected PropertyExecutor propertyExecutor
Method Detail

getName

public java.lang.String getName()
Returns property's name

Returns:
property's name

getValue

public java.lang.Object getValue()
Returns property's value, can be null

Returns:
property's value

setValue

public void setValue(java.lang.Object value)
Set property's value. The type of value must match with this property value type.

Parameters:
value - the value that is to be set

getPropertyEditor

public java.beans.PropertyEditor getPropertyEditor()
Returns the PropertyEditor associated to the property value.

Returns:
the property editor

setPropertyEditorClass

public void setPropertyEditorClass(java.lang.Class<? extends java.beans.PropertyEditor> clazz)
Sets the property editor class. The class must implement PropertyEditor.

Parameters:
clazz - the property editor class

getValueType

public java.lang.Class getValueType()
Returns the property's value type.

Returns:
the value type

getFilter

public Filter getFilter()
Returns the filter instance this property is associated to.

Returns:
the filter this property belongs to

createProperty

public static FilterProperty createProperty(Filter filter,
                                            java.lang.Class valueType,
                                            java.lang.String propertyName,
                                            java.lang.String getMethod,
                                            java.lang.String setMethod)
                                     throws java.lang.NoSuchMethodException
Create a property.

Parameters:
filter - The filter instance
valueType - The type of the property value, ex: Double.class
propertyName - The display name of the property
getMethod - The name of the get method for this property, must exist to make Java reflexion working.
setMethod - The name of the set method for this property, must exist to make Java reflexion working.
Returns:
the created property
Throws:
java.lang.NoSuchMethodException - if the getter or setter methods cannot be found

createProperty

public static FilterProperty createProperty(Filter filter,
                                            java.lang.Class valueType,
                                            java.lang.String fieldName)
                                     throws java.lang.NoSuchMethodException
Create a property.

Parameters:
filter - The filter instance
valueType - The type of the property value, ex: Double.class
fieldName - The Java field name of the property
Throws:
java.lang.NoSuchMethodException - if the getter or setter methods cannot be found

Gephi Toolkit Javadoc