Package org.gephi.appearance
Class AppearanceModelImpl
- java.lang.Object
-
- org.gephi.appearance.AppearanceModelImpl
-
- All Implemented Interfaces:
AppearanceModel,org.gephi.project.spi.Model
public class AppearanceModelImpl extends Object implements AppearanceModel, org.gephi.project.spi.Model
- Author:
- mbastian
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gephi.appearance.api.AppearanceModel
AppearanceModel.GraphFunction
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AppearanceModelImpl(org.gephi.project.api.Workspace workspace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcleanAttributeRankingsAndPartitions(org.gephi.graph.api.Table table)private AppearanceModel.GraphFunctionconvertColumnToGraphFunction(org.gephi.graph.api.Column column)protected intcountNodeAttributeRanking()private List<AttributeFunctionImpl>getAttributeFunctions(org.gephi.graph.api.Column column, Transformer transformer)private List<AttributeFunctionImpl>getAttributeFunctions(org.gephi.graph.api.Table table)private List<GraphFunctionImpl>getDegreeFunctions(Transformer transformer)protected RankingImplgetDegreeRanking()FunctiongetEdgeFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)Returns the edge function for the given column and transformer.Function[]getEdgeFunctions()Returns all edge functions for the given graph.PartitiongetEdgePartition(org.gephi.graph.api.Column column)Returns the edge partition for this column.protected PartitionImpl[]getEdgePartitions()protected RankinggetEdgeRanking(org.gephi.graph.api.Column column)protected RankingImpl[]getEdgeRankings()private List<FunctionImpl>getEdgeSimpleFunctions()protected PartitiongetEdgeTypePartition()protected RankinggetEdgeWeightRanking()private FunctiongetFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)org.gephi.graph.api.GraphModelgetGraphModel()Returns the graph model this model is associated with.private StringgetId(String prefix, Transformer transformer, String suffix)private StringgetId(String prefix, Transformer transformer, org.gephi.graph.api.Column column)protected RankinggetInDegreeRanking()FunctiongetNodeFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)Returns the node function for the given column and transformer.Function[]getNodeFunctions()Returns all node functions for the given graph.PartitiongetNodePartition(org.gephi.graph.api.Column column)Returns the node partition for thid column.protected PartitionImpl[]getNodePartitions()protected RankingImplgetNodeRanking(org.gephi.graph.api.Column column)private List<GraphFunctionImpl>getNodeRankingFunctions()protected RankingImpl[]getNodeRankings()private List<FunctionImpl>getNodeSimpleFunctions()protected RankinggetOutDegreeRanking()protected org.gephi.graph.api.GraphgetPartitionGraph()private List<GraphFunctionImpl>getRankingAndPartitionEdgeFunctions()protected org.gephi.graph.api.GraphgetRankingGraph()private List<AttributeFunctionImpl>getTimesetFunctions(org.gephi.graph.api.Column column, Transformer transformer)protected TransformerUIgetTransformerUI(Transformer transformer)org.gephi.project.api.WorkspacegetWorkspace()Return the workspace this model is associated withprivate AttributePartitionImplinitAttributePartition(org.gephi.graph.api.Column column)private voidinitAttributeRankingsAndPartitions()private List<Transformer>initEdgeTransformers()private List<Transformer>initNodeTransformers()private Map<Class,TransformerUI>initTransformerUIs()booleanisPartitionLocalScale()Returnstrueif partitions are using the currently visible graph as a source.booleanisRankingLocalScale()Returnstrueif rankings are using the currently visible graph as a scale.booleanisTransformNullValues()Returnstrueif null values are considered in functions.voidsetPartitionLocalScale(boolean localScale)voidsetRankingLocalScale(boolean localScale)voidsetTransformNullValues(boolean transformNullValues)
-
-
-
Field Detail
-
workspace
private final org.gephi.project.api.Workspace workspace
-
graphModel
private final org.gephi.graph.api.GraphModel graphModel
-
nodeTransformers
private final List<Transformer> nodeTransformers
-
edgeTransformers
private final List<Transformer> edgeTransformers
-
transformerUIs
private final Map<Class,TransformerUI> transformerUIs
-
degreeRanking
private final DegreeRankingImpl degreeRanking
-
inDegreeRanking
private final InDegreeRankingImpl inDegreeRanking
-
outDegreeRanking
private final OutDegreeRankingImpl outDegreeRanking
-
edgeWeightRanking
private final EdgeWeightRankingImpl edgeWeightRanking
-
edgeTypePartition
private final EdgeTypePartitionImpl edgeTypePartition
-
nodeAttributeRankings
private final Map<org.gephi.graph.api.Column,AttributeRankingImpl> nodeAttributeRankings
-
edgeAttributeRankings
private final Map<org.gephi.graph.api.Column,AttributeRankingImpl> edgeAttributeRankings
-
nodeAttributePartitions
private final Map<org.gephi.graph.api.Column,AttributePartitionImpl> nodeAttributePartitions
-
edgeAttributePartitions
private final Map<org.gephi.graph.api.Column,AttributePartitionImpl> edgeAttributePartitions
-
nodeStaticFunctions
private final List<FunctionImpl> nodeStaticFunctions
-
edgeStaticFunctions
private final List<FunctionImpl> edgeStaticFunctions
-
rankingLocalScale
private boolean rankingLocalScale
-
partitionLocalScale
private boolean partitionLocalScale
-
transformNullValues
private boolean transformNullValues
-
-
Method Detail
-
getRankingGraph
protected org.gephi.graph.api.Graph getRankingGraph()
-
getPartitionGraph
protected org.gephi.graph.api.Graph getPartitionGraph()
-
getNodeFunctions
public Function[] getNodeFunctions()
Description copied from interface:AppearanceModelReturns all node functions for the given graph.- Specified by:
getNodeFunctionsin interfaceAppearanceModel- Returns:
- all node functions
-
getEdgeFunctions
public Function[] getEdgeFunctions()
Description copied from interface:AppearanceModelReturns all edge functions for the given graph.- Specified by:
getEdgeFunctionsin interfaceAppearanceModel- Returns:
- all edge functions
-
getNodeFunction
public Function getNodeFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)
Description copied from interface:AppearanceModelReturns the node function for the given column and transformer.- Specified by:
getNodeFunctionin interfaceAppearanceModel- Parameters:
column- columntransformer- transformer- Returns:
- node function or null if not found
-
getEdgeFunction
public Function getEdgeFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)
Description copied from interface:AppearanceModelReturns the edge function for the given column and transformer.- Specified by:
getEdgeFunctionin interfaceAppearanceModel- Parameters:
column- columntransformer- transformer- Returns:
- edge function or null if not found
-
getFunction
private Function getFunction(org.gephi.graph.api.Column column, Class<? extends Transformer> transformer)
-
getNodePartition
public Partition getNodePartition(org.gephi.graph.api.Column column)
Description copied from interface:AppearanceModelReturns the node partition for thid column.- Specified by:
getNodePartitionin interfaceAppearanceModel- Parameters:
column- column- Returns:
- node partition of null if it doesn't exist
-
getEdgePartition
public Partition getEdgePartition(org.gephi.graph.api.Column column)
Description copied from interface:AppearanceModelReturns the edge partition for this column.- Specified by:
getEdgePartitionin interfaceAppearanceModel- Parameters:
column- column- Returns:
- edge partition of null if it doesn't exist
-
getNodeRankings
protected RankingImpl[] getNodeRankings()
-
getEdgeRankings
protected RankingImpl[] getEdgeRankings()
-
getNodePartitions
protected PartitionImpl[] getNodePartitions()
-
getEdgePartitions
protected PartitionImpl[] getEdgePartitions()
-
getDegreeRanking
protected RankingImpl getDegreeRanking()
-
getInDegreeRanking
protected Ranking getInDegreeRanking()
-
getOutDegreeRanking
protected Ranking getOutDegreeRanking()
-
getEdgeWeightRanking
protected Ranking getEdgeWeightRanking()
-
getEdgeTypePartition
protected Partition getEdgeTypePartition()
-
getNodeRanking
protected RankingImpl getNodeRanking(org.gephi.graph.api.Column column)
-
getEdgeRanking
protected Ranking getEdgeRanking(org.gephi.graph.api.Column column)
-
countNodeAttributeRanking
protected int countNodeAttributeRanking()
-
getWorkspace
public org.gephi.project.api.Workspace getWorkspace()
Description copied from interface:AppearanceModelReturn the workspace this model is associated with- Specified by:
getWorkspacein interfaceAppearanceModel- Specified by:
getWorkspacein interfaceorg.gephi.project.spi.Model- Returns:
- the workspace of this model
-
isRankingLocalScale
public boolean isRankingLocalScale()
Description copied from interface:AppearanceModelReturnstrueif rankings are using the currently visible graph as a scale. Iffalsethe complete graph is used to determine minimum and maximum values.- Specified by:
isRankingLocalScalein interfaceAppearanceModel- Returns:
trueif using a local scale,falseif global scale
-
setRankingLocalScale
public void setRankingLocalScale(boolean localScale)
-
isPartitionLocalScale
public boolean isPartitionLocalScale()
Description copied from interface:AppearanceModelReturnstrueif partitions are using the currently visible graph as a source. Iffalsethe complete graph is used to determine partitions.- Specified by:
isPartitionLocalScalein interfaceAppearanceModel- Returns:
trueif using a local scale,falseif global scale
-
setPartitionLocalScale
public void setPartitionLocalScale(boolean localScale)
-
isTransformNullValues
public boolean isTransformNullValues()
Description copied from interface:AppearanceModelReturnstrueif null values are considered in functions. Iffalseelements with null values will be transformed as well. Default value isfalse.When using a ranking function, null values will receive the lowest normalised value.
- Specified by:
isTransformNullValuesin interfaceAppearanceModel- Returns:
trueif null values are transformed,falseotherwise
-
setTransformNullValues
public void setTransformNullValues(boolean transformNullValues)
-
getNodeRankingFunctions
private List<GraphFunctionImpl> getNodeRankingFunctions()
-
cleanAttributeRankingsAndPartitions
private void cleanAttributeRankingsAndPartitions(org.gephi.graph.api.Table table)
-
getAttributeFunctions
private List<AttributeFunctionImpl> getAttributeFunctions(org.gephi.graph.api.Table table)
-
getTimesetFunctions
private List<AttributeFunctionImpl> getTimesetFunctions(org.gephi.graph.api.Column column, Transformer transformer)
-
getAttributeFunctions
private List<AttributeFunctionImpl> getAttributeFunctions(org.gephi.graph.api.Column column, Transformer transformer)
-
initAttributeRankingsAndPartitions
private void initAttributeRankingsAndPartitions()
-
initAttributePartition
private AttributePartitionImpl initAttributePartition(org.gephi.graph.api.Column column)
-
getNodeSimpleFunctions
private List<FunctionImpl> getNodeSimpleFunctions()
-
getEdgeSimpleFunctions
private List<FunctionImpl> getEdgeSimpleFunctions()
-
getDegreeFunctions
private List<GraphFunctionImpl> getDegreeFunctions(Transformer transformer)
-
getRankingAndPartitionEdgeFunctions
private List<GraphFunctionImpl> getRankingAndPartitionEdgeFunctions()
-
getTransformerUI
protected TransformerUI getTransformerUI(Transformer transformer)
-
getGraphModel
public org.gephi.graph.api.GraphModel getGraphModel()
Description copied from interface:AppearanceModelReturns the graph model this model is associated with.- Specified by:
getGraphModelin interfaceAppearanceModel- Returns:
- the graph model
-
initTransformerUIs
private Map<Class,TransformerUI> initTransformerUIs()
-
initNodeTransformers
private List<Transformer> initNodeTransformers()
-
initEdgeTransformers
private List<Transformer> initEdgeTransformers()
-
convertColumnToGraphFunction
private AppearanceModel.GraphFunction convertColumnToGraphFunction(org.gephi.graph.api.Column column)
-
getId
private String getId(String prefix, Transformer transformer, org.gephi.graph.api.Column column)
-
getId
private String getId(String prefix, Transformer transformer, String suffix)
-
-