Class AppearanceModelImpl

  • All Implemented Interfaces:
    AppearanceModel, org.gephi.project.spi.Model

    public class AppearanceModelImpl
    extends Object
    implements AppearanceModel, org.gephi.project.spi.Model
    Author:
    mbastian
    • Field Detail

      • workspace

        private final org.gephi.project.api.Workspace workspace
      • graphModel

        private final org.gephi.graph.api.GraphModel graphModel
      • nodeAttributeRankings

        private final Map<org.gephi.graph.api.Column,​AttributeRankingImpl> nodeAttributeRankings
      • edgeAttributeRankings

        private final Map<org.gephi.graph.api.Column,​AttributeRankingImpl> edgeAttributeRankings
      • rankingLocalScale

        private boolean rankingLocalScale
      • partitionLocalScale

        private boolean partitionLocalScale
      • transformNullValues

        private boolean transformNullValues
    • Constructor Detail

      • AppearanceModelImpl

        public AppearanceModelImpl​(org.gephi.project.api.Workspace workspace)
    • Method Detail

      • getRankingGraph

        protected org.gephi.graph.api.Graph getRankingGraph()
      • getPartitionGraph

        protected org.gephi.graph.api.Graph getPartitionGraph()
      • getNodeFunction

        public Function getNodeFunction​(org.gephi.graph.api.Column column,
                                        Class<? extends Transformer> transformer)
        Description copied from interface: AppearanceModel
        Returns the node function for the given column and transformer.
        Specified by:
        getNodeFunction in interface AppearanceModel
        Parameters:
        column - column
        transformer - 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: AppearanceModel
        Returns the edge function for the given column and transformer.
        Specified by:
        getEdgeFunction in interface AppearanceModel
        Parameters:
        column - column
        transformer - 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: AppearanceModel
        Returns the node partition for thid column.
        Specified by:
        getNodePartition in interface AppearanceModel
        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: AppearanceModel
        Returns the edge partition for this column.
        Specified by:
        getEdgePartition in interface AppearanceModel
        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: AppearanceModel
        Return the workspace this model is associated with
        Specified by:
        getWorkspace in interface AppearanceModel
        Specified by:
        getWorkspace in interface org.gephi.project.spi.Model
        Returns:
        the workspace of this model
      • isRankingLocalScale

        public boolean isRankingLocalScale()
        Description copied from interface: AppearanceModel
        Returns true if rankings are using the currently visible graph as a scale. If false the complete graph is used to determine minimum and maximum values.
        Specified by:
        isRankingLocalScale in interface AppearanceModel
        Returns:
        true if using a local scale, false if global scale
      • setRankingLocalScale

        public void setRankingLocalScale​(boolean localScale)
      • isPartitionLocalScale

        public boolean isPartitionLocalScale()
        Description copied from interface: AppearanceModel
        Returns true if partitions are using the currently visible graph as a source. If false the complete graph is used to determine partitions.
        Specified by:
        isPartitionLocalScale in interface AppearanceModel
        Returns:
        true if using a local scale, false if global scale
      • setPartitionLocalScale

        public void setPartitionLocalScale​(boolean localScale)
      • isTransformNullValues

        public boolean isTransformNullValues()
        Description copied from interface: AppearanceModel
        Returns true if null values are considered in functions. If false elements with null values will be transformed as well. Default value is false.

        When using a ranking function, null values will receive the lowest normalised value.

        Specified by:
        isTransformNullValues in interface AppearanceModel
        Returns:
        true if null values are transformed, false otherwise
      • setTransformNullValues

        public void setTransformNullValues​(boolean transformNullValues)
      • cleanAttributeRankingsAndPartitions

        private void cleanAttributeRankingsAndPartitions​(org.gephi.graph.api.Table table)
      • initAttributeRankingsAndPartitions

        private void initAttributeRankingsAndPartitions()
      • initAttributePartition

        private AttributePartitionImpl initAttributePartition​(org.gephi.graph.api.Column column)
      • getRankingAndPartitionEdgeFunctions

        private List<GraphFunctionImpl> getRankingAndPartitionEdgeFunctions()
      • getGraphModel

        public org.gephi.graph.api.GraphModel getGraphModel()
        Description copied from interface: AppearanceModel
        Returns the graph model this model is associated with.
        Specified by:
        getGraphModel in interface AppearanceModel
        Returns:
        the graph model