Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Christnowx
Gephi
提交
1fb3fd07
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,发现更多精彩内容 >>
提交
1fb3fd07
编写于
4月 09, 2013
作者:
M
Mathieu Bastian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove dynamic processor in ProcessorPlugin
上级
310efb35
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
1098 deletion
+0
-1098
modules/ProcessorPlugin/src/main/java/org/gephi/io/processor/plugin/DynamicProcessor.java
.../java/org/gephi/io/processor/plugin/DynamicProcessor.java
+0
-445
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorPanel.form
.../org/gephi/ui/processor/plugin/DynamicProcessorPanel.form
+0
-174
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorPanel.java
.../org/gephi/ui/processor/plugin/DynamicProcessorPanel.java
+0
-368
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorUI.java
...ava/org/gephi/ui/processor/plugin/DynamicProcessorUI.java
+0
-111
未找到文件。
modules/ProcessorPlugin/src/main/java/org/gephi/io/processor/plugin/DynamicProcessor.java
已删除
100644 → 0
浏览文件 @
310efb35
此差异已折叠。
点击以展开。
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorPanel.form
已删除
100644 → 0
浏览文件 @
310efb35
<?xml version="1.1" encoding="UTF-8" ?>
<Form
version=
"1.5"
maxVersion=
"1.7"
type=
"org.netbeans.modules.form.forminfo.JPanelFormInfo"
>
<NonVisualComponents>
<Component
class=
"javax.swing.ButtonGroup"
name=
"buttongroup"
>
</Component>
</NonVisualComponents>
<AuxValues>
<AuxValue
name=
"FormSettings_autoResourcing"
type=
"java.lang.Integer"
value=
"1"
/>
<AuxValue
name=
"FormSettings_autoSetComponentName"
type=
"java.lang.Boolean"
value=
"false"
/>
<AuxValue
name=
"FormSettings_generateFQN"
type=
"java.lang.Boolean"
value=
"true"
/>
<AuxValue
name=
"FormSettings_generateMnemonicsCode"
type=
"java.lang.Boolean"
value=
"false"
/>
<AuxValue
name=
"FormSettings_i18nAutoMode"
type=
"java.lang.Boolean"
value=
"true"
/>
<AuxValue
name=
"FormSettings_layoutCodeTarget"
type=
"java.lang.Integer"
value=
"1"
/>
<AuxValue
name=
"FormSettings_listenerGenerationStyle"
type=
"java.lang.Integer"
value=
"0"
/>
<AuxValue
name=
"FormSettings_variablesLocal"
type=
"java.lang.Boolean"
value=
"false"
/>
<AuxValue
name=
"FormSettings_variablesModifier"
type=
"java.lang.Integer"
value=
"2"
/>
</AuxValues>
<Layout>
<DimensionLayout
dim=
"0"
>
<Group
type=
"103"
groupAlignment=
"0"
attributes=
"0"
>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<EmptySpace
max=
"-2"
attributes=
"0"
/>
<Component
id=
"labelMatchingCheckbox"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
pref=
"285"
max=
"32767"
attributes=
"0"
/>
</Group>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<EmptySpace
max=
"-2"
attributes=
"0"
/>
<Component
id=
"labelLastFrame"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"lastFrameLabel"
pref=
"243"
max=
"32767"
attributes=
"0"
/>
<EmptySpace
min=
"-2"
pref=
"136"
max=
"-2"
attributes=
"0"
/>
</Group>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<EmptySpace
max=
"-2"
attributes=
"0"
/>
<Group
type=
"103"
groupAlignment=
"0"
attributes=
"0"
>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<EmptySpace
min=
"21"
pref=
"21"
max=
"21"
attributes=
"0"
/>
<Component
id=
"labelDate"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"datePicker"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
</Group>
<Component
id=
"dateRadio"
alignment=
"0"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<EmptySpace
min=
"21"
pref=
"21"
max=
"21"
attributes=
"0"
/>
<Component
id=
"labelTime"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"timestampField"
min=
"-2"
pref=
"117"
max=
"-2"
attributes=
"0"
/>
</Group>
<Component
id=
"timeStampRadio"
alignment=
"0"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
</Group>
<EmptySpace
pref=
"205"
max=
"32767"
attributes=
"0"
/>
</Group>
<Component
id=
"header"
alignment=
"0"
pref=
"498"
max=
"32767"
attributes=
"0"
/>
</Group>
</DimensionLayout>
<DimensionLayout
dim=
"1"
>
<Group
type=
"103"
groupAlignment=
"0"
attributes=
"0"
>
<Group
type=
"102"
alignment=
"0"
attributes=
"0"
>
<Component
id=
"header"
min=
"-2"
pref=
"91"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"labelMatchingCheckbox"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
min=
"-2"
pref=
"18"
max=
"-2"
attributes=
"0"
/>
<Group
type=
"103"
groupAlignment=
"0"
attributes=
"0"
>
<Group
type=
"102"
attributes=
"0"
>
<Component
id=
"labelLastFrame"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"separate"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"dateRadio"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
</Group>
<Component
id=
"lastFrameLabel"
min=
"-2"
pref=
"14"
max=
"-2"
attributes=
"0"
/>
</Group>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Group
type=
"103"
groupAlignment=
"3"
attributes=
"0"
>
<Component
id=
"labelDate"
alignment=
"3"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"datePicker"
alignment=
"3"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
</Group>
<EmptySpace
type=
"separate"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"timeStampRadio"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<EmptySpace
type=
"unrelated"
max=
"-2"
attributes=
"0"
/>
<Group
type=
"103"
groupAlignment=
"3"
attributes=
"0"
>
<Component
id=
"labelTime"
alignment=
"3"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
<Component
id=
"timestampField"
alignment=
"3"
min=
"-2"
max=
"-2"
attributes=
"0"
/>
</Group>
<EmptySpace
pref=
"30"
max=
"32767"
attributes=
"0"
/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component
class=
"org.jdesktop.swingx.JXHeader"
name=
"header"
>
<Properties>
<Property
name=
"description"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.header.description"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
<Property
name=
"title"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.header.title"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
</Component>
<Component
class=
"javax.swing.JRadioButton"
name=
"dateRadio"
>
<Properties>
<Property
name=
"buttonGroup"
type=
"javax.swing.ButtonGroup"
editor=
"org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"
>
<ComponentRef
name=
"buttongroup"
/>
</Property>
<Property
name=
"selected"
type=
"boolean"
value=
"true"
/>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.dateRadio.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
</Component>
<Component
class=
"javax.swing.JLabel"
name=
"labelDate"
>
<Properties>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.labelDate.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
<BindingProperties>
<BindingProperty
name=
"enabled"
source=
"dateRadio"
sourcePath=
"${selected}"
target=
"labelDate"
targetPath=
"enabled"
updateStrategy=
"0"
immediately=
"false"
/>
</BindingProperties>
</Component>
<Component
class=
"org.jdesktop.swingx.JXDatePicker"
name=
"datePicker"
>
<BindingProperties>
<BindingProperty
name=
"enabled"
source=
"dateRadio"
sourcePath=
"${selected}"
target=
"datePicker"
targetPath=
"enabled"
updateStrategy=
"0"
immediately=
"false"
/>
</BindingProperties>
</Component>
<Component
class=
"javax.swing.JRadioButton"
name=
"timeStampRadio"
>
<Properties>
<Property
name=
"buttonGroup"
type=
"javax.swing.ButtonGroup"
editor=
"org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"
>
<ComponentRef
name=
"buttongroup"
/>
</Property>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.timeStampRadio.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
</Component>
<Component
class=
"javax.swing.JLabel"
name=
"labelTime"
>
<Properties>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.labelTime.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
<BindingProperties>
<BindingProperty
name=
"enabled"
source=
"timeStampRadio"
sourcePath=
"${selected}"
target=
"labelTime"
targetPath=
"enabled"
updateStrategy=
"0"
immediately=
"false"
/>
</BindingProperties>
</Component>
<Component
class=
"javax.swing.JTextField"
name=
"timestampField"
>
<BindingProperties>
<BindingProperty
name=
"enabled"
source=
"timeStampRadio"
sourcePath=
"${selected}"
target=
"timestampField"
targetPath=
"enabled"
updateStrategy=
"0"
immediately=
"false"
/>
</BindingProperties>
</Component>
<Component
class=
"javax.swing.JLabel"
name=
"labelLastFrame"
>
<Properties>
<Property
name=
"font"
type=
"java.awt.Font"
editor=
"org.netbeans.modules.form.editors2.FontEditor"
>
<FontInfo
relative=
"true"
>
<Font
bold=
"true"
component=
"labelLastFrame"
property=
"font"
relativeSize=
"true"
size=
"0"
/>
</FontInfo>
</Property>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.labelLastFrame.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
</Component>
<Component
class=
"javax.swing.JLabel"
name=
"lastFrameLabel"
>
</Component>
<Component
class=
"javax.swing.JCheckBox"
name=
"labelMatchingCheckbox"
>
<Properties>
<Property
name=
"text"
type=
"java.lang.String"
editor=
"org.netbeans.modules.i18n.form.FormI18nStringEditor"
>
<ResourceString
bundle=
"org/gephi/ui/processor/plugin/Bundle.properties"
key=
"DynamicProcessorPanel.labelMatchingCheckbox.text"
replaceFormat=
"org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"
/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorPanel.java
已删除
100644 → 0
浏览文件 @
310efb35
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package
org.gephi.ui.processor.plugin
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.beans.PropertyChangeEvent
;
import
java.beans.PropertyChangeListener
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
javax.swing.event.DocumentEvent
;
import
javax.swing.event.DocumentListener
;
import
org.gephi.dynamic.DynamicUtilities
;
import
org.gephi.dynamic.api.DynamicController
;
import
org.gephi.dynamic.api.DynamicModel
;
import
org.gephi.io.processor.plugin.DynamicProcessor
;
import
org.netbeans.validation.api.Problems
;
import
org.netbeans.validation.api.Validator
;
import
org.netbeans.validation.api.ui.ValidationGroup
;
import
org.netbeans.validation.api.ui.ValidationListener
;
import
org.netbeans.validation.api.ui.ValidationPanel
;
import
org.openide.util.Lookup
;
/**
*
* @author Mathieu Bastian
*/
public
class
DynamicProcessorPanel
extends
javax
.
swing
.
JPanel
{
private
double
lastFrame
=
Double
.
POSITIVE_INFINITY
;
public
DynamicProcessorPanel
()
{
initComponents
();
}
public
void
setup
(
DynamicProcessor
processor
)
{
DynamicController
dynamicController
=
Lookup
.
getDefault
().
lookup
(
DynamicController
.
class
);
DynamicModel
dynamicModel
=
dynamicController
.
getModel
();
if
(
dynamicModel
!=
null
)
{
lastFrame
=
dynamicModel
.
getMax
();
}
lastFrameLabel
.
setText
(
"None"
);
if
(
dynamicModel
!=
null
&&
!(
dynamicModel
.
getMin
()
==
Double
.
NEGATIVE_INFINITY
&&
dynamicModel
.
getMax
()
==
Double
.
POSITIVE_INFINITY
))
{
//Select only the current time format
DynamicModel
.
TimeFormat
timeFormat
=
dynamicModel
.
getTimeFormat
();
if
(
timeFormat
.
equals
(
DynamicModel
.
TimeFormat
.
DATE
))
{
dateRadio
.
setSelected
(
true
);
timeStampRadio
.
setEnabled
(
false
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
try
{
datePicker
.
setDate
(
sdf
.
parse
(
processor
.
getDate
()));
}
catch
(
Exception
e
)
{
datePicker
.
setDate
(
new
Date
());
}
lastFrameLabel
.
setText
(
DynamicUtilities
.
getXMLDateStringFromDouble
(
lastFrame
));
}
else
{
timeStampRadio
.
setSelected
(
true
);
dateRadio
.
setEnabled
(
false
);
lastFrameLabel
.
setText
(
Double
.
toString
(
lastFrame
));
}
}
labelMatchingCheckbox
.
setSelected
(
processor
.
isLabelmatching
());
}
public
void
unsetup
(
DynamicProcessor
processor
)
{
processor
.
setDateMode
(
dateRadio
.
isSelected
());
if
(
dateRadio
.
isSelected
())
{
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
begin
=
sdf
.
format
(
datePicker
.
getDate
());
processor
.
setDate
(
begin
);
}
catch
(
Exception
e
)
{
//Exception catched later in processor
}
}
else
{
processor
.
setDate
(
timestampField
.
getText
());
}
processor
.
setLabelmatching
(
labelMatchingCheckbox
.
isSelected
());
}
public
static
ValidationPanel
createValidationPanel
(
DynamicProcessorPanel
innerPanel
)
{
ValidationPanel
validationPanel
=
new
ValidationPanel
();
validationPanel
.
setInnerComponent
(
innerPanel
);
ValidationGroup
group
=
validationPanel
.
getValidationGroup
();
final
FullValidationListener
fullValidationListener
=
new
FullValidationListener
(
innerPanel
);
group
.
add
(
fullValidationListener
);
PropertyChangeListener
listener
=
new
PropertyChangeListener
()
{
@Override
public
void
propertyChange
(
PropertyChangeEvent
e
)
{
if
(
"date"
.
equals
(
e
.
getPropertyName
()))
{
fullValidationListener
.
event
();
}
}
};
innerPanel
.
datePicker
.
addPropertyChangeListener
(
listener
);
innerPanel
.
timestampField
.
getDocument
().
addDocumentListener
(
new
DocumentListener
()
{
public
void
insertUpdate
(
DocumentEvent
e
)
{
fullValidationListener
.
event
();
}
public
void
removeUpdate
(
DocumentEvent
e
)
{
fullValidationListener
.
event
();
}
public
void
changedUpdate
(
DocumentEvent
e
)
{
}
});
innerPanel
.
dateRadio
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
fullValidationListener
.
event
();
}
});
innerPanel
.
timeStampRadio
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
fullValidationListener
.
event
();
}
});
return
validationPanel
;
}
private
static
class
FullValidationListener
extends
ValidationListener
{
FullValidator
lastFrameValidator
;
public
FullValidationListener
(
DynamicProcessorPanel
panel
)
{
lastFrameValidator
=
new
FullValidator
((
panel
));
}
@Override
protected
boolean
validate
(
Problems
problems
)
{
return
lastFrameValidator
.
validate
(
problems
,
""
,
""
);
}
public
void
event
()
{
this
.
validate
();
}
}
private
static
class
FullValidator
implements
Validator
<
String
>
{
private
DynamicProcessorPanel
panel
;
public
FullValidator
(
DynamicProcessorPanel
panel
)
{
this
.
panel
=
panel
;
}
@Override
public
boolean
validate
(
Problems
problems
,
String
compName
,
String
model
)
{
if
(
panel
.
dateRadio
.
isSelected
())
{
if
(
panel
.
datePicker
.
getDate
()
==
null
)
{
problems
.
add
(
"The date can't be empty"
);
return
false
;
}
else
if
(!
Double
.
isInfinite
(
panel
.
lastFrame
))
{
//Date
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
begin
=
sdf
.
format
(
panel
.
datePicker
.
getDate
());
double
d
=
DynamicUtilities
.
getDoubleFromXMLDateString
(
begin
);
if
(
d
<=
panel
.
lastFrame
)
{
problems
.
add
(
"The new date must be later than the last current date"
);
return
false
;
}
}
}
else
{
String
t
=
panel
.
timestampField
.
getText
();
if
(
t
.
isEmpty
())
{
problems
.
add
(
"The time stamp can't be empty"
);
return
false
;
}
try
{
Double
.
parseDouble
(
panel
.
timestampField
.
getText
());
}
catch
(
Exception
e
)
{
problems
.
add
(
"The time stamp must be a number"
);
return
false
;
}
if
(!
Double
.
isInfinite
(
panel
.
lastFrame
)
&&
Double
.
parseDouble
(
panel
.
timestampField
.
getText
())
<=
panel
.
lastFrame
)
{
problems
.
add
(
"The new time stamp must be greater than the last frame"
);
return
false
;
}
}
return
true
;
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings
(
"unchecked"
)
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private
void
initComponents
()
{
bindingGroup
=
new
org
.
jdesktop
.
beansbinding
.
BindingGroup
();
buttongroup
=
new
javax
.
swing
.
ButtonGroup
();
header
=
new
org
.
jdesktop
.
swingx
.
JXHeader
();
dateRadio
=
new
javax
.
swing
.
JRadioButton
();
labelDate
=
new
javax
.
swing
.
JLabel
();
datePicker
=
new
org
.
jdesktop
.
swingx
.
JXDatePicker
();
timeStampRadio
=
new
javax
.
swing
.
JRadioButton
();
labelTime
=
new
javax
.
swing
.
JLabel
();
timestampField
=
new
javax
.
swing
.
JTextField
();
labelLastFrame
=
new
javax
.
swing
.
JLabel
();
lastFrameLabel
=
new
javax
.
swing
.
JLabel
();
labelMatchingCheckbox
=
new
javax
.
swing
.
JCheckBox
();
header
.
setDescription
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.header.description"
));
// NOI18N
header
.
setTitle
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.header.title"
));
// NOI18N
buttongroup
.
add
(
dateRadio
);
dateRadio
.
setSelected
(
true
);
dateRadio
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.dateRadio.text"
));
// NOI18N
labelDate
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.labelDate.text"
));
// NOI18N
org
.
jdesktop
.
beansbinding
.
Binding
binding
=
org
.
jdesktop
.
beansbinding
.
Bindings
.
createAutoBinding
(
org
.
jdesktop
.
beansbinding
.
AutoBinding
.
UpdateStrategy
.
READ_WRITE
,
dateRadio
,
org
.
jdesktop
.
beansbinding
.
ELProperty
.
create
(
"${selected}"
),
labelDate
,
org
.
jdesktop
.
beansbinding
.
BeanProperty
.
create
(
"enabled"
));
bindingGroup
.
addBinding
(
binding
);
binding
=
org
.
jdesktop
.
beansbinding
.
Bindings
.
createAutoBinding
(
org
.
jdesktop
.
beansbinding
.
AutoBinding
.
UpdateStrategy
.
READ_WRITE
,
dateRadio
,
org
.
jdesktop
.
beansbinding
.
ELProperty
.
create
(
"${selected}"
),
datePicker
,
org
.
jdesktop
.
beansbinding
.
BeanProperty
.
create
(
"enabled"
));
bindingGroup
.
addBinding
(
binding
);
buttongroup
.
add
(
timeStampRadio
);
timeStampRadio
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.timeStampRadio.text"
));
// NOI18N
labelTime
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.labelTime.text"
));
// NOI18N
binding
=
org
.
jdesktop
.
beansbinding
.
Bindings
.
createAutoBinding
(
org
.
jdesktop
.
beansbinding
.
AutoBinding
.
UpdateStrategy
.
READ_WRITE
,
timeStampRadio
,
org
.
jdesktop
.
beansbinding
.
ELProperty
.
create
(
"${selected}"
),
labelTime
,
org
.
jdesktop
.
beansbinding
.
BeanProperty
.
create
(
"enabled"
));
bindingGroup
.
addBinding
(
binding
);
binding
=
org
.
jdesktop
.
beansbinding
.
Bindings
.
createAutoBinding
(
org
.
jdesktop
.
beansbinding
.
AutoBinding
.
UpdateStrategy
.
READ_WRITE
,
timeStampRadio
,
org
.
jdesktop
.
beansbinding
.
ELProperty
.
create
(
"${selected}"
),
timestampField
,
org
.
jdesktop
.
beansbinding
.
BeanProperty
.
create
(
"enabled"
));
bindingGroup
.
addBinding
(
binding
);
labelLastFrame
.
setFont
(
labelLastFrame
.
getFont
().
deriveFont
(
labelLastFrame
.
getFont
().
getStyle
()
|
java
.
awt
.
Font
.
BOLD
));
labelLastFrame
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.labelLastFrame.text"
));
// NOI18N
labelMatchingCheckbox
.
setText
(
org
.
openide
.
util
.
NbBundle
.
getMessage
(
DynamicProcessorPanel
.
class
,
"DynamicProcessorPanel.labelMatchingCheckbox.text"
));
// NOI18N
javax
.
swing
.
GroupLayout
layout
=
new
javax
.
swing
.
GroupLayout
(
this
);
this
.
setLayout
(
layout
);
layout
.
setHorizontalGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addContainerGap
()
.
addComponent
(
labelMatchingCheckbox
)
.
addContainerGap
(
285
,
Short
.
MAX_VALUE
))
.
addGroup
(
layout
.
createSequentialGroup
()
.
addContainerGap
()
.
addComponent
(
labelLastFrame
)
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addComponent
(
lastFrameLabel
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
243
,
Short
.
MAX_VALUE
)
.
addGap
(
136
,
136
,
136
))
.
addGroup
(
layout
.
createSequentialGroup
()
.
addContainerGap
()
.
addGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addGap
(
21
,
21
,
21
)
.
addComponent
(
labelDate
)
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addComponent
(
datePicker
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addComponent
(
dateRadio
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addGap
(
21
,
21
,
21
)
.
addComponent
(
labelTime
)
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addComponent
(
timestampField
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
117
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addComponent
(
timeStampRadio
))
.
addContainerGap
(
205
,
Short
.
MAX_VALUE
))
.
addComponent
(
header
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
498
,
Short
.
MAX_VALUE
)
);
layout
.
setVerticalGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addComponent
(
header
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
91
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
)
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addComponent
(
labelMatchingCheckbox
)
.
addGap
(
18
,
18
,
18
)
.
addGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
LEADING
)
.
addGroup
(
layout
.
createSequentialGroup
()
.
addComponent
(
labelLastFrame
)
.
addGap
(
18
,
18
,
18
)
.
addComponent
(
dateRadio
))
.
addComponent
(
lastFrameLabel
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
14
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
BASELINE
)
.
addComponent
(
labelDate
)
.
addComponent
(
datePicker
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addGap
(
18
,
18
,
18
)
.
addComponent
(
timeStampRadio
)
.
addPreferredGap
(
javax
.
swing
.
LayoutStyle
.
ComponentPlacement
.
UNRELATED
)
.
addGroup
(
layout
.
createParallelGroup
(
javax
.
swing
.
GroupLayout
.
Alignment
.
BASELINE
)
.
addComponent
(
labelTime
)
.
addComponent
(
timestampField
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
,
javax
.
swing
.
GroupLayout
.
DEFAULT_SIZE
,
javax
.
swing
.
GroupLayout
.
PREFERRED_SIZE
))
.
addContainerGap
(
30
,
Short
.
MAX_VALUE
))
);
bindingGroup
.
bind
();
}
// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private
javax
.
swing
.
ButtonGroup
buttongroup
;
private
org
.
jdesktop
.
swingx
.
JXDatePicker
datePicker
;
private
javax
.
swing
.
JRadioButton
dateRadio
;
private
org
.
jdesktop
.
swingx
.
JXHeader
header
;
private
javax
.
swing
.
JLabel
labelDate
;
private
javax
.
swing
.
JLabel
labelLastFrame
;
private
javax
.
swing
.
JCheckBox
labelMatchingCheckbox
;
private
javax
.
swing
.
JLabel
labelTime
;
private
javax
.
swing
.
JLabel
lastFrameLabel
;
private
javax
.
swing
.
JRadioButton
timeStampRadio
;
private
javax
.
swing
.
JTextField
timestampField
;
private
org
.
jdesktop
.
beansbinding
.
BindingGroup
bindingGroup
;
// End of variables declaration//GEN-END:variables
}
modules/ProcessorPluginUI/src/main/java/org/gephi/ui/processor/plugin/DynamicProcessorUI.java
已删除
100644 → 0
浏览文件 @
310efb35
/*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package
org.gephi.ui.processor.plugin
;
import
javax.swing.JPanel
;
import
org.gephi.io.importer.api.Container
;
import
org.gephi.io.processor.plugin.DynamicProcessor
;
import
org.gephi.io.processor.spi.Processor
;
import
org.gephi.io.processor.spi.ProcessorUI
;
import
org.openide.util.lookup.ServiceProvider
;
/**
*
* @author Mathieu Bastian
*/
@ServiceProvider
(
service
=
ProcessorUI
.
class
)
public
class
DynamicProcessorUI
implements
ProcessorUI
{
private
DynamicProcessor
dynamicProcessor
;
private
DynamicProcessorSettings
settings
=
new
DynamicProcessorSettings
();
private
DynamicProcessorPanel
panel
;
@Override
public
void
setup
(
Processor
processor
)
{
dynamicProcessor
=
(
DynamicProcessor
)
processor
;
settings
.
load
(
dynamicProcessor
);
panel
.
setup
(
dynamicProcessor
);
}
@Override
public
JPanel
getPanel
()
{
panel
=
new
DynamicProcessorPanel
();
return
DynamicProcessorPanel
.
createValidationPanel
(
panel
);
}
@Override
public
void
unsetup
()
{
panel
.
unsetup
(
dynamicProcessor
);
settings
.
save
(
dynamicProcessor
);
panel
=
null
;
dynamicProcessor
=
null
;
}
@Override
public
boolean
isUIFoProcessor
(
Processor
processor
)
{
return
processor
instanceof
DynamicProcessor
;
}
@Override
public
boolean
isValid
(
Container
container
)
{
return
!
container
.
isDynamicGraph
();
}
private
static
class
DynamicProcessorSettings
{
private
boolean
dateMode
=
true
;
private
String
date
=
""
;
private
boolean
labelMatching
=
true
;
private
void
save
(
DynamicProcessor
dynamicProcessor
)
{
this
.
dateMode
=
dynamicProcessor
.
isDateMode
();
this
.
date
=
dynamicProcessor
.
getDate
();
this
.
labelMatching
=
dynamicProcessor
.
isLabelmatching
();
}
private
void
load
(
DynamicProcessor
dynamicProcessor
)
{
dynamicProcessor
.
setDateMode
(
dateMode
);
dynamicProcessor
.
setDate
(
date
);
dynamicProcessor
.
setLabelmatching
(
labelMatching
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录