Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Christnowx
Gephi
提交
2b137a91
G
Gephi
项目概览
Christnowx
/
Gephi
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gephi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b137a91
编写于
12月 02, 2015
作者:
M
Mathieu Bastian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Host appearance interpolator in function rather than in ranking
上级
12e3edd4
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
78 addition
and
65 deletion
+78
-65
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AppearanceModelImpl.java
...c/main/java/org/gephi/appearance/AppearanceModelImpl.java
+10
-10
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AttributeFunctionImpl.java
...main/java/org/gephi/appearance/AttributeFunctionImpl.java
+14
-3
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AttributeRankingImpl.java
.../main/java/org/gephi/appearance/AttributeRankingImpl.java
+2
-2
modules/AppearanceAPI/src/main/java/org/gephi/appearance/DegreeRankingImpl.java
...src/main/java/org/gephi/appearance/DegreeRankingImpl.java
+2
-3
modules/AppearanceAPI/src/main/java/org/gephi/appearance/EdgeTypePartitionImpl.java
...main/java/org/gephi/appearance/EdgeTypePartitionImpl.java
+4
-2
modules/AppearanceAPI/src/main/java/org/gephi/appearance/EdgeWeightRankingImpl.java
...main/java/org/gephi/appearance/EdgeWeightRankingImpl.java
+2
-3
modules/AppearanceAPI/src/main/java/org/gephi/appearance/FunctionImpl.java
...eAPI/src/main/java/org/gephi/appearance/FunctionImpl.java
+5
-2
modules/AppearanceAPI/src/main/java/org/gephi/appearance/GraphFunctionImpl.java
...src/main/java/org/gephi/appearance/GraphFunctionImpl.java
+14
-5
modules/AppearanceAPI/src/main/java/org/gephi/appearance/InDegreeRankingImpl.java
...c/main/java/org/gephi/appearance/InDegreeRankingImpl.java
+2
-3
modules/AppearanceAPI/src/main/java/org/gephi/appearance/OutDegreeRankingImpl.java
.../main/java/org/gephi/appearance/OutDegreeRankingImpl.java
+2
-3
modules/AppearanceAPI/src/main/java/org/gephi/appearance/RankingImpl.java
...ceAPI/src/main/java/org/gephi/appearance/RankingImpl.java
+2
-14
modules/AppearanceAPI/src/main/java/org/gephi/appearance/SimpleFunctionImpl.java
...rc/main/java/org/gephi/appearance/SimpleFunctionImpl.java
+1
-1
modules/AppearanceAPI/src/main/java/org/gephi/appearance/api/Ranking.java
...ceAPI/src/main/java/org/gephi/appearance/api/Ranking.java
+1
-5
modules/AppearanceAPI/src/main/java/org/gephi/appearance/api/RankingFunction.java
...c/main/java/org/gephi/appearance/api/RankingFunction.java
+4
-0
modules/AppearanceAPI/src/main/java/org/gephi/appearance/spi/RankingTransformer.java
...ain/java/org/gephi/appearance/spi/RankingTransformer.java
+2
-1
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingElementColorTransformer.java
...phi/appearance/plugin/RankingElementColorTransformer.java
+3
-2
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingLabelColorTransformer.java
...gephi/appearance/plugin/RankingLabelColorTransformer.java
+3
-2
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingNodeSizeTransformer.java
...g/gephi/appearance/plugin/RankingNodeSizeTransformer.java
+3
-2
modules/DesktopAppearance/src/main/java/org/gephi/desktop/appearance/AppearanceTopComponent.java
.../org/gephi/desktop/appearance/AppearanceTopComponent.java
+2
-2
未找到文件。
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AppearanceModelImpl.java
浏览文件 @
2b137a91
...
@@ -188,13 +188,13 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -188,13 +188,13 @@ public class AppearanceModelImpl implements AppearanceModel {
@Override
@Override
public
void
refreshGraphFunctions
()
{
public
void
refreshGraphFunctions
()
{
if
(!
rankings
.
containsKey
(
getId
(
"degree"
)))
{
if
(!
rankings
.
containsKey
(
getId
(
"degree"
)))
{
rankings
.
put
(
getId
(
"degree"
),
new
DegreeRankingImpl
(
graph
,
defaultInterpolator
));
rankings
.
put
(
getId
(
"degree"
),
new
DegreeRankingImpl
(
graph
));
}
}
if
(
graph
.
isDirected
())
{
if
(
graph
.
isDirected
())
{
if
(!
rankings
.
containsKey
(
getId
(
"indegree"
)))
{
if
(!
rankings
.
containsKey
(
getId
(
"indegree"
)))
{
DirectedGraph
directedGraph
=
(
DirectedGraph
)
graph
;
DirectedGraph
directedGraph
=
(
DirectedGraph
)
graph
;
rankings
.
put
(
getId
(
"indegree"
),
new
InDegreeRankingImpl
(
directedGraph
,
defaultInterpolator
));
rankings
.
put
(
getId
(
"indegree"
),
new
InDegreeRankingImpl
(
directedGraph
));
rankings
.
put
(
getId
(
"outdegree"
),
new
OutDegreeRankingImpl
(
directedGraph
,
defaultInterpolator
));
rankings
.
put
(
getId
(
"outdegree"
),
new
OutDegreeRankingImpl
(
directedGraph
));
}
}
}
else
{
}
else
{
rankings
.
remove
(
getId
(
"indegree"
));
rankings
.
remove
(
getId
(
"indegree"
));
...
@@ -207,7 +207,7 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -207,7 +207,7 @@ public class AppearanceModelImpl implements AppearanceModel {
RankingImpl
degreeRanking
=
rankings
.
get
(
getId
(
"degree"
));
RankingImpl
degreeRanking
=
rankings
.
get
(
getId
(
"degree"
));
if
(!
graphFunctions
.
containsKey
(
degreeId
))
{
if
(!
graphFunctions
.
containsKey
(
degreeId
))
{
String
name
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.Degree.name"
);
String
name
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.Degree.name"
);
graphFunctions
.
put
(
degreeId
,
new
GraphFunctionImpl
(
degreeId
,
name
,
graph
,
t
,
getTransformerUI
(
t
),
degreeRanking
));
graphFunctions
.
put
(
degreeId
,
new
GraphFunctionImpl
(
degreeId
,
name
,
graph
,
t
,
getTransformerUI
(
t
),
degreeRanking
,
defaultInterpolator
));
}
}
degreeRanking
.
refresh
();
degreeRanking
.
refresh
();
...
@@ -220,8 +220,8 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -220,8 +220,8 @@ public class AppearanceModelImpl implements AppearanceModel {
if
(!
graphFunctions
.
containsKey
(
indegreeId
))
{
if
(!
graphFunctions
.
containsKey
(
indegreeId
))
{
String
inDegreeName
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.InDegree.name"
);
String
inDegreeName
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.InDegree.name"
);
String
outDegreeName
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.OutDegree.name"
);
String
outDegreeName
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"NodeGraphFunction.OutDegree.name"
);
graphFunctions
.
put
(
indegreeId
,
new
GraphFunctionImpl
(
indegreeId
,
inDegreeName
,
graph
,
t
,
getTransformerUI
(
t
),
indegreeRanking
));
graphFunctions
.
put
(
indegreeId
,
new
GraphFunctionImpl
(
indegreeId
,
inDegreeName
,
graph
,
t
,
getTransformerUI
(
t
),
indegreeRanking
,
defaultInterpolator
));
graphFunctions
.
put
(
outdegreeId
,
new
GraphFunctionImpl
(
outdegreeId
,
outDegreeName
,
graph
,
t
,
getTransformerUI
(
t
),
outdegreeRanking
));
graphFunctions
.
put
(
outdegreeId
,
new
GraphFunctionImpl
(
outdegreeId
,
outDegreeName
,
graph
,
t
,
getTransformerUI
(
t
),
outdegreeRanking
,
defaultInterpolator
));
}
}
indegreeRanking
.
refresh
();
indegreeRanking
.
refresh
();
outdegreeRanking
.
refresh
();
outdegreeRanking
.
refresh
();
...
@@ -267,7 +267,7 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -267,7 +267,7 @@ public class AppearanceModelImpl implements AppearanceModel {
@Override
@Override
public
void
refreshGraphFunctions
()
{
public
void
refreshGraphFunctions
()
{
if
(!
rankings
.
containsKey
(
getId
(
"weight"
)))
{
if
(!
rankings
.
containsKey
(
getId
(
"weight"
)))
{
rankings
.
put
(
getId
(
"weight"
),
new
EdgeWeightRankingImpl
(
graph
,
defaultInterpolator
));
rankings
.
put
(
getId
(
"weight"
),
new
EdgeWeightRankingImpl
(
graph
));
}
}
if
(
graph
.
getModel
().
isMultiGraph
())
{
if
(
graph
.
getModel
().
isMultiGraph
())
{
if
(!
partitions
.
containsKey
(
getId
(
"type"
)))
{
if
(!
partitions
.
containsKey
(
getId
(
"type"
)))
{
...
@@ -283,7 +283,7 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -283,7 +283,7 @@ public class AppearanceModelImpl implements AppearanceModel {
RankingImpl
ranking
=
rankings
.
get
(
getId
(
"weight"
));
RankingImpl
ranking
=
rankings
.
get
(
getId
(
"weight"
));
if
(!
graphFunctions
.
containsKey
(
weightId
))
{
if
(!
graphFunctions
.
containsKey
(
weightId
))
{
String
name
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"EdgeGraphFunction.Weight.name"
);
String
name
=
NbBundle
.
getMessage
(
AppearanceModelImpl
.
class
,
"EdgeGraphFunction.Weight.name"
);
graphFunctions
.
put
(
weightId
,
new
GraphFunctionImpl
(
weightId
,
name
,
graph
,
t
,
getTransformerUI
(
t
),
ranking
));
graphFunctions
.
put
(
weightId
,
new
GraphFunctionImpl
(
weightId
,
name
,
graph
,
t
,
getTransformerUI
(
t
),
ranking
,
defaultInterpolator
));
}
}
ranking
.
refresh
();
ranking
.
refresh
();
}
}
...
@@ -423,7 +423,7 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -423,7 +423,7 @@ public class AppearanceModelImpl implements AppearanceModel {
partition
=
new
AttributePartitionImpl
(
column
,
getIndex
(
false
));
partition
=
new
AttributePartitionImpl
(
column
,
getIndex
(
false
));
partitions
.
put
(
getId
(
column
),
partition
);
partitions
.
put
(
getId
(
column
),
partition
);
}
else
{
}
else
{
ranking
=
new
AttributeRankingImpl
(
column
,
getIndex
(
localScale
)
,
defaultInterpolator
);
ranking
=
new
AttributeRankingImpl
(
column
,
getIndex
(
localScale
));
rankings
.
put
(
getId
(
column
),
ranking
);
rankings
.
put
(
getId
(
column
),
ranking
);
}
}
}
}
...
@@ -442,7 +442,7 @@ public class AppearanceModelImpl implements AppearanceModel {
...
@@ -442,7 +442,7 @@ public class AppearanceModelImpl implements AppearanceModel {
if
(
ranking
!=
null
)
{
if
(
ranking
!=
null
)
{
String
id
=
getId
(
t
,
col
);
String
id
=
getId
(
t
,
col
);
if
(!
attributeFunctions
.
containsKey
(
id
))
{
if
(!
attributeFunctions
.
containsKey
(
id
))
{
attributeFunctions
.
put
(
id
,
new
AttributeFunctionImpl
(
id
,
graph
,
col
,
t
,
getTransformerUI
(
t
),
ranking
));
attributeFunctions
.
put
(
id
,
new
AttributeFunctionImpl
(
id
,
graph
,
col
,
t
,
getTransformerUI
(
t
),
ranking
,
defaultInterpolator
));
}
}
}
}
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AttributeFunctionImpl.java
浏览文件 @
2b137a91
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.AttributeFunction
;
import
org.gephi.appearance.api.AttributeFunction
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.api.Partition
;
import
org.gephi.appearance.api.Partition
;
import
org.gephi.appearance.api.PartitionFunction
;
import
org.gephi.appearance.api.PartitionFunction
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.Ranking
;
...
@@ -21,12 +22,22 @@ import org.gephi.graph.api.Graph;
...
@@ -21,12 +22,22 @@ import org.gephi.graph.api.Graph;
*/
*/
public
class
AttributeFunctionImpl
extends
FunctionImpl
implements
RankingFunction
,
PartitionFunction
,
AttributeFunction
{
public
class
AttributeFunctionImpl
extends
FunctionImpl
implements
RankingFunction
,
PartitionFunction
,
AttributeFunction
{
public
AttributeFunctionImpl
(
String
id
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
RankingImpl
ranking
)
{
public
AttributeFunctionImpl
(
String
id
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
RankingImpl
ranking
,
Interpolator
interpolator
)
{
super
(
id
,
null
,
graph
,
column
,
transformer
,
transformerUI
,
null
,
ranking
);
super
(
id
,
null
,
graph
,
column
,
transformer
,
transformerUI
,
null
,
ranking
,
interpolator
);
}
}
public
AttributeFunctionImpl
(
String
id
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
)
{
public
AttributeFunctionImpl
(
String
id
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
)
{
super
(
id
,
null
,
graph
,
column
,
transformer
,
transformerUI
,
partition
,
null
);
super
(
id
,
null
,
graph
,
column
,
transformer
,
transformerUI
,
partition
,
null
,
null
);
}
@Override
public
Interpolator
getInterpolator
()
{
return
interpolator
;
}
@Override
public
void
setInterpolator
(
Interpolator
interpolator
)
{
this
.
interpolator
=
interpolator
;
}
}
@Override
@Override
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/AttributeRankingImpl.java
浏览文件 @
2b137a91
...
@@ -19,8 +19,8 @@ public class AttributeRankingImpl extends RankingImpl {
...
@@ -19,8 +19,8 @@ public class AttributeRankingImpl extends RankingImpl {
protected
final
Index
index
;
protected
final
Index
index
;
protected
final
Column
column
;
protected
final
Column
column
;
public
AttributeRankingImpl
(
Column
column
,
Index
index
,
Interpolator
interpolator
)
{
public
AttributeRankingImpl
(
Column
column
,
Index
index
)
{
super
(
interpolator
);
super
();
this
.
column
=
column
;
this
.
column
=
column
;
this
.
index
=
index
;
this
.
index
=
index
;
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/DegreeRankingImpl.java
浏览文件 @
2b137a91
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
*/
*/
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Graph
;
import
org.gephi.graph.api.Graph
;
import
org.gephi.graph.api.Node
;
import
org.gephi.graph.api.Node
;
...
@@ -54,8 +53,8 @@ public class DegreeRankingImpl extends RankingImpl {
...
@@ -54,8 +53,8 @@ public class DegreeRankingImpl extends RankingImpl {
private
final
Graph
graph
;
private
final
Graph
graph
;
public
DegreeRankingImpl
(
Graph
graph
,
Interpolator
interpolator
)
{
public
DegreeRankingImpl
(
Graph
graph
)
{
super
(
interpolator
);
super
();
this
.
graph
=
graph
;
this
.
graph
=
graph
;
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/EdgeTypePartitionImpl.java
浏览文件 @
2b137a91
...
@@ -65,7 +65,8 @@ public class EdgeTypePartitionImpl extends PartitionImpl {
...
@@ -65,7 +65,8 @@ public class EdgeTypePartitionImpl extends PartitionImpl {
@Override
@Override
public
Iterable
getValues
()
{
public
Iterable
getValues
()
{
return
Arrays
.
asList
(
model
.
getEdgeTypeLabels
());
// return Arrays.asList(model.getEdgeTypeLabels());
return
null
;
}
}
@Override
@Override
...
@@ -91,7 +92,8 @@ public class EdgeTypePartitionImpl extends PartitionImpl {
...
@@ -91,7 +92,8 @@ public class EdgeTypePartitionImpl extends PartitionImpl {
@Override
@Override
public
int
size
()
{
public
int
size
()
{
return
model
.
getEdgeTypeCount
();
// return model.getEdgeTypeCount();
return
0
;
}
}
@Override
@Override
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/EdgeWeightRankingImpl.java
浏览文件 @
2b137a91
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
*/
*/
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.graph.api.Edge
;
import
org.gephi.graph.api.Edge
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Graph
;
import
org.gephi.graph.api.Graph
;
...
@@ -54,8 +53,8 @@ public class EdgeWeightRankingImpl extends RankingImpl {
...
@@ -54,8 +53,8 @@ public class EdgeWeightRankingImpl extends RankingImpl {
private
final
Graph
graph
;
private
final
Graph
graph
;
public
EdgeWeightRankingImpl
(
Graph
graph
,
Interpolator
interpolator
)
{
public
EdgeWeightRankingImpl
(
Graph
graph
)
{
super
(
interpolator
);
super
();
this
.
graph
=
graph
;
this
.
graph
=
graph
;
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/FunctionImpl.java
浏览文件 @
2b137a91
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.Function
;
import
org.gephi.appearance.api.Function
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.spi.PartitionTransformer
;
import
org.gephi.appearance.spi.PartitionTransformer
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.SimpleTransformer
;
import
org.gephi.appearance.spi.SimpleTransformer
;
...
@@ -65,8 +66,9 @@ public abstract class FunctionImpl implements Function {
...
@@ -65,8 +66,9 @@ public abstract class FunctionImpl implements Function {
protected
final
TransformerUI
transformerUI
;
protected
final
TransformerUI
transformerUI
;
protected
final
PartitionImpl
partition
;
protected
final
PartitionImpl
partition
;
protected
final
RankingImpl
ranking
;
protected
final
RankingImpl
ranking
;
protected
Interpolator
interpolator
;
protected
FunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
,
RankingImpl
ranking
)
{
protected
FunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Column
column
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
,
RankingImpl
ranking
,
Interpolator
interpolator
)
{
if
(
id
==
null
)
{
if
(
id
==
null
)
{
throw
new
NullPointerException
(
"The id can't be null"
);
throw
new
NullPointerException
(
"The id can't be null"
);
}
}
...
@@ -74,6 +76,7 @@ public abstract class FunctionImpl implements Function {
...
@@ -74,6 +76,7 @@ public abstract class FunctionImpl implements Function {
this
.
name
=
name
;
this
.
name
=
name
;
this
.
column
=
column
;
this
.
column
=
column
;
this
.
graph
=
graph
;
this
.
graph
=
graph
;
this
.
interpolator
=
interpolator
;
try
{
try
{
this
.
transformer
=
transformer
.
getClass
().
newInstance
();
this
.
transformer
=
transformer
.
getClass
().
newInstance
();
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
...
@@ -90,7 +93,7 @@ public abstract class FunctionImpl implements Function {
...
@@ -90,7 +93,7 @@ public abstract class FunctionImpl implements Function {
((
SimpleTransformer
)
transformer
).
transform
(
element
);
((
SimpleTransformer
)
transformer
).
transform
(
element
);
}
else
if
(
isRanking
())
{
}
else
if
(
isRanking
())
{
Number
val
=
ranking
.
getValue
(
element
);
Number
val
=
ranking
.
getValue
(
element
);
((
RankingTransformer
)
transformer
).
transform
(
element
,
ranking
,
val
);
((
RankingTransformer
)
transformer
).
transform
(
element
,
ranking
,
interpolator
,
val
);
}
else
if
(
isPartition
())
{
}
else
if
(
isPartition
())
{
Object
val
=
partition
.
getValue
(
element
);
Object
val
=
partition
.
getValue
(
element
);
((
PartitionTransformer
)
transformer
).
transform
(
element
,
partition
,
val
);
((
PartitionTransformer
)
transformer
).
transform
(
element
,
partition
,
val
);
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/GraphFunctionImpl.java
浏览文件 @
2b137a91
...
@@ -6,9 +6,8 @@
...
@@ -6,9 +6,8 @@
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.GraphFunction
;
import
org.gephi.appearance.api.GraphFunction
;
import
org.gephi.appearance.api.
Partition
;
import
org.gephi.appearance.api.
Interpolator
;
import
org.gephi.appearance.api.PartitionFunction
;
import
org.gephi.appearance.api.PartitionFunction
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.RankingFunction
;
import
org.gephi.appearance.api.RankingFunction
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.appearance.spi.TransformerUI
;
import
org.gephi.appearance.spi.TransformerUI
;
...
@@ -20,12 +19,22 @@ import org.gephi.graph.api.Graph;
...
@@ -20,12 +19,22 @@ import org.gephi.graph.api.Graph;
*/
*/
public
class
GraphFunctionImpl
extends
FunctionImpl
implements
GraphFunction
,
RankingFunction
,
PartitionFunction
{
public
class
GraphFunctionImpl
extends
FunctionImpl
implements
GraphFunction
,
RankingFunction
,
PartitionFunction
{
public
GraphFunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
,
RankingImpl
ranking
)
{
public
GraphFunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
,
RankingImpl
ranking
,
Interpolator
interpolator
)
{
super
(
id
,
name
,
graph
,
null
,
transformer
,
transformerUI
,
null
,
ranking
);
super
(
id
,
name
,
graph
,
null
,
transformer
,
transformerUI
,
null
,
ranking
,
interpolator
);
}
}
public
GraphFunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
)
{
public
GraphFunctionImpl
(
String
id
,
String
name
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
,
PartitionImpl
partition
)
{
super
(
id
,
name
,
graph
,
null
,
transformer
,
transformerUI
,
partition
,
null
);
super
(
id
,
name
,
graph
,
null
,
transformer
,
transformerUI
,
partition
,
null
,
null
);
}
@Override
public
Interpolator
getInterpolator
()
{
return
interpolator
;
}
@Override
public
void
setInterpolator
(
Interpolator
interpolator
)
{
this
.
interpolator
=
interpolator
;
}
}
@Override
@Override
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/InDegreeRankingImpl.java
浏览文件 @
2b137a91
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
*/
*/
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.graph.api.DirectedGraph
;
import
org.gephi.graph.api.DirectedGraph
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Node
;
import
org.gephi.graph.api.Node
;
...
@@ -54,8 +53,8 @@ public class InDegreeRankingImpl extends RankingImpl {
...
@@ -54,8 +53,8 @@ public class InDegreeRankingImpl extends RankingImpl {
private
final
DirectedGraph
graph
;
private
final
DirectedGraph
graph
;
public
InDegreeRankingImpl
(
DirectedGraph
graph
,
Interpolator
interpolator
)
{
public
InDegreeRankingImpl
(
DirectedGraph
graph
)
{
super
(
interpolator
);
super
();
this
.
graph
=
graph
;
this
.
graph
=
graph
;
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/OutDegreeRankingImpl.java
浏览文件 @
2b137a91
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
*/
*/
package
org.gephi.appearance
;
package
org.gephi.appearance
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.graph.api.DirectedGraph
;
import
org.gephi.graph.api.DirectedGraph
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Node
;
import
org.gephi.graph.api.Node
;
...
@@ -54,8 +53,8 @@ public class OutDegreeRankingImpl extends RankingImpl {
...
@@ -54,8 +53,8 @@ public class OutDegreeRankingImpl extends RankingImpl {
private
final
DirectedGraph
graph
;
private
final
DirectedGraph
graph
;
public
OutDegreeRankingImpl
(
DirectedGraph
graph
,
Interpolator
interpolator
)
{
public
OutDegreeRankingImpl
(
DirectedGraph
graph
)
{
super
(
interpolator
);
super
();
this
.
graph
=
graph
;
this
.
graph
=
graph
;
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/RankingImpl.java
浏览文件 @
2b137a91
...
@@ -50,12 +50,10 @@ import org.gephi.appearance.api.Ranking;
...
@@ -50,12 +50,10 @@ import org.gephi.appearance.api.Ranking;
*/
*/
public
abstract
class
RankingImpl
implements
Ranking
{
public
abstract
class
RankingImpl
implements
Ranking
{
protected
Interpolator
interpolator
;
protected
Number
min
;
protected
Number
min
;
protected
Number
max
;
protected
Number
max
;
protected
RankingImpl
(
Interpolator
interpolator
)
{
protected
RankingImpl
()
{
this
.
interpolator
=
interpolator
;
}
}
protected
abstract
void
refresh
();
protected
abstract
void
refresh
();
...
@@ -71,17 +69,7 @@ public abstract class RankingImpl implements Ranking {
...
@@ -71,17 +69,7 @@ public abstract class RankingImpl implements Ranking {
}
}
@Override
@Override
public
Interpolator
getInterpolator
()
{
public
float
normalize
(
Number
value
,
Interpolator
interpolator
)
{
return
interpolator
;
}
@Override
public
void
setInterpolator
(
Interpolator
interpolator
)
{
this
.
interpolator
=
interpolator
;
}
@Override
public
float
normalize
(
Number
value
)
{
float
normalizedValue
=
(
float
)
(
value
.
doubleValue
()
-
min
.
doubleValue
())
/
(
float
)
(
max
.
doubleValue
()
-
min
.
doubleValue
());
float
normalizedValue
=
(
float
)
(
value
.
doubleValue
()
-
min
.
doubleValue
())
/
(
float
)
(
max
.
doubleValue
()
-
min
.
doubleValue
());
return
interpolator
.
interpolate
(
normalizedValue
);
return
interpolator
.
interpolate
(
normalizedValue
);
}
}
...
...
modules/AppearanceAPI/src/main/java/org/gephi/appearance/SimpleFunctionImpl.java
浏览文件 @
2b137a91
...
@@ -17,6 +17,6 @@ import org.gephi.graph.api.Graph;
...
@@ -17,6 +17,6 @@ import org.gephi.graph.api.Graph;
public
class
SimpleFunctionImpl
extends
FunctionImpl
implements
SimpleFunction
{
public
class
SimpleFunctionImpl
extends
FunctionImpl
implements
SimpleFunction
{
public
SimpleFunctionImpl
(
String
id
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
)
{
public
SimpleFunctionImpl
(
String
id
,
Graph
graph
,
Transformer
transformer
,
TransformerUI
transformerUI
)
{
super
(
id
,
null
,
graph
,
null
,
transformer
,
transformerUI
,
null
,
null
);
super
(
id
,
null
,
graph
,
null
,
transformer
,
transformerUI
,
null
,
null
,
null
);
}
}
}
}
modules/AppearanceAPI/src/main/java/org/gephi/appearance/api/Ranking.java
浏览文件 @
2b137a91
...
@@ -53,11 +53,7 @@ public interface Ranking {
...
@@ -53,11 +53,7 @@ public interface Ranking {
public
Number
getMaxValue
();
public
Number
getMaxValue
();
public
Interpolator
getInterpolator
();
public
void
setInterpolator
(
Interpolator
interpolator
);
public
Number
getValue
(
Element
element
);
public
Number
getValue
(
Element
element
);
public
float
normalize
(
Number
value
);
public
float
normalize
(
Number
value
,
Interpolator
interpolator
);
}
}
modules/AppearanceAPI/src/main/java/org/gephi/appearance/api/RankingFunction.java
浏览文件 @
2b137a91
...
@@ -48,4 +48,8 @@ package org.gephi.appearance.api;
...
@@ -48,4 +48,8 @@ package org.gephi.appearance.api;
public
interface
RankingFunction
extends
Function
{
public
interface
RankingFunction
extends
Function
{
public
Ranking
getRanking
();
public
Ranking
getRanking
();
public
void
setInterpolator
(
Interpolator
interpolator
);
public
Interpolator
getInterpolator
();
}
}
modules/AppearanceAPI/src/main/java/org/gephi/appearance/spi/RankingTransformer.java
浏览文件 @
2b137a91
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
*/
*/
package
org.gephi.appearance.spi
;
package
org.gephi.appearance.spi
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
...
@@ -50,5 +51,5 @@ import org.gephi.graph.api.Element;
...
@@ -50,5 +51,5 @@ import org.gephi.graph.api.Element;
*/
*/
public
interface
RankingTransformer
<
E
extends
Element
>
extends
Transformer
{
public
interface
RankingTransformer
<
E
extends
Element
>
extends
Transformer
{
public
void
transform
(
E
element
,
Ranking
ranking
,
Number
value
);
public
void
transform
(
E
element
,
Ranking
ranking
,
Interpolator
interpolator
,
Number
value
);
}
}
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingElementColorTransformer.java
浏览文件 @
2b137a91
...
@@ -44,6 +44,7 @@ package org.gephi.appearance.plugin;
...
@@ -44,6 +44,7 @@ package org.gephi.appearance.plugin;
import
java.awt.Color
;
import
java.awt.Color
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.appearance.spi.Transformer
;
...
@@ -60,8 +61,8 @@ public class RankingElementColorTransformer implements RankingTransformer<Elemen
...
@@ -60,8 +61,8 @@ public class RankingElementColorTransformer implements RankingTransformer<Elemen
protected
final
LinearGradient
linearGradient
=
new
LinearGradient
(
new
Color
[]{
Color
.
WHITE
,
Color
.
BLACK
},
new
float
[]{
0
f
,
1
f
});
protected
final
LinearGradient
linearGradient
=
new
LinearGradient
(
new
Color
[]{
Color
.
WHITE
,
Color
.
BLACK
},
new
float
[]{
0
f
,
1
f
});
@Override
@Override
public
void
transform
(
Element
element
,
Ranking
ranking
,
Number
value
)
{
public
void
transform
(
Element
element
,
Ranking
ranking
,
Interpolator
interpolator
,
Number
value
)
{
Color
color
=
linearGradient
.
getValue
(
ranking
.
normalize
(
value
));
Color
color
=
linearGradient
.
getValue
(
ranking
.
normalize
(
value
,
interpolator
));
element
.
setColor
(
color
);
element
.
setColor
(
color
);
}
}
...
...
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingLabelColorTransformer.java
浏览文件 @
2b137a91
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
package
org.gephi.appearance.plugin
;
package
org.gephi.appearance.plugin
;
import
java.awt.Color
;
import
java.awt.Color
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.Element
;
...
@@ -55,8 +56,8 @@ import org.openide.util.lookup.ServiceProvider;
...
@@ -55,8 +56,8 @@ import org.openide.util.lookup.ServiceProvider;
public
class
RankingLabelColorTransformer
extends
RankingElementColorTransformer
{
public
class
RankingLabelColorTransformer
extends
RankingElementColorTransformer
{
@Override
@Override
public
void
transform
(
Element
element
,
Ranking
ranking
,
Number
value
)
{
public
void
transform
(
Element
element
,
Ranking
ranking
,
Interpolator
interpolator
,
Number
value
)
{
Color
color
=
linearGradient
.
getValue
(
ranking
.
normalize
(
value
));
Color
color
=
linearGradient
.
getValue
(
ranking
.
normalize
(
value
,
interpolator
));
element
.
getTextProperties
().
setColor
(
color
);
element
.
getTextProperties
().
setColor
(
color
);
}
}
...
...
modules/AppearancePlugin/src/main/java/org/gephi/appearance/plugin/RankingNodeSizeTransformer.java
浏览文件 @
2b137a91
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
*/
*/
package
org.gephi.appearance.plugin
;
package
org.gephi.appearance.plugin
;
import
org.gephi.appearance.api.Interpolator
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.api.Ranking
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.RankingTransformer
;
import
org.gephi.appearance.spi.Transformer
;
import
org.gephi.appearance.spi.Transformer
;
...
@@ -58,8 +59,8 @@ public class RankingNodeSizeTransformer implements RankingTransformer<Node> {
...
@@ -58,8 +59,8 @@ public class RankingNodeSizeTransformer implements RankingTransformer<Node> {
protected
float
maxSize
=
4
f
;
protected
float
maxSize
=
4
f
;
@Override
@Override
public
void
transform
(
Node
node
,
Ranking
ranking
,
Number
value
)
{
public
void
transform
(
Node
node
,
Ranking
ranking
,
Interpolator
interpolator
,
Number
value
)
{
float
rankingValue
=
ranking
.
normalize
(
value
);
float
rankingValue
=
ranking
.
normalize
(
value
,
interpolator
);
float
size
=
rankingValue
*
(
maxSize
-
minSize
)
+
minSize
;
float
size
=
rankingValue
*
(
maxSize
-
minSize
)
+
minSize
;
node
.
setSize
(
size
);
node
.
setSize
(
size
);
}
}
...
...
modules/DesktopAppearance/src/main/java/org/gephi/desktop/appearance/AppearanceTopComponent.java
浏览文件 @
2b137a91
...
@@ -341,7 +341,7 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
...
@@ -341,7 +341,7 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
if
(
splineEditor
==
null
)
{
if
(
splineEditor
==
null
)
{
splineEditor
=
new
SplineEditor
(
NbBundle
.
getMessage
(
AppearanceTopComponent
.
class
,
"AppearanceTopComponent.splineEditor.title"
));
splineEditor
=
new
SplineEditor
(
NbBundle
.
getMessage
(
AppearanceTopComponent
.
class
,
"AppearanceTopComponent.splineEditor.title"
));
}
}
Interpolator
interpolator
=
function
.
get
Ranking
().
get
Interpolator
();
Interpolator
interpolator
=
function
.
getInterpolator
();
if
(
interpolator
instanceof
Interpolator
.
BezierInterpolator
)
{
if
(
interpolator
instanceof
Interpolator
.
BezierInterpolator
)
{
Interpolator
.
BezierInterpolator
bezierInterpolator
=
(
Interpolator
.
BezierInterpolator
)
interpolator
;
Interpolator
.
BezierInterpolator
bezierInterpolator
=
(
Interpolator
.
BezierInterpolator
)
interpolator
;
splineEditor
.
setControl1
(
bezierInterpolator
.
getControl1
());
splineEditor
.
setControl1
(
bezierInterpolator
.
getControl1
());
...
@@ -351,7 +351,7 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
...
@@ -351,7 +351,7 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
splineEditor
.
setControl2
(
new
Point2D
.
Float
(
1
,
1
));
splineEditor
.
setControl2
(
new
Point2D
.
Float
(
1
,
1
));
}
}
splineEditor
.
setVisible
(
true
);
splineEditor
.
setVisible
(
true
);
function
.
getRanking
().
setInterpolator
(
function
.
setInterpolator
(
new
Interpolator
.
BezierInterpolator
(
new
Interpolator
.
BezierInterpolator
(
(
float
)
splineEditor
.
getControl1
().
getX
(),
(
float
)
splineEditor
.
getControl1
().
getY
(),
(
float
)
splineEditor
.
getControl1
().
getX
(),
(
float
)
splineEditor
.
getControl1
().
getY
(),
(
float
)
splineEditor
.
getControl2
().
getX
(),
(
float
)
splineEditor
.
getControl2
().
getY
()));
(
float
)
splineEditor
.
getControl2
().
getX
(),
(
float
)
splineEditor
.
getControl2
().
getY
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录