proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
gephi_gephi | gephi/modules/StatisticsPlugin/src/main/java/org/gephi/statistics/plugin/dynamic/DynamicNbNodes.java | DynamicNbNodes | getReport | class DynamicNbNodes implements DynamicStatistics {
public static final String NB_NODES = "dynamic nodecount";
//Data
private GraphModel graphModel;
private double window;
private double tick;
private Interval bounds;
//Average
private Map<Double, Integer> counts;
@Override
pub... |
//Time series
XYSeries dSeries = ChartUtils.createXYSeries(counts, "Nb Nodes Time Series");
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(dSeries);
JFreeChart chart = ChartFactory.createXYLineChart(
"# Nodes Time Series",
"Tim... | 437 | 416 | 853 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/ClusteringCoefficientPanel.java | ClusteringCoefficientPanel | initComponents | class ClusteringCoefficientPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup algorithmButtonGroup;
private javax.swing.ButtonGroup directedButtonGroup;
// End of variables declaration//GEN-END:variables
// public boolea... |
directedButtonGroup = new javax.swing.ButtonGroup();
algorithmButtonGroup = new javax.swing.ButtonGroup();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swing.JRadioButton();
header = new org.jdesktop.swingx.JXHeader();
directe... | 533 | 703 | 1,236 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/ClusteringCoefficientUI.java | ClusteringCoefficientUI | unsetup | class ClusteringCoefficientUI implements StatisticsUI {
private ClusteringCoefficientPanel panel;
private ClusteringCoefficient clusteringCoefficient;
@Override
public JPanel getSettingsPanel() {
panel = new ClusteringCoefficientPanel();
return panel;
}
@Override
public vo... |
if (panel != null) {
clusteringCoefficient.setDirected(panel.isDirected());
}
clusteringCoefficient = null;
panel = null;
| 410 | 48 | 458 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/ConnectedComponentPanel.java | ConnectedComponentPanel | initComponents | class ConnectedComponentPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JRadioButton directedRadioButton;
private org.jdesktop.swingx.JXHeader header;
private javax.swing.JLabel jLabel... |
buttonGroup1 = new javax.swing.ButtonGroup();
header = new org.jdesktop.swingx.JXHeader();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swing.JRadioButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel(... | 470 | 1,063 | 1,533 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/DegreeDistributionPanel.java | DegreeDistributionPanel | initComponents | class DegreeDistributionPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton directedRadioButton;
private javax.swing.JRadioButton undirectedRadioButton;
private org.jdesktop.swingx.JXLabel descriptionLabel;
private javax.... |
directedButtonGroup = new javax.swing.ButtonGroup();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swing.JRadioButton();
descriptionLabel = new org.jdesktop.swingx.JXLabel();
header = new org.jdesktop.swingx.JXHeader();
directe... | 447 | 860 | 1,307 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/DiameterUI.java | DiameterUI | unsetup | class DiameterUI implements StatisticsUI {
private GraphDistancePanel panel;
private GraphDistance graphDistance;
@Override
public JPanel getSettingsPanel() {
panel = new GraphDistancePanel();
return panel;
}
@Override
public void setup(Statistics statistics) {
thi... |
if (panel != null) {
graphDistance.setDirected(panel.isDirected());
graphDistance.setNormalized(panel.normalize());
}
panel = null;
graphDistance = null;
| 375 | 58 | 433 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/EigenvectorCentralityPanel.java | EigenvectorCentralityPanel | initComponents | class EigenvectorCentralityPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JRadioButton directedRadioButton;
private org.jdesktop.swingx.JXHeader header;
private javax.swing.JTextField... |
buttonGroup1 = new javax.swing.ButtonGroup();
header = new org.jdesktop.swingx.JXHeader();
iterationTextField = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swin... | 666 | 1,065 | 1,731 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/EigenvectorCentralityUI.java | EigenvectorCentralityUI | setup | class EigenvectorCentralityUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private EigenvectorCentralityPanel panel;
private EigenvectorCentrality eigen;
@Override
public JPanel getSettingsPanel() {
panel = new EigenvectorCentralityPanel();
re... |
this.eigen = (EigenvectorCentrality) statistics;
if (panel != null) {
settings.load(eigen);
panel.setNumRuns(eigen.getNumRuns());
panel.setDirected(eigen.isDirected());
}
| 488 | 74 | 562 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/GraphDensityPanel.java | GraphDensityPanel | initComponents | class GraphDensityPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton directedRadioButton;
private javax.swing.JRadioButton undirectedRadioButton;
private javax.swing.ButtonGroup directedButtonGroup;
private org.jdesktop.... |
directedButtonGroup = new javax.swing.ButtonGroup();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swing.JRadioButton();
header = new org.jdesktop.swingx.JXHeader();
directedButtonGroup.add(directedRadioButton);
directedRadioBu... | 428 | 662 | 1,090 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/HitsUI.java | HitsUI | setup | class HitsUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private HitsPanel panel;
private Hits hits;
@Override
public JPanel getSettingsPanel() {
panel = new HitsPanel();
return panel;
}
@Override
public void setup(Statistics sta... |
this.hits = (Hits) statistics;
if (panel != null) {
settings.load(hits);
panel.setEpsilon(hits.getEpsilon());
panel.setDirected(!hits.getUndirected());
}
| 446 | 70 | 516 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/ModularityUI.java | ModularityUI | unsetup | class ModularityUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private ModularityPanel panel;
private Modularity mod;
@Override
public JPanel getSettingsPanel() {
panel = new ModularityPanel();
return panel;
}
@Override
public vo... |
if (panel != null) {
mod.setRandom(panel.isRandomize());
mod.setUseWeight(panel.useWeight());
mod.setResolution(panel.resolution());
mod.setInitialModularityClassIndex(panel.getInitialModularityClassIndex());
settings.save(mod);
}
mod ... | 543 | 96 | 639 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/PageRankUI.java | StatSettings | save | class StatSettings {
private double epsilon = 0.001;
private double probability = 0.85;
private boolean useEdgeWeight = false;
private void save(PageRank stat) {<FILL_FUNCTION_BODY>}
private void load(PageRank stat) {
stat.setEpsilon(epsilon);
stat.setP... |
this.epsilon = stat.getEpsilon();
this.probability = stat.getProbability();
this.useEdgeWeight = stat.isUseEdgeWeight();
| 118 | 43 | 161 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicClusteringCoefficientPanel.java | DynamicClusteringCoefficientPanel | setDirected | class DynamicClusteringCoefficientPanel extends javax.swing.JPanel {
protected javax.swing.JRadioButton directedRadioButton;
protected javax.swing.JRadioButton undirectedRadioButton;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox averageOnlyCheckbox;
pri... |
directedButtonGroup
.setSelected(directed ? directedRadioButton.getModel() : undirectedRadioButton.getModel(), true);
if (!directed) {
directedRadioButton.setEnabled(false);
}
| 1,293 | 61 | 1,354 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicClusteringCoefficientUI.java | DynamicClusteringCoefficientUI | setup | class DynamicClusteringCoefficientUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private DynamicClusteringCoefficient clusetingCoefficient;
private DynamicClusteringCoefficientPanel panel;
@Override
public JPanel getSettingsPanel() {
panel = new Dyna... |
this.clusetingCoefficient = (DynamicClusteringCoefficient) statistics;
if (panel != null) {
settings.load(clusetingCoefficient);
panel.setDirected(clusetingCoefficient.isDirected());
panel.setAverageOnly(clusetingCoefficient.isAverageOnly());
}
| 574 | 87 | 661 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicDegreePanel.java | DynamicDegreePanel | initComponents | class DynamicDegreePanel extends javax.swing.JPanel {
protected javax.swing.JRadioButton directedRadioButton;
protected javax.swing.JRadioButton undirectedRadioButton;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox averageOnlyCheckbox;
private javax.swin... |
directedButtonGroup = new javax.swing.ButtonGroup();
header = new org.jdesktop.swingx.JXHeader();
directedRadioButton = new javax.swing.JRadioButton();
undirectedRadioButton = new javax.swing.JRadioButton();
averageOnlyCheckbox = new javax.swing.JCheckBox();
header.set... | 523 | 775 | 1,298 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicDegreeUI.java | DynamicDegreeUI | unsetup | class DynamicDegreeUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private DynamicDegree degree;
private DynamicDegreePanel panel;
@Override
public JPanel getSettingsPanel() {
panel = new DynamicDegreePanel();
return panel;
}
@Overrid... |
if (panel != null) {
degree.setDirected(panel.isDirected());
degree.setAverageOnly(panel.isAverageOnly());
settings.save(degree);
}
degree = null;
panel = null;
| 531 | 66 | 597 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicNbEdgesPanel.java | DynamicNbEdgesPanel | initComponents | class DynamicNbEdgesPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.jdesktop.swingx.JXHeader header;
/**
* Creates new form DynamicNbEdgesPanel
*/
public DynamicNbEdgesPanel() {
initComponents();
}
/**
* This ... |
header = new org.jdesktop.swingx.JXHeader();
header.setDescription(org.openide.util.NbBundle
.getMessage(DynamicNbEdgesPanel.class, "DynamicNbEdgesPanel.header.description")); // NOI18N
header.setTitle(org.openide.util.NbBundle
.getMessage(DynamicNbEdgesPanel.class, "D... | 241 | 325 | 566 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicNbEdgesUI.java | DynamicNbEdgesUI | unsetup | class DynamicNbEdgesUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private DynamicNbEdges nbEdges;
private DynamicNbEdgesPanel panel;
@Override
public JPanel getSettingsPanel() {
panel = new DynamicNbEdgesPanel();
return panel;
}
@Ov... |
if (panel != null) {
settings.save(nbEdges);
}
nbEdges = null;
| 481 | 35 | 516 | <no_super_class> |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicNbNodesPanel.java | DynamicNbNodesPanel | initComponents | class DynamicNbNodesPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.jdesktop.swingx.JXHeader header;
/**
* Creates new form DynamicNbNodesPanel
*/
public DynamicNbNodesPanel() {
initComponents();
}
/**
* This ... |
header = new org.jdesktop.swingx.JXHeader();
header.setDescription(org.openide.util.NbBundle
.getMessage(DynamicNbNodesPanel.class, "DynamicNbNodesPanel.header.description")); // NOI18N
header.setTitle(org.openide.util.NbBundle
.getMessage(DynamicNbNodesPanel.class, "D... | 238 | 321 | 559 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/StatisticsPluginUI/src/main/java/org/gephi/ui/statistics/plugin/dynamic/DynamicNbNodesUI.java | DynamicNbNodesUI | unsetup | class DynamicNbNodesUI implements StatisticsUI {
private final StatSettings settings = new StatSettings();
private DynamicNbNodes nbNodes;
private DynamicNbNodesPanel panel;
@Override
public JPanel getSettingsPanel() {
panel = new DynamicNbNodesPanel();
return panel;
}
@Ov... |
if (panel != null) {
settings.save(nbNodes);
}
nbNodes = null;
| 468 | 33 | 501 | <no_super_class> |
gephi_gephi | gephi/modules/TimelineAPI/src/main/java/org/gephi/timeline/GraphObserverThread.java | GraphObserverThread | run | class GraphObserverThread extends Thread {
private final TimelineControllerImpl timelineController;
private final TimelineModelImpl timelineModel;
private boolean stop;
private Interval interval;
public GraphObserverThread(TimelineControllerImpl controller, TimelineModelImpl model) {
this.... |
while (!stop) {
GraphModel graphModel = timelineModel.getGraphModel();
Interval bounds = graphModel.getTimeBounds();
if (!bounds.equals(interval)) {
interval = bounds;
timelineController.setMinMax(interval.getLow(), interval.getHigh());
... | 151 | 112 | 263 | <methods>public void <init>() ,public void <init>(java.lang.Runnable) ,public void <init>(java.lang.String) ,public void <init>(java.lang.ThreadGroup, java.lang.Runnable) ,public void <init>(java.lang.ThreadGroup, java.lang.String) ,public void <init>(java.lang.Runnable, java.lang.String) ,public void <init>(java.lang.... |
gephi_gephi | gephi/modules/TimelineAPI/src/main/java/org/gephi/timeline/TimelineChartImpl.java | TimelineChartImpl | getY | class TimelineChartImpl implements TimelineChart {
private final String column;
private final Number[] x;
private final Number[] y;
private final Number minY;
private final Number maxY;
private final Number minX;
private final Number maxX;
public TimelineChartImpl(String column, Number... |
double pos = posX.doubleValue();
Double value = null;
if (pos <= maxX.doubleValue()) {
for (int i = 0; i < x.length; i++) {
if (pos < x[i].doubleValue()) {
return value;
}
value = y[i].doubleValue();
}
... | 1,296 | 98 | 1,394 | <no_super_class> |
gephi_gephi | gephi/modules/TimelineAPI/src/main/java/org/gephi/timeline/TimelineModelImpl.java | TimelineModelImpl | getIntervalEnd | class TimelineModelImpl implements TimelineModel {
private final GraphModel graphModel;
private final AtomicBoolean playing;
private boolean enabled;
private double customMin;
private double customMax;
//Animation
private int playDelay;
private double playStep;
private PlayMode play... |
double vi = interval.getHigh();
if (Double.isInfinite(vi)) {
return getCustomMax();
}
return vi;
| 1,080 | 41 | 1,121 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/Brush.java | Brush | brush | class Brush implements Tool {
//Architecture
private ToolEventListener[] listeners;
private BrushPanel brushPanel;
//Settings
private float[] color = {1f, 0f, 0f};
private float intensity = 0.3f;
private DiffusionMethods.DiffusionMethod diffusionMethod = DiffusionMethods.DiffusionMethod.NEI... |
for (Node node : nodes) {
float r = node.r();
float g = node.g();
float b = node.b();
r = intensity * color[0] + (1 - intensity) * r;
g = intensity * color[1] + (1 - intensity) * g;
b = intensity * color[2] + (1 - intensity) * b;
... | 843 | 258 | 1,101 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/DiffusionMethods.java | DiffusionMethods | getNeighborsOfNeighbors | class DiffusionMethods {
public static Node[] getNeighbors(Graph graph, Node[] nodes) {
Set<Node> nodeTree = new HashSet<>();
graph.readLock();
try {
for (Node n : nodes) {
nodeTree.addAll(graph.getNeighbors(n).toCollection());
}
} finally {
... |
Set<Node> nodeTree = new HashSet<>();
graph.readLock();
try {
for (Node n : nodes) {
nodeTree.addAll(graph.getNeighbors(n).toCollection());
}
//remove original nodes
for (Node n : nodes) {
nodeTree.remove(n);
... | 652 | 193 | 845 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/EdgePencil.java | EdgePencil | getListeners | class EdgePencil implements Tool {
//Architecture
private ToolEventListener[] listeners;
private EdgePencilPanel edgePencilPanel;
//Settings
private Color color;
private float weight;
//State
private Node sourceNode;
public EdgePencil() {
//Default settings
color = ... |
listeners = new ToolEventListener[2];
listeners[0] = new NodeClickEventListener() {
@Override
public void clickNodes(Node[] nodes) {
Node n = nodes[0];
if (sourceNode == null) {
sourceNode = n;
edgePencilPa... | 747 | 332 | 1,079 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/Edit.java | Edit | getListeners | class Edit implements Tool {
private EditWindowController edc;
@Override
public void select() {
edc = Lookup.getDefault().lookup(EditWindowController.class);
edc.openEditWindow();
}
@Override
public void unselect() {
edc.disableEdit();
edc.closeEditWindow();
... |
return new ToolEventListener[] {new NodeClickEventListener() {
@Override
public void clickNodes(Node[] nodes) {
if (nodes.length > 0) {
edc.editNode(nodes[0]);
} else {
edc.disableEdit();
}
... | 335 | 80 | 415 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/HeatMap.java | HeatMap | clickNodes | class HeatMap implements Tool {
//Architecture
private ToolEventListener[] listeners;
private HeatMapPanel heatMapPanel;
//Settings
private Color[] gradientColors;
private float[] gradientPositions; //All between 0 and 1
private boolean dontPaintUnreachable = true;
public HeatMap() {
... |
try {
Node n = nodes[0];
Color[] colors;
float[] positions;
if (heatMapPanel.isUsePalette()) {
colors = heatMapPanel.getSelectedPalette().getColors();
positions = heatMapPanel... | 547 | 621 | 1,168 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/NodePencil.java | NodePencil | mouseClick | class NodePencil implements Tool {
//Architecture
private ToolEventListener[] listeners;
private NodePencilPanel nodePencilPanel;
//Settings
private Color color;
private float size;
public NodePencil() {
//Default settings
color = new Color(153, 153, 153);//Default gray of ... |
color = nodePencilPanel.getColor();
size = nodePencilPanel.getNodeSize();
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
GraphModel gm = gc.getGraphModel();
Graph graph = gm.getGraph();
Node node = ... | 497 | 140 | 637 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/Painter.java | Painter | pressingNodes | class Painter implements Tool {
private ToolEventListener[] listeners;
private PainterPanel painterPanel;
//Settings
private float[] color = {1f, 0f, 0f};
private float intensity = 0.3f;
@Override
public void select() {
}
@Override
public void unselect() {
listeners = ... |
color = painterPanel.getColor().getColorComponents(color);
for (Node node : nodes) {
float r = node.r();
float g = node.g();
float b = node.b();
r = intensity * color[0] + (1 - intensity) * r;
... | 460 | 145 | 605 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/tools/plugin/Sizer.java | Sizer | getListeners | class Sizer implements Tool {
private final float INTENSITY = 0.4f;
private final float LIMIT = 0.1f;
private SizerPanel sizerPanel;
private ToolEventListener[] listeners;
//Vars
private Node[] nodes;
private float[] sizes;
@Override
public void select() {
}
@Override
... |
listeners = new ToolEventListener[1];
listeners[0] = new NodePressAndDraggingEventListener() {
@Override
public void pressNodes(Node[] nodes) {
Sizer.this.nodes = nodes;
sizes = new float[nodes.length];
for (int i = 0; i < nodes.le... | 394 | 312 | 706 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/BrushPanel.java | BrushPanel | initComponents | class BrushPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton colorButton;
private javax.swing.JComboBox diffusionCombobox;
private javax.swing.JSpinner intensitySpinner;
private javax.swing.JLabel jLabel1;
private javax.... |
labelDiffusion = new javax.swing.JLabel();
labelColor = new javax.swing.JLabel();
diffusionCombobox = new javax.swing.JComboBox();
colorButton = new JColorButton(Color.BLACK);
labelIntensity = new javax.swing.JLabel();
intensitySpinner = new javax.swing.JSpinner();
... | 562 | 1,417 | 1,979 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/HeatMapPanel.java | PaletteListCellRenderer | getListCellRendererComponent | class PaletteListCellRenderer extends JLabel implements ListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {<FILL_FUNCTION_BODY>}
... |
//int selectedIndex = ((Integer) value).intValue();
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
} else {
setBackground(list.getBackground());
... | 68 | 129 | 197 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/NodePencilPanel.java | NodePencilPanel | initComponents | class NodePencilPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton colorButton;
private javax.swing.JLabel labelColor;
private javax.swing.JLabel labelSize;
private javax.swing.JSpinner sizeSpinner;
private javax.swing.JL... |
sizeSpinner = new javax.swing.JSpinner();
labelSize = new javax.swing.JLabel();
colorButton = new JColorButton(Color.BLACK);
labelColor = new javax.swing.JLabel();
statusLabel = new javax.swing.JLabel();
sizeSpinner.setFont(sizeSpinner.getFont().deriveFont((float) 10))... | 421 | 1,056 | 1,477 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/PainterPanel.java | PainterPanel | initComponents | class PainterPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton colorButton;
private javax.swing.JLabel labelColor;
// End of variables declaration//GEN-END:variables
public PainterPanel() {
initComponents();
}
... |
colorButton = new JColorButton(Color.BLACK);
labelColor = new javax.swing.JLabel();
colorButton.setText(
org.openide.util.NbBundle.getMessage(PainterPanel.class, "PainterPanel.colorButton.text")); // NOI18N
colorButton.setContentAreaFilled(false);
colorButton.setFo... | 277 | 507 | 784 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/SizerPanel.java | SizerPanel | setAvgSize | class SizerPanel extends javax.swing.JPanel {
private float avgSize;
private DecimalFormat formatter;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel labelSize;
private javax.swing.JLabel sizeLabel;
// End of varia... |
this.avgSize = avgSize;
if (avgSize == -1) {
sizeLabel.setText("NaN");
} else {
String str = formatter.format(avgSize);
if (!str.equals(sizeLabel.getText())) {
sizeLabel.setText(str);
}
}
| 973 | 85 | 1,058 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditNodes.java | MultipleNodesPropertiesWrapper | setNodesSize | class MultipleNodesPropertiesWrapper {
private final Node[] nodes;
//Methods and fields for multiple nodes editing:
private Float nodesX = null;
private Float nodesY = null;
private Float nodesZ = null;
private Float nodesSize = null;
private Color nodesColor = n... |
nodesSize = size;
for (Node node : nodes) {
node.setSize(size);
}
| 843 | 32 | 875 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditToolTopComponent.java | EditToolTopComponent | readProperties | class EditToolTopComponent extends TopComponent {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel propertySheet;
// End of variables declaration//GEN-END:variables
public EditToolTopComponent() {
initComponents();
setName(NbBundle.getMessage(Edi... |
String version = p.getProperty("version");
// TODO read your settings according to their version
| 1,027 | 26 | 1,053 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/EditWindowControllerImpl.java | IsOpenRunnable | run | class IsOpenRunnable implements Runnable {
boolean open = false;
@Override
public void run() {<FILL_FUNCTION_BODY>}
} |
EditToolTopComponent topComponent = findInstance();
open = topComponent != null && topComponent.isOpened();
| 47 | 32 | 79 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/MultipleRowsAttributeValueWrapper.java | MultipleRowsAttributeValueWrapper | convertToStringIfNotNull | class MultipleRowsAttributeValueWrapper implements AttributeValueWrapper {
private final Element[] rows;
private final Column column;
private final TimeFormat currentTimeFormat;
private final DateTimeZone dateTimeZone;
private Object value;
public MultipleRowsAttributeValueWrapper(Element[] ro... |
if (value != null) {
return AttributeUtils.print(value, currentTimeFormat, dateTimeZone);
} else {
return null;
}
| 779 | 45 | 824 | <no_super_class> |
gephi_gephi | gephi/modules/ToolsPlugin/src/main/java/org/gephi/ui/tools/plugin/edit/SingleRowAttributeValueWrapper.java | SingleRowAttributeValueWrapper | convertToStringIfNotNull | class SingleRowAttributeValueWrapper implements EditWindowUtils.AttributeValueWrapper {
private final Element row;
private final Column column;
private final TimeFormat currentTimeFormat;
private final DateTimeZone dateTimeZone;
public SingleRowAttributeValueWrapper(Element row, Column column, Tim... |
Object value = row.getAttribute(column);
if (value != null) {
return AttributeUtils.print(value, currentTimeFormat, dateTimeZone);
} else {
return null;
}
| 770 | 57 | 827 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/BusyUtils.java | BusyLabel | setBusy | class BusyLabel {
private final JScrollPane scrollPane;
private final JXBusyLabel busyLabel;
private JComponent component;
private BusyLabel(JScrollPane scrollpane, String text, JComponent component) {
this.scrollPane = scrollpane;
this.component = component;
... |
if (busy) {
if (scrollPane != null) {
scrollPane.setViewportView(busyLabel);
}
busyLabel.setBusy(true);
} else {
busyLabel.setBusy(false);
if (scrollPane != null) {
scrollPan... | 197 | 96 | 293 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/CloseButton.java | CloseButton | init | class CloseButton extends JButton {
public CloseButton(Action a) {
super(a);
init();
}
public CloseButton() {
super();
init();
}
private void init() {<FILL_FUNCTION_BODY>}
@Override
public void setAction(Action a) {
super.setAction(a);
init... |
if (UIUtils.isGTKLookAndFeel()) {
setIcon(
ImageUtilities.loadImageIcon("UIComponents/gtk_bigclose_enabled.png", false));
setRolloverIcon(
ImageUtilities.loadImageIcon("UIComponents/gtk_bigclose_rollover.png", false));
setPressedIcon(
... | 105 | 641 | 746 | <methods>public void <init>() ,public void <init>(javax.swing.Icon) ,public void <init>(java.lang.String) ,public void <init>(javax.swing.Action) ,public void <init>(java.lang.String, javax.swing.Icon) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.lang.String getUIClassID() ,public b... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/ColumnSelectionPanel.java | ColumnSelectionPanel | showColumnSelectionDialog | class ColumnSelectionPanel extends JPanel {
private final Map<ColumnSelectionModel, JCheckBox> checkBoxes;
public ColumnSelectionPanel(ColumnSelectionModel[] columns) {
checkBoxes = new HashMap<>();
setLayout(new GridBagLayout());
init(columns);
}
public static void showColumn... |
ColumnSelectionPanel panel = new ColumnSelectionPanel(columns);
int res = JOptionPane.showConfirmDialog(null, panel, dialogTitle, JOptionPane.OK_CANCEL_OPTION);
if (res == JOptionPane.OK_OPTION) {
panel.applyDialogChanges();
}
| 752 | 79 | 831 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/DecoratedIcon.java | DecoratedIcon | paintIcon | class DecoratedIcon implements Icon {
private final Icon orig;
private final Icon decoration;
private final DecorationController decorationController;
public DecoratedIcon(Icon orig, Icon decoration) {
this.orig = orig;
this.decoration = decoration;
this.decorationController = ... |
orig.paintIcon(c, g, x, y);
if (decorationController == null || decorationController.isDecorated()) {
decoration.paintIcon(c, g, x + orig.getIconWidth() - decoration.getIconWidth(), y);
}
| 247 | 70 | 317 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/IconWithArrow.java | IconWithArrow | paintIcon | class IconWithArrow implements Icon {
private static final String ARROW_IMAGE_NAME = "org/openide/awt/resources/arrow.png"; //NOI18N
private static final int GAP = 6;
private final Icon orig;
private final Icon arrow = ImageUtilities.image2Icon(ImageUtilities.loadImage(ARROW_IMAGE_NAME, false));
pr... |
int height = getIconHeight();
orig.paintIcon(c, g, x, y + (height - orig.getIconHeight()) / 2);
arrow.paintIcon(c, g, x + GAP + orig.getIconWidth(), y + (height - arrow.getIconHeight()) / 2);
if (paintRollOver) {
Color brighter = UIManager.getColor("controlHighlight"); //N... | 292 | 305 | 597 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JColorBlackWhiteSwitcher.java | JColorBlackWhiteSwitcher | refreshIcon | class JColorBlackWhiteSwitcher extends JButton {
private final static int ICON_WIDTH = 16;
private final static int ICON_HEIGHT = 16;
private final static Color DISABLED_BORDER = new Color(200, 200, 200);
private final static Color DISABLED_FILL = new Color(220, 220, 220);
public static String EVEN... |
if (color.equals(Color.WHITE)) {//White color, show a lightbulb on:
setIcon(ImageUtilities.loadImageIcon("UIComponents/light-bulb.png", false));
} else if (color.equals(Color.BLACK)) {//Black color, show a lightbulb off:
setIcon(ImageUtilities.loadImageIcon("UIComponents/light-b... | 1,014 | 139 | 1,153 | <methods>public void <init>() ,public void <init>(javax.swing.Icon) ,public void <init>(java.lang.String) ,public void <init>(javax.swing.Action) ,public void <init>(java.lang.String, javax.swing.Icon) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.lang.String getUIClassID() ,public b... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JColorButton.java | JColorButton | paintIcon | class JColorButton extends JButton {
private final static int ICON_WIDTH = 16;
private final static int ICON_HEIGHT = 16;
private final static Color DISABLED_BORDER = new Color(200, 200, 200);
private final static Color DISABLED_FILL = new Color(220, 220, 220);
public static String EVENT_COLOR = "c... |
if (c.isEnabled()) {
g.setColor(Color.BLACK);
g.drawRect(x + 2, y + 2, ICON_WIDTH - 5, ICON_HEIGHT - 5);
if (color != null) {
g.setColor(color);
g.fillRect(x + 3, y + 3, ICON_WIDTH - 6, ICON_HEIG... | 733 | 216 | 949 | <methods>public void <init>() ,public void <init>(javax.swing.Icon) ,public void <init>(java.lang.String) ,public void <init>(javax.swing.Action) ,public void <init>(java.lang.String, javax.swing.Icon) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.lang.String getUIClassID() ,public b... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JImagePanel.java | JImagePanel | setPreferredBackground | class JImagePanel extends JPanel {
//~ Static fields/initializers -----------------------------------------------------------------------------------------------
private static final MediaTracker mTracker = new MediaTracker(new JPanel());
//~ Instance fields -----------------------------------------------... |
int[] pixels = new int[1];
PixelGrabber pg = null;
switch (imageAlign) {
case (SwingConstants.TOP):
pg = new PixelGrabber(image, 0, image.getHeight(null) - 1, 1, 1, pixels, 0, 1);
break;
case (SwingConstants.BOTTOM):
pg ... | 664 | 247 | 911 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JMenuToggleButton.java | LineIcon | paintIcon | class LineIcon implements Icon {
private final Icon origIcon;
private final int arrowWidth;
public LineIcon(Icon origIcon, int arrowWidth) {
this.origIcon = origIcon;
this.arrowWidth = arrowWidth;
}
@Override
public void paintIcon(Component c, G... |
origIcon.paintIcon(c, g, x, y);
g.setColor(UIManager.getColor("controlHighlight")); //NOI18N
g.drawLine(x + origIcon.getIconWidth() - arrowWidth - 2, y,
x + origIcon.getIconWidth() - arrowWidth - 2, y + getIconHeight());
g.setColor(UIManager.getColor("co... | 159 | 169 | 328 | <methods>public void <init>() ,public void <init>(javax.swing.Icon) ,public void <init>(java.lang.String) ,public void <init>(javax.swing.Action) ,public void <init>(javax.swing.Icon, boolean) ,public void <init>(java.lang.String, boolean) ,public void <init>(java.lang.String, javax.swing.Icon) ,public void <init>(java... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JPopupButton.java | JPopupButton | setSelectedItem | class JPopupButton extends JButton {
private final ArrayList<JPopupButtonItem> items;
private JPopupButtonItem selectedItem;
private ChangeListener listener;
public JPopupButton() {
items = new ArrayList<>();
addActionListener(new ActionListener() {
@Override
... |
for (JPopupButtonItem i : items) {
if (i.object == item) {
selectedItem = i;
return;
}
}
throw new IllegalArgumentException("This elemen doesn't exist.");
| 508 | 60 | 568 | <methods>public void <init>() ,public void <init>(javax.swing.Icon) ,public void <init>(java.lang.String) ,public void <init>(javax.swing.Action) ,public void <init>(java.lang.String, javax.swing.Icon) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.lang.String getUIClassID() ,public b... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JPopupPane.java | HideAWTListener | eventDispatched | class HideAWTListener extends ComponentAdapter implements AWTEventListener, WindowStateListener {
@Override
public void eventDispatched(java.awt.AWTEvent aWTEvent) {<FILL_FUNCTION_BODY>}
@Override
public void windowStateChanged(WindowEvent windowEvent) {
if (showingPopup) {... |
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) aWTEvent;
if (mv.getClickCount() > 0) {
if (!(aWTEvent.getSource() instanceof Component)) {
return;
}
Component comp = (Comp... | 330 | 176 | 506 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JRangeSlider.java | RangeTrackListener | mousePressed | class RangeTrackListener extends TrackListener {
@Override
public void mousePressed(MouseEvent e) {<FILL_FUNCTION_BODY>}
@Override
public void mouseReleased(MouseEvent e) {
lowerDragging = false;
upperDragging = false;
sli... |
if (!slider.isEnabled()) {
return;
}
currentMouseX = e.getX();
currentMouseY = e.getY();
if (slider.isRequestFocusEnabled()) {
slider.requestFocus();
}
// Determine... | 1,374 | 518 | 1,892 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(javax.swing.BoundedRangeModel) ,public void <init>(int, int) ,public void <init>(int, int, int) ,public void <init>(int, int, int, int) ,public void addChangeListener(javax.swing.event.ChangeListener) ,public Hashtable<java.lang.Integer,javax.sw... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/JSqueezeBoxPanel.java | VerticalLayout | minimumLayoutSize | class VerticalLayout implements LayoutManager {
//~ Methods --------------------------------------------------------------------------------------------------------------
@Override
public void addLayoutComponent(final String name, final Component comp) {
}
@Override
pub... |
final Dimension d = new Dimension(parent.getInsets().left + parent.getInsets().right,
parent.getInsets().top + parent.getInsets().bottom);
int maxWidth = 0;
int height = 0;
final Component[] comps = parent.getComponents();
for (int i = 0; i <... | 560 | 188 | 748 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/PaletteIcon.java | PaletteIcon | paintIcon | class PaletteIcon implements Icon {
private static final int COLOR_WIDTH = 13;
private static final int COLOR_HEIGHT = 13;
private static final Color BORDER_COLOR = new Color(0x444444);
private final Color[] colors;
private final int maxColors;
public PaletteIcon(Color[] colors) {
this... |
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(1));
for (int i = 0; i < maxColors; i++) {
g2.setColor(colors[i]);
g2.fillRect(x + 2 + i * COLOR_WIDTH, y, COLOR_WIDTH, COLOR_HEIGHT);
g2.setColor(BORDER_COLOR);
g2.drawRect(x + 2 + i *... | 254 | 151 | 405 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/WrapLayout.java | WrapLayout | layoutContainer | class WrapLayout extends FlowLayout {
private Dimension preferredLayoutSize;
/**
* Constructs a new <code>WrapLayout</code> with a left
* alignment and a default 5-unit horizontal and vertical gap.
*/
public WrapLayout() {
super();
}
/**
* Constructs a new <code>FlowLa... |
Dimension size = preferredLayoutSize(target);
// When a frame is minimized or maximized the preferred size of the
// Container is assumed not to change. Therefore we need to force a
// validate() to make sure that space, if available, is allocated to
// the panel using a Wr... | 1,466 | 164 | 1,630 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(int, int, int) ,public void addLayoutComponent(java.lang.String, java.awt.Component) ,public boolean getAlignOnBaseline() ,public int getAlignment() ,public int getHgap() ,public int getVgap() ,public void layoutContainer(java.awt.Container) ,pu... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/gradientslider/PaintUtils.java | PaintUtils | paintFocus | class PaintUtils {
/**
* Four shades of white, each with increasing opacity.
*/
public final static Color[] whites = new Color[] {
new Color(255, 255, 255, 50),
new Color(255, 255, 255, 100),
new Color(255, 255, 255, 150)
};
/**
* Four shades of black, each with i... |
Color focusColor = getFocusRingColor();
Color[] focusArray = new Color[] {
new Color(focusColor.getRed(), focusColor.getGreen(), focusColor.getBlue(), 255),
new Color(focusColor.getRed(), focusColor.getGreen(), focusColor.getBlue(), 170),
new Color(focusColor.getRed(... | 1,093 | 248 | 1,341 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/richtooltip/JRichTooltipPanel.java | JRichTooltipPanel | updateUI | class JRichTooltipPanel extends JPanel {
/**
* @see #getUIClassID
*/
public static final String uiClassID = "RichTooltipPanelUI";
protected RichTooltip tooltipInfo;
public JRichTooltipPanel(RichTooltip tooltipInfo) {
this.tooltipInfo = tooltipInfo;
}
/*
* (non-Javadoc)
... |
if (UIManager.get(getUIClassID()) != null) {
setUI((RichTooltipPanelUI) UIManager.getUI(this));
} else {
setUI(BasicRichTooltipPanelUI.createUI(this));
}
| 368 | 70 | 438 | <methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/splineeditor/Java2dHelper.java | Java2dHelper | createCompatibleImage | class Java2dHelper {
public static BufferedImage createCompatibleImage(int width, int height) {<FILL_FUNCTION_BODY>}
public static BufferedImage loadCompatibleImage(URL resource) throws IOException {
BufferedImage image = ImageIO.read(resource);
BufferedImage compatibleImage = createCompatible... |
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice screenDevice = environment.getDefaultScreenDevice();
GraphicsConfiguration configuration = screenDevice.getDefaultConfiguration();
return configuration.createCompatibleImage(width, height... | 404 | 58 | 462 | <no_super_class> |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/splineeditor/SplineDisplay.java | SelectionHandler | mousePressed | class SelectionHandler extends MouseAdapter {
@Override
public void mousePressed(MouseEvent e) {<FILL_FUNCTION_BODY>}
@Override
public void mouseReleased(MouseEvent e) {
resetSelection();
}
} |
Ellipse2D area1 = getDraggableArea(control1);
Ellipse2D area2 = getDraggableArea(control2);
if (area1.contains(e.getPoint())) {
selected = control1;
dragStart = e.getPoint();
Rectangle bounds = area1.getBounds();
repa... | 69 | 193 | 262 | <methods>public void <init>(double, double, double, double, double, double, double, int, double, int) ,public void addEquation(org.gephi.ui.components.splineeditor.equation.AbstractEquation, java.awt.Color) ,public List<org.gephi.ui.components.splineeditor.equation.EquationDisplay.DrawableEquation> getEquations() ,publ... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/splineeditor/SplineEditor.java | SplineEditor | buildHeader | class SplineEditor extends JDialog {
private SplineControlPanel splineControlPanel;
public SplineEditor(String title) throws HeadlessException {
super(WindowManager.getDefault().getMainWindow(), title, true);
add(buildHeader(), BorderLayout.NORTH);
add(buildControlPanel(), BorderLayout... |
ImageIcon icon = ImageUtilities.loadImageIcon("UIComponents/simulator.png", false);
JXHeader header = new JXHeader(NbBundle.getMessage(SplineEditor.class, "splineEditor_title"),
NbBundle.getMessage(SplineEditor.class, "splineEditor_header"),
icon);
return header;
| 351 | 91 | 442 | <methods>public void <init>() ,public void <init>(java.awt.Frame) ,public void <init>(java.awt.Dialog) ,public void <init>(java.awt.Window) ,public void <init>(java.awt.Frame, boolean) ,public void <init>(java.awt.Frame, java.lang.String) ,public void <init>(java.awt.Dialog, boolean) ,public void <init>(java.awt.Dialog... |
gephi_gephi | gephi/modules/UIComponents/src/main/java/org/gephi/ui/components/splineeditor/equation/AbstractEquation.java | AbstractEquation | firePropertyChange | class AbstractEquation implements Equation {
protected List<PropertyChangeListener> listeners;
protected AbstractEquation() {
this.listeners = new LinkedList<>();
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (listener != null && !listeners.contains(lis... |
PropertyChangeEvent changeEvent = new PropertyChangeEvent(this,
propertyName,
oldValue,
newValue);
for (PropertyChangeListener listener : listeners) {
listener.propertyChange(changeEvent);
}
| 177 | 58 | 235 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/lib/validation/BetweenZeroAndOneValidator.java | BetweenZeroAndOneValidator | validate | class BetweenZeroAndOneValidator implements Validator<String> {
@Override
public void validate(Problems problems, String compName, String model) {<FILL_FUNCTION_BODY>}
@Override
public Class<String> modelType() {
return String.class;
}
} |
boolean result = false;
try {
Double d = Double.parseDouble(model);
result = d >= 0 && d <= 1;
} catch (Exception e) {
}
if (!result) {
String message = NbBundle.getMessage(BetweenZeroAndOneValidator.class,
"BetweenZeroAndOneVa... | 77 | 108 | 185 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/lib/validation/DialogDescriptorWithValidation.java | DialogDescriptorWithValidation | dialog | class DialogDescriptorWithValidation implements ValidationUI {
private final DialogDescriptor dialogDescriptor;
private DialogDescriptorWithValidation(DialogDescriptor dialogDescriptor) {
this.dialogDescriptor = dialogDescriptor;
}
public static DialogDescriptor dialog(Object innerPane, Strin... |
DialogDescriptor dd = new DialogDescriptor(innerPane, title);
if (innerPane instanceof ValidationPanel) {
((ValidationPanel) innerPane).getValidationGroup().addUI(new DialogDescriptorWithValidation(dd));
}
return dd;
| 146 | 67 | 213 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/lib/validation/Multiple4NumberValidator.java | Multiple4NumberValidator | validate | class Multiple4NumberValidator implements Validator<String> {
@Override
public void validate(Problems problems, String compName, String model) {<FILL_FUNCTION_BODY>}
@Override
public Class<String> modelType() {
return String.class;
}
} |
boolean result = false;
try {
Integer i = Integer.parseInt(model);
result = i > 0 && i % 4 == 0;
} catch (Exception e) {
}
if (!result) {
String message = NbBundle.getMessage(Multiple4NumberValidator.class,
"Multiple4NumberVali... | 77 | 109 | 186 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/lib/validation/PositiveNumberValidator.java | PositiveNumberValidator | validate | class PositiveNumberValidator implements Validator<String> {
@Override
public void validate(Problems problems, String compName, String model) {<FILL_FUNCTION_BODY>}
@Override
public Class<String> modelType() {
return String.class;
}
} |
boolean result = false;
try {
Integer i = Integer.parseInt(model);
result = i > 0;
} catch (Exception e) {
}
if (!result) {
String message = NbBundle.getMessage(PositiveNumberValidator.class,
"PositiveNumberValidator_NOT_POSITI... | 76 | 99 | 175 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/propertyeditor/AbstractAttributeColumnPropertyEditor.java | AbstractAttributeColumnPropertyEditor | getColumns | class AbstractAttributeColumnPropertyEditor extends PropertyEditorSupport {
private final EditorClass editorClass;
private final AttributeTypeClass attributeTypeClass;
private Column[] columns;
private Column selectedColumn;
protected AbstractAttributeColumnPropertyEditor(EditorClass editorClass, ... |
List<Column> cols = new ArrayList<>();
GraphModel model = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
if (model != null) {
if (editorClass.equals(EditorClass.NODE) || editorClass.equals(EditorClass.NODEEDGE)) {
for (Column column : model.getNod... | 604 | 552 | 1,156 | <methods>public void <init>() ,public void <init>(java.lang.Object) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public void firePropertyChange() ,public java.lang.String getAsText() ,public java.awt.Component getCustomEditor() ,public java.lang.String getJavaInitializationStr... |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/ColorUtils.java | ColorUtils | encode | class ColorUtils {
public static String encode(Color color) {<FILL_FUNCTION_BODY>}
public static Color decode(String nm) throws NumberFormatException {
int i = (int) Long.parseLong(nm, 16); //Bug 4215269
return new Color((i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF);
}
... |
char[] buf = new char[8];
String s = Integer.toHexString(color.getRed());
if (s.length() == 1) {
buf[0] = '0';
buf[1] = s.charAt(0);
} else {
buf[0] = s.charAt(0);
buf[1] = s.charAt(1);
}
s = Integer.toHexString(color.getGr... | 238 | 378 | 616 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/ColumnTitleValidator.java | ColumnTitleValidator | validate | class ColumnTitleValidator implements Validator<String> {
private Table table;
private boolean allowNoTitle;
public ColumnTitleValidator(Table table) {
this(table, false);
}
public ColumnTitleValidator(Table table, boolean allowNoTitle) {
this.table = table;
thi... |
if (!allowNoTitle && (t == null || t.isEmpty())) {
prblms.add(NbBundle.getMessage(ColumnTitleValidator.class, "ColumnTitleValidator.title.empty"));
} else if (table.hasColumn(t)) {
prblms.add(NbBundle.getMessage(ColumnTitleValidator.class, "ColumnTitleValidator.title.repeate... | 283 | 104 | 387 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/DialogFileFilter.java | DialogFileFilter | accept | class DialogFileFilter extends javax.swing.filechooser.FileFilter {
private String description;
private final List<String> extensions;
public DialogFileFilter(String description) {
if (description == null) {
Logger.getLogger(DialogFileFilter.class.getName())
.throwing(g... |
if (file.isDirectory() || extensions.isEmpty()) {
return true;
}
String fileName = file.getName().toLowerCase();
for (String extension : extensions) {
if (fileName.endsWith(extension)) {
return true;
}
}
return false;
... | 770 | 79 | 849 | <methods>public abstract boolean accept(java.io.File) ,public abstract java.lang.String getDescription() <variables> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/FontUtils.java | FontUtils | encode | class FontUtils {
public static String encode(Font font) {<FILL_FUNCTION_BODY>}
} |
StringBuffer fontAsString = new StringBuffer();
fontAsString.append(font.getName());
if (!font.isPlain()) {
fontAsString.append('-');
if (font.isBold()) {
fontAsString.append("bold");
}
if (font.isItalic()) {
fontAs... | 31 | 133 | 164 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/GradientUtils.java | LinearGradient | getValue | class LinearGradient {
private Color[] colors;
private float[] positions;
public LinearGradient(Color[] colors, float[] positions) {
if (colors == null || positions == null) {
throw new NullPointerException();
}
if (colors.length != positions... |
for (int a = 0; a < positions.length - 1; a++) {
if (positions[a] == pos) {
return colors[a];
}
if (positions[a] < pos && pos < positions[a + 1]) {
float v = (pos - positions[a]) / (positions[a + 1] - positions[a]);
... | 373 | 175 | 548 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/IntervalBoundValidator.java | IntervalBoundValidator | validate | class IntervalBoundValidator implements Validator<String> {
/**
* If not null, interval start <= end is also validated.
*/
private JTextComponent intervalStartTextField = null;
public IntervalBoundValidator() {
}
public IntervalBoundValidator(JTextComponent intervalStartTex... |
try {
double time = AttributeUtils.parseDateTimeOrTimestamp(value);
if (intervalStartTextField != null) {
//Also validate that this (end time) is greater or equal than start time.
try {
double startTime = AttributeUtils.parseDate... | 186 | 206 | 392 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/PrefsUtils.java | PrefsUtils | floatArrayToString | class PrefsUtils {
public static final String floatArrayToString(float[] array) {<FILL_FUNCTION_BODY>}
public static final float[] stringToFloatArray(String string) {
StringTokenizer tokenizer = new StringTokenizer(string, ",");
float[] array = new float[tokenizer.countTokens()];
for ... |
StringBuilder builder = new StringBuilder();
for (int i = 0; i < array.length; i++) {
if (i > 0) {
builder.append(',');
}
builder.append(array[i]);
}
return builder.toString();
| 139 | 72 | 211 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/SupportedColumnTypeWrapper.java | SupportedColumnTypeWrapper | compareTo | class SupportedColumnTypeWrapper implements Comparable<SupportedColumnTypeWrapper> {
private static final List<Class> SIMPLE_TYPES_ORDER = Arrays.asList(new Class[] {
String.class,
Integer.class,
Long.class,
Float.class,
Double.class,
Boolean.class,
... |
boolean isArray = type.isArray();
boolean isArrayOther = other.type.isArray();
if (isArray != isArrayOther) {
if (isArray) {
return 1;
} else {
return -1;
}
} else {
boolean isDynamic = Attribute... | 952 | 293 | 1,245 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/TimeFormatWrapper.java | TimeFormatWrapper | hashCode | class TimeFormatWrapper {
private final TimeFormat timeFormat;
public TimeFormatWrapper(TimeFormat timeFormat) {
this.timeFormat = timeFormat;
}
@Override
public int hashCode() {<FILL_FUNCTION_BODY>}
@Override
public boolean equals(Object obj) {
if (this == obj) {
... |
int hash = 7;
hash = 53 * hash + (this.timeFormat != null ? this.timeFormat.hashCode() : 0);
return hash;
| 238 | 45 | 283 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/TimeRepresentationWrapper.java | TimeRepresentationWrapper | equals | class TimeRepresentationWrapper {
private final TimeRepresentation timeRepresentation;
public TimeRepresentationWrapper(TimeRepresentation timeRepresentation) {
this.timeRepresentation = timeRepresentation;
}
@Override
public int hashCode() {
int hash = 3;
hash = 41 * hash... |
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TimeRepresentationWrapper other = (TimeRepresentationWrapper) obj;
return this.timeRepresent... | 232 | 96 | 328 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/TimeZoneWrapper.java | TimeZoneWrapper | hashCode | class TimeZoneWrapper {
private final TimeZone timeZone;
private final long currentTimestamp;
public TimeZoneWrapper(TimeZone timeZone, long currentTimestamp) {
this.timeZone = timeZone;
this.currentTimestamp = currentTimestamp;
}
private String getTimeZoneText() {
int off... |
int hash = 5;
hash = 97 * hash + (this.timeZone != null ? this.timeZone.hashCode() : 0);
return hash;
| 432 | 45 | 477 | <no_super_class> |
gephi_gephi | gephi/modules/UIUtils/src/main/java/org/gephi/ui/utils/WhiteFilter.java | WhiteFilter | filterRGB | class WhiteFilter extends RGBImageFilter {
//~ Instance fields ------------------------------------------------------------------------------------------------------
private final float[] hsv = new float[3];
//~ Constructors ---------------------------------------------------------------------------------... |
int transparency = (rgb >> 24) & 0xFF;
if (transparency <= 1) {
return rgb; // do not alter fully transparent pixels (those would end up being black)
}
transparency /= 2; // set transparency to 50% of original
Color.RGBtoHSB((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, (... | 327 | 172 | 499 | <methods>public java.awt.image.IndexColorModel filterIndexColorModel(java.awt.image.IndexColorModel) ,public abstract int filterRGB(int, int, int) ,public void filterRGBPixels(int, int, int, int, int[], int, int) ,public void setColorModel(java.awt.image.ColorModel) ,public void setPixels(int, int, int, int, java.awt.i... |
gephi_gephi | gephi/modules/Utils/src/main/java/org/gephi/utils/Attributes.java | Attributes | isTypeAvailable | class Attributes {
public static boolean isTypeAvailable(Class<?> type, TimeRepresentation timeRepresentation) {<FILL_FUNCTION_BODY>}
public static boolean isTimestampType(Class<?> type) {
return TimestampSet.class.isAssignableFrom(type)
|| TimestampMap.class.isAssignableFrom(type);
}
... |
if (AttributeUtils.isDynamicType(type)) {
switch (timeRepresentation) {
case INTERVAL:
return isIntervalType(type);
case TIMESTAMP:
return isTimestampType(type);
default:
throw new IllegalArg... | 152 | 93 | 245 | <no_super_class> |
gephi_gephi | gephi/modules/Utils/src/main/java/org/gephi/utils/HTMLEscape.java | HTMLEscape | stringToHTMLString | class HTMLEscape {
/**Code previously used in web applications, adapted from a google search**/
/**
* Escape html from a string to make it safe to show.
*
* @param string String to escape html
* @return Result string
*/
public static String stringToHTMLString(String string) {<FILL... |
StringBuilder sb = new StringBuilder(string.length());
// true if last char was blank
boolean lastWasBlankChar = false;
int len = string.length();
char c;
for (int i = 0; i < len; i++) {
c = string.charAt(i);
if (c == ' ') {
// bl... | 96 | 444 | 540 | <no_super_class> |
gephi_gephi | gephi/modules/Utils/src/main/java/org/gephi/utils/NumberUtils.java | NumberUtils | equals | class NumberUtils {
public static final double EPS = 1e-5;
public static <T extends Number> T parseNumber(String str, Class<T> type) throws UnsupportedOperationException {
try {
/*
* Try to access the staticFactory method for:
* Byte, Short, Integer, Long, Double,... |
return a == b || Math.abs(a - b) < epsilon;
| 352 | 22 | 374 | <no_super_class> |
gephi_gephi | gephi/modules/Utils/src/main/java/org/gephi/utils/TempDirUtils.java | TempDirUtils | createTempDirectory | class TempDirUtils {
public static TempDir createTempDir() throws IOException {
return new TempDir(createTempDirectory());
}
public static File createTempDirectory() throws IOException {<FILL_FUNCTION_BODY>}
public static class TempDir {
private final File tempDir;
private T... |
final File temp;
temp = File.createTempFile("temp", Long.toString(System.nanoTime()));
temp.deleteOnExit();
if (!(temp.delete())) {
throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
}
if (!(temp.mkdir())) {
throw n... | 174 | 119 | 293 | <no_super_class> |
gephi_gephi | gephi/modules/Utils/src/main/java/org/gephi/utils/sparklines/SparklineComponent.java | SparklineComponent | paintComponent | class SparklineComponent extends JComponent {
private final Number[] xValues;
private final Number[] yValues;
private final Number yMinValue;
private final Number yMaxValue;
private final SparklineParameters sparklineParameters;
public SparklineComponent(Number[] yValues, SparklineParameters s... |
sparklineParameters.setWidth(getWidth());
sparklineParameters.setHeight(getHeight());
BufferedImage image = SparklineGraph.draw(xValues, yValues, yMinValue, yMaxValue, sparklineParameters);
g.drawImage(image, 0, 0, this);
| 591 | 76 | 667 | <methods>public void <init>() ,public void addAncestorListener(javax.swing.event.AncestorListener) ,public void addNotify() ,public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener) ,public void computeVisibleRect(java.awt.Rectangle) ,public boolean contains(int, int) ,public javax.swing.JT... |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Line.java | Line | recalc | class Line {
private Vec3f point;
/**
* Normalized
*/
private Vec3f direction;
/**
* For computing projections along line
*/
private final Vec3f alongVec;
/**
* Default constructor initializes line to point (0, 0, 0) and
* direction (1, 0, 0)
*/
public Lin... |
float denom = direction.lengthSquared();
if (denom == 0.0f) {
throw new RuntimeException("Line.recalc: ERROR: direction was the zero vector " +
"(not allowed)");
}
alongVec.set(point.minus(direction.times(point.dot(direction))));
| 1,077 | 85 | 1,162 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Mat2f.java | Mat2f | makeIdent | class Mat2f {
private final float[] data;
/**
* Creates new matrix initialized to the zero matrix
*/
public Mat2f() {
data = new float[4];
}
/**
* Initialize to the identity matrix.
*/
public void makeIdent() {<FILL_FUNCTION_BODY>}
/**
* Gets the (i,j)th e... |
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
if (i == j) {
set(i, j, 1.0f);
} else {
set(i, j, 0.0f);
}
}
}
| 1,222 | 88 | 1,310 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Mat3f.java | Mat3f | mul | class Mat3f {
private final float[] data;
/**
* Creates new matrix initialized to the zero matrix
*/
public Mat3f() {
data = new float[9];
}
/**
* Initialize to the identity matrix.
*/
public void makeIdent() {
for (int i = 0; i < 3; i++) {
for (... |
for (int rc = 0; rc < 3; rc++) {
for (int cc = 0; cc < 3; cc++) {
float tmp = 0.0f;
for (int i = 0; i < 3; i++) {
tmp += a.get(rc, i) * b.get(i, cc);
}
set(rc, cc, tmp);
}
}
| 1,887 | 107 | 1,994 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Matf.java | Matf | mul | class Matf {
private final float[] data;
private final int nCol; // number of columns
private final int nRow; // number of columns
public Matf(int nRow, int nCol) {
data = new float[nRow * nCol];
this.nCol = nCol;
this.nRow = nRow;
}
public Matf(Matf arg) {
nRow... |
if (nCol() != v.length()) {
throw new DimensionMismatchException();
}
Vecf out = new Vecf(nRow());
for (int i = 0; i < nRow(); i++) {
float tmp = 0;
for (int j = 0; j < nCol(); j++) {
tmp += get(i, j) * v.get(j);
}
... | 1,166 | 127 | 1,293 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/MathUtil.java | MathUtil | makePerpendicular | class MathUtil {
/**
* Makes an arbitrary vector perpendicular to <B>src</B> and
* inserts it into <B>dest</B>. Returns false if the source vector
* was equal to (0, 0, 0).
*/
public static boolean makePerpendicular(Vec3f src,
Vec3f dest) {<FILL_FU... |
if ((src.x() == 0.0f) && (src.y() == 0.0f) && (src.z() == 0.0f)) {
return false;
}
if (src.x() != 0.0f) {
if (src.y() != 0.0f) {
dest.set(-src.y(), src.x(), 0.0f);
} else {
dest.set(-src.z(), 0.0f, src.x());
}
... | 356 | 167 | 523 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Plane.java | Plane | intersectRay | class Plane {
/**
* Constant for faster projection and intersection
*/
float c;
/**
* Normalized
*/
private final Vec3f normal;
private final Vec3f point;
/**
* Default constructor initializes normal to (0, 1, 0) and point to
* (0, 0, 0)
*/
public Plane() ... |
float denom = normal.dot(rayDirection);
if (denom == 0) {
return false;
}
intPt.setT((c - normal.dot(rayStart)) / denom);
intPt.setIntersectionPoint(rayStart.plus(rayDirection.times(intPt.getT())));
return true;
| 720 | 90 | 810 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/PlaneUV.java | PlaneUV | projectPoint | class PlaneUV {
private final Vec3f origin = new Vec3f();
/**
* Normalized
*/
private final Vec3f normal = new Vec3f();
private final Vec3f uAxis = new Vec3f();
private final Vec3f vAxis = new Vec3f();
/**
* Default constructor initializes normal to (0, 1, 0), origin to
* (0... |
// Using projPt as a temporary
projPt.sub(point, origin);
float dotp = normal.dot(projPt);
// Component perpendicular to plane
Vec3f tmpDir = new Vec3f();
tmpDir.set(normal);
tmpDir.scale(dotp);
projPt.sub(projPt, tmpDir);
// Take dot products wit... | 1,612 | 157 | 1,769 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Vec2f.java | Vec2f | addScaled | class Vec2f {
private float x;
private float y;
public Vec2f() {
}
public Vec2f(Vec2f arg) {
this(arg.x, arg.y);
}
public Vec2f(float x, float y) {
set(x, y);
}
public Vec2f copy() {
return new Vec2f(this);
}
public void set(Vec2f arg) {
s... |
Vec2f tmp = new Vec2f();
tmp.addScaled(this, s, arg);
return tmp;
| 1,234 | 36 | 1,270 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Vec3d.java | Vec3d | addScaled | class Vec3d {
private double x;
private double y;
private double z;
public Vec3d() {
}
public Vec3d(Vec3d arg) {
set(arg);
}
public Vec3d(double x, double y, double z) {
set(x, y, z);
}
public Vec3d copy() {
return new Vec3d(this);
}
/**
... |
x = a.x + s * b.x;
y = a.y + s * b.y;
z = a.z + s * b.z;
| 1,533 | 45 | 1,578 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Vec3f.java | Vec3f | cross | class Vec3f {
public static final Vec3f X_AXIS = new Vec3f(1, 0, 0);
public static final Vec3f Y_AXIS = new Vec3f(0, 1, 0);
public static final Vec3f Z_AXIS = new Vec3f(0, 0, 1);
public static final Vec3f NEG_X_AXIS = new Vec3f(-1, 0, 0);
public static final Vec3f NEG_Y_AXIS = new Vec3f(0, -1, 0);
... |
x = a.y * b.z - a.z * b.y;
y = a.z * b.x - a.x * b.z;
z = a.x * b.y - a.y * b.x;
| 1,838 | 63 | 1,901 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Vec4f.java | Vec4f | dot | class Vec4f {
private float x;
private float y;
private float z;
private float w;
public Vec4f() {
}
public Vec4f(Vec4f arg) {
set(arg);
}
public Vec4f(float x, float y, float z, float w) {
set(x, y, z, w);
}
public Vec4f copy() {
return new Vec4f(... |
return x * arg.x + y * arg.y + z * arg.z + w * arg.w;
| 1,616 | 30 | 1,646 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Vecf.java | Vecf | toVec3f | class Vecf {
private final float[] data;
public Vecf(int n) {
data = new float[n];
}
public Vecf(Vecf arg) {
data = new float[arg.data.length];
System.arraycopy(arg.data, 0, data, 0, data.length);
}
public int length() {
return data.length;
}
public fl... |
if (length() != 3) {
throw new DimensionMismatchException();
}
Vec3f out = new Vec3f();
for (int i = 0; i < 3; i++) {
out.set(i, get(i));
}
return out;
| 361 | 79 | 440 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/lib/gleem/linalg/Veci.java | Veci | toVecf | class Veci {
private final int[] data;
public Veci(int n) {
data = new int[n];
}
public Veci(Veci arg) {
data = new int[arg.data.length];
System.arraycopy(arg.data, 0, data, 0, data.length);
}
public int length() {
return data.length;
}
public int get(... |
Vecf out = new Vecf(length());
for (int i = 0; i < length(); i++) {
out.set(i, get(i));
}
return out;
| 385 | 54 | 439 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/visualization/GraphLimits.java | GraphLimits | getDistanceFromPoint | class GraphLimits {
private float minXoctree;
private float maxXoctree;
private float minYoctree;
private float maxYoctree;
private float minZoctree;
private float maxZoctree;
private Vec3f closestPoint = new Vec3f(0, 0, 0);
private float maxWeight;
private float minWeight;
pub... |
float dis = (float) Math.sqrt(
(closestPoint.x() - x) * (closestPoint.x() - x) + (closestPoint.y() - y) * (closestPoint.y() - y) +
(closestPoint.z() - z) * (closestPoint.z() - z));
return dis;
//Minimum distance with the 8 points of the cube, poor method
/*... | 632 | 639 | 1,271 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/visualization/VizModelPersistenceProvider.java | VizModelPersistenceProvider | writeXML | class VizModelPersistenceProvider implements WorkspaceXMLPersistenceProvider {
@Override
public void writeXML(XMLStreamWriter writer, Workspace workspace) {<FILL_FUNCTION_BODY>}
@Override
public void readXML(XMLStreamReader reader, Workspace workspace) {
VizModel vizModel = workspace.getLookup... |
VizModel model = workspace.getLookup().lookup(VizModel.class);
if (model != null) {
try {
model.writeXML(writer);
} catch (XMLStreamException ex) {
throw new RuntimeException(ex);
}
}
| 249 | 75 | 324 | <no_super_class> |
gephi_gephi | gephi/modules/VisualizationImpl/src/main/java/org/gephi/visualization/api/selection/SelectionManager.java | SelectionManager | resetSelection | class SelectionManager implements VizArchitecture {
private final List<ChangeListener> listeners;
private VizConfig vizConfig;
private AbstractEngine engine;
//Settings
private int mouseSelectionDiameter;
private boolean mouseSelectionZoomProportionnal;
private boolean selectionUpdateWhileD... |
if (isCustomSelection()) {
engine.resetSelection();
vizModel.setAutoSelectNeighbor(wasAutoSelectNeighbors);
if (wasRectangleSelection) {
setRectangleSelection();
} else if (wasDragSelection) {
setDraggingMouseSelection();
... | 1,814 | 100 | 1,914 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.