Gephi Toolkit Javadoc

org.gephi.preview.api
Class PreviewPreset

java.lang.Object
  extended by org.gephi.preview.api.PreviewPreset
All Implemented Interfaces:
java.lang.Comparable<PreviewPreset>
Direct Known Subclasses:
BlackBackground, DefaultCurved, DefaultPreset, DefaultStraight, EdgesCustomColor, TagCloud, TextOutline

public class PreviewPreset
extends java.lang.Object
implements java.lang.Comparable<PreviewPreset>

Read only set of PreviewProperty values.

Author:
Mathieu Bastian

Field Summary
protected  java.lang.String name
           
protected  java.util.Map<java.lang.String,java.lang.Object> properties
           
 
Constructor Summary
PreviewPreset(java.lang.String name)
           
PreviewPreset(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> propertiesMap)
           
 
Method Summary
 int compareTo(PreviewPreset o)
           
static PreviewPreset deserialize(java.lang.String presetName, java.util.Map<java.lang.String,java.lang.String> propertiesString)
          Create a PreviewPreset from a list of (key,value) pairs as strings.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Returns a read-only map of all properties
 int hashCode()
           
static java.util.Map<java.lang.String,java.lang.String> serialize(PreviewPreset preset)
          Serialize preset property values to strings and return a map of (key,value) for all properties.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

properties

protected final java.util.Map<java.lang.String,java.lang.Object> properties

name

protected final java.lang.String name
Constructor Detail

PreviewPreset

public PreviewPreset(java.lang.String name)

PreviewPreset

public PreviewPreset(java.lang.String name,
                     java.util.Map<java.lang.String,java.lang.Object> propertiesMap)
Method Detail

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Returns a read-only map of all properties

Returns:
a read-only map of all properties

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(PreviewPreset o)
Specified by:
compareTo in interface java.lang.Comparable<PreviewPreset>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

serialize

public static java.util.Map<java.lang.String,java.lang.String> serialize(PreviewPreset preset)
Serialize preset property values to strings and return a map of (key,value) for all properties.

Parameters:
preset - the preset to serialize
Returns:
a map of all properties with values serialized as strings

deserialize

public static PreviewPreset deserialize(java.lang.String presetName,
                                        java.util.Map<java.lang.String,java.lang.String> propertiesString)
Create a PreviewPreset from a list of (key,value) pairs as strings. Typically property values are not string but serialized as strings and this method is used to deserialize them

Parameters:
presetName - the name of the preset
propertiesString - the property keys and values as stirngs
Returns:
the deserialized preset with the given preset name

Gephi Toolkit Javadoc