Enable auto-apply in DesktopAppearance
Esse commit está contido em:
+29
-4
@@ -180,16 +180,17 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="autoApplyButton">
|
||||
<Component class="javax.swing.JToggleButton" name="stopAutoApplyButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/gephi/desktop/appearance/resources/apply.gif"/>
|
||||
<Image iconType="3" name="/org/gephi/desktop/appearance/resources/stop.png"/>
|
||||
</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/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.autoApplyButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.stopAutoApplyButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.autoApplyButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.stopAutoApplyButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
@@ -236,6 +237,30 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JToggleButton" name="autoApplyButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/gephi/desktop/appearance/resources/apply.gif"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.autoApplyButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/appearance/Bundle.properties" key="AppearanceTopComponent.autoApplyButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[0, 7, 0, 7]"/>
|
||||
</Property>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="3" insetsRight="5" anchor="14" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
+83
-16
@@ -127,6 +127,10 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
refreshCenterPanel();
|
||||
refreshCombo();
|
||||
refreshControls();
|
||||
} else if(pce.getPropertyName().equals(AppearanceUIModelEvent.SET_AUTO_APPLY)) {
|
||||
refreshControls();
|
||||
} else if(pce.getPropertyName().equals(AppearanceUIModelEvent.START_STOP_AUTO_APPLY)) {
|
||||
refreshControls();
|
||||
}
|
||||
// if (pce.getPropertyName().equals(RankingUIModel.LIST_VISIBLE)) {
|
||||
// listButton.setSelected((Boolean) pce.getNewValue());
|
||||
@@ -174,11 +178,8 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
// listButton.setSelected(false);
|
||||
// localScaleButton.setSelected(false);
|
||||
// }
|
||||
|
||||
|
||||
//Chooser
|
||||
// ((RankingChooser) centerPanel).refreshModel(model);
|
||||
|
||||
//Toolbar
|
||||
// ((RankingToolbar) categoryToolbar).refreshModel(model);
|
||||
}
|
||||
@@ -217,7 +218,6 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
centerPanel.repaint();
|
||||
|
||||
//setCenterPanel
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -284,11 +284,37 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
public void run() {
|
||||
if (model != null) {
|
||||
if (model.getSelectedFunction() != null) {
|
||||
applyButton.setEnabled(true);
|
||||
enableAutoButton.setEnabled(true);
|
||||
if (model.getAutoAppyTransformer() != null) {
|
||||
applyButton.setVisible(false);
|
||||
enableAutoButton.setSelected(true);
|
||||
AutoAppyTransformer aat = model.getAutoAppyTransformer();
|
||||
if (aat.isRunning()) {
|
||||
autoApplyButton.setVisible(false);
|
||||
stopAutoApplyButton.setVisible(true);
|
||||
stopAutoApplyButton.setSelected(true);
|
||||
} else {
|
||||
autoApplyButton.setVisible(true);
|
||||
autoApplyButton.setSelected(false);
|
||||
stopAutoApplyButton.setVisible(false);
|
||||
}
|
||||
} else {
|
||||
autoApplyButton.setVisible(false);
|
||||
stopAutoApplyButton.setVisible(false);
|
||||
enableAutoButton.setSelected(false);
|
||||
applyButton.setVisible(true);
|
||||
applyButton.setEnabled(true);
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
//Disable
|
||||
stopAutoApplyButton.setVisible(false);
|
||||
autoApplyButton.setVisible(false);
|
||||
applyButton.setVisible(true);
|
||||
applyButton.setEnabled(false);
|
||||
enableAutoButton.setEnabled(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -327,8 +353,8 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
splineEditor.setVisible(true);
|
||||
function.getRanking().setInterpolator(
|
||||
new Interpolator.BezierInterpolator(
|
||||
(float) splineEditor.getControl1().getX(), (float) splineEditor.getControl1().getY(),
|
||||
(float) splineEditor.getControl2().getX(), (float) splineEditor.getControl2().getY()));
|
||||
(float) splineEditor.getControl1().getX(), (float) splineEditor.getControl1().getY(),
|
||||
(float) splineEditor.getControl2().getX(), (float) splineEditor.getControl2().getY()));
|
||||
}
|
||||
});
|
||||
applyButton.addActionListener(new ActionListener() {
|
||||
@@ -337,6 +363,30 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
controller.appearanceController.transform(model.getSelectedFunction());
|
||||
}
|
||||
});
|
||||
autoApplyButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.startAutoApply();
|
||||
}
|
||||
});
|
||||
stopAutoApplyButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.stopAutoApply();
|
||||
}
|
||||
|
||||
});
|
||||
enableAutoButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.setAutoApply(model.getAutoAppyTransformer() == null);
|
||||
}
|
||||
});
|
||||
stopAutoApplyButton.setVisible(false);
|
||||
autoApplyButton.setVisible(false);
|
||||
|
||||
// listButton = new JToggleButton();
|
||||
// listButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/ranking/resources/list.png"))); // NOI18N
|
||||
@@ -422,9 +472,10 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
splineButton = new org.jdesktop.swingx.JXHyperlink();
|
||||
controlPanel = new javax.swing.JPanel();
|
||||
applyButton = new javax.swing.JButton();
|
||||
autoApplyButton = new javax.swing.JToggleButton();
|
||||
stopAutoApplyButton = new javax.swing.JToggleButton();
|
||||
autoApplyToolbar = new javax.swing.JToolBar();
|
||||
enableAutoButton = new javax.swing.JToggleButton();
|
||||
autoApplyButton = new javax.swing.JToggleButton();
|
||||
|
||||
setOpaque(true);
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
@@ -523,19 +574,20 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 18, 3, 5);
|
||||
controlPanel.add(applyButton, gridBagConstraints);
|
||||
|
||||
autoApplyButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/appearance/resources/apply.gif"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(autoApplyButton, org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.autoApplyButton.text")); // NOI18N
|
||||
autoApplyButton.setToolTipText(org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.autoApplyButton.toolTipText")); // NOI18N
|
||||
autoApplyButton.setFocusable(false);
|
||||
autoApplyButton.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
autoApplyButton.setMargin(new java.awt.Insets(0, 7, 0, 7));
|
||||
autoApplyButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
stopAutoApplyButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/appearance/resources/stop.png"))); // NOI18N
|
||||
stopAutoApplyButton.setSelected(true);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(stopAutoApplyButton, org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.stopAutoApplyButton.text")); // NOI18N
|
||||
stopAutoApplyButton.setToolTipText(org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.stopAutoApplyButton.toolTipText")); // NOI18N
|
||||
stopAutoApplyButton.setFocusable(false);
|
||||
stopAutoApplyButton.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
stopAutoApplyButton.setMargin(new java.awt.Insets(0, 7, 0, 7));
|
||||
stopAutoApplyButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 3, 3, 5);
|
||||
controlPanel.add(autoApplyButton, gridBagConstraints);
|
||||
controlPanel.add(stopAutoApplyButton, gridBagConstraints);
|
||||
|
||||
autoApplyToolbar.setFloatable(false);
|
||||
autoApplyToolbar.setRollover(true);
|
||||
@@ -556,6 +608,20 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
controlPanel.add(autoApplyToolbar, gridBagConstraints);
|
||||
|
||||
autoApplyButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/appearance/resources/apply.gif"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(autoApplyButton, org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.autoApplyButton.text")); // NOI18N
|
||||
autoApplyButton.setToolTipText(org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.autoApplyButton.toolTipText")); // NOI18N
|
||||
autoApplyButton.setFocusable(false);
|
||||
autoApplyButton.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
autoApplyButton.setMargin(new java.awt.Insets(0, 7, 0, 7));
|
||||
autoApplyButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 3, 3, 5);
|
||||
controlPanel.add(autoApplyButton, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
@@ -579,6 +645,7 @@ public class AppearanceTopComponent extends TopComponent implements Lookup.Provi
|
||||
private javax.swing.JToggleButton localScaleButton;
|
||||
private javax.swing.JPanel mainPanel;
|
||||
private org.jdesktop.swingx.JXHyperlink splineButton;
|
||||
private javax.swing.JToggleButton stopAutoApplyButton;
|
||||
private javax.swing.JToolBar tranformerToolbar;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
|
||||
+29
@@ -231,6 +231,7 @@ public class AppearanceUIController {
|
||||
if (model != null) {
|
||||
TransformerUI oldValue = model.getSelectedTransformerUI();
|
||||
if (!oldValue.equals(ui)) {
|
||||
model.setAutoApply(false);
|
||||
model.setSelectedTransformerUI(ui);
|
||||
firePropertyChangeEvent(AppearanceUIModelEvent.SELECTED_TRANSFORMER_UI, oldValue, ui);
|
||||
}
|
||||
@@ -241,12 +242,40 @@ public class AppearanceUIController {
|
||||
if (model != null) {
|
||||
Function oldValue = model.getSelectedFunction();
|
||||
if ((oldValue == null && function != null) || (oldValue != null && function == null) || (function != null && oldValue != null && !oldValue.equals(function))) {
|
||||
model.setAutoApply(false);
|
||||
model.setSelectedFunction(function);
|
||||
firePropertyChangeEvent(AppearanceUIModelEvent.SELECTED_FUNCTION, oldValue, function);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAutoApply(boolean autoApply) {
|
||||
if (model != null) {
|
||||
model.setAutoApply(autoApply);
|
||||
firePropertyChangeEvent(AppearanceUIModelEvent.SET_AUTO_APPLY, !autoApply, autoApply);
|
||||
}
|
||||
}
|
||||
|
||||
public void startAutoApply() {
|
||||
if (model != null) {
|
||||
AutoAppyTransformer aat = model.getAutoAppyTransformer();
|
||||
if (aat != null) {
|
||||
aat.start();
|
||||
firePropertyChangeEvent(AppearanceUIModelEvent.START_STOP_AUTO_APPLY, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stopAutoApply() {
|
||||
if (model != null) {
|
||||
AutoAppyTransformer aat = model.getAutoAppyTransformer();
|
||||
if (aat != null) {
|
||||
aat.stop();
|
||||
firePropertyChangeEvent(AppearanceUIModelEvent.START_STOP_AUTO_APPLY, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AppearanceController getAppearanceController() {
|
||||
return appearanceController;
|
||||
}
|
||||
|
||||
+29
-1
@@ -68,6 +68,7 @@ public class AppearanceUIModel {
|
||||
protected final Map<String, Map<TransformerCategory, TransformerUI>> selectedTransformerUI;
|
||||
protected final Map<String, Map<TransformerUI, Function>> selectedFunction;
|
||||
protected final Map<String, TransformerCategory> selectedCategory;
|
||||
protected final Map<String, Map<TransformerCategory, AutoAppyTransformer>> selectedAutoTransformer;
|
||||
protected String selectedElementClass = AppearanceUIController.NODE_ELEMENT;
|
||||
protected Transformer selectedTransformer;
|
||||
|
||||
@@ -79,6 +80,7 @@ public class AppearanceUIModel {
|
||||
selectedCategory = new HashMap<String, TransformerCategory>();
|
||||
selectedTransformerUI = new HashMap<String, Map<TransformerCategory, TransformerUI>>();
|
||||
selectedFunction = new HashMap<String, Map<TransformerUI, Function>>();
|
||||
selectedAutoTransformer = new HashMap<String, Map<TransformerCategory, AutoAppyTransformer>>();
|
||||
|
||||
//Init selected
|
||||
for (String ec : ELEMENT_CLASSES) {
|
||||
@@ -104,6 +106,7 @@ public class AppearanceUIModel {
|
||||
}
|
||||
selectedTransformerUI.put(elementClass, newMap);
|
||||
selectedFunction.put(elementClass, new HashMap<TransformerUI, Function>());
|
||||
selectedAutoTransformer.put(elementClass, new HashMap<TransformerCategory, AutoAppyTransformer>());
|
||||
}
|
||||
|
||||
private void refreshSelectedFunctions(String elementClass) {
|
||||
@@ -127,7 +130,7 @@ public class AppearanceUIModel {
|
||||
Function sFunction = getSelectedFunction();
|
||||
if (sFunction != null && sFunction.isAttribute()) {
|
||||
for (Function func : getSelectedElementClass().equals(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
|
||||
if(func.equals(sFunction)) {
|
||||
if (func.equals(sFunction)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -157,6 +160,15 @@ public class AppearanceUIModel {
|
||||
return selectedFunction.get(selectedElementClass).get(getSelectedTransformerUI());
|
||||
}
|
||||
|
||||
public AutoAppyTransformer getAutoAppyTransformer() {
|
||||
String elm = getSelectedElementClass();
|
||||
TransformerCategory ct = getSelectedCategory();
|
||||
if (ct != null) {
|
||||
return selectedAutoTransformer.get(elm).get(ct);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Collection<Function> getFunctions() {
|
||||
List<Function> functions = new ArrayList<Function>();
|
||||
for (Function func : selectedElementClass.equalsIgnoreCase(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
|
||||
@@ -170,6 +182,22 @@ public class AppearanceUIModel {
|
||||
return functions;
|
||||
}
|
||||
|
||||
protected void setAutoApply(boolean autoApply) {
|
||||
if (!autoApply) {
|
||||
AutoAppyTransformer aat = getAutoAppyTransformer();
|
||||
if (aat != null) {
|
||||
aat.stop();
|
||||
}
|
||||
}
|
||||
String elmt = getSelectedElementClass();
|
||||
TransformerCategory cat = getSelectedCategory();
|
||||
if (autoApply) {
|
||||
selectedAutoTransformer.get(elmt).put(cat, new AutoAppyTransformer(controller, getSelectedFunction()));
|
||||
} else {
|
||||
selectedAutoTransformer.get(elmt).put(cat, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isAttributeTransformerUI(TransformerUI ui) {
|
||||
Class transformerClass = ui.getTransformerClass();
|
||||
if (RankingTransformer.class.isAssignableFrom(transformerClass) || PartitionTransformer.class.isAssignableFrom(transformerClass)) {
|
||||
|
||||
+3
-1
@@ -55,7 +55,9 @@ public class AppearanceUIModelEvent extends PropertyChangeEvent {
|
||||
public static String SELECTED_TRANSFORMER_UI = "selectedTransformerUI";
|
||||
public static String SELECTED_FUNCTION = "selectedFunction";
|
||||
public static String ATTRIBUTE_LIST = "attributeList";
|
||||
|
||||
public static String START_STOP_AUTO_APPLY = "startStopAutoApply";
|
||||
public static String SET_AUTO_APPLY = "setStopAutoApply";
|
||||
|
||||
public AppearanceUIModelEvent(Object source, String propertyName,
|
||||
Object oldValue, Object newValue) {
|
||||
super(source, propertyName, oldValue, newValue);
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
Copyright 2008-2013 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 2013 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 2013 Gephi Consortium.
|
||||
*/
|
||||
package org.gephi.desktop.appearance;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.gephi.appearance.api.Function;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author mbastian
|
||||
*/
|
||||
public class AutoAppyTransformer implements Runnable {
|
||||
|
||||
private static final long DEFAULT_DELAY = 500; //ms
|
||||
private final Function function;
|
||||
private final AppearanceUIController controller;
|
||||
private ScheduledExecutorService executor;
|
||||
|
||||
public AutoAppyTransformer(AppearanceUIController controller, Function function) {
|
||||
this.controller = controller;
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread t = new Thread(r, "Appearance Auto Transformer");
|
||||
return t;
|
||||
}
|
||||
});
|
||||
executor.scheduleWithFixedDelay(this, 0, getDelayInMs(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (executor != null && !executor.isShutdown()) {
|
||||
executor.shutdown();
|
||||
}
|
||||
executor = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
controller.appearanceController.transform(function);
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
return executor != null;
|
||||
}
|
||||
|
||||
private long getDelayInMs() {
|
||||
return DEFAULT_DELAY;
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -25,10 +25,12 @@ PartitionChooser.refreshButton.text=
|
||||
PartitionChooser.refreshButton.toolTipText=Refresh
|
||||
AppearanceTopComponent.applyButton.text=Apply
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=Enable auto transformation - applied continuously
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Apply continuously even when the values changes
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto Apply
|
||||
AppearanceTopComponent.splineButton.toolTipText=Configure rank interpolation
|
||||
AppearanceTopComponent.splineButton.text=Spline...
|
||||
AppearanceTopComponent.splineEditor.title=Interpolate
|
||||
AppearanceTopComponent.applyButton.toolTipText=Apply the current transformation to the graph
|
||||
AppearanceTopComponent.localScaleButton.toolTipText=\ Use local scale. The bounds are calculated only on the visible graph instead of the complete graph.
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=Stop auto apply
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=Stop
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Apply continuously even when the values changes
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto Apply
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
|
||||
AppearanceTopComponent.applyButton.text=Pou\u017e\u00edt
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=Povolit auto transformaci - pou\u017eiv\u00e1na nep\u0159etr\u017eit\u011b
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Pou\u017e\u00edvat nep\u0159etr\u017eit\u011b, i kdy\u017e se hodnoty zm\u011bn\u00ed
|
||||
AppearanceTopComponent.autoApplyButton.text=Automaticky pou\u017e\u00edt
|
||||
AppearanceTopComponent.splineButton.toolTipText=Nastavit interpolaci hodnocen\u00ed
|
||||
AppearanceTopComponent.splineButton.text=K\u0159ivka...
|
||||
AppearanceTopComponent.applyButton.toolTipText=Pou\u017e\u00edt sou\u010dasnou transformaci na graf
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=Pou\u017e\u00edvat nep\u0159etr\u017eit\u011b, i kdy\u017e se hodnoty zm\u011bn\u00ed
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=Automaticky pou\u017e\u00edt
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Pou\u017e\u00edvat nep\u0159etr\u017eit\u011b, i kdy\u017e se hodnoty zm\u011bn\u00ed
|
||||
AppearanceTopComponent.autoApplyButton.text=Automaticky pou\u017e\u00edt
|
||||
|
||||
+4
-4
@@ -1,10 +1,6 @@
|
||||
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=Activar auto transformaci\u00f3n - aplicada continuamente
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Aplicar continuamente incluso cuando los valores cambian
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto aplicar
|
||||
|
||||
AppearanceTopComponent.splineButton.toolTipText=Configurar interpolaci\u00f3n de la clasificaci\u00f3n
|
||||
|
||||
AppearanceTopComponent.splineButton.text=Spline...
|
||||
@@ -12,3 +8,7 @@ AppearanceTopComponent.splineButton.text=Spline...
|
||||
AppearanceTopComponent.applyButton.toolTipText=Aplicar la transformaci\u00f3n actual al grafo
|
||||
|
||||
AppearanceTopComponent.applyButton.text=Aplicar
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=Aplicar continuamente incluso cuando los valores cambian
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=Auto aplicar
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto aplicar
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Aplicar continuamente incluso cuando los valores cambian
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
|
||||
AppearanceTopComponent.applyButton.text=Appliquer
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=Active la transformation automatique - en continu
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Ex\u00e9cute en continu m\u00eame si les valeurs changent
|
||||
AppearanceTopComponent.autoApplyButton.text=Ex\u00e9cution auto
|
||||
AppearanceTopComponent.splineButton.toolTipText=Configurer l'interpolation des rangs
|
||||
AppearanceTopComponent.splineButton.text=Spline...
|
||||
AppearanceTopComponent.applyButton.toolTipText=Appliquer la transformation actuelle au graphe.
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=Ex\u00e9cute en continu m\u00eame si les valeurs changent
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=Ex\u00e9cution auto
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Ex\u00e9cute en continu m\u00eame si les valeurs changent
|
||||
AppearanceTopComponent.autoApplyButton.text=Ex\u00e9cution auto
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
|
||||
AppearanceTopComponent.applyButton.text=\u9069\u7528
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=\u81ea\u52d5\u5909\u5f62\u53ef\u80fd - \u7d99\u7d9a\u3057\u3066\u9069\u7528
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u5024\u306e\u5909\u66f4\u304c\u3042\u3063\u305f\u3068\u304d\u306f\u7d99\u7d9a\u3057\u3066\u9069\u7528
|
||||
AppearanceTopComponent.autoApplyButton.text=\u81ea\u52d5\u9069\u7528
|
||||
AppearanceTopComponent.splineButton.toolTipText=\u30e9\u30f3\u30af\u306e\u5185\u633f\u306e\u8a2d\u5b9a
|
||||
AppearanceTopComponent.splineButton.text=\u30b9\u30d7\u30e9\u30a4\u30f3...
|
||||
AppearanceTopComponent.applyButton.toolTipText=\u73fe\u5728\u306e\u5909\u5f62\u3092\u30b0\u30e9\u30d5\u306b\u9069\u7528
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=\u5024\u306e\u5909\u66f4\u304c\u3042\u3063\u305f\u3068\u304d\u306f\u7d99\u7d9a\u3057\u3066\u9069\u7528
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=\u81ea\u52d5\u9069\u7528
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u5024\u306e\u5909\u66f4\u304c\u3042\u3063\u305f\u3068\u304d\u306f\u7d99\u7d9a\u3057\u3066\u9069\u7528
|
||||
AppearanceTopComponent.autoApplyButton.text=\u81ea\u52d5\u9069\u7528
|
||||
|
||||
+4
-4
@@ -1,10 +1,6 @@
|
||||
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=Habilitar auto transforma\u00e7\u00e3o - aplicada continuamente
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Aplicar continuamente mesmo quando os valores mudem
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto aplicar
|
||||
|
||||
AppearanceTopComponent.splineButton.toolTipText=Configurar interpola\u00e7\u00e3o de classifica\u00e7\u00e3o
|
||||
|
||||
AppearanceTopComponent.splineButton.text=Spline...
|
||||
@@ -12,3 +8,7 @@ AppearanceTopComponent.splineButton.text=Spline...
|
||||
AppearanceTopComponent.applyButton.toolTipText=Aplicar a transforma\u00e7\u00e3o atual ao grafo
|
||||
|
||||
AppearanceTopComponent.applyButton.text=Aplicar
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=Aplicar continuamente mesmo quando os valores mudem
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=Auto aplicar
|
||||
AppearanceTopComponent.autoApplyButton.text=Auto aplicar
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=Aplicar continuamente mesmo quando os valores mudem
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
|
||||
AppearanceTopComponent.applyButton.text=\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e-\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439
|
||||
AppearanceTopComponent.autoApplyButton.text=\u0410\u0432\u0442\u043e-\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435
|
||||
AppearanceTopComponent.splineButton.toolTipText=\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e \u0440\u0430\u043d\u0433\u0430
|
||||
AppearanceTopComponent.splineButton.text=\u0421\u043f\u043b\u0430\u0439\u043d\u044b...
|
||||
AppearanceTopComponent.applyButton.toolTipText=\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0433\u0440\u0430\u0444\u0443
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=\u0410\u0432\u0442\u043e-\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439
|
||||
AppearanceTopComponent.autoApplyButton.text=\u0410\u0432\u0442\u043e-\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435
|
||||
|
||||
+4
-4
@@ -1,10 +1,6 @@
|
||||
|
||||
AppearanceTopComponent.enableAutoButton.toolTipText=\u5f00\u542f\u81ea\u52a8\u8f6c\u6362-\u7ee7\u7eed\u5e94\u7528
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u6570\u636e\u6539\u53d8\u540e\u7ee7\u7eed\u5e94\u7528
|
||||
|
||||
AppearanceTopComponent.autoApplyButton.text=\u81ea\u52a8\u5e94\u7528
|
||||
|
||||
AppearanceTopComponent.splineButton.toolTipText=\u8bbe\u7f6e\u7b49\u7ea7\u63d2\u503c\u6cd5
|
||||
|
||||
AppearanceTopComponent.splineButton.text=\u6837\u6761\u66f2\u7ebf
|
||||
@@ -12,3 +8,7 @@ AppearanceTopComponent.splineButton.text=\u6837\u6761\u66f2\u7ebf
|
||||
AppearanceTopComponent.applyButton.toolTipText=\u5e94\u7528\u73b0\u6709\u7684\u8f6c\u6362\u5230\u56fe
|
||||
|
||||
AppearanceTopComponent.applyButton.text=\u5e94\u7528
|
||||
AppearanceTopComponent.stopAutoApplyButton.toolTipText=\u6570\u636e\u6539\u53d8\u540e\u7ee7\u7eed\u5e94\u7528
|
||||
AppearanceTopComponent.stopAutoApplyButton.text=\u81ea\u52a8\u5e94\u7528
|
||||
AppearanceTopComponent.autoApplyButton.toolTipText=\u6570\u636e\u6539\u53d8\u540e\u7ee7\u7eed\u5e94\u7528
|
||||
AppearanceTopComponent.autoApplyButton.text=\u81ea\u52a8\u5e94\u7528
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário