|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gephi.preview.api.PreviewProperty
public class PreviewProperty
Define a (key, value) pair property attached to a PreviewProperties
instance.
Preview properties are created by renderers to let users configure how items
should be rendered. Each property should have a unique name and a type. Users
should use the static createProperty() methods to create instances.
Static default property names are defined in this class to help renderers to reuse external properties and have cleaner code.
Properties can be grouped by categories, which default are
PreviewProperty.CATEGORY_NODES, PreviewProperty.CATEGORY_EDGES,
PreviewProperty.CATEGORY_NODE_LABELS, PreviewProperty.CATEGORY_EDGE_LABELS
and PreviewProperty.CATEGORY_EDGE_ARROWS.
Renderer.getProperties()| Field Summary | |
|---|---|
static java.lang.String |
ARROW_SIZE
Arrow Float property defining the arrow size. |
static java.lang.String |
BACKGROUND_COLOR
General Color property of the background color |
static java.lang.String |
CATEGORY_EDGE_ARROWS
Edge arrow category |
static java.lang.String |
CATEGORY_EDGE_LABELS
Edge Label category |
static java.lang.String |
CATEGORY_EDGES
Edge category |
static java.lang.String |
CATEGORY_NODE_LABELS
Node Label category |
static java.lang.String |
CATEGORY_NODES
Node category |
static java.lang.String |
DIRECTED
General Boolean property which indicates wheter the graph is directed |
static java.lang.String |
EDGE_COLOR
Edge EdgeColor property defining the edge color. |
static java.lang.String |
EDGE_CURVED
Edge Boolean property whether to draw curved edges. |
static java.lang.String |
EDGE_LABEL_COLOR
Edge Label DependantOriginalColor property defining the color label. |
static java.lang.String |
EDGE_LABEL_FONT
Edge Label Font property defining edge label's font. |
static java.lang.String |
EDGE_LABEL_MAX_CHAR
Edge Label Integer property defining the maximum number of
characters. |
static java.lang.String |
EDGE_LABEL_OUTLINE_COLOR
Edge Label Outline DependantColor property defining the outline color. |
static java.lang.String |
EDGE_LABEL_OUTLINE_OPACITY
Edge Label Outline Float property between 0-100 which defines the opacity. |
static java.lang.String |
EDGE_LABEL_OUTLINE_SIZE
Edge Label Outline Float property defining the outline size. |
static java.lang.String |
EDGE_LABEL_SHORTEN
Edge Label Boolean property defining whether the label is shortened. |
static java.lang.String |
EDGE_OPACITY
Edge Float property between 0-100 which defines the opacity. |
static java.lang.String |
EDGE_RADIUS
Edge Float property defining an extra distance between the node
and the edge. |
static java.lang.String |
EDGE_RESCALE_WEIGHT
Edge Boolean property defining whether edge's weight should be
rescaled between fixed bounds. |
static java.lang.String |
EDGE_THICKNESS
Edge Float property for the edge's thickness |
static java.lang.String |
MARGIN
General Float property in percentage (0-100) describing the
margin size. |
static java.lang.String |
MOVING
General Boolean property set as true when the user
is panning the canvas. |
static java.lang.String |
NODE_BORDER_COLOR
Node DependantColor property which defines the border color. |
static java.lang.String |
NODE_BORDER_WIDTH
Node Float property defining the node border size. |
static java.lang.String |
NODE_LABEL_BOX_COLOR
|
static java.lang.String |
NODE_LABEL_BOX_OPACITY
|
static java.lang.String |
NODE_LABEL_COLOR
Node Label DependantOriginalColor property defining the color label. |
static java.lang.String |
NODE_LABEL_FONT
Node Label Font property defining node label's font. |
static java.lang.String |
NODE_LABEL_MAX_CHAR
Node Label Integer property defining the maximum number of
characters. |
static java.lang.String |
NODE_LABEL_OUTLINE_COLOR
Node Label Outline DependantColor property defining the outline color. |
static java.lang.String |
NODE_LABEL_OUTLINE_OPACITY
Node Label Outline Float property between 0-100 which defines the opacity. |
static java.lang.String |
NODE_LABEL_OUTLINE_SIZE
Node Label Outline Float property defining the outline size. |
static java.lang.String |
NODE_LABEL_PROPORTIONAL_SIZE
Node Label Boolean> property defining whether to use node's size
in label size calculation. |
static java.lang.String |
NODE_LABEL_SHORTEN
Node Label Boolean property defining whether the label is shortened. |
static java.lang.String |
NODE_LABEL_SHOW_BOX
|
static java.lang.String |
NODE_OPACITY
Node Float property between 0-100 which defines the opacity. |
static java.lang.String |
SHOW_EDGE_LABELS
Edge Label Boolean property defining whether to show edge labels. |
static java.lang.String |
SHOW_EDGES
Edge Boolean property defining whether to show edges. |
static java.lang.String |
SHOW_NODE_LABELS
Node Label Boolean property defining whether to show node labels. |
static java.lang.String |
VISIBILITY_RATIO
General Float property which indicates the ratio of the visible graph
used in preview. |
| Method Summary | ||
|---|---|---|
static PreviewProperty |
createProperty(java.lang.Object source,
java.lang.String name)
Create a new preview property. |
|
static PreviewProperty |
createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type)
Create a new preview property. |
|
static PreviewProperty |
createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type,
java.lang.String displayName,
java.lang.String description,
java.lang.String category)
Create a new preview property. |
|
static PreviewProperty |
createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type,
java.lang.String displayName,
java.lang.String description,
java.lang.String category,
java.lang.String... dependantProperties)
Create a new preview property. |
|
java.lang.String |
getCategory()
Returns the category of this property or null if not set. |
|
java.lang.String |
getDescription()
Returns the description of this property or null if not set. |
|
java.lang.String |
getDisplayName()
Returns the display name of this property or null if not set. |
|
java.lang.String |
getName()
Returns the (unique) name of this property. |
|
java.lang.Object |
getSource()
Returns the source object of this property. |
|
java.lang.Class |
getType()
Returns the type of this property. |
|
|
getValue()
Returns the property value. |
|
PreviewProperty |
setValue(java.lang.Object value)
Sets this property value and return it. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DIRECTED
Boolean property which indicates wheter the graph is directed
public static final java.lang.String BACKGROUND_COLOR
Color property of the background color
public static final java.lang.String VISIBILITY_RATIO
Float property which indicates the ratio of the visible graph
used in preview. For instance if 0.5 only 50% of nodes items are built.
public static final java.lang.String MARGIN
Float property in percentage (0-100) describing the
margin size. For instance if the value is 4 the size of the margin is 4% of
the total graph width.
public static final java.lang.String NODE_BORDER_WIDTH
Float property defining the node border size.
public static final java.lang.String NODE_BORDER_COLOR
DependantColor property which defines the border color. A
dependant color value is either the node's color or a custom color.
public static final java.lang.String NODE_OPACITY
Float property between 0-100 which defines the opacity.
100 means opaque.
public static final java.lang.String SHOW_EDGES
Boolean property defining whether to show edges.
public static final java.lang.String EDGE_THICKNESS
Float property for the edge's thickness
public static final java.lang.String EDGE_CURVED
Boolean property whether to draw curved edges. A
false value means straight edges.
public static final java.lang.String EDGE_COLOR
EdgeColor property defining the edge color. It could be
the source's color, the target's color, a mixed color, the edge's original
color or a custom color.
public static final java.lang.String EDGE_OPACITY
Float property between 0-100 which defines the opacity.
100 means opaque.
public static final java.lang.String EDGE_RESCALE_WEIGHT
Boolean property defining whether edge's weight should be
rescaled between fixed bounds.
public static final java.lang.String EDGE_RADIUS
Float property defining an extra distance between the node
and the edge.
public static final java.lang.String ARROW_SIZE
Float property defining the arrow size.
public static final java.lang.String SHOW_NODE_LABELS
Boolean property defining whether to show node labels.
public static final java.lang.String NODE_LABEL_FONT
Font property defining node label's font.
public static final java.lang.String NODE_LABEL_PROPORTIONAL_SIZE
Boolean> property defining whether to use node's size
in label size calculation.
public static final java.lang.String NODE_LABEL_COLOR
DependantOriginalColor property defining the color label.
The color could either be the node's color, the label original color if it has any
or a custom color.
public static final java.lang.String NODE_LABEL_SHORTEN
Boolean property defining whether the label is shortened.
public static final java.lang.String NODE_LABEL_MAX_CHAR
Integer property defining the maximum number of
characters.
public static final java.lang.String NODE_LABEL_OUTLINE_SIZE
Float property defining the outline size.
public static final java.lang.String NODE_LABEL_OUTLINE_OPACITY
Float property between 0-100 which defines the opacity.
100 means opaque.
public static final java.lang.String NODE_LABEL_OUTLINE_COLOR
DependantColor property defining the outline color.
The color can be the node's color or a custom color.
public static final java.lang.String NODE_LABEL_SHOW_BOX
public static final java.lang.String NODE_LABEL_BOX_COLOR
public static final java.lang.String NODE_LABEL_BOX_OPACITY
public static final java.lang.String SHOW_EDGE_LABELS
Boolean property defining whether to show edge labels.
public static final java.lang.String EDGE_LABEL_FONT
Font property defining edge label's font.
public static final java.lang.String EDGE_LABEL_COLOR
DependantOriginalColor property defining the color label.
The color could either be the edge's color, the label original color if it has any
or a custom color.
public static final java.lang.String EDGE_LABEL_SHORTEN
Boolean property defining whether the label is shortened.
public static final java.lang.String EDGE_LABEL_MAX_CHAR
Integer property defining the maximum number of
characters.
public static final java.lang.String EDGE_LABEL_OUTLINE_SIZE
Float property defining the outline size.
public static final java.lang.String EDGE_LABEL_OUTLINE_OPACITY
Float property between 0-100 which defines the opacity.
100 means opaque.
public static final java.lang.String EDGE_LABEL_OUTLINE_COLOR
DependantColor property defining the outline color.
The color can be the edge's color or a custom color.
public static final java.lang.String MOVING
Boolean property set as true when the user
is panning the canvas. Helps to conditionally hide elements while moving to
speed things up.
public static final java.lang.String CATEGORY_NODES
public static final java.lang.String CATEGORY_EDGES
public static final java.lang.String CATEGORY_NODE_LABELS
public static final java.lang.String CATEGORY_EDGE_LABELS
public static final java.lang.String CATEGORY_EDGE_ARROWS
| Method Detail |
|---|
public static PreviewProperty createProperty(java.lang.Object source,
java.lang.String name)
name should be unique.
source - the property source, for instance the renderername - the property's name
public static PreviewProperty createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type)
name should be unique. If
the type is different from basic types (Integer, Float, Double, String,
Boolean or Color) make sure to implement a PropertyEditor and register it:
PropertyEditorManager.registerEditor(MyType.class, MyTypePropertyEditor.class);
source - the property source, for instance the renderername - the property's nametype - the property's value type
public static PreviewProperty createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type,
java.lang.String displayName,
java.lang.String description,
java.lang.String category)
name should be unique. If
the type is different from basic types (Integer, Float, Double, String,
Boolean or Color) make sure to implement a PropertyEditor and register it:
PropertyEditorManager.registerEditor(MyType.class, MyTypePropertyEditor.class);The category can be one of the default categories:
source - the property source, for instance the renderername - the property's nametype - the property's value typedisplayName - the property's display namedescription - the property's descriptioncategory - the property's category
public static PreviewProperty createProperty(java.lang.Object source,
java.lang.String name,
java.lang.Class type,
java.lang.String displayName,
java.lang.String description,
java.lang.String category,
java.lang.String... dependantProperties)
name should be unique. If
the type is different from basic types (Integer, Float, Double, String,
Boolean or Color) make sure to implement a PropertyEditor and register it:
PropertyEditorManager.registerEditor(MyType.class, MyTypePropertyEditor.class);The category can be one of the default categories:
dependantProperties list is used to automatically disable
the property if the dependant property is not selected. The dependant properties
need to be Boolean type.
source - the property source, for instance the renderername - the property's nametype - the property's value typedisplayName - the property's display namedescription - the property's descriptioncategory - the property's categorydependantProperties - a list of boolean properties this property depend on
public <T> T getValue()
T - the return type
nullpublic PreviewProperty setValue(java.lang.Object value)
null.
value - the value to be set
public java.lang.String getName()
public java.lang.Class getType()
public java.lang.String getDisplayName()
null if not set.
nullpublic java.lang.String getDescription()
null if not set.
nullpublic java.lang.Object getSource()
public java.lang.String getCategory()
null if not set.
null
|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||