Comparar commits
173 Commits
master
...
new-vizengine
| Autor | SHA1 | Data | |
|---|---|---|---|
| 9193082603 | |||
| c39f59e67d | |||
| d13b79f955 | |||
| 4d75ffe077 | |||
| 9b7c419938 | |||
| 478b31421f | |||
| b3acb22476 | |||
| 6abfaa9cf5 | |||
| 0427a0f0f5 | |||
| 38f632d7cd | |||
| 499c4b9d34 | |||
| 9c864c72b0 | |||
| fd8150ea63 | |||
| 8032716c24 | |||
| 468b0f6318 | |||
| 64755dbbac | |||
| 0f1cfa107e | |||
| 4532003acf | |||
| 099a76cf41 | |||
| 8312fd5321 | |||
| f6e787c774 | |||
| 9a73e71297 | |||
| a92fd58ebe | |||
| 51912ea691 | |||
| 73df32882e | |||
| 40138a3475 | |||
| 3372a64c32 | |||
| d4de7a0aac | |||
| a22ea28120 | |||
| 231d42414b | |||
| cd40d998e9 | |||
| 1a58118392 | |||
| 3e96bc780e | |||
| d692047174 | |||
| efd8c801cb | |||
| d34e0e39ad | |||
| 7b6afcfa2c | |||
| be58d1cd9e | |||
| a72a78d5f0 | |||
| efeae52ca5 | |||
| 0e49098819 | |||
| 9dcad95072 | |||
| 5cc2082e04 | |||
| d5c522d50d | |||
| ef31628fd2 | |||
| b581feee69 | |||
| be2b07a5c2 | |||
| 262a0d6460 | |||
| 095c60ecd8 | |||
| e19cc39385 | |||
| 8a7f46cedd | |||
| 9730adbfa8 | |||
| 656ea2c01d | |||
| 42aad541d7 | |||
| 9cca6c33ca | |||
| f322293cb4 | |||
| 0abe9ff6b1 | |||
| ce434ca6c6 | |||
| 8017249522 | |||
| 65e4f6ad8c | |||
| ff9369ad60 | |||
| 4a139bbf20 | |||
| 500f124fcd | |||
| dcc6d2e863 | |||
| 6fd99a72cc | |||
| dbcf557114 | |||
| 3c6acf0444 | |||
| 31fd09472b | |||
| cc19b38528 | |||
| daa65d0021 | |||
| 1c8c8b4b0b | |||
| 45f9eb7c7e | |||
| badbd773f4 | |||
| b489810dc0 | |||
| db58335640 | |||
| 9528797ef1 | |||
| 9a9f1b5526 | |||
| df87ac59c3 | |||
| a583acecc0 | |||
| 7cac7e796c | |||
| 72b2e59d37 | |||
| 7398807e64 | |||
| 97a6ae7a5a | |||
| 40c3fa4908 | |||
| bad7522898 | |||
| 8fc7697cff | |||
| 2cb33d5d98 | |||
| 5bf5789b23 | |||
| c98cd4670a | |||
| d19903c75e | |||
| dd320b19b3 | |||
| 3a87ebd089 | |||
| 23bdfdc0a3 | |||
| 04ac5af3ea | |||
| b133e8a26e | |||
| f5a6077d14 | |||
| 80dc404d25 | |||
| ef45ad9f0f | |||
| 7360ea3592 | |||
| 3c10554634 | |||
| 03dcf3efac | |||
| 532074879e | |||
| c2def6f760 | |||
| 7437be2971 | |||
| ba6cd247a6 | |||
| cf03948efd | |||
| 7521077f6c | |||
| 5f7515c268 | |||
| aff9ce3f80 | |||
| 550c9582ce | |||
| 0a26ff41dc | |||
| 9f45164efa | |||
| a17bc26092 | |||
| d18f338b53 | |||
| de11b99353 | |||
| 7eba980478 | |||
| 6cb80f71c8 | |||
| b47ea85a1f | |||
| d064593dd4 | |||
| 3363616484 | |||
| 4392cae230 | |||
| 9cc53ebe23 | |||
| 338eee181d | |||
| 94c7940419 | |||
| 6de961f170 | |||
| 7276e00fcb | |||
| 818d7cb3e8 | |||
| 8c20af24a4 | |||
| ca0597993b | |||
| f40e044789 | |||
| 93279cdfea | |||
| 8e0d2f009c | |||
| a407dd91e4 | |||
| e213ab0087 | |||
| 83064a2ade | |||
| 3f96903d8d | |||
| 88bc3fe15f | |||
| 9bd1fb7cac | |||
| 54b724358b | |||
| 4f539ad901 | |||
| 87cf08da1c | |||
| ad56aff268 | |||
| c4203cf969 | |||
| 4901487d94 | |||
| 9569c2e2f0 | |||
| 99362a957f | |||
| cbad91916b | |||
| 0303df8307 | |||
| 808e4ad393 | |||
| 03997b1e2e | |||
| b285a87a31 | |||
| 10f9643549 | |||
| 565c5624aa | |||
| 356f806205 | |||
| 3b3b7c696b | |||
| fdcc5b8c48 | |||
| df2d37800a | |||
| ea5c1888df | |||
| 3962e2adc9 | |||
| f4f40c7eb9 | |||
| 82b4ccefc4 | |||
| 024aca590c | |||
| bcdef8498b | |||
| 0e77574c12 | |||
| 01a946ef21 | |||
| f7859fdf45 | |||
| e0fb61010b | |||
| b8f747834b | |||
| 848a84a351 | |||
| 288e8d820c | |||
| a78a7cd8ff | |||
| 682d4f1aef | |||
| dff3c9a643 |
@@ -50,7 +50,6 @@ import org.gephi.graph.api.Attributes;
|
||||
import org.gephi.graph.api.EdgeData;
|
||||
import org.gephi.graph.spi.LayoutData;
|
||||
import org.gephi.graph.api.NodeData;
|
||||
import org.gephi.graph.api.Model;
|
||||
import org.gephi.graph.api.TextData;
|
||||
|
||||
/**
|
||||
@@ -66,8 +65,9 @@ public class EdgeDataImpl implements EdgeData {
|
||||
protected float g = 0f;
|
||||
protected float b = 0f;
|
||||
protected float alpha = 1f;
|
||||
protected boolean selected;
|
||||
protected boolean autoSelected;
|
||||
private String label;
|
||||
private Model model;
|
||||
protected Attributes attributes;
|
||||
protected TextData textData;
|
||||
|
||||
@@ -123,22 +123,6 @@ public class EdgeDataImpl implements EdgeData {
|
||||
return (getSource().z() + 2 * getTarget().z()) / 3f;
|
||||
}
|
||||
|
||||
public void setX(float x) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setY(float y) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setZ(float z) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSize() {
|
||||
return edge.getWeight();
|
||||
}
|
||||
@@ -185,14 +169,6 @@ public class EdgeDataImpl implements EdgeData {
|
||||
this.alpha = alpha;
|
||||
}
|
||||
|
||||
public Model getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(Model obj) {
|
||||
this.model = obj;
|
||||
}
|
||||
|
||||
public TextData getTextData() {
|
||||
return textData;
|
||||
}
|
||||
@@ -272,4 +248,21 @@ public class EdgeDataImpl implements EdgeData {
|
||||
((AttributeRow) attributes).setValues((AttributeRow) edgeData.getAttributes());
|
||||
}
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return this.selected;
|
||||
}
|
||||
|
||||
public void setAutoSelected(boolean autoSelected) {
|
||||
this.autoSelected = autoSelected;
|
||||
}
|
||||
|
||||
public boolean isAutoSelected() {
|
||||
return this.autoSelected;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,12 +44,13 @@ package org.gephi.graph.dhns.node;
|
||||
import org.gephi.data.properties.PropertiesColumn;
|
||||
import org.gephi.graph.api.Attributes;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.graph.api.NodeShape;
|
||||
import org.gephi.graph.spi.LayoutData;
|
||||
import org.gephi.graph.api.NodeData;
|
||||
import org.gephi.graph.api.GroupData;
|
||||
import org.gephi.graph.api.Model;
|
||||
import org.gephi.graph.api.TextData;
|
||||
import org.gephi.graph.dhns.utils.avl.ViewNodeTree;
|
||||
import org.gephi.graph.spi.SpatialData;
|
||||
|
||||
/**
|
||||
* Implementation of the node data interface.
|
||||
@@ -63,6 +64,7 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
protected final ViewNodeTree nodes;
|
||||
//NodeData
|
||||
protected LayoutData layoutData;
|
||||
protected SpatialData spatialData;
|
||||
protected float x;
|
||||
protected float y;
|
||||
protected float z;
|
||||
@@ -70,13 +72,14 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
protected float g = 0.6f;
|
||||
protected float b = 0.6f;
|
||||
protected float alpha = 1f;
|
||||
protected float size = 1f;
|
||||
protected Model model;
|
||||
protected float radius = 1f;
|
||||
protected boolean selected = false;
|
||||
protected boolean autoSelected = false;
|
||||
protected boolean fixed;
|
||||
protected String label;
|
||||
protected Attributes attributes;
|
||||
protected TextData textData;
|
||||
protected Model hullModel;
|
||||
protected NodeShape nodeShape;
|
||||
|
||||
public NodeDataImpl(int ID, AbstractNode rootNode) {
|
||||
this.nodes = new ViewNodeTree();
|
||||
@@ -112,6 +115,22 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
this.layoutData = layoutData;
|
||||
}
|
||||
|
||||
public SpatialData getSpatialData() {
|
||||
return spatialData;
|
||||
}
|
||||
|
||||
public void setSpatialData(SpatialData spatialData) {
|
||||
this.spatialData = spatialData;
|
||||
}
|
||||
|
||||
public NodeShape getNodeShape() {
|
||||
return nodeShape;
|
||||
}
|
||||
|
||||
public void setNodeShape(NodeShape nodeShape) {
|
||||
this.nodeShape = nodeShape;
|
||||
}
|
||||
|
||||
public Attributes getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
@@ -151,22 +170,25 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
updatePositionFlag();
|
||||
}
|
||||
|
||||
public void setPosition(float x, float y, float z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
updatePositionFlag();
|
||||
}
|
||||
|
||||
private void updatePositionFlag() {
|
||||
if (model != null) {
|
||||
model.updatePositionFlag();
|
||||
if (getSpatialData() != null) {
|
||||
getSpatialData().positionUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public float getSize() {
|
||||
return size;
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setSize(float size) {
|
||||
this.size = size;
|
||||
public void setSize(float radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public float r() {
|
||||
@@ -215,14 +237,6 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
this.alpha = alpha;
|
||||
}
|
||||
|
||||
public Model getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(Model obj) {
|
||||
this.model = obj;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
if (attributes != null) {
|
||||
return (String) attributes.getValue(PropertiesColumn.NODE_LABEL.getIndex());
|
||||
@@ -263,11 +277,23 @@ public class NodeDataImpl implements NodeData, GroupData {
|
||||
this.textData = textData;
|
||||
}
|
||||
|
||||
public Model getHullModel() {
|
||||
return hullModel;
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
if (!selected) {
|
||||
this.autoSelected = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setHullModel(Model hullModel) {
|
||||
this.hullModel = hullModel;
|
||||
public boolean isSelected() {
|
||||
return this.selected;
|
||||
}
|
||||
|
||||
public void setAutoSelected(boolean autoSelected) {
|
||||
this.autoSelected = autoSelected;
|
||||
}
|
||||
|
||||
public boolean isAutoSelected() {
|
||||
return this.autoSelected;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ package org.gephi.datalab.spi;
|
||||
|
||||
import org.gephi.datalab.spi.nodes.NodesManipulator;
|
||||
|
||||
|
||||
/**
|
||||
* <p>This interface defines a common extension for the manipulators that appear as context menu items
|
||||
* such as NodesManipulator, EdgesManipulator and GraphContextMenuItem (from Visualization API)</p>
|
||||
@@ -52,7 +51,7 @@ import org.gephi.datalab.spi.nodes.NodesManipulator;
|
||||
* @see NodesManipulator
|
||||
*/
|
||||
public interface ContextMenuItemManipulator extends Manipulator {
|
||||
|
||||
|
||||
/**
|
||||
* <p>This is optional. Return sub items for this menu item if desired.</p>
|
||||
* <p>If this item should contain more items, return a new instance of each sub item.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=f64ee4f1
|
||||
build.xml.script.CRC32=b3cd8b3b
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=f64ee4f1
|
||||
nbproject/build-impl.xml.script.CRC32=948a0238
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
build.xml.data.CRC32=58c5ba1d
|
||||
build.xml.script.CRC32=b3cd8b3b
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=58c5ba1d
|
||||
nbproject/build-impl.xml.script.CRC32=948a0238
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
|
||||
@@ -79,11 +79,11 @@
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<code-name-base>org.gephi.visualization.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1</specification-version>
|
||||
<specification-version>0.7.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -45,8 +45,9 @@ import javax.swing.Icon;
|
||||
import org.gephi.datalab.spi.ManipulatorUI;
|
||||
import org.gephi.graph.api.Edge;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
@@ -63,7 +64,7 @@ public class SelectSourceOnGraph extends BasicEdgesManipulator {
|
||||
|
||||
public void execute() {
|
||||
Node source = clickedEdge.getSource();
|
||||
VizController.getInstance().getSelectionManager().centerOnNode(source);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).centerOnNode(source);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -45,8 +45,9 @@ import javax.swing.Icon;
|
||||
import org.gephi.datalab.spi.ManipulatorUI;
|
||||
import org.gephi.graph.api.Edge;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
@@ -57,12 +58,12 @@ public class SelectTargetOnGraph extends BasicEdgesManipulator {
|
||||
private Edge clickedEdge;
|
||||
|
||||
public void setup(Edge[] edges, Edge clickedEdge) {
|
||||
this.clickedEdge=clickedEdge;
|
||||
this.clickedEdge = clickedEdge;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
Node source=clickedEdge.getTarget();
|
||||
VizController.getInstance().getSelectionManager().centerOnNode(source);
|
||||
Node source = clickedEdge.getTarget();
|
||||
Lookup.getDefault().lookup(VisualizationController.class).centerOnNode(source);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -44,8 +44,9 @@ package org.gephi.datalab.plugin.manipulators.nodes;
|
||||
import javax.swing.Icon;
|
||||
import org.gephi.datalab.spi.ManipulatorUI;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
@@ -56,11 +57,11 @@ public class SelectOnGraph extends BasicNodesManipulator {
|
||||
private Node node;
|
||||
|
||||
public void setup(Node[] nodes, Node clickedNode) {
|
||||
this.node=clickedNode;
|
||||
this.node = clickedNode;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
VizController.getInstance().getSelectionManager().centerOnNode(node);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).centerOnNode(node);;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.branding.desktop" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.branding.desktop.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.branding.desktop" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.branding.desktop.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.branding.desktop
|
||||
OpenIDE-Module-Install: org/gephi/branding/desktop/Installer.class
|
||||
OpenIDE-Module-Layer: org/gephi/branding/desktop/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/branding/desktop/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.0.4
|
||||
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.branding.desktop
|
||||
OpenIDE-Module-Install: org/gephi/branding/desktop/Installer.class
|
||||
OpenIDE-Module-Layer: org/gephi/branding/desktop/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/branding/desktop/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8.0.4
|
||||
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.branding.desktop-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.branding.desktop-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=485008bd
|
||||
build.xml.script.CRC32=3a13ec7e
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.46.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=485008bd
|
||||
nbproject/build-impl.xml.script.CRC32=3c0d63a0
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.1
|
||||
build.xml.data.CRC32=815db322
|
||||
build.xml.script.CRC32=3a13ec7e
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=815db322
|
||||
nbproject/build-impl.xml.script.CRC32=3c0d63a0
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
|
||||
|
||||
@@ -1,165 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.branding.desktop</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.progress</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.project</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.filters</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.io.importer.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.3</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.importer.plugin</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.partition.plugin</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.api.progress</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.16.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.autoupdate.services</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>1.16.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.sendopts</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>2</release-version>
|
||||
<specification-version>2.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.swing.tabcontrol</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.13.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.awt</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.23.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.dialogs</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.8.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.filesystems</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.13.1.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.modules</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.7.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.windows</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>6.24.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages/>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.branding.desktop</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.progress</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.project</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.filters</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.io.importer.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.3</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.importer.plugin</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.partition.plugin</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.api.progress</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.16.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.autoupdate.services</code-name-base>
|
||||
<run-dependency>
|
||||
<specification-version>1.16.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.sendopts</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>2</release-version>
|
||||
<specification-version>2.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.swing.tabcontrol</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.13.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.awt</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.23.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.dialogs</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.8.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.filesystems</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.13.1.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.modules</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.7.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.windows</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>6.24.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages/>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
@@ -58,7 +58,6 @@ import javax.management.NotificationEmitter;
|
||||
import javax.management.NotificationListener;
|
||||
import javax.management.openmbean.CompositeData;
|
||||
import org.gephi.desktop.project.api.ProjectControllerUI;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.LifecycleManager;
|
||||
import org.openide.NotifyDescriptor;
|
||||
@@ -321,7 +320,7 @@ public class MemoryStarvationManager implements NotificationListener {
|
||||
|
||||
private void freeSomeMemory() {
|
||||
//Stop Graphics engine and free all elements models. Should be enough
|
||||
VizController.getInstance().destroy();
|
||||
//VizController.getInstance().destroy();
|
||||
}
|
||||
|
||||
private boolean canRestart() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=a63bf6d7
|
||||
build.xml.data.CRC32=699de760
|
||||
build.xml.script.CRC32=fe592508
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=a63bf6d7
|
||||
nbproject/build-impl.xml.data.CRC32=699de760
|
||||
nbproject/build-impl.xml.script.CRC32=729ce773
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
|
||||
@@ -55,11 +55,11 @@
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<code-name-base>org.gephi.visualization.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
<specification-version>0.7.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -53,7 +53,6 @@ import org.gephi.data.attributes.api.AttributeController;
|
||||
import org.gephi.data.attributes.api.AttributeModel;
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.data.attributes.api.AttributeType;
|
||||
import org.gephi.graph.api.Graph;
|
||||
import org.gephi.graph.api.GraphController;
|
||||
import org.gephi.graph.api.GraphModel;
|
||||
import org.gephi.graph.api.HierarchicalGraph;
|
||||
@@ -62,7 +61,7 @@ import org.gephi.project.api.ProjectController;
|
||||
import org.gephi.utils.longtask.spi.LongTask;
|
||||
import org.gephi.utils.longtask.api.LongTaskErrorHandler;
|
||||
import org.gephi.utils.longtask.api.LongTaskExecutor;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.selection.SelectionManager;
|
||||
import org.openide.awt.StatusDisplayer;
|
||||
import org.openide.util.Lookup;
|
||||
@@ -139,8 +138,8 @@ public class ClusteringControllerImpl implements ClusteringController {
|
||||
}
|
||||
|
||||
public void selectCluster(Cluster cluster) {
|
||||
SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
|
||||
selectionManager.resetSelection();
|
||||
SelectionManager selectionManager = Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager();
|
||||
selectionManager.clearSelection();
|
||||
selectionManager.selectNodes(cluster.getNodes());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.desktop.hierarchy
|
||||
OpenIDE-Module-Layer: org/gephi/desktop/hierarchy/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/desktop/hierarchy/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8
|
||||
|
||||
Manifest-Version: 1.0
|
||||
AutoUpdate-Essential-Module: true
|
||||
OpenIDE-Module: org.gephi.desktop.hierarchy
|
||||
OpenIDE-Module-Layer: org/gephi/desktop/hierarchy/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/desktop/hierarchy/Bundle.properties
|
||||
OpenIDE-Module-Specification-Version: 0.8
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=282915f8
|
||||
build.xml.data.CRC32=a1e4f4d5
|
||||
build.xml.script.CRC32=6c1a3115
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.45.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=282915f8
|
||||
nbproject/build-impl.xml.data.CRC32=a1e4f4d5
|
||||
nbproject/build-impl.xml.script.CRC32=f30d3528
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
<code-name-base>org.gephi.desktop.hierarchy</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.visualization</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
@@ -30,14 +38,6 @@
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.jdesktop.swingx</code-name-base>
|
||||
<build-prerequisite/>
|
||||
|
||||
@@ -54,7 +54,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
import org.gephi.visualization.apiimpl.PropertiesBarAddon;
|
||||
import org.gephi.desktop.visualization.spi.PropertiesBarAddon;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.desktop.ranking" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.desktop.ranking.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.desktop.ranking" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.desktop.ranking.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.desktop.ranking-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.desktop.ranking-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
|
||||
@@ -5,4 +5,4 @@ build.xml.stylesheet.CRC32=a56c6a5b@1.46.1
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=6c7286ab
|
||||
nbproject/build-impl.xml.script.CRC32=137347c8
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.1
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.1
|
||||
|
||||
@@ -98,4 +98,4 @@
|
||||
<public-packages/>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=3cf15a55
|
||||
build.xml.data.CRC32=c73389a5
|
||||
build.xml.script.CRC32=a9ffbbd4
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.1
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=3cf15a55
|
||||
nbproject/build-impl.xml.data.CRC32=c73389a5
|
||||
nbproject/build-impl.xml.script.CRC32=b3f9f36d
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.1
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<code-name-base>org.gephi.visualization.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
<specification-version>0.7.1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -4,8 +4,10 @@ OpenIDE-Module-Short-Description=Implement ToolController and integrate tools UI
|
||||
PropertiesBar.fullScreenButton.tooltip = Full Screen
|
||||
MouseSelectionPopupPanel.labelDiameter.text=Diameter
|
||||
MouseSelectionPopupPanel.proportionnalZoomCheckbox.text=Proportional to zoom
|
||||
|
||||
SelectionBar.statusLabel.rectangleSelection = Rectangle selection
|
||||
SelectionBar.statusLabel.mouseSelection = Mouse selection
|
||||
SelectionBar.statusLabel.ellipseSelection = Ellipse selection
|
||||
SelectionBar.statusLabel.polygonSelection = Polygon selection
|
||||
SelectionBar.statusLabel.mouseSelection = Direct selection
|
||||
SelectionBar.statusLabel.dragging = Dragging
|
||||
SelectionBar.statusLabel.movement = Movement
|
||||
SelectionBar.statusLabel.noSelection = No selection
|
||||
|
||||
@@ -64,11 +64,12 @@ import org.gephi.tools.spi.ToolEventListener;
|
||||
import org.gephi.tools.spi.ToolSelectionType;
|
||||
import org.gephi.tools.spi.ToolUI;
|
||||
import org.gephi.tools.spi.UnselectToolException;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.apiimpl.VizEvent;
|
||||
import org.gephi.visualization.apiimpl.VizEvent.Type;
|
||||
import org.gephi.visualization.apiimpl.VizEventListener;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.event.VizEvent;
|
||||
import org.gephi.visualization.api.event.VizEvent.Type;
|
||||
import org.gephi.visualization.api.event.VizEventListener;
|
||||
import org.gephi.visualization.api.selection.SelectionManager;
|
||||
import org.gephi.visualization.api.selection.SelectionType;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
|
||||
@@ -122,17 +123,20 @@ public class DesktopToolController implements ToolController {
|
||||
}
|
||||
}
|
||||
currentHandlers = handlers.toArray(new ToolEventHandler[0]);
|
||||
SelectionManager selectionManager = Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager();
|
||||
switch (tool.getSelectionType()) {
|
||||
case NONE:
|
||||
VizController.getInstance().getSelectionManager().disableSelection();
|
||||
selectionManager.disableSelection();
|
||||
break;
|
||||
case SELECTION:
|
||||
VizController.getInstance().getSelectionManager().blockSelection(true);
|
||||
VizController.getInstance().getSelectionManager().setDraggingEnable(false);
|
||||
//electionManager.blockSelection(true);
|
||||
selectionManager.setDraggingEnabled(false);
|
||||
selectionManager.setDirectMouseSelection();
|
||||
break;
|
||||
case SELECTION_AND_DRAGGING:
|
||||
VizController.getInstance().getSelectionManager().blockSelection(true);
|
||||
VizController.getInstance().getSelectionManager().setDraggingEnable(true);
|
||||
//selectionManager.blockSelection(true);
|
||||
selectionManager.setDraggingEnabled(true);
|
||||
selectionManager.setDirectMouseSelection();
|
||||
break;
|
||||
}
|
||||
currentTool = tool;
|
||||
@@ -169,11 +173,10 @@ public class DesktopToolController implements ToolController {
|
||||
|
||||
}
|
||||
//Sort by priority
|
||||
Collections.sort(toolsUI, new Comparator() {
|
||||
|
||||
public int compare(Object o1, Object o2) {
|
||||
Integer p1 = ((ToolUI) o1).getPosition();
|
||||
Integer p2 = ((ToolUI) o2).getPosition();
|
||||
Collections.sort(toolsUI, new Comparator<ToolUI>() {
|
||||
public int compare(ToolUI o1, ToolUI o2) {
|
||||
Integer p1 = o1.getPosition();
|
||||
Integer p2 = o2.getPosition();
|
||||
return p1.compareTo(p2);
|
||||
}
|
||||
});
|
||||
@@ -212,15 +215,13 @@ public class DesktopToolController implements ToolController {
|
||||
}
|
||||
|
||||
//SelectionManager events
|
||||
VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {
|
||||
|
||||
final SelectionManager selectionManager = Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager();
|
||||
selectionManager.addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
|
||||
|
||||
if (selectionManager.isRectangleSelection() && currentTool != null) {
|
||||
if (selectionManager.getSelectionType() != SelectionType.NONE && currentTool != null) {
|
||||
toolbar.clearSelection();
|
||||
unselect();
|
||||
} else if (selectionManager.isSelectionEnabled() && currentTool != null && currentTool.getSelectionType() == ToolSelectionType.NONE) {
|
||||
} else if (selectionManager.isDirectMouseSelection() && currentTool != null && currentTool.getSelectionType() == ToolSelectionType.NONE) {
|
||||
toolbar.clearSelection();
|
||||
unselect();
|
||||
} else if (selectionManager.isDraggingEnabled() && currentTool != null) {
|
||||
@@ -267,11 +268,11 @@ public class DesktopToolController implements ToolController {
|
||||
return VizEvent.Type.NODE_LEFT_CLICK;
|
||||
}
|
||||
};
|
||||
VizController.getInstance().getVizEventManager().addListener(currentListener);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().addListener(currentListener);
|
||||
}
|
||||
|
||||
public void unselect() {
|
||||
VizController.getInstance().getVizEventManager().removeListener(currentListener);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().removeListener(currentListener);
|
||||
currentListener = null;
|
||||
toolEventListener = null;
|
||||
}
|
||||
@@ -308,11 +309,11 @@ public class DesktopToolController implements ToolController {
|
||||
return VizEvent.Type.MOUSE_RELEASED;
|
||||
}
|
||||
};
|
||||
VizController.getInstance().getVizEventManager().addListener(currentListeners);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().addListener(currentListeners);
|
||||
}
|
||||
|
||||
public void unselect() {
|
||||
VizController.getInstance().getVizEventManager().removeListener(currentListeners);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().removeListener(currentListeners);
|
||||
toolEventListener = null;
|
||||
currentListeners = null;
|
||||
}
|
||||
@@ -360,11 +361,11 @@ public class DesktopToolController implements ToolController {
|
||||
return VizEvent.Type.MOUSE_RELEASED;
|
||||
}
|
||||
};
|
||||
VizController.getInstance().getVizEventManager().addListener(currentListeners);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().addListener(currentListeners);
|
||||
}
|
||||
|
||||
public void unselect() {
|
||||
VizController.getInstance().getVizEventManager().removeListener(currentListeners);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().removeListener(currentListeners);
|
||||
toolEventListener = null;
|
||||
currentListeners = null;
|
||||
}
|
||||
@@ -385,7 +386,7 @@ public class DesktopToolController implements ToolController {
|
||||
public void handleEvent(VizEvent event) {
|
||||
float[] data = (float[]) event.getData();
|
||||
int[] viewport = new int[]{(int) data[0], (int) data[1]};
|
||||
float[] threed = new float[]{data[2], data[3]};
|
||||
float[] threed = new float[]{data[2], data[3], data[4]};
|
||||
toolEventListener.mouseClick(viewport, threed);
|
||||
}
|
||||
|
||||
@@ -393,11 +394,11 @@ public class DesktopToolController implements ToolController {
|
||||
return VizEvent.Type.MOUSE_LEFT_CLICK;
|
||||
}
|
||||
};
|
||||
VizController.getInstance().getVizEventManager().addListener(currentListener);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().addListener(currentListener);
|
||||
}
|
||||
|
||||
public void unselect() {
|
||||
VizController.getInstance().getVizEventManager().removeListener(currentListener);
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getVizEventManager().removeListener(currentListener);
|
||||
toolEventListener = null;
|
||||
currentListener = null;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,11 @@ import javax.swing.UIManager;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.selection.SelectionManager;
|
||||
import org.gephi.visualization.api.selection.SelectionType;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
@@ -65,8 +68,7 @@ public class SelectionBar extends javax.swing.JPanel {
|
||||
/** Creates new form SelectionBar */
|
||||
public SelectionBar() {
|
||||
initComponents();
|
||||
VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {
|
||||
|
||||
Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager().addChangeListener(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
refresh();
|
||||
}
|
||||
@@ -90,17 +92,16 @@ public class SelectionBar extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
public JPopupMenu createPopup() {
|
||||
|
||||
SelectionManager manager = VizController.getInstance().getSelectionManager();
|
||||
VizConfig vizConfig = Lookup.getDefault().lookup(VisualizationController.class).getVizConfig();
|
||||
final MouseSelectionPopupPanel popupPanel = new MouseSelectionPopupPanel();
|
||||
popupPanel.setDiameter(manager.getMouseSelectionDiameter());
|
||||
popupPanel.setProportionnalToZoom(manager.isMouseSelectionZoomProportionnal());
|
||||
popupPanel.setDiameter(vizConfig.getIntProperty(VizConfig.MOUSE_SELECTION_DIAMETER));
|
||||
popupPanel.setProportionnalToZoom(vizConfig.getBooleanProperty(VizConfig.MOUSE_SELECTION_ZOOM_PROPORTIONAL));
|
||||
popupPanel.setChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
SelectionManager manager = VizController.getInstance().getSelectionManager();
|
||||
manager.setMouseSelectionDiameter(popupPanel.getDiameter());
|
||||
manager.setMouseSelectionZoomProportionnal(popupPanel.isProportionnalToZoom());
|
||||
VizConfig vizConfig = Lookup.getDefault().lookup(VisualizationController.class).getVizConfig();
|
||||
vizConfig.setProperty(VizConfig.MOUSE_SELECTION_DIAMETER, popupPanel.getDiameter());
|
||||
vizConfig.setProperty(VizConfig.MOUSE_SELECTION_ZOOM_PROPORTIONAL, popupPanel.isProportionnalToZoom());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -110,21 +111,29 @@ public class SelectionBar extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
SelectionManager manager = VizController.getInstance().getSelectionManager();
|
||||
if (manager.isSelectionEnabled()) {
|
||||
if (manager.isRectangleSelection()) {
|
||||
mouseSelection = false;
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.rectangleSelection"));
|
||||
} else if (manager.isDirectMouseSelection()) {
|
||||
mouseSelection = true;
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.mouseSelection"));
|
||||
} else if (manager.isDraggingEnabled()) {
|
||||
mouseSelection = true;
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.dragging"));
|
||||
SelectionManager manager = Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager();
|
||||
if (manager.isDirectMouseSelection()) {
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.mouseSelection"));
|
||||
mouseSelection = true;
|
||||
} else if (manager.isNodeDraggingEnabled()) {
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.dragging"));
|
||||
mouseSelection = true;
|
||||
} else if (manager.getSelectionType() != SelectionType.NONE) {
|
||||
switch (manager.getSelectionType()) {
|
||||
case ELLIPSE:
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.ellipseSelection"));
|
||||
break;
|
||||
case POLYGON:
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.polygonSelection"));
|
||||
break;
|
||||
case RECTANGLE:
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.rectangleSelection"));
|
||||
break;
|
||||
}
|
||||
mouseSelection = manager.getSelectionType() != SelectionType.NONE;
|
||||
} else {
|
||||
mouseSelection = false;
|
||||
statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.noSelection"));
|
||||
mouseSelection = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.gephi.desktop.visualization" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.gephi.desktop.visualization.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
Manifest-Version: 1.0
|
||||
OpenIDE-Module: org.gephi.desktop.visualization
|
||||
OpenIDE-Module-Layer: org/gephi/desktop/visualization/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/gephi/desktop/visualization/Bundle.properties
|
||||
OpenIDE-Module-Requires: org.openide.windows.WindowManager
|
||||
OpenIDE-Module-Specification-Version: 1.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.gephi.desktop.visualization-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=3aeb6878
|
||||
build.xml.script.CRC32=fc5ca4fb
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@1.45.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=3aeb6878
|
||||
nbproject/build-impl.xml.script.CRC32=a47b7734
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1
|
||||
@@ -0,0 +1,2 @@
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
@@ -1,190 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.visualization</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.datalab.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1.4</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.desktop.project</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.dynamic.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.lib.gleem</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.lib.jogl</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.lib.validation</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.4</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.tools.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.components</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.utils</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.utils.collection</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.jdesktop.swingx</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.7</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.options.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.10.2</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.awt</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.23.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.dialogs</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.8.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.6.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.windows</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>6.24.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.visualization</package>
|
||||
<package>org.gephi.visualization.api.initializer</package>
|
||||
<package>org.gephi.visualization.api.objects</package>
|
||||
<package>org.gephi.visualization.api.selection</package>
|
||||
<package>org.gephi.visualization.apiimpl</package>
|
||||
<package>org.gephi.visualization.events</package>
|
||||
<package>org.gephi.visualization.opengl.text</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.gephi.desktop.visualization</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.data.attributes.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.datalab.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8.0.4</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.graph.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.lib.validation</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.4</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.math</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.project.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.tools.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8.0.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.components</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.ui.utils</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.gephi.visualization.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>0.8</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.options.api</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.18.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.settings</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.26.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.awt</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.23.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.dialogs</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.15.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.6.2</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.3.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.windows</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>6.33.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages>
|
||||
<package>org.gephi.desktop.visualization.spi</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
OpenIDE-Module-Name=Desktop Visualization
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
To change this template, choose Tools | Templates
|
||||
and open the template in the editor.
|
||||
-->
|
||||
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
|
||||
<settings version="1.0">
|
||||
<module name="org.gephi.desktop.visualization" spec="1.0"/>
|
||||
<instanceof class="org.openide.windows.TopComponent"/>
|
||||
<instanceof class="org.gephi.desktop.visualization.components.GraphTopComponent"/>
|
||||
<instance class="org.gephi.desktop.visualization.components.GraphTopComponent" method="getDefault"/>
|
||||
</settings>
|
||||
@@ -1,7 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd">
|
||||
<tc-ref version="2.0" >
|
||||
<module name="org.gephi.visualization" spec="1.0"/>
|
||||
<tc-id id="GraphTopComponent"/>
|
||||
<state opened="true"/>
|
||||
</tc-ref>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
To change this template, choose Tools | Templates
|
||||
and open the template in the editor.
|
||||
-->
|
||||
<!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd">
|
||||
<tc-ref version="2.0" >
|
||||
<module name="org.gephi.desktop.visualization" spec="1.0"/>
|
||||
<tc-id id="GraphTopComponent"/>
|
||||
<state opened="true"/>
|
||||
</tc-ref>
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -58,7 +37,7 @@ import org.gephi.graph.api.GraphController;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.ui.components.JColorButton;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
@@ -78,36 +57,35 @@ public class ActionsToolbar extends JToolBar {
|
||||
}
|
||||
|
||||
private void initContent() {
|
||||
|
||||
//Center on graph
|
||||
final JButton centerOnGraphButton = new JButton();
|
||||
centerOnGraphButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "ActionsToolbar.centerOnGraph"));
|
||||
centerOnGraphButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/centerOnGraph.png")));
|
||||
centerOnGraphButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.centerOnGraph"));
|
||||
centerOnGraphButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/centerOnGraph.png")));
|
||||
centerOnGraphButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizController.getInstance().getGraphIO().centerOnGraph();
|
||||
Lookup.getDefault().lookup(VisualizationController.class).centerOnGraph();
|
||||
}
|
||||
});
|
||||
add(centerOnGraphButton);
|
||||
|
||||
//Center on zero
|
||||
/*final JButton centerOnZeroButton = new JButton();
|
||||
centerOnZeroButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "ActionsToolbar.centerOnZero"));
|
||||
centerOnZeroButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/centerOnZero.png")));
|
||||
final JButton centerOnZeroButton = new JButton();
|
||||
centerOnZeroButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.centerOnZero"));
|
||||
centerOnZeroButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/centerOnZero.png")));
|
||||
centerOnZeroButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizController.getInstance().getGraphIO().centerOnZero();
|
||||
Lookup.getDefault().lookup(VisualizationController.class).centerOnZero();
|
||||
}
|
||||
});
|
||||
add(centerOnZeroButton);*/
|
||||
add(centerOnZeroButton);
|
||||
|
||||
//Reset colors
|
||||
final JColorButton resetColorButton = new JColorButton(color, true, false);
|
||||
resetColorButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.resetColors"));
|
||||
resetColorButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
color = resetColorButton.getColor();
|
||||
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
|
||||
@@ -130,10 +108,10 @@ public class ActionsToolbar extends JToolBar {
|
||||
|
||||
//Reset sizes
|
||||
final JButton resetSizeButton = new JButton();
|
||||
resetSizeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/resetSize.png")));
|
||||
resetSizeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/resetSize.png")));
|
||||
resetSizeButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.resetSizes"));
|
||||
resetSizeButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
|
||||
Graph graph = gc.getModel().getGraphVisible();
|
||||
@@ -162,10 +140,10 @@ public class ActionsToolbar extends JToolBar {
|
||||
|
||||
//Reset label colors
|
||||
final JButton resetLabelColorButton = new JButton();
|
||||
resetLabelColorButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/resetLabelColor.png")));
|
||||
resetLabelColorButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/resetLabelColor.png")));
|
||||
resetLabelColorButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.resetLabelColors"));
|
||||
resetLabelColorButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
|
||||
Graph graph = gc.getModel().getGraphVisible();
|
||||
@@ -181,10 +159,10 @@ public class ActionsToolbar extends JToolBar {
|
||||
|
||||
//Reset label colors
|
||||
final JButton resetLabelVisibleButton = new JButton();
|
||||
resetLabelVisibleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/resetLabelVisible.png")));
|
||||
resetLabelVisibleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/resetLabelVisible.png")));
|
||||
resetLabelVisibleButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.resetLabelVisible"));
|
||||
resetLabelVisibleButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
|
||||
Graph graph = gc.getModel().getGraphVisible();
|
||||
@@ -200,10 +178,10 @@ public class ActionsToolbar extends JToolBar {
|
||||
|
||||
//Reset label size
|
||||
JButton resetLabelSizeButton = new JButton();
|
||||
resetLabelSizeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/resetLabelSize.png")));
|
||||
resetLabelSizeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/resetLabelSize.png")));
|
||||
resetLabelSizeButton.setToolTipText(NbBundle.getMessage(ActionsToolbar.class, "ActionsToolbar.resetLabelSizes"));
|
||||
resetLabelSizeButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
|
||||
Graph graph = gc.getModel().getGraphVisible();
|
||||
@@ -226,7 +204,7 @@ public class ActionsToolbar extends JToolBar {
|
||||
@Override
|
||||
public void setEnabled(final boolean enabled) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (Component c : getComponents()) {
|
||||
c.setEnabled(enabled);
|
||||
@@ -0,0 +1,251 @@
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="repeatComboBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="colorButton" alignment="0" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="fileBrowseButton" alignment="0" min="-2" pref="102" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="75" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sizeComboBox" alignment="0" min="-2" pref="104" max="-2" attributes="1"/>
|
||||
<Component id="positionComboBox" alignment="0" min="-2" pref="104" max="-2" attributes="1"/>
|
||||
<Component id="attachmentComboBox" alignment="0" min="-2" pref="104" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="sizeTextField" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="positionTextField" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="positionSetVectorButton" alignment="0" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Component id="sizeSetVectorButton" alignment="0" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="54" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="attachmentComboBox" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="colorButton" alignment="2" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel7" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="positionTextField" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="positionComboBox" alignment="2" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Component id="positionSetVectorButton" alignment="2" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" alignment="2" min="-2" pref="14" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="fileBrowseButton" alignment="2" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="sizeTextField" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="sizeComboBox" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="repeatComboBox" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="sizeSetVectorButton" alignment="2" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="15" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.color" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.file" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.repeat" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.attachment" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.position" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.size" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="colorButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.colorButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JColorButton(Color.WHITE)"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="fileBrowseButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.fileBrowseButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="repeatComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="attachmentComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="positionComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="sizeComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="positionTextField">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="6"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.positionTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new VectorTextField()"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="sizeTextField">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="6"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.sizeTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new VectorTextField()"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="positionSetVectorButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.positionSetVectorButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="sizeSetVectorButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.sizeSetVectorButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="BackgroundSettingsPanel.parameters" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,443 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Vojtech Bardiovsky <vojtech.bardiovsky@gmail.com>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.io.File;
|
||||
import javax.swing.ComboBoxModel;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JTextField;
|
||||
import org.gephi.math.Vec2;
|
||||
import org.gephi.ui.components.JColorButton;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.rendering.background.Background;
|
||||
import org.gephi.visualization.api.rendering.background.BackgroundAttachment;
|
||||
import org.gephi.visualization.api.rendering.background.BackgroundPosition;
|
||||
import org.gephi.visualization.api.rendering.background.BackgroundRepeat;
|
||||
import org.gephi.visualization.api.rendering.background.BackgroundSize;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.openide.DialogDescriptor;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
/**
|
||||
* @author Vojtech Bardiovsky
|
||||
*/
|
||||
public class BackgroundSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
private File selectedFile;
|
||||
|
||||
/** Creates new form BackgroundPanel */
|
||||
public BackgroundSettingsPanel() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("init")) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals(VizConfig.BACKGROUND)) {
|
||||
refreshSharedConfig();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
((JColorButton) colorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().getColor().equals(((JColorButton) colorButton).getColor())) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
fileBrowseButton.addActionListener(new ActionListener() {
|
||||
private final String LAST_PATH = "BackgroundSettingsPanel.lastPath";
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final String path = NbPreferences.forModule(BackgroundSettingsPanel.class).get(LAST_PATH, null);
|
||||
JFileChooser fileChooser = new JFileChooser(path);
|
||||
if (fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == JFileChooser.APPROVE_OPTION) {
|
||||
selectedFile = fileChooser.getSelectedFile();
|
||||
NbPreferences.forModule(BackgroundSettingsPanel.class).put(LAST_PATH, selectedFile.getAbsolutePath());
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!selectedFile.getAbsolutePath().equals(vizModel.getBackground().image)) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ComboBoxModel repeatComboBoxModel = new DefaultComboBoxModel(BackgroundRepeat.values());
|
||||
repeatComboBox.setModel(repeatComboBoxModel);
|
||||
repeatComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().repeat.equals((BackgroundRepeat) repeatComboBox.getSelectedItem())) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ComboBoxModel attachmentComboBoxModel = new DefaultComboBoxModel(BackgroundAttachment.values());
|
||||
attachmentComboBox.setModel(attachmentComboBoxModel);
|
||||
attachmentComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().attachment.equals((BackgroundAttachment) attachmentComboBox.getSelectedItem())) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ComboBoxModel positionComboBoxModel = new DefaultComboBoxModel(BackgroundPosition.Mode.values());
|
||||
positionComboBox.setModel(positionComboBoxModel);
|
||||
positionComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().position.mode.equals((BackgroundPosition.Mode) positionComboBox.getSelectedItem())) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
positionTextField.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!((VectorTextField) positionTextField).getVector().equals(vizModel.getBackground().position.parameter)) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
positionSetVectorButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VectorInputPanel panel = new VectorInputPanel();
|
||||
Vec2 vector = ((VectorTextField) positionTextField).getVector();
|
||||
panel.setup((int) vector.x(), (int) vector.y());
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(VizBarController.class, "VectorInputPanel.label"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
if (DialogDisplayer.getDefault().notify(dd).equals(NotifyDescriptor.OK_OPTION)) {
|
||||
((VectorTextField) positionTextField).setup(panel.unsetup());
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ComboBoxModel sizeComboBoxModel = new DefaultComboBoxModel(BackgroundSize.Mode.values());
|
||||
sizeComboBox.setModel(sizeComboBoxModel);
|
||||
sizeComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().size.mode.equals((BackgroundSize.Mode) sizeComboBox.getSelectedItem())) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sizeTextField.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!((VectorTextField) sizeTextField).getVector().equals(vizModel.getBackground().size.parameter)) {
|
||||
vizModel.setBackground(extractBackground());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sizeSetVectorButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VectorInputPanel panel = new VectorInputPanel();
|
||||
Vec2 vector = ((VectorTextField) sizeTextField).getVector();
|
||||
panel.setup((int) vector.x(), (int) vector.y());
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(VizBarController.class, "VectorInputPanel.label"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
if (DialogDisplayer.getDefault().notify(dd).equals(NotifyDescriptor.OK_OPTION)) {
|
||||
((VectorTextField) sizeTextField).setup(panel.unsetup());
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
refreshSharedConfig();
|
||||
}
|
||||
|
||||
private Background extractBackground() {
|
||||
return new Background(((JColorButton) colorButton).getColor(),
|
||||
selectedFile == null ? null : selectedFile.getAbsolutePath(),
|
||||
new BackgroundPosition((BackgroundPosition.Mode) positionComboBox.getSelectedItem(),
|
||||
((VectorTextField) positionTextField).getVector()),
|
||||
new BackgroundSize((BackgroundSize.Mode) sizeComboBox.getSelectedItem(),
|
||||
((VectorTextField) sizeTextField).getVector()),
|
||||
(BackgroundRepeat) repeatComboBox.getSelectedItem(),
|
||||
(BackgroundAttachment) attachmentComboBox.getSelectedItem());
|
||||
}
|
||||
|
||||
private void refreshSharedConfig() {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
setEnable(!vizModel.isDefaultModel());
|
||||
if (vizModel.isDefaultModel()) {
|
||||
return;
|
||||
}
|
||||
if (!vizModel.getBackground().getColor().equals(((JColorButton) colorButton).getColor())) {
|
||||
((JColorButton) colorButton).setColor(vizModel.getBackground().getColor());
|
||||
}
|
||||
if (selectedFile == null) {
|
||||
if (vizModel.getBackground().image != null) {
|
||||
selectedFile = new File(vizModel.getBackground().image);
|
||||
}
|
||||
} else {
|
||||
if (vizModel.getBackground().image == null) {
|
||||
selectedFile = null;
|
||||
} else if (selectedFile.getAbsolutePath().equals(vizModel.getBackground().image)) {
|
||||
selectedFile = new File(vizModel.getBackground().image);
|
||||
}
|
||||
}
|
||||
if (!vizModel.getBackground().repeat.equals((BackgroundRepeat) repeatComboBox.getSelectedItem())) {
|
||||
repeatComboBox.setSelectedItem(vizModel.getBackground().repeat);
|
||||
}
|
||||
if (!vizModel.getBackground().attachment.equals((BackgroundAttachment) attachmentComboBox.getSelectedItem())) {
|
||||
attachmentComboBox.setSelectedItem(vizModel.getBackground().attachment);
|
||||
}
|
||||
if (!vizModel.getBackground().position.mode.equals((BackgroundPosition.Mode) positionComboBox.getSelectedItem())) {
|
||||
positionComboBox.setSelectedItem(vizModel.getBackground().position.mode);
|
||||
}
|
||||
if (!((VectorTextField) positionTextField).getVector().equals(vizModel.getBackground().position.parameter)) {
|
||||
((VectorTextField) positionTextField).setup(vizModel.getBackground().position.parameter);
|
||||
}
|
||||
if (!vizModel.getBackground().size.mode.equals((BackgroundSize.Mode) sizeComboBox.getSelectedItem())) {
|
||||
sizeComboBox.setSelectedItem(vizModel.getBackground().size.mode);
|
||||
}
|
||||
if (!((VectorTextField) sizeTextField).getVector().equals(vizModel.getBackground().size.parameter)) {
|
||||
((VectorTextField) sizeTextField).setup(vizModel.getBackground().size.parameter);
|
||||
}
|
||||
}
|
||||
|
||||
private void setEnable(boolean enable) {
|
||||
attachmentComboBox.setEnabled(enable);
|
||||
colorButton.setEnabled(enable);
|
||||
fileBrowseButton.setEnabled(enable);
|
||||
positionComboBox.setEnabled(enable);
|
||||
positionSetVectorButton.setEnabled(enable);
|
||||
positionTextField.setEnabled(enable);
|
||||
repeatComboBox.setEnabled(enable);
|
||||
sizeComboBox.setEnabled(enable);
|
||||
sizeSetVectorButton.setEnabled(enable);
|
||||
sizeTextField.setEnabled(enable);
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
colorButton = new JColorButton(Color.WHITE);
|
||||
fileBrowseButton = new javax.swing.JButton();
|
||||
repeatComboBox = new javax.swing.JComboBox();
|
||||
attachmentComboBox = new javax.swing.JComboBox();
|
||||
positionComboBox = new javax.swing.JComboBox();
|
||||
sizeComboBox = new javax.swing.JComboBox();
|
||||
positionTextField = new VectorTextField();
|
||||
sizeTextField = new VectorTextField();
|
||||
positionSetVectorButton = new javax.swing.JButton();
|
||||
sizeSetVectorButton = new javax.swing.JButton();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
|
||||
jLabel1.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.color")); // NOI18N
|
||||
|
||||
jLabel2.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.file")); // NOI18N
|
||||
|
||||
jLabel3.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.repeat")); // NOI18N
|
||||
|
||||
jLabel4.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.attachment")); // NOI18N
|
||||
|
||||
jLabel5.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.position")); // NOI18N
|
||||
|
||||
jLabel6.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.size")); // NOI18N
|
||||
|
||||
colorButton.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.colorButton.text")); // NOI18N
|
||||
|
||||
fileBrowseButton.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.fileBrowseButton.text")); // NOI18N
|
||||
|
||||
repeatComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
attachmentComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
positionComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
sizeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
positionTextField.setColumns(6);
|
||||
positionTextField.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.positionTextField.text")); // NOI18N
|
||||
|
||||
sizeTextField.setColumns(6);
|
||||
sizeTextField.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.sizeTextField.text")); // NOI18N
|
||||
|
||||
positionSetVectorButton.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.positionSetVectorButton.text")); // NOI18N
|
||||
|
||||
sizeSetVectorButton.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.sizeSetVectorButton.text")); // NOI18N
|
||||
|
||||
jLabel7.setText(org.openide.util.NbBundle.getMessage(BackgroundSettingsPanel.class, "BackgroundSettingsPanel.parameters")); // 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()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(jLabel2))
|
||||
.addGap(40, 40, 40)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(repeatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(colorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(fileBrowseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(75, 75, 75)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6))
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(positionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(attachmentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(sizeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(positionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(positionSetVectorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sizeSetVectorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(jLabel7))
|
||||
.addContainerGap(54, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(attachmentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(colorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel1))
|
||||
.addComponent(jLabel7))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(positionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(positionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(positionSetVectorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(fileBrowseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(sizeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(sizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(repeatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(sizeSetVectorButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel6))
|
||||
.addContainerGap(15, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox attachmentComboBox;
|
||||
private javax.swing.JButton colorButton;
|
||||
private javax.swing.JButton fileBrowseButton;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JLabel jLabel7;
|
||||
private javax.swing.JComboBox positionComboBox;
|
||||
private javax.swing.JButton positionSetVectorButton;
|
||||
private javax.swing.JTextField positionTextField;
|
||||
private javax.swing.JComboBox repeatComboBox;
|
||||
private javax.swing.JComboBox sizeComboBox;
|
||||
private javax.swing.JButton sizeSetVectorButton;
|
||||
private javax.swing.JTextField sizeTextField;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
||||
class VectorTextField extends JTextField {
|
||||
|
||||
private float x, y;
|
||||
|
||||
public VectorTextField() {
|
||||
refreshText();
|
||||
setEditable(false);
|
||||
}
|
||||
|
||||
public void setup(Vec2 vector) {
|
||||
this.x = vector.x();
|
||||
this.y = vector.y();
|
||||
refreshText();
|
||||
}
|
||||
|
||||
public Vec2 getVector() {
|
||||
return new Vec2(x, y);
|
||||
}
|
||||
|
||||
private void refreshText() {
|
||||
setText("[" + x + ", " + y + "]");
|
||||
//firePropertyChange("text", null, "[" + x + ", " + y + "]");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
CTL_GraphAction=Graph
|
||||
CTL_GraphTopComponent=Graph Window
|
||||
HINT_GraphTopComponent=This is a Graph window
|
||||
|
||||
CTL_GraphAction=Graph
|
||||
CTL_GraphTopComponent=Graph
|
||||
!HINT_GraphTopComponent=
|
||||
@@ -6,7 +10,7 @@ GraphTopComponent.jToggleButton2.TabConstraints.tabTitle=tab2
|
||||
CollapsePanel.extendButton.text=
|
||||
GraphTopComponent.waitingLabel.text=Initializing...
|
||||
|
||||
VizToolbar.Global.background = Background color (left click to switch black-white, right click to choose color)
|
||||
VizToolbar.Global.background = Background color
|
||||
VizToolbar.Global.screenshot = Take screenshot
|
||||
VizToolbar.Global.screenshot.configure = Configure...
|
||||
VizToolbar.Nodes.showLabels = Show Node Labels
|
||||
@@ -23,9 +27,6 @@ VizToolbar.Labels.attributes = Attributes
|
||||
VizToolbar.Labels.fontScale = Font size scale
|
||||
NodeSettingsPanel.adjustTextCheckbox.text=Adjust to text
|
||||
NodeSettingsPanel.labelShape.text=Default shape:
|
||||
NodeSettingsPanel.defaultShape.message3d=This shape is a 3d shape, the engine will be reinitialized. Do you want to proceed ?
|
||||
NodeSettingsPanel.defaultShape.message.title = Default shape
|
||||
NodeSettingsPanel.defaultShape.message2d=This shape is a 2d shape, the engine will be reinitialized. Do you want to proceed ?
|
||||
EdgeSettingsPanel.labelEdgeColor.text=Edge default color:
|
||||
EdgeSettingsPanel.edgeColorButton.text=
|
||||
EdgeSettingsPanel.sourceNodeColorCheckbox.text=Source node color
|
||||
@@ -34,6 +35,10 @@ GlobalSettingsPanel.backgroundColorButton.text=
|
||||
GlobalSettingsPanel.hightlightCheckBox.text=Highlight selection
|
||||
GlobalSettingsPanel.labelBackgroundColor.text=Background color:
|
||||
GlobalSettingsPanel.autoSelectNeigborCheckbox.text=Autoselect neighbor
|
||||
GlobalSettingsPanel.use3dCheckbox.text=Work in 3D
|
||||
GlobalSettingsPanel.mode.message3d=To switch to 3D mode, the engine has to be reinitialized. Do you want to proceed?
|
||||
GlobalSettingsPanel.mode.message.title = Mode change
|
||||
GlobalSettingsPanel.mode.message2d=o switch to 2D mode, the engine has to be reinitialized. Do you want to proceed?
|
||||
LabelSettingsPanel.labelNodeFont.text=Font:
|
||||
LabelSettingsPanel.nodeColorButton.text=
|
||||
LabelSettingsPanel.showNodeLabelsCheckbox.text=Node
|
||||
@@ -50,8 +55,11 @@ LabelSettingsPanel.labelSizeMode.text=Size:
|
||||
LabelSettingsPanel.labelColorMode.text=Color:
|
||||
LabelSettingsPanel.hideNonSelectedCheckbox.text=Hide non-selected
|
||||
SelectionToolbar.rectangle.tooltip = Rectangle selection
|
||||
SelectionToolbar.polygon.tooltip = Polygon selection
|
||||
SelectionToolbar.ellipse.tooltip = Ellipse selection
|
||||
SelectionToolbar.mouse.tooltip = Direct selection
|
||||
SelectionToolbar.drag.tooltip = Drag
|
||||
SelectionToolbar.movement.tooltip = Movement
|
||||
|
||||
ActionsToolbar.centerOnGraph = Center On Graph
|
||||
ActionsToolbar.centerOnZero = Center On Zero
|
||||
@@ -72,6 +80,7 @@ EdgeSettingsPanel.selectionColorCheckbox.toolTipText=Draw particular color for s
|
||||
EdgeSettingsPanel.selectionColorCheckbox.text=Selection color
|
||||
EdgeSettingsPanel.edgeInSelectionColorChooser.toolTipText=Edge IN<- Color
|
||||
NodeSettingsPanel.showHullsCheckbox.text=Show hulls
|
||||
NodeSettingsPanel.browseImage=Image...
|
||||
EdgeSettingsPanel.labelScale.text=Scale
|
||||
EdgeSettingsPanel.labelIn.text=In:
|
||||
EdgeSettingsPanel.labelOut.text=Out:
|
||||
@@ -80,3 +89,44 @@ EdgeSettingsPanel.edgeOutSelectionColorChooser.toolTipText=Edge Out-> Color
|
||||
EdgeSettingsPanel.edgeBothSelectionColorChooser.toolTipText=Edge Both<-> Color
|
||||
GlobalSettingsPanel.labelZoom.text=Zoom
|
||||
EdgeSettingsPanel.labelMetaScale.text=Scale (meta-edge)
|
||||
GraphTopComponent.waitingLabel.text_1=Initializing...
|
||||
BackgroundSettingsPanel.color=Color:
|
||||
BackgroundSettingsPanel.file=File:
|
||||
BackgroundSettingsPanel.repeat=Repeat:
|
||||
BackgroundSettingsPanel.attachment=Attachment:
|
||||
BackgroundSettingsPanel.position=Position:
|
||||
BackgroundSettingsPanel.size=Size:
|
||||
BackgroundSettingsPanel.colorButton.text=
|
||||
BackgroundSettingsPanel.fileBrowseButton.text=Select file...
|
||||
VectorInputPanel.jLabel1.text=x
|
||||
VectorInputPanel.jLabel2.text=y
|
||||
VectorInputPanel.label=Vector input
|
||||
VectorInputPanel.yTextField.text=
|
||||
VectorInputPanel.xTextField.text=
|
||||
BackgroundSettingsPanel.positionSetVectorButton.text=...
|
||||
BackgroundSettingsPanel.sizeSetVectorButton.text=...
|
||||
BackgroundSettingsPanel.positionTextField.text=
|
||||
BackgroundSettingsPanel.sizeTextField.text=
|
||||
|
||||
BackgroundSettingsPanel.parameters=Parameters:
|
||||
ScreenshotMaker.finishedMessage.message = Screenshot saved to ''{0}''
|
||||
ScreenshotMaker.finishedMessage.title = Take screenshot
|
||||
ScreenshotMaker.filechooser.title = Save As...
|
||||
ScreenshotMaker.filechooser.pngDescription = PNG
|
||||
ScreenshotMaker.configure.title = Screenshot settings
|
||||
ScreenshotSettingsPanel.heightTextField.text=
|
||||
ScreenshotSettingsPanel.labelWidth.text=Width:
|
||||
ScreenshotSettingsPanel.labelHeight.text=Height:
|
||||
ScreenshotSettingsPanel.widthTextField.text=
|
||||
ScreenshotSettingsPanel.autoSaveCheckBox.text=Autosave
|
||||
ScreenshotSettingsPanel.selectDirectoryButton.text=Select directory...
|
||||
GlobalSettingsPanel.zoomOutButton.text=
|
||||
GlobalSettingsPanel.zoomInButton.text=
|
||||
|
||||
NodeShapeSelectionPanel.availableImages=Available images:
|
||||
NodeShapeSelectionPanel.newImage=New image...
|
||||
NodeShapeSelectionPanel.title=Select image
|
||||
NodeShapeSelectionPanel.unsupportedImage.title=Format not supported
|
||||
NodeShapeSelectionPanel.unsupportedImage.message=This image format is not supported.
|
||||
|
||||
GraphContextMenu_SetNodeShape = Set shape...
|
||||
@@ -1,11 +1,9 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# Eduardo Ramos <eduramiba@gmail.com>, 2011.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-16 21\:29+0000\nLast-Translator\: eduramiba <eduramiba@gmail.com>\nLanguage-Team\: Spanish (Castilian) (http\://www.transifex.net/projects/p/gephi/team/es/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: es\nPlural-Forms\: nplurals\=2; plural\=(n \!\= 1)\n
|
||||
# Spanish translation for gephi
|
||||
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
|
||||
# This file is distributed under the same license as the gephi package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2010-10-21 13\:58+0000\nLast-Translator\: Eduardo Ramos <Unknown>\nLanguage-Team\: Spanish <es@li.org>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:49+0000\nX-Generator\: Launchpad (build 12559)\n
|
||||
|
||||
CTL_GraphAction=Grafo
|
||||
|
||||
@@ -17,7 +15,7 @@ GraphTopComponent.jToggleButton2.TabConstraints.tabTitle=tab2
|
||||
|
||||
GraphTopComponent.waitingLabel.text=Inicializando...
|
||||
|
||||
VizToolbar.Global.background=Color de fondo (click izquierdo para cambiar negro-blanco, click derecho para escoger color)
|
||||
VizToolbar.Global.background=Color de fondo
|
||||
|
||||
VizToolbar.Global.screenshot=Captura de pantalla
|
||||
|
||||
@@ -63,8 +61,6 @@ EdgeSettingsPanel.sourceNodeColorCheckbox.text=Color del nodo origen
|
||||
|
||||
EdgeSettingsPanel.showEdgesCheckbox.text=Mostrar
|
||||
|
||||
GlobalSettingsPanel.hightlightCheckBox.text=Destacar selecci\u00f3n
|
||||
|
||||
GlobalSettingsPanel.labelBackgroundColor.text=Color de fondo\:
|
||||
|
||||
GlobalSettingsPanel.autoSelectNeigborCheckbox.text=Auto-seleccionar nodos vecinos
|
||||
@@ -148,3 +144,14 @@ EdgeSettingsPanel.edgeBothSelectionColorChooser.toolTipText=Color de arista Bidi
|
||||
GlobalSettingsPanel.labelZoom.text=Zoom
|
||||
|
||||
EdgeSettingsPanel.labelMetaScale.text=Escala (meta-arista)
|
||||
GraphTopComponent.waitingLabel.text_1=Inicializando...
|
||||
|
||||
ScreenshotMaker.finishedMessage.message=Captura de pantalla guardada en ''{0}''
|
||||
ScreenshotMaker.finishedMessage.title=Capturar pantalla
|
||||
ScreenshotMaker.filechooser.title=Guardar como...
|
||||
ScreenshotMaker.filechooser.pngDescription=PNG
|
||||
ScreenshotMaker.configure.title=Par\u00e1metros de captura de pantalla
|
||||
ScreenshotSettingsPanel.labelWidth.text=Ancho\:
|
||||
ScreenshotSettingsPanel.labelHeight.text=Alto\:
|
||||
ScreenshotSettingsPanel.autoSaveCheckBox.text=Autoguardado
|
||||
ScreenshotSettingsPanel.selectDirectoryButton.text=Seleccionar directorio...
|
||||
@@ -1,10 +1,9 @@
|
||||
# Translation file for Gephi.
|
||||
# Copyright (C) 2011 Gephi contributors.
|
||||
# This file is distributed under the same license as the Gephi package.
|
||||
#
|
||||
# Translators:
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
!=Project-Id-Version\: Gephi\nReport-Msgid-Bugs-To\: https\://bugs.launchpad.net/gephi\nPOT-Creation-Date\: 2011-08-05 14\:52+0200\nPO-Revision-Date\: 2011-08-16 21\:28+0000\nLast-Translator\: gephi <sebastien.heymann@gmail.com>\nLanguage-Team\: French (http\://www.transifex.net/projects/p/gephi/team/fr/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: fr\nPlural-Forms\: nplurals\=2; plural\=(n > 1)\n
|
||||
# French translation for gephi
|
||||
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
|
||||
# This file is distributed under the same license as the gephi package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
!=Project-Id-Version\: gephi\nReport-Msgid-Bugs-To\: FULL NAME <EMAIL@ADDRESS>\nPOT-Creation-Date\: 2010-04-07 13\:16+0200\nPO-Revision-Date\: 2011-02-08 20\:49+0000\nLast-Translator\: S\u00e9bastien Heymann <Unknown>\nLanguage-Team\: French <fr@li.org>\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nX-Launchpad-Export-Date\: 2011-03-13 04\:49+0000\nX-Generator\: Launchpad (build 12559)\n
|
||||
|
||||
CTL_GraphAction=Graphe
|
||||
|
||||
@@ -62,8 +61,6 @@ EdgeSettingsPanel.sourceNodeColorCheckbox.text=Couleur du noeud source
|
||||
|
||||
EdgeSettingsPanel.showEdgesCheckbox.text=Afficher
|
||||
|
||||
GlobalSettingsPanel.hightlightCheckBox.text=S\u00e9lection en surbrillance
|
||||
|
||||
GlobalSettingsPanel.labelBackgroundColor.text=Couleur d'arri\u00e8re-plan \:
|
||||
|
||||
GlobalSettingsPanel.autoSelectNeigborCheckbox.text=Voisins s\u00e9lectionn\u00e9s
|
||||
@@ -147,3 +144,14 @@ EdgeSettingsPanel.edgeBothSelectionColorChooser.toolTipText=Couleur de lien E/S<
|
||||
GlobalSettingsPanel.labelZoom.text=Zoom
|
||||
|
||||
EdgeSettingsPanel.labelMetaScale.text=Echelle (m\u00e9ta-liens)
|
||||
GraphTopComponent.waitingLabel.text_1=Initialisation...
|
||||
|
||||
ScreenshotMaker.finishedMessage.message=Capture d'\u00e9cran enregistr\u00e9e dans ''{0}''
|
||||
ScreenshotMaker.finishedMessage.title=Capturer l'\u00e9cran
|
||||
ScreenshotMaker.filechooser.title=Enregistrer sous...
|
||||
ScreenshotMaker.filechooser.pngDescription=PNG
|
||||
ScreenshotMaker.configure.title=Param\u00e8tres de capture d'\u00e9cran
|
||||
ScreenshotSettingsPanel.labelWidth.text=Largeur \:
|
||||
ScreenshotSettingsPanel.labelHeight.text=Hauteur \:
|
||||
ScreenshotSettingsPanel.autoSaveCheckBox.text=Enregistrement automatique
|
||||
ScreenshotSettingsPanel.selectDirectoryButton.text=S\u00e9lectionnez le dossier...
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -70,12 +49,12 @@ public class CollapsePanel extends javax.swing.JPanel {
|
||||
|
||||
this.extended = extended;
|
||||
if (extended) {
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowDown.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowDown_rollover.png"))); // NOI18N
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowDown.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowDown_rollover.png"))); // NOI18N
|
||||
|
||||
} else {
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowUp.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowUp_rollover.png"))); // NOI18N
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowUp.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowUp_rollover.png"))); // NOI18N
|
||||
}
|
||||
extendButton.addActionListener(new ActionListener() {
|
||||
|
||||
@@ -84,11 +63,11 @@ public class CollapsePanel extends javax.swing.JPanel {
|
||||
ext = !ext;
|
||||
CollapsePanel.this.extended = ext;
|
||||
if (ext) {
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowDown.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowDown_rollover.png"))); // NOI18N
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowDown.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowDown_rollover.png"))); // NOI18N
|
||||
} else {
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowUp.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/arrowUp_rollover.png"))); // NOI18N
|
||||
extendButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowUp.png"))); // NOI18N
|
||||
extendButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/arrowUp_rollover.png"))); // NOI18N
|
||||
}
|
||||
extendedPanel.setVisible(ext);
|
||||
getParent().validate();
|
||||
@@ -232,12 +232,12 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="12" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="12" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
@@ -5,44 +5,22 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.color.ColorSpace;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
@@ -52,8 +30,10 @@ import java.beans.PropertyChangeListener;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.gephi.ui.components.JColorButton;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.VizModel;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,29 +47,29 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("init")) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeHasUniColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.EDGE_HAS_UNIQUE_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("showEdges")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SHOW_EDGES)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeUniColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SELECTEDEDGE_HAS_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeSelectionColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SELECTEDNODE_UNIQUE_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeInSelectionColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SELECTEDEDGE_IN_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeOutSelectionColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SELECTEDEDGE_OUT_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeBothSelectionColor")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SELECTEDEDGE_BOTH_COLOR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("edgeScale")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.EDGE_SCALE)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("metaEdgeScale")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.META_EDGE_SCALE)) {
|
||||
refreshSharedConfig();
|
||||
}
|
||||
}
|
||||
@@ -99,7 +79,7 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
showEdgesCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setShowEdges(showEdgesCheckbox.isSelected());
|
||||
setEnable(true);
|
||||
}
|
||||
@@ -107,49 +87,49 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
((JColorButton) edgeColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
vizModel.setEdgeUniColor(((JColorButton) edgeColorButton).getColorArray());
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeUniColor(((JColorButton) edgeColorButton).getColor());
|
||||
}
|
||||
});
|
||||
sourceNodeColorCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeHasUniColor(!sourceNodeColorCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
selectionColorCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeSelectionColor(selectionColorCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
edgeInSelectionColorChooser.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
vizModel.setEdgeInSelectionColor(edgeInSelectionColorChooser.getColor().getComponents(null));
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeInSelectionColor(edgeInSelectionColorChooser.getColor());
|
||||
}
|
||||
});
|
||||
edgeBothSelectionColorChooser.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
vizModel.setEdgeBothSelectionColor(edgeBothSelectionColorChooser.getColor().getComponents(null));
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeBothSelectionColor(edgeBothSelectionColorChooser.getColor());
|
||||
}
|
||||
});
|
||||
edgeOutSelectionColorChooser.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
vizModel.setEdgeOutSelectionColor(edgeOutSelectionColorChooser.getColor().getComponents(null));
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeOutSelectionColor(edgeOutSelectionColorChooser.getColor());
|
||||
}
|
||||
});
|
||||
scaleSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (vizModel.getEdgeScale() != (scaleSlider.getValue() / 10f + 0.1f)) {
|
||||
vizModel.setEdgeScale(scaleSlider.getValue() / 10f + 0.1f);
|
||||
}
|
||||
@@ -158,7 +138,7 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
metaScaleSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
int val = metaScaleSlider.getValue();
|
||||
if (vizModel.getMetaEdgeScale() != (val / 50f + 0.0001f)) {
|
||||
vizModel.setMetaEdgeScale(val / 50f + 0.0001f);
|
||||
@@ -168,7 +148,7 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
private void refreshSharedConfig() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
setEnable(!vizModel.isDefaultModel());
|
||||
if (vizModel.isDefaultModel()) {
|
||||
return;
|
||||
@@ -176,8 +156,8 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
if (showEdgesCheckbox.isSelected() != vizModel.isShowEdges()) {
|
||||
showEdgesCheckbox.setSelected(vizModel.isShowEdges());
|
||||
}
|
||||
float[] edgeCol = vizModel.getEdgeUniColor();
|
||||
((JColorButton) edgeColorButton).setColor(new Color(edgeCol[0], edgeCol[1], edgeCol[2], edgeCol[3]));
|
||||
Color edgeCol = vizModel.getEdgeUniColor();
|
||||
((JColorButton) edgeColorButton).setColor(edgeCol);
|
||||
|
||||
if (sourceNodeColorCheckbox.isSelected() != !vizModel.isEdgeHasUniColor()) {
|
||||
sourceNodeColorCheckbox.setSelected(!vizModel.isEdgeHasUniColor());
|
||||
@@ -185,9 +165,9 @@ public class EdgeSettingsPanel extends javax.swing.JPanel {
|
||||
if (selectionColorCheckbox.isSelected() != vizModel.isEdgeSelectionColor()) {
|
||||
selectionColorCheckbox.setSelected(vizModel.isEdgeSelectionColor());
|
||||
}
|
||||
Color in = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeInSelectionColor(), 1f);
|
||||
Color out = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeOutSelectionColor(), 1f);
|
||||
Color both = new Color(ColorSpace.getInstance(ColorSpace.CS_sRGB), vizModel.getEdgeBothSelectionColor(), 1f);
|
||||
Color in = vizModel.getEdgeInSelectionColor();
|
||||
Color out = vizModel.getEdgeOutSelectionColor();
|
||||
Color both = vizModel.getEdgeBothSelectionColor();
|
||||
if (!edgeInSelectionColorChooser.getColor().equals(in)) {
|
||||
edgeInSelectionColorChooser.setColor(in);
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="autoSelectNeigborCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="hightlightCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="use3dCheckbox" min="-2" pref="77" max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="430" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="hightlightCheckBox" min="-2" pref="25" max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="use3dCheckbox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="autoSelectNeigborCheckbox" alignment="3" min="-2" pref="26" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JCheckBox" name="hightlightCheckBox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/component/Bundle.properties" key="GlobalSettingsPanel.hightlightCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
<Property name="horizontalTextPosition" type="int" value="2"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[2, 0, 2, 2]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="autoSelectNeigborCheckbox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/component/Bundle.properties" key="GlobalSettingsPanel.autoSelectNeigborCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
<Property name="horizontalTextPosition" type="int" value="2"/>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[2, 0, 2, 2]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="use3dCheckbox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="GlobalSettingsPanel.use3dCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="horizontalTextPosition" type="int" value="2"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="labelZoom" min="-2" pref="34" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jToolBar1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="24" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelZoom" alignment="0" pref="30" max="32767" attributes="1"/>
|
||||
<Component id="jToolBar1" alignment="0" pref="30" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JToolBar" name="jToolBar1">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
|
||||
<EmptyBorder bottom="0" left="2" right="2" top="0"/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="floatable" type="boolean" value="false"/>
|
||||
<Property name="opaque" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="zoomOutButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/gephi/desktop/visualization/components/zoomOut.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="GlobalSettingsPanel.zoomOutButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="zoomInButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/gephi/desktop/visualization/components/zoomIn.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="GlobalSettingsPanel.zoomInButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="labelZoom">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="GlobalSettingsPanel.labelZoom.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class GlobalSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
/** Creates new form GlobalSettingsPanel */
|
||||
public GlobalSettingsPanel() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("init")) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals(VizConfig.AUTO_SELECT_NEIGHBOUR)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals(VizConfig.HIGHLIGHT_NON_SELECTED)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals(VizConfig.CAMERA_USE_3D)) {
|
||||
refreshSharedConfig();
|
||||
}
|
||||
}
|
||||
});
|
||||
refreshSharedConfig();
|
||||
hightlightCheckBox.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setHighlightNonSelectedEnabled(hightlightCheckBox.isSelected());
|
||||
}
|
||||
});
|
||||
autoSelectNeigborCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setAutoSelectNeighbor(autoSelectNeigborCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
zoomInButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.getCamera().zoom(-10);
|
||||
}
|
||||
});
|
||||
zoomOutButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.getCamera().zoom(10);
|
||||
}
|
||||
});
|
||||
use3dCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setUse3d(use3dCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshSharedConfig() {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
setEnable(!vizModel.isDefaultModel());
|
||||
if (vizModel.isDefaultModel()) {
|
||||
return;
|
||||
}
|
||||
if (autoSelectNeigborCheckbox.isSelected() != vizModel.isAutoSelectNeighbor()) {
|
||||
autoSelectNeigborCheckbox.setSelected(vizModel.isAutoSelectNeighbor());
|
||||
}
|
||||
if (hightlightCheckBox.isSelected() != vizModel.isHighlightNonSelectedEnabled()) {
|
||||
hightlightCheckBox.setSelected(vizModel.isHighlightNonSelectedEnabled());
|
||||
}
|
||||
if (use3dCheckbox.isSelected() != vizModel.isUse3d()) {
|
||||
use3dCheckbox.setSelected(vizModel.isUse3d());
|
||||
}
|
||||
}
|
||||
|
||||
private void setEnable(boolean enable) {
|
||||
autoSelectNeigborCheckbox.setEnabled(enable);
|
||||
hightlightCheckBox.setEnabled(enable);
|
||||
labelZoom.setEnabled(enable);
|
||||
zoomInButton.setEnabled(enable);
|
||||
zoomOutButton.setEnabled(enable);
|
||||
use3dCheckbox.setEnabled(enable);
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
hightlightCheckBox = new javax.swing.JCheckBox();
|
||||
autoSelectNeigborCheckbox = new javax.swing.JCheckBox();
|
||||
use3dCheckbox = new javax.swing.JCheckBox();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jToolBar1 = new javax.swing.JToolBar();
|
||||
zoomOutButton = new javax.swing.JButton();
|
||||
zoomInButton = new javax.swing.JButton();
|
||||
labelZoom = new javax.swing.JLabel();
|
||||
|
||||
hightlightCheckBox.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.hightlightCheckBox.text")); // NOI18N
|
||||
hightlightCheckBox.setBorder(null);
|
||||
hightlightCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||
hightlightCheckBox.setMargin(new java.awt.Insets(2, 0, 2, 2));
|
||||
|
||||
autoSelectNeigborCheckbox.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.autoSelectNeigborCheckbox.text")); // NOI18N
|
||||
autoSelectNeigborCheckbox.setBorder(null);
|
||||
autoSelectNeigborCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||
autoSelectNeigborCheckbox.setMargin(new java.awt.Insets(2, 0, 2, 2));
|
||||
|
||||
use3dCheckbox.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.use3dCheckbox.text")); // NOI18N
|
||||
use3dCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||
|
||||
jToolBar1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 2, 0, 2));
|
||||
jToolBar1.setFloatable(false);
|
||||
jToolBar1.setOpaque(false);
|
||||
|
||||
zoomOutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/zoomOut.png"))); // NOI18N
|
||||
zoomOutButton.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.zoomOutButton.text")); // NOI18N
|
||||
zoomOutButton.setFocusable(false);
|
||||
zoomOutButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
zoomOutButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
jToolBar1.add(zoomOutButton);
|
||||
|
||||
zoomInButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/zoomIn.png"))); // NOI18N
|
||||
zoomInButton.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.zoomInButton.text")); // NOI18N
|
||||
zoomInButton.setFocusable(false);
|
||||
zoomInButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
zoomInButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
jToolBar1.add(zoomInButton);
|
||||
|
||||
labelZoom.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.labelZoom.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(labelZoom, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelZoom, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
|
||||
.addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
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()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(autoSelectNeigborCheckbox)
|
||||
.addComponent(hightlightCheckBox))
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(use3dCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(430, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(hightlightCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(use3dCheckbox)
|
||||
.addComponent(autoSelectNeigborCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JCheckBox autoSelectNeigborCheckbox;
|
||||
private javax.swing.JCheckBox hightlightCheckBox;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JToolBar jToolBar1;
|
||||
private javax.swing.JLabel labelZoom;
|
||||
private javax.swing.JCheckBox use3dCheckbox;
|
||||
private javax.swing.JButton zoomInButton;
|
||||
private javax.swing.JButton zoomOutButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/component/Bundle.properties" key="GraphTopComponent.waitingLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="GraphTopComponent.waitingLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="verticalAlignment" type="int" value="1"/>
|
||||
</Properties>
|
||||
@@ -32,7 +32,7 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="org.gephi.visualization.component.CollapsePanel" name="collapsePanel">
|
||||
<Component class="org.gephi.desktop.visualization.components.CollapsePanel" name="collapsePanel">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Last"/>
|
||||
@@ -1,142 +1,131 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
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.visualization.component;
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import org.gephi.desktop.visualization.spi.PropertiesBarAddon;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.AWTEventListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.ToolTipManager;
|
||||
import javax.swing.UIManager;
|
||||
import org.gephi.datalab.api.DataLaboratoryHelper;
|
||||
import org.gephi.datalab.spi.ContextMenuItemManipulator;
|
||||
import org.gephi.project.api.ProjectController;
|
||||
import org.gephi.tools.api.ToolController;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.apiimpl.PropertiesBarAddon;
|
||||
import org.gephi.visualization.opengl.AbstractEngine;
|
||||
import org.gephi.visualization.swing.GraphDrawableImpl;
|
||||
import org.gephi.project.api.Workspace;
|
||||
import org.gephi.project.api.WorkspaceListener;
|
||||
import org.gephi.visualization.bridge.DHNSEventBridge;
|
||||
import org.gephi.visualization.spi.GraphContextMenuItem;
|
||||
import org.openide.util.Lookup;
|
||||
import org.gephi.tools.api.ToolController;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.TopComponent;
|
||||
import org.openide.windows.WindowManager;
|
||||
//import org.openide.util.ImageUtilities;
|
||||
import org.netbeans.api.settings.ConvertAsProperties;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
/**
|
||||
* Top component for visualization.
|
||||
*/
|
||||
@ConvertAsProperties(dtd = "-//org.gephi.visualization.components//Graph//EN", autostore = false)
|
||||
public final class GraphTopComponent extends TopComponent {
|
||||
|
||||
private static GraphTopComponent instance;
|
||||
/** path to the icon used by the component and its open action */
|
||||
// static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";
|
||||
private static final String PREFERRED_ID = "GraphTopComponent";
|
||||
private AbstractEngine engine;
|
||||
private VizBarController vizBarController;
|
||||
private final DHNSEventBridge eventBridge;
|
||||
private Map<Integer, ContextMenuItemManipulator> keyActionMappings = new HashMap<Integer, ContextMenuItemManipulator>();
|
||||
|
||||
private GraphTopComponent() {
|
||||
private final VisualizationController controller;
|
||||
|
||||
public GraphTopComponent() {
|
||||
initComponents();
|
||||
|
||||
setName(NbBundle.getMessage(GraphTopComponent.class, "CTL_GraphTopComponent"));
|
||||
// setToolTipText(NbBundle.getMessage(GraphTopComponent.class, "HINT_GraphTopComponent"));
|
||||
// setIcon(Utilities.loadImage(ICON_PATH, true));
|
||||
setToolTipText(NbBundle.getMessage(GraphTopComponent.class, "HINT_GraphTopComponent"));
|
||||
// setIcon(ImageUtilities.loadImage(ICON_PATH, true));
|
||||
|
||||
engine = VizController.getInstance().getEngine();
|
||||
eventBridge = (DHNSEventBridge) VizController.getInstance().getEventBridge();
|
||||
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
|
||||
ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
|
||||
|
||||
this.controller = Lookup.getDefault().lookup(VisualizationController.class);
|
||||
|
||||
//Init
|
||||
initCollapsePanel();
|
||||
initToolPanels();
|
||||
final GraphDrawableImpl drawable = VizController.getInstance().getDrawable();
|
||||
|
||||
//Request component activation and therefore initialize JOGL component
|
||||
final Component canvas = controller.getViewComponent();
|
||||
|
||||
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
open();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
requestActive();
|
||||
add(drawable.getGraphComponent(), BorderLayout.CENTER);
|
||||
remove(waitingLabel);
|
||||
}
|
||||
});
|
||||
requestActive();
|
||||
add(canvas, BorderLayout.CENTER);
|
||||
remove(waitingLabel);
|
||||
canvas.setVisible(true);
|
||||
}
|
||||
});
|
||||
initKeyEventContextMenuActionMappings();
|
||||
//remove(waitingLabel);
|
||||
//add(drawable.getGraphComponent(), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
private void initCollapsePanel() {
|
||||
vizBarController = new VizBarController();
|
||||
if (VizController.getInstance().getVizConfig().isShowVizVar()) {
|
||||
collapsePanel.init(vizBarController.getToolbar(), vizBarController.getExtendedBar(), false);
|
||||
} else {
|
||||
collapsePanel.setVisible(false);
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
waitingLabel = new javax.swing.JLabel();
|
||||
collapsePanel = new org.gephi.desktop.visualization.components.CollapsePanel();
|
||||
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
waitingLabel.setBackground(new java.awt.Color(255, 255, 255));
|
||||
org.openide.awt.Mnemonics.setLocalizedText(waitingLabel, org.openide.util.NbBundle.getMessage(GraphTopComponent.class, "GraphTopComponent.waitingLabel.text")); // NOI18N
|
||||
waitingLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
|
||||
add(waitingLabel, java.awt.BorderLayout.CENTER);
|
||||
add(collapsePanel, java.awt.BorderLayout.PAGE_END);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private org.gephi.desktop.visualization.components.CollapsePanel collapsePanel;
|
||||
private javax.swing.JLabel waitingLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
/**
|
||||
* Gets default instance. Do not use directly: reserved for *.settings files only,
|
||||
* i.e. deserialization routines; otherwise you could get a non-deserialized instance.
|
||||
* To obtain the singleton instance, use {@link #findInstance}.
|
||||
*/
|
||||
public static synchronized GraphTopComponent getDefault() {
|
||||
if (instance == null) {
|
||||
instance = new GraphTopComponent();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private VizBarController vizBarController;
|
||||
private SelectionToolbar selectionToolbar;
|
||||
private ActionsToolbar actionsToolbar;
|
||||
private JComponent toolbar;
|
||||
private JComponent propertiesBar;
|
||||
private AddonsBar addonsBar;
|
||||
|
||||
private void initCollapsePanel() {
|
||||
vizBarController = new VizBarController();
|
||||
if (Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getConfig().getBooleanProperty(VizConfig.VIZBAR)) {
|
||||
collapsePanel.init(vizBarController.getToolbar(), vizBarController.getExtendedBar(), false);
|
||||
} else {
|
||||
collapsePanel.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void initToolPanels() {
|
||||
ToolController tc = Lookup.getDefault().lookup(ToolController.class);
|
||||
if (tc != null) {
|
||||
if (VizController.getInstance().getVizConfig().isToolbar()) {
|
||||
VizConfig vizConfig = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getConfig();
|
||||
if (vizConfig.getBooleanProperty(VizConfig.TOOLBAR)) {
|
||||
JPanel westPanel = new JPanel(new BorderLayout(0, 0));
|
||||
if (UIUtils.isAquaLookAndFeel()) {
|
||||
westPanel.setBackground(UIManager.getColor("NbExplorerView.background"));
|
||||
@@ -154,7 +143,7 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
add(westPanel, BorderLayout.WEST);
|
||||
}
|
||||
|
||||
if (VizController.getInstance().getVizConfig().isPropertiesbar()) {
|
||||
if (vizConfig.getBooleanProperty(VizConfig.PROPERTIES_BAR)) {
|
||||
JPanel northBar = new JPanel(new BorderLayout());
|
||||
if (UIUtils.isAquaLookAndFeel()) {
|
||||
northBar.setBackground(UIManager.getColor("NbExplorerView.background"));
|
||||
@@ -176,9 +165,11 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
|
||||
projectController.addWorkspaceListener(new WorkspaceListener() {
|
||||
|
||||
@Override
|
||||
public void initialize(Workspace workspace) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select(Workspace workspace) {
|
||||
toolbar.setEnabled(true);
|
||||
propertiesBar.setEnabled(true);
|
||||
@@ -187,12 +178,15 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
addonsBar.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unselect(Workspace workspace) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(Workspace workspace) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable() {
|
||||
toolbar.setEnabled(false);
|
||||
propertiesBar.setEnabled(false);
|
||||
@@ -210,81 +204,6 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
addonsBar.setEnabled(hasWorkspace);
|
||||
}
|
||||
|
||||
private void initKeyEventContextMenuActionMappings() {
|
||||
mapItems(Lookup.getDefault().lookupAll(GraphContextMenuItem.class).toArray(new GraphContextMenuItem[0]));
|
||||
}
|
||||
|
||||
private void mapItems(ContextMenuItemManipulator[] items) {
|
||||
Integer key;
|
||||
ContextMenuItemManipulator[] subItems;
|
||||
for (ContextMenuItemManipulator item : items) {
|
||||
key = item.getMnemonicKey();
|
||||
if (key != null) {
|
||||
if (!keyActionMappings.containsKey(key)) {
|
||||
keyActionMappings.put(key, item);
|
||||
}
|
||||
}
|
||||
subItems = item.getSubItems();
|
||||
if (subItems != null) {
|
||||
mapItems(subItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For attending Ctrl+Key events in graph window to launch context menu actions
|
||||
*/
|
||||
public void eventDispatched(AWTEvent event) {
|
||||
KeyEvent evt = (KeyEvent) event;
|
||||
|
||||
if (evt.getID() == KeyEvent.KEY_RELEASED && (evt.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) == KeyEvent.CTRL_DOWN_MASK) {
|
||||
final ContextMenuItemManipulator item = keyActionMappings.get(evt.getKeyCode());
|
||||
if (item != null) {
|
||||
((GraphContextMenuItem) item).setup(eventBridge.getGraph(), eventBridge.getSelectedNodes());
|
||||
if (item.isAvailable() && item.canExecute()) {
|
||||
DataLaboratoryHelper.getDefault().executeManipulator(item);
|
||||
}
|
||||
evt.consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
waitingLabel = new javax.swing.JLabel();
|
||||
collapsePanel = new org.gephi.visualization.component.CollapsePanel();
|
||||
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
waitingLabel.setBackground(new java.awt.Color(255, 255, 255));
|
||||
org.openide.awt.Mnemonics.setLocalizedText(waitingLabel, org.openide.util.NbBundle.getMessage(GraphTopComponent.class, "GraphTopComponent.waitingLabel.text")); // NOI18N
|
||||
waitingLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
|
||||
add(waitingLabel, java.awt.BorderLayout.CENTER);
|
||||
add(collapsePanel, java.awt.BorderLayout.PAGE_END);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private org.gephi.visualization.component.CollapsePanel collapsePanel;
|
||||
private javax.swing.JLabel waitingLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
/**
|
||||
* Gets default instance. Do not use directly: reserved for *.settings files only,
|
||||
* i.e. deserialization routines; otherwise you could get a non-deserialized instance.
|
||||
* To obtain the singleton instance, use {@link #findInstance}.
|
||||
*/
|
||||
public static synchronized GraphTopComponent getDefault() {
|
||||
if (instance == null) {
|
||||
instance = new GraphTopComponent();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the GraphTopComponent instance. Never call {@link #getDefault} directly!
|
||||
*/
|
||||
@@ -312,38 +231,44 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
@Override
|
||||
protected void componentShowing() {
|
||||
super.componentShowing();
|
||||
engine.startDisplay();
|
||||
this.validateTree();
|
||||
this.controller.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void componentHidden() {
|
||||
super.componentHidden();
|
||||
engine.stopDisplay();
|
||||
this.controller.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentOpened() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void componentActivated() {
|
||||
java.awt.Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void componentDeactivated() {
|
||||
java.awt.Toolkit.getDefaultToolkit().removeAWTEventListener(this);
|
||||
// TODO add custom code on component opening
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentClosed() {
|
||||
engine.stopDisplay();
|
||||
this.controller.stop();
|
||||
}
|
||||
|
||||
/** replaces this in object stream */
|
||||
@Override
|
||||
public Object writeReplace() {
|
||||
return new ResolvableHelper();
|
||||
void writeProperties(java.util.Properties p) {
|
||||
// better to version settings since initial version as advocated at
|
||||
// http://wiki.apidesign.org/wiki/PropertyFiles
|
||||
p.setProperty("version", "1.0");
|
||||
// TODO store your settings
|
||||
}
|
||||
|
||||
Object readProperties(java.util.Properties p) {
|
||||
if (instance == null) {
|
||||
instance = this;
|
||||
}
|
||||
instance.readPropertiesImpl(p);
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void readPropertiesImpl(java.util.Properties p) {
|
||||
String version = p.getProperty("version");
|
||||
// TODO read your settings according to their version
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -351,15 +276,6 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
return PREFERRED_ID;
|
||||
}
|
||||
|
||||
final static class ResolvableHelper implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Object readResolve() {
|
||||
return GraphTopComponent.getDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AddonsBar extends JPanel {
|
||||
|
||||
public AddonsBar() {
|
||||
@@ -370,6 +286,7 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
public void setEnabled(final boolean enabled) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (Component c : getComponents()) {
|
||||
c.setEnabled(enabled);
|
||||
@@ -378,4 +295,5 @@ final class GraphTopComponent extends TopComponent implements AWTEventListener {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?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="elementButtonGroup">
|
||||
</Component>
|
||||
</NonVisualComponents>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,19,0,0,1,83"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
@@ -26,7 +23,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="contentScrollPane" alignment="0" pref="319" max="32767" attributes="0"/>
|
||||
<Component id="contentScrollPane" alignment="0" pref="919" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="controlPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="94" max="32767" attributes="0"/>
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -54,7 +33,7 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.gephi.data.attributes.api.AttributeColumn;
|
||||
import org.gephi.data.attributes.api.AttributeController;
|
||||
import org.gephi.data.attributes.api.AttributeOrigin;
|
||||
import org.gephi.visualization.opengl.text.TextModel;
|
||||
import org.gephi.visualization.api.vizmodel.TextModel;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
@@ -47,10 +47,10 @@
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jSeparator1" alignment="0" pref="136" max="32767" attributes="1"/>
|
||||
<Component id="jSeparator1" alignment="0" pref="146" max="32767" attributes="1"/>
|
||||
<Component id="nodePanel" alignment="0" max="32767" attributes="1"/>
|
||||
<Component id="edgePanel" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator2" alignment="0" pref="136" max="32767" attributes="1"/>
|
||||
<Component id="jSeparator2" alignment="0" pref="146" max="32767" attributes="1"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@@ -64,12 +64,12 @@
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="hideNonSelectedCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="44" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="63" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="configureLabelsButton" min="-2" pref="46" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="84" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="89" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -86,7 +86,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="showNodeLabelsCheckbox" min="-2" pref="97" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="163" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="476" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
@@ -117,7 +117,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="showNodeLabelsCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="112" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="120" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
@@ -138,7 +138,7 @@
|
||||
<Component id="nodeSizeSlider" min="-2" pref="34" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="50" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="52" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -403,7 +403,7 @@
|
||||
<Font name="Tahoma" size="10" style="0"/>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/gephi/visualization/component/configureLabels.png"/>
|
||||
<Image iconType="3" name="/org/gephi/desktop/visualization/components/configureLabels.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/component/Bundle.properties" key="LabelSettingsPanel.configureLabelsButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import com.connectina.swing.fontchooser.JFontChooser;
|
||||
import java.awt.Color;
|
||||
@@ -50,19 +29,16 @@ import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.gephi.ui.components.JColorButton;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.VizModel;
|
||||
import org.gephi.visualization.opengl.text.ColorMode;
|
||||
import org.gephi.visualization.opengl.text.SizeMode;
|
||||
import org.gephi.visualization.opengl.text.TextManager;
|
||||
import org.gephi.visualization.opengl.text.TextModel;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.vizmodel.TextModel;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.openide.DialogDescriptor;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
@@ -80,7 +56,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
TextModel model = vizModel.getTextModel();
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
@@ -96,7 +72,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
boolean value = showNodeLabelsCheckbox.isSelected();
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (value != model.isShowNodeLabels()) {
|
||||
model.setShowNodeLabels(value);
|
||||
setEnable(true);
|
||||
@@ -106,7 +82,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
nodeFontButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
Font font = JFontChooser.showDialog(WindowManager.getDefault().getMainWindow(), model.getNodeFont());
|
||||
if (font != null && font != model.getNodeFont()) {
|
||||
model.setNodeFont(font);
|
||||
@@ -116,7 +92,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
((JColorButton) nodeColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (!model.getNodeColor().equals(((JColorButton) nodeColorButton).getColor())) {
|
||||
model.setNodeColor(((JColorButton) nodeColorButton).getColor());
|
||||
}
|
||||
@@ -126,7 +102,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
nodeSizeSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (model.getNodeSizeFactor() != nodeSizeSlider.getValue() / 100f) {
|
||||
model.setNodeSizeFactor(nodeSizeSlider.getValue() / 100f);
|
||||
}
|
||||
@@ -138,7 +114,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
boolean value = showEdgeLabelsCheckbox.isSelected();
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (value != model.isShowEdgeLabels()) {
|
||||
model.setShowEdgeLabels(value);
|
||||
setEnable(true);
|
||||
@@ -148,7 +124,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
edgeFontButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
Font font = JFontChooser.showDialog(WindowManager.getDefault().getMainWindow(), model.getEdgeFont());
|
||||
if (font != null && font != model.getEdgeFont()) {
|
||||
model.setEdgeFont(font);
|
||||
@@ -158,7 +134,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
((JColorButton) edgeColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (!model.getEdgeColor().equals(((JColorButton) edgeColorButton).getColor())) {
|
||||
model.setEdgeColor(((JColorButton) edgeColorButton).getColor());
|
||||
}
|
||||
@@ -167,13 +143,14 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
edgeSizeSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
model.setEdgeSizeFactor(edgeSizeSlider.getValue() / 100f);
|
||||
}
|
||||
});
|
||||
|
||||
//General
|
||||
final TextManager textManager = VizController.getInstance().getTextManager();
|
||||
// TODO include
|
||||
/*final TextManager textManager = VizController.getInstance().getTextManager();
|
||||
final DefaultComboBoxModel sizeModeModel = new DefaultComboBoxModel(textManager.getSizeModes());
|
||||
sizeModeCombo.setModel(sizeModeModel);
|
||||
final DefaultComboBoxModel colorModeModel = new DefaultComboBoxModel(textManager.getColorModes());
|
||||
@@ -195,11 +172,11 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
model.setColorMode((ColorMode) colorModeModel.getSelectedItem());
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
hideNonSelectedCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (model.isSelectedOnly() != hideNonSelectedCheckbox.isSelected()) {
|
||||
model.setSelectedOnly(hideNonSelectedCheckbox.isSelected());
|
||||
}
|
||||
@@ -210,7 +187,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
configureLabelsButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
LabelAttributesPanel panel = new LabelAttributesPanel();
|
||||
panel.setup(model);
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(VizBarController.class, "LabelAttributesPanel.title"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
@@ -232,7 +209,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
private void refreshSharedConfig() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
setEnable(!vizModel.isDefaultModel());
|
||||
if (vizModel.isDefaultModel()) {
|
||||
return;
|
||||
@@ -263,12 +240,14 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
if (hideNonSelectedCheckbox.isSelected() != model.isSelectedOnly()) {
|
||||
hideNonSelectedCheckbox.setSelected(model.isSelectedOnly());
|
||||
}
|
||||
// TODO include
|
||||
/*
|
||||
if (sizeModeCombo.getSelectedItem() != model.getSizeMode()) {
|
||||
sizeModeCombo.setSelectedItem(model.getSizeMode());
|
||||
}
|
||||
if (colorModeCombo.getSelectedItem() != model.getColorMode()) {
|
||||
colorModeCombo.setSelectedItem(model.getColorMode());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
@@ -281,7 +260,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
labelSizeMode.setEnabled(enable);
|
||||
configureLabelsButton.setEnabled(enable);
|
||||
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
boolean edgeValue = model.isShowEdgeLabels();
|
||||
edgeFontButton.setEnabled(enable && edgeValue);
|
||||
edgeColorButton.setEnabled(enable && edgeValue);
|
||||
@@ -359,7 +338,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(showNodeLabelsCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(163, Short.MAX_VALUE))
|
||||
.addContainerGap(476, Short.MAX_VALUE))
|
||||
.addGroup(nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
@@ -383,7 +362,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(showNodeLabelsCheckbox)
|
||||
.addContainerGap(112, Short.MAX_VALUE))
|
||||
.addContainerGap(120, Short.MAX_VALUE))
|
||||
.addGroup(nodePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addGap(31, 31, 31)
|
||||
@@ -399,7 +378,7 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
.addGroup(nodePanelLayout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(nodeSizeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(50, Short.MAX_VALUE)))
|
||||
.addContainerGap(52, Short.MAX_VALUE)))
|
||||
);
|
||||
|
||||
jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
|
||||
@@ -485,8 +464,8 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
hideNonSelectedCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||
hideNonSelectedCheckbox.setMargin(new java.awt.Insets(2, 0, 2, 2));
|
||||
|
||||
configureLabelsButton.setFont(new java.awt.Font("Tahoma", 0, 10));
|
||||
configureLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/configureLabels.png"))); // NOI18N
|
||||
configureLabelsButton.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
|
||||
configureLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/configureLabels.png"))); // NOI18N
|
||||
configureLabelsButton.setText(org.openide.util.NbBundle.getMessage(LabelSettingsPanel.class, "LabelSettingsPanel.configureLabelsButton.text")); // NOI18N
|
||||
configureLabelsButton.setBorder(null);
|
||||
configureLabelsButton.setMargin(new java.awt.Insets(2, 7, 2, 7));
|
||||
@@ -520,10 +499,10 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
|
||||
.addComponent(nodePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(edgePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
|
||||
.addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
@@ -535,11 +514,11 @@ public class LabelSettingsPanel extends javax.swing.JPanel {
|
||||
.addComponent(labelColorMode))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(hideNonSelectedCheckbox)
|
||||
.addContainerGap(44, Short.MAX_VALUE))
|
||||
.addContainerGap(63, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(configureLabelsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(84, Short.MAX_VALUE))
|
||||
.addContainerGap(89, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -48,14 +27,15 @@ import java.awt.event.ItemListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JOptionPane;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.VizModel;
|
||||
import org.gephi.visualization.api.initializer.Modeler;
|
||||
import org.gephi.visualization.api.initializer.NodeModeler;
|
||||
import org.gephi.visualization.api.objects.ModelClass;
|
||||
import org.gephi.graph.api.NodeShape;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.openide.DialogDescriptor;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -69,71 +49,59 @@ public class NodeSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
adjustTextCheckbox.setSelected(vizModel.isAdjustByText());
|
||||
adjustTextCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setAdjustByText(adjustTextCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
final DefaultComboBoxModel comboModel = new DefaultComboBoxModel();
|
||||
final ModelClass nodeClass = VizController.getInstance().getModelClassLibrary().getNodeClass();
|
||||
for (Modeler modeler : nodeClass.getModelers()) {
|
||||
comboModel.addElement(modeler);
|
||||
}
|
||||
comboModel.setSelectedItem(nodeClass.getCurrentModeler());
|
||||
final DefaultComboBoxModel comboModel = new DefaultComboBoxModel(NodeShape.specificShapes());
|
||||
comboModel.addElement(NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.browseImage"));
|
||||
comboModel.setSelectedItem(vizModel.getGlobalNodeShape());
|
||||
shapeCombo.setModel(comboModel);
|
||||
shapeCombo.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (nodeClass.getCurrentModeler() == comboModel.getSelectedItem()) {
|
||||
return;
|
||||
}
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
NodeModeler modeler = (NodeModeler) comboModel.getSelectedItem();
|
||||
if (modeler.is3d() && !vizModel.isUse3d()) {
|
||||
// String msg = NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message3d");
|
||||
// if (JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message.title"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||
//enable 3d
|
||||
vizModel.setUse3d(true);
|
||||
nodeClass.setCurrentModeler(modeler);
|
||||
// }
|
||||
|
||||
} else if (!modeler.is3d() && vizModel.isUse3d()) {
|
||||
// String msg = NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message2d");
|
||||
// if (JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message.title"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||
//disable 3d
|
||||
vizModel.setUse3d(false);
|
||||
nodeClass.setCurrentModeler(modeler);
|
||||
// }
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (comboModel.getSelectedItem() instanceof NodeShape) {
|
||||
if (vizModel.getGlobalNodeShape() != comboModel.getSelectedItem()) {
|
||||
vizModel.setGlobalNodeShape((NodeShape) comboModel.getSelectedItem());
|
||||
}
|
||||
} else {
|
||||
nodeClass.setCurrentModeler(modeler);
|
||||
NodeShapeSelectionPanel panel = new NodeShapeSelectionPanel();
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.title"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
if (DialogDisplayer.getDefault().notify(dd).equals(NotifyDescriptor.OK_OPTION) && panel.getSelectedNodeShape() != null) {
|
||||
vizModel.setGlobalNodeShape(panel.getSelectedNodeShape());
|
||||
} else {
|
||||
refreshSharedConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
showHullsCheckbox.setSelected(vizModel.isShowHulls());
|
||||
showHullsCheckbox.addItemListener(new ItemListener() {
|
||||
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setShowHulls(showHullsCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("nodeModeler")) {
|
||||
if (evt.getPropertyName().equals("init")) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("init")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.NODE_GLOBAL_SHAPE)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("adjustByText")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.ADJUST_BY_TEXT)) {
|
||||
refreshSharedConfig();
|
||||
} else if (evt.getPropertyName().equals("showHulls")) {
|
||||
} else if (evt.getPropertyName().equals(VizConfig.SHOW_HULLS)) {
|
||||
refreshSharedConfig();
|
||||
}
|
||||
}
|
||||
@@ -142,14 +110,18 @@ public class NodeSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
private void refreshSharedConfig() {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
setEnable(!vizModel.isDefaultModel());
|
||||
if (vizModel.isDefaultModel()) {
|
||||
return;
|
||||
}
|
||||
final ModelClass nodeClass = VizController.getInstance().getModelClassLibrary().getNodeClass();
|
||||
if (shapeCombo.getSelectedItem() != nodeClass.getCurrentModeler()) {
|
||||
shapeCombo.setSelectedItem(nodeClass.getCurrentModeler());
|
||||
if (shapeCombo.getSelectedItem() != vizModel.getGlobalNodeShape() &&
|
||||
((shapeCombo.getSelectedItem() instanceof NodeShape) || !vizModel.getGlobalNodeShape().isImage())) {
|
||||
if (vizModel.getGlobalNodeShape().isImage()) {
|
||||
shapeCombo.setSelectedIndex(shapeCombo.getItemCount() - 1);
|
||||
} else {
|
||||
shapeCombo.setSelectedItem(vizModel.getGlobalNodeShape());
|
||||
}
|
||||
}
|
||||
if (adjustTextCheckbox.isSelected() != vizModel.isAdjustByText()) {
|
||||
adjustTextCheckbox.setSelected(vizModel.isAdjustByText());
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="imagesScrollPane" alignment="0" min="-2" pref="362" max="-2" attributes="0"/>
|
||||
<Component id="selectImageButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="imagesScrollPane" min="-2" pref="287" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="selectImageButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="imagesScrollPane">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="innerPanel">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="360" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="285" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/ui/components/Bundle.properties" key="NodeShapeSelectionPanel.availableImages" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="selectImageButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/ui/components/Bundle.properties" key="NodeShapeSelectionPanel.newImage" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
Copyright 2008-2011 Gephi
|
||||
Authors : Vojtech Bardiovsky <vojtech.bardiovsky@gmail.com>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.Box.Filler;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import org.gephi.graph.api.NodeShape;
|
||||
import org.gephi.graph.api.NodeShape.NodeShapeException;
|
||||
import org.gephi.visualization.api.ImageManager;
|
||||
import org.gephi.visualization.api.ImageNodeShape;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
/**
|
||||
* @author Vojtech Bardiovsky
|
||||
*/
|
||||
public class NodeShapeSelectionPanel extends javax.swing.JPanel {
|
||||
|
||||
private ButtonGroup group;
|
||||
|
||||
/** Creates new form ImageSelectionPanel */
|
||||
public NodeShapeSelectionPanel() {
|
||||
initComponents();
|
||||
|
||||
refreshPanel();
|
||||
|
||||
imagesScrollPane.getVerticalScrollBar().setUnitIncrement(5);
|
||||
|
||||
selectImageButton.addActionListener(new ActionListener() {
|
||||
private final String LAST_PATH = "NodeShapeSelectionPanel.lastPath";
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ImageManager imageManager = Lookup.getDefault().lookup(ImageManager.class);
|
||||
final String path = NbPreferences.forModule(BackgroundSettingsPanel.class).get(LAST_PATH, null);
|
||||
JFileChooser fileChooser = new JFileChooser(path);
|
||||
if (fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == JFileChooser.APPROVE_OPTION) {
|
||||
File selectedFile = fileChooser.getSelectedFile();
|
||||
NbPreferences.forModule(BackgroundSettingsPanel.class).put(LAST_PATH, selectedFile.getAbsolutePath());
|
||||
try {
|
||||
imageManager.createNodeShape(selectedFile.toURI().toString());
|
||||
} catch (NodeShapeException ex) {
|
||||
switch (ex.getExceptionCause()) {
|
||||
case IO_ERROR:
|
||||
Logger.getLogger("").log(Level.WARNING, "", ex);
|
||||
break;
|
||||
case UNSUPPORTED_IMAGE_FORMAT:
|
||||
JOptionPane.showMessageDialog(NodeShapeSelectionPanel.this, NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.unsupportedImage.message"), NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.unsupportedImage.title"), JOptionPane.WARNING_MESSAGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
refreshPanel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public NodeShape getSelectedNodeShape() {
|
||||
Enumeration<AbstractButton> buttons = group.getElements();
|
||||
while (buttons.hasMoreElements()) {
|
||||
AbstractButton button = buttons.nextElement();
|
||||
if (button.getModel() == group.getSelection()) {
|
||||
return ((NodeShapeRadioButton) button).getNodeShape();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void refreshPanel() {
|
||||
ImageManager imageManager = Lookup.getDefault().lookup(ImageManager.class);
|
||||
ImageNodeShape[] nodeShapes = imageManager.getCreatedShapes();
|
||||
innerPanel.removeAll();
|
||||
innerPanel.setLayout(new GridBagLayout());
|
||||
GridBagConstraints constraints = new GridBagConstraints();
|
||||
group = new ButtonGroup();
|
||||
for (int i = 0; i < nodeShapes.length; i++) {
|
||||
BufferedImage image = imageManager.getImage(nodeShapes[i].id);
|
||||
|
||||
constraints.gridy = i;
|
||||
constraints.weightx = 0.5;
|
||||
constraints.insets = new Insets(8, 8, 8, 8);
|
||||
constraints.anchor = GridBagConstraints.WEST;
|
||||
constraints.gridx = 0;
|
||||
innerPanel.add(new ImagePanel(image), constraints);
|
||||
|
||||
constraints.anchor = GridBagConstraints.EAST;
|
||||
constraints.gridx = 1;
|
||||
JRadioButton button = new NodeShapeRadioButton(nodeShapes[i]);
|
||||
button.setSelected(i == 0);
|
||||
innerPanel.add(button, constraints);
|
||||
group.add(button);
|
||||
}
|
||||
constraints.weighty = 1.0;
|
||||
constraints.gridy = nodeShapes.length;
|
||||
innerPanel.add(new Filler(new Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)), constraints);
|
||||
imagesScrollPane.setViewportView(innerPanel);
|
||||
}
|
||||
|
||||
/** 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() {
|
||||
|
||||
imagesScrollPane = new javax.swing.JScrollPane();
|
||||
innerPanel = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
selectImageButton = new javax.swing.JButton();
|
||||
|
||||
javax.swing.GroupLayout innerPanelLayout = new javax.swing.GroupLayout(innerPanel);
|
||||
innerPanel.setLayout(innerPanelLayout);
|
||||
innerPanelLayout.setHorizontalGroup(
|
||||
innerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 360, Short.MAX_VALUE)
|
||||
);
|
||||
innerPanelLayout.setVerticalGroup(
|
||||
innerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 285, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
imagesScrollPane.setViewportView(innerPanel);
|
||||
|
||||
jLabel1.setText(org.openide.util.NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.availableImages")); // NOI18N
|
||||
|
||||
selectImageButton.setText(org.openide.util.NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.newImage")); // 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()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(imagesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(selectImageButton))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(9, 9, 9)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(imagesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(selectImageButton)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JScrollPane imagesScrollPane;
|
||||
private javax.swing.JPanel innerPanel;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JButton selectImageButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
class NodeShapeRadioButton extends JRadioButton {
|
||||
private final NodeShape nodeShape;
|
||||
|
||||
public NodeShapeRadioButton(NodeShape nodeShape) {
|
||||
this.nodeShape = nodeShape;
|
||||
}
|
||||
|
||||
public NodeShape getNodeShape() {
|
||||
return nodeShape;
|
||||
}
|
||||
}
|
||||
|
||||
class ImagePanel extends JPanel {
|
||||
private final BufferedImage image;
|
||||
|
||||
public ImagePanel(BufferedImage image) {
|
||||
this.image = image;
|
||||
this.setSize(new Dimension(image.getWidth(), image.getHeight()));
|
||||
this.setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
super.paint(g);
|
||||
g.drawImage(image, 0, 0, null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="imagePanel" max="32767" attributes="0"/>
|
||||
<Component id="imagePanel" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="autoSaveCheckBox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
@@ -35,12 +35,12 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="imagePanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="autoSaveCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="selectDirectoryButton" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="21" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -60,22 +60,13 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="labelWidth" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
|
||||
<Component id="widthTextField" min="-2" pref="58" max="-2" attributes="1"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="labelHeight" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="heightTextField" min="-2" pref="58" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="labelAntiAliasing" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="antiAliasingCombo" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="labelWidth" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
|
||||
<Component id="widthTextField" min="-2" pref="58" max="-2" attributes="1"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="labelHeight" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="heightTextField" min="-2" pref="58" max="-2" attributes="1"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -90,11 +81,6 @@
|
||||
<Component id="labelHeight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="heightTextField" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="labelAntiAliasing" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="antiAliasingCombo" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -104,48 +90,28 @@
|
||||
<Component class="javax.swing.JLabel" name="labelHeight">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.labelHeight.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.labelHeight.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelWidth">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.labelWidth.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.labelWidth.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="widthTextField">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.widthTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelAntiAliasing">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.labelAntiAliasing.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="antiAliasingCombo">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="5">
|
||||
<StringItem index="0" value="0x"/>
|
||||
<StringItem index="1" value="2x"/>
|
||||
<StringItem index="2" value="4x"/>
|
||||
<StringItem index="3" value="8x"/>
|
||||
<StringItem index="4" value="16x"/>
|
||||
</StringArray>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.widthTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="heightTextField">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.heightTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.heightTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -154,14 +120,14 @@
|
||||
<Component class="javax.swing.JCheckBox" name="autoSaveCheckBox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.autoSaveCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.autoSaveCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="selectDirectoryButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/visualization/screenshot/Bundle.properties" key="ScreenshotSettingsPanel.selectDirectoryButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="ScreenshotSettingsPanel.selectDirectoryButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -5,51 +5,35 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.screenshot;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.gephi.lib.validation.Multiple4NumberValidator;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.rendering.ScreenshotSettings;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.netbeans.validation.api.builtin.Validators;
|
||||
import org.netbeans.validation.api.ui.ValidationGroup;
|
||||
import org.netbeans.validation.api.ui.ValidationPanel;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
/**
|
||||
@@ -58,84 +42,49 @@ import org.openide.windows.WindowManager;
|
||||
*/
|
||||
public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
private File folder;
|
||||
|
||||
/** Creates new form ScreenshotSettingsPanel */
|
||||
public ScreenshotSettingsPanel() {
|
||||
initComponents();
|
||||
|
||||
autoSaveCheckBox.addChangeListener(new ChangeListener() {
|
||||
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
selectDirectoryButton.setEnabled(autoSaveCheckBox.isSelected());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setup(final ScreenshotMaker screenshotMaker) {
|
||||
autoSaveCheckBox.setSelected(screenshotMaker.isAutoSave());
|
||||
public void setup() {
|
||||
VizConfig vizConfig = Lookup.getDefault().lookup(VisualizationController.class).getVizConfig();
|
||||
final ScreenshotSettings settings = vizConfig.getProperty(ScreenshotSettings.class, VizConfig.SCREENSHOT_SETTINGS);
|
||||
autoSaveCheckBox.setSelected(settings.autoSave);
|
||||
selectDirectoryButton.setEnabled(autoSaveCheckBox.isSelected());
|
||||
widthTextField.setText(String.valueOf(screenshotMaker.getWidth()));
|
||||
heightTextField.setText(String.valueOf(screenshotMaker.getHeight()));
|
||||
switch (screenshotMaker.getAntiAliasing()) {
|
||||
case 0:
|
||||
antiAliasingCombo.setSelectedIndex(0);
|
||||
break;
|
||||
case 2:
|
||||
antiAliasingCombo.setSelectedIndex(1);
|
||||
break;
|
||||
case 4:
|
||||
antiAliasingCombo.setSelectedIndex(2);
|
||||
break;
|
||||
case 8:
|
||||
antiAliasingCombo.setSelectedIndex(3);
|
||||
break;
|
||||
case 16:
|
||||
antiAliasingCombo.setSelectedIndex(4);
|
||||
break;
|
||||
default:
|
||||
antiAliasingCombo.setSelectedIndex(4);
|
||||
break;
|
||||
}
|
||||
//transparentBackgroundCheckBox.setSelected(screenshotMaker.isTransparentBackground());
|
||||
widthTextField.setText(String.valueOf(settings.width));
|
||||
heightTextField.setText(String.valueOf(settings.height));
|
||||
selectDirectoryButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JFileChooser fileChooser = new JFileChooser(screenshotMaker.getDefaultDirectory());
|
||||
JFileChooser fileChooser = new JFileChooser(settings.folder);
|
||||
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
int result = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow());
|
||||
if (result == JFileChooser.APPROVE_OPTION) {
|
||||
screenshotMaker.setDefaultDirectory(fileChooser.getSelectedFile());
|
||||
folder = fileChooser.getSelectedFile();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void unsetup(ScreenshotMaker screenshotMaker) {
|
||||
screenshotMaker.setAutoSave(autoSaveCheckBox.isSelected());
|
||||
screenshotMaker.setWidth(Integer.parseInt(widthTextField.getText()));
|
||||
screenshotMaker.setHeight(Integer.parseInt(heightTextField.getText()));
|
||||
switch (antiAliasingCombo.getSelectedIndex()) {
|
||||
case 0:
|
||||
screenshotMaker.setAntiAliasing(0);
|
||||
break;
|
||||
case 1:
|
||||
screenshotMaker.setAntiAliasing(2);
|
||||
break;
|
||||
case 2:
|
||||
screenshotMaker.setAntiAliasing(4);
|
||||
break;
|
||||
case 3:
|
||||
screenshotMaker.setAntiAliasing(8);
|
||||
break;
|
||||
case 4:
|
||||
screenshotMaker.setAntiAliasing(16);
|
||||
break;
|
||||
default:
|
||||
screenshotMaker.setAntiAliasing(0);
|
||||
break;
|
||||
}
|
||||
//screenshotMaker.setTransparentBackground(transparentBackgroundCheckBox.isSelected());
|
||||
|
||||
private ScreenshotSettings extractScreenshotSettings() {
|
||||
return new ScreenshotSettings(Integer.parseInt(widthTextField.getText()), Integer.parseInt(heightTextField.getText()), autoSaveCheckBox.isSelected(), folder.getAbsolutePath());
|
||||
}
|
||||
|
||||
public void unsetup() {
|
||||
VizConfig vizConfig = Lookup.getDefault().lookup(VisualizationController.class).getVizConfig();
|
||||
vizConfig.setProperty(VizConfig.SCREENSHOT_SETTINGS, extractScreenshotSettings());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static ValidationPanel createValidationPanel(ScreenshotSettingsPanel innerPanel) {
|
||||
ValidationPanel validationPanel = new ValidationPanel();
|
||||
if (innerPanel == null) {
|
||||
@@ -146,13 +95,10 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
ValidationGroup group = validationPanel.getValidationGroup();
|
||||
|
||||
//Node field
|
||||
group.add(innerPanel.widthTextField, Validators.REQUIRE_NON_EMPTY_STRING,
|
||||
new Multiple4NumberValidator());
|
||||
group.add(innerPanel.widthTextField, Validators.REQUIRE_NON_EMPTY_STRING, new Multiple4NumberValidator());
|
||||
|
||||
//Edge field
|
||||
group.add(innerPanel.heightTextField, Validators.REQUIRE_NON_EMPTY_STRING,
|
||||
new Multiple4NumberValidator());
|
||||
|
||||
group.add(innerPanel.heightTextField, Validators.REQUIRE_NON_EMPTY_STRING, new Multiple4NumberValidator());
|
||||
|
||||
return validationPanel;
|
||||
}
|
||||
@@ -170,8 +116,6 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
labelHeight = new javax.swing.JLabel();
|
||||
labelWidth = new javax.swing.JLabel();
|
||||
widthTextField = new javax.swing.JTextField();
|
||||
labelAntiAliasing = new javax.swing.JLabel();
|
||||
antiAliasingCombo = new javax.swing.JComboBox();
|
||||
heightTextField = new javax.swing.JTextField();
|
||||
autoSaveCheckBox = new javax.swing.JCheckBox();
|
||||
selectDirectoryButton = new javax.swing.JButton();
|
||||
@@ -184,10 +128,6 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
widthTextField.setText(org.openide.util.NbBundle.getMessage(ScreenshotSettingsPanel.class, "ScreenshotSettingsPanel.widthTextField.text")); // NOI18N
|
||||
|
||||
labelAntiAliasing.setText(org.openide.util.NbBundle.getMessage(ScreenshotSettingsPanel.class, "ScreenshotSettingsPanel.labelAntiAliasing.text")); // NOI18N
|
||||
|
||||
antiAliasingCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0x", "2x", "4x", "8x", "16x" }));
|
||||
|
||||
heightTextField.setText(org.openide.util.NbBundle.getMessage(ScreenshotSettingsPanel.class, "ScreenshotSettingsPanel.heightTextField.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout imagePanelLayout = new javax.swing.GroupLayout(imagePanel);
|
||||
@@ -196,19 +136,13 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(imagePanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(imagePanelLayout.createSequentialGroup()
|
||||
.addComponent(labelWidth)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(widthTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(labelHeight)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(heightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(imagePanelLayout.createSequentialGroup()
|
||||
.addComponent(labelAntiAliasing)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(antiAliasingCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(labelWidth)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(widthTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(labelHeight)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(heightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
imagePanelLayout.setVerticalGroup(
|
||||
@@ -220,10 +154,6 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
.addComponent(widthTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelHeight)
|
||||
.addComponent(heightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(labelAntiAliasing)
|
||||
.addComponent(antiAliasingCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -250,19 +180,17 @@ public class ScreenshotSettingsPanel extends javax.swing.JPanel {
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(imagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(autoSaveCheckBox)
|
||||
.addComponent(selectDirectoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(21, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox antiAliasingCombo;
|
||||
private javax.swing.JCheckBox autoSaveCheckBox;
|
||||
private javax.swing.JTextField heightTextField;
|
||||
private javax.swing.JPanel imagePanel;
|
||||
private javax.swing.JLabel labelAntiAliasing;
|
||||
private javax.swing.JLabel labelHeight;
|
||||
private javax.swing.JLabel labelWidth;
|
||||
private javax.swing.JButton selectDirectoryButton;
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.selection.SelectionManager;
|
||||
import org.gephi.visualization.api.selection.SelectionType;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class SelectionToolbar extends JToolBar {
|
||||
|
||||
private ButtonGroup buttonGroup;
|
||||
private SelectionManager selectionManager;
|
||||
|
||||
public SelectionToolbar() {
|
||||
selectionManager = Lookup.getDefault().lookup(VisualizationController.class).getSelectionManager();
|
||||
initDesign();
|
||||
buttonGroup = new ButtonGroup();
|
||||
initContent();
|
||||
}
|
||||
|
||||
private void initContent() {
|
||||
|
||||
//Mouse
|
||||
final JToggleButton mouseButton = new JToggleButton(new ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/mouse.png")));
|
||||
mouseButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.mouse.tooltip"));
|
||||
mouseButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (mouseButton.isSelected()) {
|
||||
selectionManager.setDirectMouseSelection();
|
||||
}
|
||||
}
|
||||
});
|
||||
add(mouseButton);
|
||||
|
||||
//Rectangle
|
||||
final JToggleButton rectangleButton = new JToggleButton(new ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/rectangle.png")));
|
||||
rectangleButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.rectangle.tooltip"));
|
||||
rectangleButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (rectangleButton.isSelected()) {
|
||||
selectionManager.setSelectionType(SelectionType.RECTANGLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(rectangleButton);
|
||||
|
||||
//Polygon
|
||||
final JToggleButton polygonButton = new JToggleButton(new ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/polygon.png")));
|
||||
polygonButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.polygon.tooltip"));
|
||||
polygonButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (polygonButton.isSelected()) {
|
||||
selectionManager.setSelectionType(SelectionType.POLYGON);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(polygonButton);
|
||||
|
||||
//Ellipse
|
||||
final JToggleButton ellipseButton = new JToggleButton(new ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/ellipse.png")));
|
||||
ellipseButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.ellipse.tooltip"));
|
||||
ellipseButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (ellipseButton.isSelected()) {
|
||||
selectionManager.setSelectionType(SelectionType.ELLIPSE);
|
||||
}
|
||||
}
|
||||
});
|
||||
add(ellipseButton);
|
||||
|
||||
//Drag
|
||||
final JToggleButton dragButton = new JToggleButton(new ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/hand.png")));
|
||||
dragButton.setToolTipText(NbBundle.getMessage(SelectionToolbar.class, "SelectionToolbar.drag.tooltip"));
|
||||
dragButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (dragButton.isSelected()) {
|
||||
selectionManager.setNodeDraggingEnabled();
|
||||
}
|
||||
}
|
||||
});
|
||||
add(dragButton);
|
||||
addSeparator();
|
||||
|
||||
buttonGroup.setSelected(rectangleButton.getModel(), selectionManager.getSelectionType() == SelectionType.RECTANGLE);
|
||||
buttonGroup.setSelected(polygonButton.getModel(), selectionManager.getSelectionType() == SelectionType.POLYGON);
|
||||
buttonGroup.setSelected(ellipseButton.getModel(), selectionManager.getSelectionType() == SelectionType.ELLIPSE);
|
||||
buttonGroup.setSelected(mouseButton.getModel(), selectionManager.isDirectMouseSelection());
|
||||
buttonGroup.setSelected(dragButton.getModel(), selectionManager.isNodeDraggingEnabled());
|
||||
|
||||
//Init events
|
||||
selectionManager.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
buttonGroup.clearSelection();
|
||||
/*
|
||||
if (selectionManager.isBlocked()) {
|
||||
buttonGroup.clearSelection();
|
||||
} else if (!selectionManager.isSelectionEnabled()) {
|
||||
buttonGroup.clearSelection();
|
||||
} else if (selectionManager.isDirectMouseSelection()) {
|
||||
if (!buttonGroup.isSelected(mouseButton.getModel())) {
|
||||
buttonGroup.setSelected(mouseButton.getModel(), true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (selectionManager.isDirectMouseSelection()) {
|
||||
buttonGroup.setSelected(mouseButton.getModel(), true);
|
||||
} else if (selectionManager.isNodeDraggingEnabled()) {
|
||||
buttonGroup.setSelected(dragButton.getModel(), true);
|
||||
} else {
|
||||
switch (selectionManager.getSelectionType()) {
|
||||
case ELLIPSE:
|
||||
buttonGroup.setSelected(ellipseButton.getModel(), true);
|
||||
break;
|
||||
case POLYGON:
|
||||
buttonGroup.setSelected(polygonButton.getModel(), true);
|
||||
break;
|
||||
case RECTANGLE:
|
||||
buttonGroup.setSelected(rectangleButton.getModel(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initDesign() {
|
||||
setFloatable(false);
|
||||
setOrientation(JToolBar.VERTICAL);
|
||||
putClientProperty("JToolBar.isRollover", Boolean.TRUE); //NOI18N
|
||||
setOpaque(false);
|
||||
setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(final boolean enabled) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (Component c : getComponents()) {
|
||||
c.setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component add(Component comp) {
|
||||
if (comp instanceof JButton) {
|
||||
UIUtils.fixButtonUI((JButton) comp);
|
||||
}
|
||||
if (comp instanceof AbstractButton) {
|
||||
buttonGroup.add((AbstractButton) comp);
|
||||
}
|
||||
|
||||
return super.add(comp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="xTextField" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="yTextField" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="xTextField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="yTextField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="VectorInputPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="VectorInputPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="xTextField">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="6"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="VectorInputPanel.xTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="yTextField">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="6"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="VectorInputPanel.yTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/gephi/desktop/visualization/components/Bundle.properties" key="VectorInputPanel.label" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Vojtech Bardiovsky <vojtech.bardiovsky@gmail.com>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import javax.swing.InputVerifier;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JTextField;
|
||||
import org.gephi.math.Vec2;
|
||||
|
||||
/**
|
||||
* @author Vojtech Bardiovsky
|
||||
*/
|
||||
public class VectorInputPanel extends javax.swing.JPanel {
|
||||
|
||||
/** Creates new form VectorInputPanel */
|
||||
public VectorInputPanel() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void setup(int x, int y) {
|
||||
this.xTextField.setText("" + x);
|
||||
this.yTextField.setText("" + y);
|
||||
this.xTextField.setInputVerifier(new FloatInputVerifier());
|
||||
this.yTextField.setInputVerifier(new FloatInputVerifier());
|
||||
}
|
||||
|
||||
public Vec2 unsetup() {
|
||||
return new Vec2(Float.parseFloat(xTextField.getText()), Float.parseFloat(yTextField.getText()));
|
||||
}
|
||||
|
||||
private class FloatInputVerifier extends InputVerifier {
|
||||
|
||||
@Override
|
||||
public boolean verify(JComponent input) {
|
||||
String text = ((JTextField) input).getText();
|
||||
try {
|
||||
Float.parseFloat(text);
|
||||
} catch (NumberFormatException e) {
|
||||
((JTextField) input).setText("0");
|
||||
}
|
||||
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() {
|
||||
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
xTextField = new javax.swing.JTextField();
|
||||
yTextField = new javax.swing.JTextField();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
|
||||
jLabel1.setText(org.openide.util.NbBundle.getMessage(VectorInputPanel.class, "VectorInputPanel.jLabel1.text")); // NOI18N
|
||||
|
||||
jLabel2.setText(org.openide.util.NbBundle.getMessage(VectorInputPanel.class, "VectorInputPanel.jLabel2.text")); // NOI18N
|
||||
|
||||
xTextField.setColumns(6);
|
||||
xTextField.setText(org.openide.util.NbBundle.getMessage(VectorInputPanel.class, "VectorInputPanel.xTextField.text")); // NOI18N
|
||||
|
||||
yTextField.setColumns(6);
|
||||
yTextField.setText(org.openide.util.NbBundle.getMessage(VectorInputPanel.class, "VectorInputPanel.yTextField.text")); // NOI18N
|
||||
|
||||
jLabel3.setText(org.openide.util.NbBundle.getMessage(VectorInputPanel.class, "VectorInputPanel.label")); // 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()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(xTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(yTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jLabel3))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(xTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(yTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JTextField xTextField;
|
||||
private javax.swing.JTextField yTextField;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -5,44 +5,22 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import com.connectina.swing.fontchooser.JFontChooser;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -58,19 +36,17 @@ import javax.swing.JToggleButton;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import net.java.dev.colorchooser.ColorChooser;
|
||||
import org.gephi.ui.components.JColorBlackWhiteSwitcher;
|
||||
import org.gephi.ui.components.JColorButton;
|
||||
import org.gephi.ui.components.JDropDownButton;
|
||||
import org.gephi.ui.components.JPopupButton;
|
||||
import org.gephi.visualization.VizController;
|
||||
import org.gephi.visualization.VizModel;
|
||||
import org.gephi.visualization.opengl.text.ColorMode;
|
||||
import org.gephi.visualization.opengl.text.SizeMode;
|
||||
import org.gephi.visualization.opengl.text.TextManager;
|
||||
import org.gephi.visualization.opengl.text.TextModel;
|
||||
import org.gephi.visualization.api.VisualizationController;
|
||||
import org.gephi.visualization.api.vizmodel.TextModel;
|
||||
import org.gephi.visualization.api.vizmodel.VizConfig;
|
||||
import org.gephi.visualization.api.vizmodel.VizModel;
|
||||
import org.netbeans.validation.api.ui.ValidationPanel;
|
||||
import org.openide.DialogDescriptor;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.windows.WindowManager;
|
||||
|
||||
@@ -89,30 +65,31 @@ public class VizBarController {
|
||||
}
|
||||
|
||||
private void createDefaultGroups() {
|
||||
groups = new VizToolbarGroup[4];
|
||||
groups = new VizToolbarGroup[5];
|
||||
|
||||
groups[0] = new GlobalGroupBar();
|
||||
groups[1] = new NodeGroupBar();
|
||||
groups[2] = new EdgeGroupBar();
|
||||
groups[3] = new LabelGroupBar();
|
||||
groups[4] = new BackgroundGroupBar();
|
||||
|
||||
VizModel model = VizController.getInstance().getVizModel();
|
||||
model.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("init")) {
|
||||
VizModel model = VizController.getInstance().getVizModel();
|
||||
toolbar.setEnable(!model.isDefaultModel());
|
||||
((NodeGroupBar) groups[1]).setModelValues(model);
|
||||
((EdgeGroupBar) groups[2]).setModelValues(model);
|
||||
((LabelGroupBar) groups[3]).setModelValues(model);
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
toolbar.setEnable(!vizModel.isDefaultModel());
|
||||
((NodeGroupBar)groups[1]).setModelValues(vizModel);
|
||||
((EdgeGroupBar)groups[2]).setModelValues(vizModel);
|
||||
((LabelGroupBar)groups[3]).setModelValues(vizModel);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public VizToolbar getToolbar() {
|
||||
VizModel model = VizController.getInstance().getVizModel();
|
||||
VizModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
toolbar = new VizToolbar(groups);
|
||||
toolbar.setEnable(!model.isDefaultModel());
|
||||
return toolbar;
|
||||
@@ -133,28 +110,25 @@ public class VizBarController {
|
||||
JComponent[] components = new JComponent[2];
|
||||
|
||||
//Background color
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
final JButton backgroundColorButton = new JColorBlackWhiteSwitcher(vizModel.getBackgroundColor());
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
final JButton backgroundColorButton = new JColorButton(vizModel.getBackground().getColor());
|
||||
backgroundColorButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Global.background"));
|
||||
backgroundColorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
Color backgroundColor=((JColorBlackWhiteSwitcher) backgroundColorButton).getColor();
|
||||
vizModel.setBackgroundColor(backgroundColor);
|
||||
|
||||
TextModel textModel = VizController.getInstance().getVizModel().getTextModel();
|
||||
boolean isDarkBackground = (backgroundColor.getRed() + backgroundColor.getGreen() + backgroundColor.getBlue()) / 3 < 128;
|
||||
textModel.setNodeColor(isDarkBackground ? Color.WHITE : Color.BLACK);
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().getColor().equals(((JColorButton) backgroundColorButton).getColor())) {
|
||||
vizModel.setBackground(vizModel.getBackground().deriveBackground(((JColorButton) backgroundColorButton).getColor()));
|
||||
}
|
||||
}
|
||||
});
|
||||
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("backgroundColor")) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
if (!(((JColorBlackWhiteSwitcher) backgroundColorButton).getColor()).equals(vizModel.getBackgroundColor())) {
|
||||
((JColorBlackWhiteSwitcher) backgroundColorButton).setColor(vizModel.getBackgroundColor());
|
||||
if (evt.getPropertyName().equals(VizConfig.BACKGROUND)) {
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (!vizModel.getBackground().getColor().equals(((JColorButton) backgroundColorButton).getColor())) {
|
||||
((JColorButton) backgroundColorButton).setColor(vizModel.getBackground().getColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,18 +139,24 @@ public class VizBarController {
|
||||
JPopupMenu screenshotPopup = new JPopupMenu();
|
||||
JMenuItem configureScreenshotItem = new JMenuItem(NbBundle.getMessage(VizBarController.class, "VizToolbar.Global.screenshot.configure"));
|
||||
configureScreenshotItem.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizController.getInstance().getScreenshotMaker().configure();
|
||||
ScreenshotSettingsPanel panel = new ScreenshotSettingsPanel();
|
||||
panel.setup();
|
||||
ValidationPanel validationPanel = ScreenshotSettingsPanel.createValidationPanel(panel);
|
||||
if (validationPanel.showOkCancelDialog(NbBundle.getMessage(VizBarController.class, "ScreenshotMaker.configure.title"))) {
|
||||
panel.unsetup();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
screenshotPopup.add(configureScreenshotItem);
|
||||
final JButton screenshotButton = new JDropDownButton(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/screenshot.png")), screenshotPopup);
|
||||
final JButton screenshotButton = new JDropDownButton(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/screenshot.png")), screenshotPopup);
|
||||
screenshotButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Global.screenshot"));
|
||||
screenshotButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizController.getInstance().getScreenshotMaker().takeScreenshot();
|
||||
//Lookup.getDefault().lookup(RenderingController.class).makeScreenshot();
|
||||
}
|
||||
});
|
||||
components[1] = screenshotButton;
|
||||
@@ -198,6 +178,38 @@ public class VizBarController {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static class BackgroundGroupBar implements VizToolbarGroup {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Background";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent[] getToolbarComponents() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getExtendedComponent() {
|
||||
BackgroundSettingsPanel panel = new BackgroundSettingsPanel();
|
||||
panel.setup();
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasToolbar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExtended() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static class NodeGroupBar implements VizToolbarGroup {
|
||||
|
||||
@@ -214,22 +226,22 @@ public class VizBarController {
|
||||
|
||||
public JComponent[] getToolbarComponents() {
|
||||
//Show labels buttons
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
final JToggleButton showLabelsButton = new JToggleButton();
|
||||
showLabelsButton.setSelected(vizModel.getTextModel().isShowNodeLabels());
|
||||
showLabelsButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Nodes.showLabels"));
|
||||
showLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/showNodeLabels.png")));
|
||||
showLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/showNodeLabels.png")));
|
||||
showLabelsButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.getTextModel().setShowNodeLabels(showLabelsButton.isSelected());
|
||||
}
|
||||
});
|
||||
vizModel.getTextModel().addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel textModel = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel textModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (showLabelsButton.isSelected() != textModel.isShowNodeLabels()) {
|
||||
showLabelsButton.setSelected(textModel.isShowNodeLabels());
|
||||
}
|
||||
@@ -241,11 +253,11 @@ public class VizBarController {
|
||||
final JToggleButton showHullsButton = new JToggleButton();
|
||||
showHullsButton.setSelected(vizModel.isShowHulls());
|
||||
showHullsButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Nodes.showHulls"));
|
||||
showHullsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/showHulls.png")));
|
||||
showHullsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/showHulls.png")));
|
||||
showHullsButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setShowHulls(showHullsButton.isSelected());
|
||||
}
|
||||
});
|
||||
@@ -253,7 +265,7 @@ public class VizBarController {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("showHulls")) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (showHullsButton.isSelected() != vizModel.isShowHulls()) {
|
||||
showHullsButton.setSelected(vizModel.isShowHulls());
|
||||
}
|
||||
@@ -297,15 +309,15 @@ public class VizBarController {
|
||||
|
||||
public JComponent[] getToolbarComponents() {
|
||||
//Show edges buttons
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
final JToggleButton showEdgeButton = new JToggleButton();
|
||||
showEdgeButton.setSelected(vizModel.isShowEdges());
|
||||
showEdgeButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Edges.showEdges"));
|
||||
showEdgeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/showEdges.png")));
|
||||
showEdgeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/showEdges.png")));
|
||||
showEdgeButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setShowEdges(showEdgeButton.isSelected());
|
||||
}
|
||||
});
|
||||
@@ -313,7 +325,7 @@ public class VizBarController {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("showEdges")) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (showEdgeButton.isSelected() != vizModel.isShowEdges()) {
|
||||
showEdgeButton.setSelected(vizModel.isShowEdges());
|
||||
}
|
||||
@@ -326,11 +338,11 @@ public class VizBarController {
|
||||
final JToggleButton edgeHasNodeColorButton = new JToggleButton();
|
||||
edgeHasNodeColorButton.setSelected(!vizModel.isEdgeHasUniColor());
|
||||
edgeHasNodeColorButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Edges.edgeNodeColor"));
|
||||
edgeHasNodeColorButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/edgeNodeColor.png")));
|
||||
edgeHasNodeColorButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/edgeNodeColor.png")));
|
||||
edgeHasNodeColorButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.setEdgeHasUniColor(!edgeHasNodeColorButton.isSelected());
|
||||
}
|
||||
});
|
||||
@@ -338,7 +350,7 @@ public class VizBarController {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("edgeHasUniColor")) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (edgeHasNodeColorButton.isSelected() != !vizModel.isEdgeHasUniColor()) {
|
||||
edgeHasNodeColorButton.setSelected(!vizModel.isEdgeHasUniColor());
|
||||
}
|
||||
@@ -352,18 +364,18 @@ public class VizBarController {
|
||||
final JToggleButton showLabelsButton = new JToggleButton();
|
||||
showLabelsButton.setSelected(vizModel.getTextModel().isShowEdgeLabels());
|
||||
showLabelsButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Edges.showLabels"));
|
||||
showLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/showEdgeLabels.png")));
|
||||
showLabelsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/showEdgeLabels.png")));
|
||||
showLabelsButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
vizModel.getTextModel().setShowEdgeLabels(showLabelsButton.isSelected());
|
||||
}
|
||||
});
|
||||
vizModel.getTextModel().addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel textModel = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel textModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (showLabelsButton.isSelected() != textModel.isShowEdgeLabels()) {
|
||||
showLabelsButton.setSelected(textModel.isShowEdgeLabels());
|
||||
}
|
||||
@@ -377,7 +389,7 @@ public class VizBarController {
|
||||
edgeScaleSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (vizModel.getEdgeScale() != (edgeScaleSlider.getValue() / 10f + 0.1f)) {
|
||||
vizModel.setEdgeScale(edgeScaleSlider.getValue() / 10f + 0.1f);
|
||||
}
|
||||
@@ -389,7 +401,7 @@ public class VizBarController {
|
||||
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals("edgeScale")) {
|
||||
VizModel vizModel = VizController.getInstance().getVizModel();
|
||||
VizModel vizModel = Lookup.getDefault().lookup(VisualizationController.class).getVizModel();
|
||||
if (vizModel.getEdgeScale() != (edgeScaleSlider.getValue() / 10f + 0.1f)) {
|
||||
edgeScaleSlider.setValue((int) ((vizModel.getEdgeScale() - 0.1f) * 10));
|
||||
}
|
||||
@@ -425,16 +437,21 @@ public class VizBarController {
|
||||
|
||||
public void setModelValues(VizModel vizModel) {
|
||||
TextModel model = vizModel.getTextModel();
|
||||
((JPopupButton) components[0]).setSelectedItem(model.getSizeMode());
|
||||
((JPopupButton) components[1]).setSelectedItem(model.getColorMode());
|
||||
//((JPopupButton) components[0]).setSelectedItem(model.getSizeMode());
|
||||
//((JPopupButton) components[1]).setSelectedItem(model.getColorMode());
|
||||
((JButton) components[2]).setText(model.getNodeFont().getFontName() + ", " + model.getNodeFont().getSize());
|
||||
((JSlider) components[3]).setValue((int) (model.getNodeSizeFactor() * 100f));
|
||||
}
|
||||
|
||||
public JComponent[] getToolbarComponents() {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
|
||||
public JComponent[] getToolbarComponents() {
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
|
||||
// TODO remove when label modes included
|
||||
components[0] = new JToggleButton();
|
||||
components[1] = new JToggleButton();
|
||||
|
||||
//Mode
|
||||
/*
|
||||
final JPopupButton labelSizeModeButton = new JPopupButton();
|
||||
TextManager textManager = VizController.getInstance().getTextManager();
|
||||
for (final SizeMode sm : textManager.getSizeModes()) {
|
||||
@@ -449,7 +466,7 @@ public class VizBarController {
|
||||
model.setSizeMode(sm);
|
||||
}
|
||||
});
|
||||
labelSizeModeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/labelSizeMode.png")));
|
||||
labelSizeModeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/labelSizeMode.png")));
|
||||
labelSizeModeButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Labels.sizeMode"));
|
||||
model.addChangeListener(new ChangeListener() {
|
||||
|
||||
@@ -476,7 +493,7 @@ public class VizBarController {
|
||||
model.setColorMode(cm);
|
||||
}
|
||||
});
|
||||
labelColorModeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/labelColorMode.png")));
|
||||
labelColorModeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/labelColorMode.png")));
|
||||
labelColorModeButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Labels.colorMode"));
|
||||
model.addChangeListener(new ChangeListener() {
|
||||
|
||||
@@ -488,14 +505,14 @@ public class VizBarController {
|
||||
}
|
||||
});
|
||||
components[1] = labelColorModeButton;
|
||||
|
||||
*/
|
||||
//Font
|
||||
final JButton fontButton = new JButton(model.getNodeFont().getFontName() + ", " + model.getNodeFont().getSize());
|
||||
fontButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Labels.font"));
|
||||
fontButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
Font font = JFontChooser.showDialog(WindowManager.getDefault().getMainWindow(), model.getNodeFont());
|
||||
if (font != null && font != model.getNodeFont()) {
|
||||
model.setNodeFont(font);
|
||||
@@ -505,7 +522,7 @@ public class VizBarController {
|
||||
model.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
fontButton.setText(model.getNodeFont().getFontName() + ", " + model.getNodeFont().getSize());
|
||||
}
|
||||
});
|
||||
@@ -517,7 +534,7 @@ public class VizBarController {
|
||||
fontSizeSlider.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
model.setNodeSizeFactor(fontSizeSlider.getValue() / 100f);
|
||||
}
|
||||
});
|
||||
@@ -526,7 +543,7 @@ public class VizBarController {
|
||||
model.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (((int) (model.getNodeSizeFactor() * 100f)) != fontSizeSlider.getValue()) {
|
||||
fontSizeSlider.setValue((int) (model.getNodeSizeFactor() * 100f));
|
||||
}
|
||||
@@ -544,7 +561,7 @@ public class VizBarController {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals(ColorChooser.PROP_COLOR)) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
model.setNodeColor(colorChooser.getColor());
|
||||
}
|
||||
}
|
||||
@@ -552,7 +569,7 @@ public class VizBarController {
|
||||
model.addChangeListener(new ChangeListener() {
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
if (!model.getNodeColor().equals(colorChooser.getColor())) {
|
||||
colorChooser.setColor(model.getNodeColor());
|
||||
}
|
||||
@@ -562,12 +579,12 @@ public class VizBarController {
|
||||
|
||||
//Attributes
|
||||
final JButton attributesButton = new JButton();
|
||||
attributesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/visualization/component/configureLabels.png")));
|
||||
attributesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/visualization/components/configureLabels.png")));
|
||||
attributesButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Labels.attributes"));
|
||||
attributesButton.addActionListener(new ActionListener() {
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TextModel model = VizController.getInstance().getVizModel().getTextModel();
|
||||
TextModel model = Lookup.getDefault().lookup(VisualizationController.class).getVizModel().getTextModel();
|
||||
LabelAttributesPanel panel = new LabelAttributesPanel();
|
||||
panel.setup(model);
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(VizBarController.class, "LabelAttributesPanel.title"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
@@ -5,41 +5,20 @@ Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Copyright 2011 Gephi Consortium. All rights reserved.
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.visualization.component;
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.UIManager;
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import java.awt.Component;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import org.gephi.ui.utils.UIUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public class VizToolbar extends JToolBar {
|
||||
|
||||
public VizToolbar(VizToolbarGroup[] groups) {
|
||||
initDesign();
|
||||
|
||||
for (VizToolbarGroup g : groups) {
|
||||
if (g.hasToolbar()) {
|
||||
addSeparator();
|
||||
for (JComponent c : g.getToolbarComponents()) {
|
||||
add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initDesign() {
|
||||
setFloatable(false);
|
||||
putClientProperty("JToolBar.isRollover", Boolean.TRUE); //NOI18N
|
||||
setBorder(BorderFactory.createEmptyBorder(2, 0, 4, 0));
|
||||
if (UIUtils.isAquaLookAndFeel()) {
|
||||
setBackground(UIManager.getColor("NbExplorerView.background"));
|
||||
}
|
||||
}
|
||||
|
||||
public void setEnable(final boolean enabled) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
for (Component c : getComponents()) {
|
||||
c.setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component add(Component comp) {
|
||||
if (comp instanceof JButton) {
|
||||
UIUtils.fixButtonUI((JButton) comp);
|
||||
}
|
||||
|
||||
return super.add(comp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mathieu Bastian
|
||||
*/
|
||||
public interface VizToolbarGroup {
|
||||
|
||||
public String getName();
|
||||
|
||||
public JComponent[] getToolbarComponents();
|
||||
|
||||
public JComponent getExtendedComponent();
|
||||
|
||||
public boolean hasToolbar();
|
||||
|
||||
public boolean hasExtended();
|
||||
}
|
||||
|
Antes Largura: | Altura: | Tamanho: 422 B Depois Largura: | Altura: | Tamanho: 422 B |
|
Antes Largura: | Altura: | Tamanho: 398 B Depois Largura: | Altura: | Tamanho: 398 B |
|
Antes Largura: | Altura: | Tamanho: 311 B Depois Largura: | Altura: | Tamanho: 311 B |
|
Antes Largura: | Altura: | Tamanho: 296 B Depois Largura: | Altura: | Tamanho: 296 B |
|
Antes Largura: | Altura: | Tamanho: 756 B Depois Largura: | Altura: | Tamanho: 756 B |
|
Antes Largura: | Altura: | Tamanho: 775 B Depois Largura: | Altura: | Tamanho: 775 B |
|
Antes Largura: | Altura: | Tamanho: 784 B Depois Largura: | Altura: | Tamanho: 784 B |
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
Copyright 2008-2010 Gephi
|
||||
Authors : Vojtech Bardiovsky <vojtech.bardiovsky@gmail.com>
|
||||
Website : http://www.gephi.org
|
||||
|
||||
This file is part of Gephi.
|
||||
|
||||
Gephi is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Gephi is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.gephi.desktop.visualization.components.contextmenu;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.Icon;
|
||||
import org.gephi.datalab.spi.ContextMenuItemManipulator;
|
||||
import org.gephi.desktop.visualization.components.NodeSettingsPanel;
|
||||
import org.gephi.desktop.visualization.components.NodeShapeSelectionPanel;
|
||||
import org.gephi.graph.api.Node;
|
||||
import org.gephi.graph.api.NodeShape;
|
||||
import org.gephi.visualization.spi.BasicItem;
|
||||
import org.gephi.visualization.spi.GraphContextMenuItem;
|
||||
import org.openide.DialogDescriptor;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
|
||||
|
||||
@ServiceProvider(service = GraphContextMenuItem.class)
|
||||
public class SetNodeShape extends BasicItem {
|
||||
|
||||
@Override
|
||||
public void execute() {}
|
||||
|
||||
@Override
|
||||
public ContextMenuItemManipulator[] getSubItems() {
|
||||
if (nodes.length > 0) {
|
||||
List<GraphContextMenuItem> subItems = new ArrayList<GraphContextMenuItem>();
|
||||
int i = 1;
|
||||
// Add native shapes
|
||||
for (final NodeShape shape : NodeShape.nativeShapes()) {
|
||||
final int j = i++;
|
||||
subItems.add(new BasicItem() {
|
||||
@Override
|
||||
public void execute() {
|
||||
for (Node node : nodes) {
|
||||
node.getNodeData().setNodeShape(shape);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return shape.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExecute() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPosition() {
|
||||
return j;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
// Add user imported image shape
|
||||
final int j = i;
|
||||
subItems.add(new BasicItem() {
|
||||
@Override
|
||||
public void execute() {
|
||||
NodeShapeSelectionPanel panel = new NodeShapeSelectionPanel();
|
||||
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(NodeShapeSelectionPanel.class, "NodeShapeSelectionPanel.title"), true, NotifyDescriptor.OK_CANCEL_OPTION, null, null);
|
||||
if (DialogDisplayer.getDefault().notify(dd).equals(NotifyDescriptor.OK_OPTION) && panel.getSelectedNodeShape() != null) {
|
||||
for (Node node : nodes) {
|
||||
node.getNodeData().setNodeShape(panel.getSelectedNodeShape());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.browseImage");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExecute() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPosition() {
|
||||
return j;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
return subItems.toArray(new GraphContextMenuItem[]{});
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return NbBundle.getMessage(NodeShapeSelectionPanel.class, "GraphContextMenu_SetNodeShape");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExecute() {
|
||||
return nodes.length > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPosition() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Antes Largura: | Altura: | Tamanho: 817 B Depois Largura: | Altura: | Tamanho: 817 B |
|
Depois Largura: | Altura: | Tamanho: 173 B |
|
Antes Largura: | Altura: | Tamanho: 413 B Depois Largura: | Altura: | Tamanho: 413 B |
|
Antes Largura: | Altura: | Tamanho: 348 B Depois Largura: | Altura: | Tamanho: 348 B |
|
Antes Largura: | Altura: | Tamanho: 324 B Depois Largura: | Altura: | Tamanho: 324 B |
|
Antes Largura: | Altura: | Tamanho: 341 B Depois Largura: | Altura: | Tamanho: 341 B |
|
Depois Largura: | Altura: | Tamanho: 195 B |
|
Antes Largura: | Altura: | Tamanho: 231 B Depois Largura: | Altura: | Tamanho: 231 B |
|
Antes Largura: | Altura: | Tamanho: 326 B Depois Largura: | Altura: | Tamanho: 326 B |
|
Antes Largura: | Altura: | Tamanho: 340 B Depois Largura: | Altura: | Tamanho: 340 B |
|
Antes Largura: | Altura: | Tamanho: 335 B Depois Largura: | Altura: | Tamanho: 335 B |
|
Antes Largura: | Altura: | Tamanho: 304 B Depois Largura: | Altura: | Tamanho: 304 B |
|
Antes Largura: | Altura: | Tamanho: 635 B Depois Largura: | Altura: | Tamanho: 635 B |
|
Antes Largura: | Altura: | Tamanho: 524 B Depois Largura: | Altura: | Tamanho: 524 B |
|
Antes Largura: | Altura: | Tamanho: 483 B Depois Largura: | Altura: | Tamanho: 483 B |
|
Antes Largura: | Altura: | Tamanho: 419 B Depois Largura: | Altura: | Tamanho: 419 B |
|
Antes Largura: | Altura: | Tamanho: 445 B Depois Largura: | Altura: | Tamanho: 445 B |
|
Depois Largura: | Altura: | Tamanho: 3.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 3.4 KiB |