Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Christnowx
Gephi
提交
e7fddb1f
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,发现更多精彩内容 >>
提交
e7fddb1f
编写于
2月 08, 2016
作者:
M
Mathieu Bastian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix issues #1354, #1355 and #1358
上级
8414e1b0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
23 deletion
+40
-23
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditEdges.java
...c/main/java/org/gephi/ui/tools/plugin/edit/EditEdges.java
+17
-4
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditNodes.java
...c/main/java/org/gephi/ui/tools/plugin/edit/EditNodes.java
+13
-3
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/MultipleRowsAttributeValueWrapper.java
.../tools/plugin/edit/MultipleRowsAttributeValueWrapper.java
+5
-8
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/SingleRowAttributeValueWrapper.java
.../ui/tools/plugin/edit/SingleRowAttributeValueWrapper.java
+5
-8
未找到文件。
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditEdges.java
浏览文件 @
e7fddb1f
...
...
@@ -47,9 +47,11 @@ import java.beans.PropertyEditorManager;
import
org.gephi.graph.api.Column
;
import
org.gephi.datalab.api.AttributeColumnsController
;
import
org.gephi.graph.api.Edge
;
import
org.gephi.graph.api.GraphController
;
import
org.gephi.graph.api.TextProperties
;
import
org.gephi.graph.api.TimeFormat
;
import
org.gephi.ui.tools.plugin.edit.EditWindowUtils.*
;
import
org.joda.time.DateTimeZone
;
import
org.openide.nodes.AbstractNode
;
import
org.openide.nodes.Children
;
import
org.openide.nodes.PropertySupport
;
...
...
@@ -70,7 +72,8 @@ public class EditEdges extends AbstractNode {
private
PropertySet
[]
propertySets
;
private
final
Edge
[]
edges
;
private
final
boolean
multipleEdges
;
private
TimeFormat
currentTimeFormat
=
TimeFormat
.
DOUBLE
;
private
final
TimeFormat
currentTimeFormat
;
private
final
DateTimeZone
dateTimeZone
;
/**
* Single edge edition mode will always be enabled with this single node
...
...
@@ -83,6 +86,10 @@ public class EditEdges extends AbstractNode {
this
.
edges
=
new
Edge
[]{
edge
};
setName
(
edge
.
getLabel
());
multipleEdges
=
false
;
GraphController
gc
=
Lookup
.
getDefault
().
lookup
(
GraphController
.
class
);
currentTimeFormat
=
gc
.
getGraphModel
().
getTimeFormat
();
dateTimeZone
=
gc
.
getGraphModel
().
getTimeZone
();
}
/**
...
...
@@ -100,6 +107,10 @@ public class EditEdges extends AbstractNode {
}
else
{
setName
(
edges
[
0
].
getLabel
());
}
GraphController
gc
=
Lookup
.
getDefault
().
lookup
(
GraphController
.
class
);
currentTimeFormat
=
gc
.
getGraphModel
().
getTimeFormat
();
dateTimeZone
=
gc
.
getGraphModel
().
getTimeZone
();
}
@Override
...
...
@@ -132,9 +143,9 @@ public class EditEdges extends AbstractNode {
AttributeValueWrapper
wrap
;
for
(
Column
column
:
row
.
getAttributeColumns
())
{
if
(
multipleEdges
)
{
wrap
=
new
MultipleRowsAttributeValueWrapper
(
edges
,
column
,
currentTimeFormat
);
wrap
=
new
MultipleRowsAttributeValueWrapper
(
edges
,
column
,
currentTimeFormat
,
dateTimeZone
);
}
else
{
wrap
=
new
SingleRowAttributeValueWrapper
(
edges
[
0
],
column
,
currentTimeFormat
);
wrap
=
new
SingleRowAttributeValueWrapper
(
edges
[
0
],
column
,
currentTimeFormat
,
dateTimeZone
);
}
Class
<?>
type
=
column
.
getTypeClass
();
Property
p
;
...
...
@@ -147,11 +158,13 @@ public class EditEdges extends AbstractNode {
p
=
new
PropertySupport
.
Reflection
(
wrap
,
String
.
class
,
"getValueAsString"
,
"setValueAsString"
);
}
}
else
//Not editable column, do not provide "set" method:
if
(
propEditor
!=
null
)
{
//The type can be edited by default:
{
if
(
propEditor
!=
null
)
{
//The type can be edited by default:
p
=
new
PropertySupport
.
Reflection
(
wrap
,
type
,
"getValue"
+
type
.
getSimpleName
(),
null
);
}
else
{
//Use the AttributeType as String:
p
=
new
PropertySupport
.
Reflection
(
wrap
,
String
.
class
,
"getValueAsString"
,
null
);
}
}
p
.
setDisplayName
(
column
.
getTitle
());
p
.
setName
(
column
.
getId
());
set
.
put
(
p
);
...
...
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditNodes.java
浏览文件 @
e7fddb1f
...
...
@@ -46,10 +46,12 @@ import java.beans.PropertyEditor;
import
java.beans.PropertyEditorManager
;
import
org.gephi.graph.api.Column
;
import
org.gephi.datalab.api.AttributeColumnsController
;
import
org.gephi.graph.api.GraphController
;
import
org.gephi.graph.api.Node
;
import
org.gephi.graph.api.TextProperties
;
import
org.gephi.graph.api.TimeFormat
;
import
org.gephi.ui.tools.plugin.edit.EditWindowUtils.AttributeValueWrapper
;
import
org.joda.time.DateTimeZone
;
import
org.openide.nodes.AbstractNode
;
import
org.openide.nodes.Children
;
import
org.openide.nodes.PropertySupport
;
...
...
@@ -70,7 +72,8 @@ public class EditNodes extends AbstractNode {
private
PropertySet
[]
propertySets
;
private
final
Node
[]
nodes
;
private
final
boolean
multipleNodes
;
private
final
TimeFormat
currentTimeFormat
=
TimeFormat
.
DOUBLE
;
private
final
TimeFormat
currentTimeFormat
;
private
final
DateTimeZone
dateTimeZone
;
/**
* Single node edition mode will always be enabled with this single node
...
...
@@ -83,6 +86,10 @@ public class EditNodes extends AbstractNode {
this
.
nodes
=
new
Node
[]{
node
};
setName
(
node
.
getLabel
());
multipleNodes
=
false
;
GraphController
gc
=
Lookup
.
getDefault
().
lookup
(
GraphController
.
class
);
currentTimeFormat
=
gc
.
getGraphModel
().
getTimeFormat
();
dateTimeZone
=
gc
.
getGraphModel
().
getTimeZone
();
}
/**
...
...
@@ -100,6 +107,9 @@ public class EditNodes extends AbstractNode {
}
else
{
setName
(
nodes
[
0
].
getLabel
());
}
GraphController
gc
=
Lookup
.
getDefault
().
lookup
(
GraphController
.
class
);
currentTimeFormat
=
gc
.
getGraphModel
().
getTimeFormat
();
dateTimeZone
=
gc
.
getGraphModel
().
getTimeZone
();
}
@Override
...
...
@@ -132,9 +142,9 @@ public class EditNodes extends AbstractNode {
AttributeValueWrapper
wrap
;
for
(
Column
column
:
row
.
getAttributeColumns
())
{
if
(
multipleNodes
)
{
wrap
=
new
MultipleRowsAttributeValueWrapper
(
nodes
,
column
,
currentTimeFormat
);
wrap
=
new
MultipleRowsAttributeValueWrapper
(
nodes
,
column
,
currentTimeFormat
,
dateTimeZone
);
}
else
{
wrap
=
new
SingleRowAttributeValueWrapper
(
nodes
[
0
],
column
,
currentTimeFormat
);
wrap
=
new
SingleRowAttributeValueWrapper
(
nodes
[
0
],
column
,
currentTimeFormat
,
dateTimeZone
);
}
Property
p
;
...
...
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/MultipleRowsAttributeValueWrapper.java
浏览文件 @
e7fddb1f
...
...
@@ -46,6 +46,7 @@ import org.gephi.graph.api.Column;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.TimeFormat
;
import
org.gephi.ui.tools.plugin.edit.EditWindowUtils.AttributeValueWrapper
;
import
org.joda.time.DateTimeZone
;
/**
*
...
...
@@ -57,23 +58,19 @@ public class MultipleRowsAttributeValueWrapper implements AttributeValueWrapper
private
final
Column
column
;
private
Object
value
;
private
final
TimeFormat
currentTimeFormat
;
private
final
DateTimeZone
dateTimeZone
;
public
MultipleRowsAttributeValueWrapper
(
Element
[]
rows
,
Column
column
,
TimeFormat
currentTimeFormat
)
{
public
MultipleRowsAttributeValueWrapper
(
Element
[]
rows
,
Column
column
,
TimeFormat
currentTimeFormat
,
DateTimeZone
dateTimeZone
)
{
this
.
rows
=
rows
;
this
.
column
=
column
;
this
.
currentTimeFormat
=
currentTimeFormat
;
this
.
dateTimeZone
=
dateTimeZone
;
this
.
value
=
null
;
}
private
String
convertToStringIfNotNull
()
{
if
(
value
!=
null
)
{
// TODO adapt this
// if (value instanceof DynamicType) {
// return ((DynamicType) value).toString(currentTimeFormat == DynamicModel.TimeFormat.DOUBLE);
// } else {
// return value.toString();
// }
return
value
.
toString
();
return
AttributeUtils
.
print
(
value
,
currentTimeFormat
,
dateTimeZone
);
}
else
{
return
null
;
}
...
...
modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/SingleRowAttributeValueWrapper.java
浏览文件 @
e7fddb1f
...
...
@@ -45,6 +45,7 @@ import org.gephi.graph.api.AttributeUtils;
import
org.gephi.graph.api.Column
;
import
org.gephi.graph.api.Element
;
import
org.gephi.graph.api.TimeFormat
;
import
org.joda.time.DateTimeZone
;
/**
*
...
...
@@ -55,23 +56,19 @@ public class SingleRowAttributeValueWrapper implements EditWindowUtils.Attribute
private
final
Element
row
;
private
final
Column
column
;
private
final
TimeFormat
currentTimeFormat
;
private
final
DateTimeZone
dateTimeZone
;
public
SingleRowAttributeValueWrapper
(
Element
row
,
Column
column
,
TimeFormat
currentTimeFormat
)
{
public
SingleRowAttributeValueWrapper
(
Element
row
,
Column
column
,
TimeFormat
currentTimeFormat
,
DateTimeZone
dateTimeZone
)
{
this
.
row
=
row
;
this
.
column
=
column
;
this
.
currentTimeFormat
=
currentTimeFormat
;
this
.
dateTimeZone
=
dateTimeZone
;
}
private
String
convertToStringIfNotNull
()
{
Object
value
=
row
.
getAttribute
(
column
);
if
(
value
!=
null
)
{
// TODO adapt this
// if (value instanceof DynamicType) {
// return ((DynamicType) value).toString(currentTimeFormat == DynamicModel.TimeFormat.DOUBLE);
// } else {
// return value.toString();
// }
return
value
.
toString
();
return
AttributeUtils
.
print
(
value
,
currentTimeFormat
,
dateTimeZone
);
}
else
{
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录