Package org.gephi.layout.spi
Class LayoutProperty
- java.lang.Object
-
- org.gephi.layout.spi.LayoutProperty
-
public final class LayoutProperty extends Object
Properties for layout algorithms that are used by the UI to fill the property sheet and thus allow user edit.- Author:
- Mathieu Bastian
-
-
Constructor Summary
Constructors Constructor Description LayoutProperty(org.openide.nodes.Node.Property property, String category, String canonicalName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LayoutProperty
createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyDescription, String getMethod, String setMethod)
Create a property.static LayoutProperty
createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyDescription, String getMethod, String setMethod, Class<? extends PropertyEditor> editorClass)
Create a property, with a particularPropertyEditor
.static LayoutProperty
createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyCanonicalName, String propertyDescription, String getMethod, String setMethod)
Create a property.static LayoutProperty
createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyCanonicalName, String propertyDescription, String getMethod, String setMethod, Class<? extends PropertyEditor> editorClass)
Create a property, with a particularPropertyEditor
.String
getCanonicalName()
String
getCategory()
Return the category of the propertyorg.openide.nodes.Node.Property
getProperty()
Return the underlyingProperty
.
-
-
-
Method Detail
-
createProperty
public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyDescription, String getMethod, String setMethod) throws NoSuchMethodException
Create a property. The parameterpropertyName
will be used as the canonical name of theLayoutProperty
.- Parameters:
layout
- The layout instancevalueType
- The type of the property value, ex:Double.class
propertyName
- The display name of the propertypropertyCategory
- A category string ornull
for using default categorypropertyDescription
- A description string for the propertygetMethod
- 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:
NoSuchMethodException
- if the getter or setter methods cannot be found
-
createProperty
public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyDescription, String getMethod, String setMethod, Class<? extends PropertyEditor> editorClass) throws NoSuchMethodException
Create a property, with a particularPropertyEditor
. A particular editor must be specified when the property type don't have a registered editor class. The parameterpropertyName
will be used as the canonical name of theLayoutProperty
.- Parameters:
layout
- The layout instancevalueType
- The type of the property value, ex:Double.class
propertyName
- The display name of the propertypropertyCategory
- A category string ornull
for using default categorypropertyDescription
- A description string for the propertygetMethod
- 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.editorClass
- APropertyEditor
class for the given type- Returns:
- the created property
- Throws:
NoSuchMethodException
- if the getter or setter methods cannot be found
-
createProperty
public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyCanonicalName, String propertyDescription, String getMethod, String setMethod) throws NoSuchMethodException
Create a property. The parameterpropertyName
will be used as the canonical name of theLayoutProperty
.- Parameters:
layout
- The layout instancevalueType
- The type of the property value, ex:Double.class
propertyName
- The display name of the propertypropertyCategory
- A category string ornull
for using default categorypropertyCanonicalName
- Canonical name for theLayoutProperty
. It should be unique and not localizedpropertyDescription
- A description string for the propertygetMethod
- 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:
NoSuchMethodException
- if the getter or setter methods cannot be found
-
createProperty
public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyCanonicalName, String propertyDescription, String getMethod, String setMethod, Class<? extends PropertyEditor> editorClass) throws NoSuchMethodException
Create a property, with a particularPropertyEditor
. A particular editor must be specified when the property type don't have a registered editor class. The parameterpropertyName
will be used as the canonical name of theLayoutProperty
.- Parameters:
layout
- The layout instancevalueType
- The type of the property value, ex:Double.class
propertyName
- The display name of the propertypropertyCategory
- A category string ornull
for using default categorypropertyCanonicalName
- Canonical name for theLayoutProperty
. It should be unique and not localizedpropertyDescription
- A description string for the propertygetMethod
- 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.editorClass
- APropertyEditor
class for the given type- Returns:
- the created property
- Throws:
NoSuchMethodException
- if the getter or setter methods cannot be found
-
getProperty
public org.openide.nodes.Node.Property getProperty()
Return the underlyingProperty
.- Returns:
- the instance of
Node.Property
-
getCategory
public String getCategory()
Return the category of the property
-
getCanonicalName
public String getCanonicalName()
-
-