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/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/tables/popup/EdgesPopupAdapter.java | EdgesPopupAdapter | createPopup | class EdgesPopupAdapter extends AbstractPopupAdapter<Edge> {
public EdgesPopupAdapter(AbstractElementsDataTable<Edge> elementsDataTable) {
super(elementsDataTable);
}
@Override
protected JPopupMenu createPopup(Point p) {<FILL_FUNCTION_BODY>}
} |
final List<Edge> selectedElements = elementsDataTable.getElementsFromSelectedRows();
final Edge clickedElement = elementsDataTable.getElementFromRow(table.rowAtPoint(p));
JPopupMenu contextMenu = new JPopupMenu();
//First add edges manipulators items:
DataLaboratoryHelper... | 91 | 386 | 477 | <methods>public void <init>(AbstractElementsDataTable<Edge>) <variables>protected final non-sealed AbstractElementsDataTable<Edge> elementsDataTable,protected final non-sealed JXTable table |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/tables/popup/NodesPopupAdapter.java | NodesPopupAdapter | createPopup | class NodesPopupAdapter extends AbstractPopupAdapter<Node> {
public NodesPopupAdapter(AbstractElementsDataTable<Node> elementsDataTable) {
super(elementsDataTable);
}
@Override
protected JPopupMenu createPopup(Point p) {<FILL_FUNCTION_BODY>}
} |
final List<Node> selectedElements = elementsDataTable.getElementsFromSelectedRows();
final Node clickedElement = elementsDataTable.getElementFromRow(table.rowAtPoint(p));
JPopupMenu contextMenu = new JPopupMenu();
//First add edges manipulators items:
DataLaboratoryHelper... | 91 | 383 | 474 | <methods>public void <init>(AbstractElementsDataTable<Node>) <variables>protected final non-sealed AbstractElementsDataTable<Node> elementsDataTable,protected final non-sealed JXTable table |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/GraphFileExporterBuilderDecorator.java | GraphFileExporterBuilderDecorator | buildExporter | class GraphFileExporterBuilderDecorator implements GraphFileExporterBuilder {
private final GraphFileExporterBuilder instance;
private final ExporterSpreadsheet.ExportTable initialSelectedTable;
public GraphFileExporterBuilderDecorator(GraphFileExporterBuilder instance,
... |
GraphExporter exporter = instance.buildExporter();
if (exporter instanceof ExporterSpreadsheet) {
((ExporterSpreadsheet) exporter).setTableToExport(initialSelectedTable);
}
return exporter;
| 184 | 63 | 247 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/PopupMenuUtils.java | PopupMenuUtils | createMenuItemFromEdgesManipulator | class PopupMenuUtils {
public static JMenuItem createMenuItemFromNodesManipulator(final NodesManipulator item, final Node clickedNode,
final Node[] nodes) {
ContextMenuItemManipulator[] subItems = item.getSubItems();
if (subItems != nul... |
ContextMenuItemManipulator[] subItems = item.getSubItems();
if (subItems != null && item.canExecute()) {
JMenu subMenu = new JMenu();
subMenu.setText(item.getName());
if (item.getDescription() != null && !item.getDescription().isEmpty()) {
subMenu.set... | 1,239 | 649 | 1,888 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/AbstractSparklinesGraphicsComponentProvider.java | AbstractSparklinesGraphicsComponentProvider | format | class AbstractSparklinesGraphicsComponentProvider extends ComponentProvider<JLabel> {
protected static final Color SELECTED_BACKGROUND = UIManager.getColor("Table.selectionBackground");
protected static final Color UNSELECTED_BACKGROUND = UIManager.getColor("Table.background");
protected final Color li... |
//Set image or text
int witdth = table.getColumnModel().getColumn(context.getColumn()).getWidth();
int height = table.getRowHeight(context.getRow());
String text = getTextFromValue(context.getValue());
rendererLabel.setSize(witdth, height);
rendererLabel.setToo... | 832 | 136 | 968 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/AbstractTimeSetGraphicsComponentProvider.java | AbstractTimeSetGraphicsComponentProvider | format | class AbstractTimeSetGraphicsComponentProvider extends ComponentProvider<JLabel> {
protected static final Color SELECTED_BACKGROUND = UIManager.getColor("Table.selectionBackground");
protected static final Color UNSELECTED_BACKGROUND = UIManager.getColor("Table.background");
protected final Color lineC... |
//Set image or text
int witdth = table.getColumnModel().getColumn(context.getColumn()).getWidth();
int height = table.getRowHeight(context.getRow());
String text = getTextFromValue(context.getValue());
rendererLabel.setSize(witdth, height);
rendererLabel.setToo... | 1,009 | 139 | 1,148 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/ArraySparklinesGraphicsComponentProvider.java | ArraySparklinesGraphicsComponentProvider | getTextFromValue | class ArraySparklinesGraphicsComponentProvider extends AbstractSparklinesGraphicsComponentProvider {
public ArraySparklinesGraphicsComponentProvider(GraphModelProvider graphModelProvider, JXTable table) {
super(graphModelProvider, table);
}
@Override
public String getTextFromValue(Objec... |
if (value == null) {
return null;
}
return AttributeUtils.printArray(value);
| 223 | 39 | 262 | <methods>public void <init>(org.gephi.desktop.datalab.utils.GraphModelProvider, JXTable) ,public abstract java.lang.Number[][] getSparklinesXAndYNumbers(java.lang.Object) ,public abstract java.lang.String getTextFromValue(java.lang.Object) ,public void setImagePainter(java.lang.Object, boolean) <variables>protected sta... |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/IntervalMapSparklinesGraphicsComponentProvider.java | IntervalMapSparklinesGraphicsComponentProvider | getSparklinesXAndYNumbers | class IntervalMapSparklinesGraphicsComponentProvider extends AbstractSparklinesGraphicsComponentProvider {
public IntervalMapSparklinesGraphicsComponentProvider(GraphModelProvider graphModelProvider, JXTable table) {
super(graphModelProvider, table);
}
@Override
public String getTextFro... |
IntervalMap intervalMap = (IntervalMap) value;
ArrayList<Number> xValues = new ArrayList<>();
ArrayList<Number> yValues = new ArrayList<>();
if (intervalMap == null) {
return new Number[2][0];
}
Interval[] intervals = intervalMap.toKeysArray();
... | 214 | 225 | 439 | <methods>public void <init>(org.gephi.desktop.datalab.utils.GraphModelProvider, JXTable) ,public abstract java.lang.Number[][] getSparklinesXAndYNumbers(java.lang.Object) ,public abstract java.lang.String getTextFromValue(java.lang.Object) ,public void setImagePainter(java.lang.Object, boolean) <variables>protected sta... |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/IntervalSetGraphicsComponentProvider.java | IntervalSetGraphicsComponentProvider | getTimeIntervalGraphicsParameters | class IntervalSetGraphicsComponentProvider extends AbstractTimeSetGraphicsComponentProvider {
public IntervalSetGraphicsComponentProvider(GraphModelProvider graphModelProvider, JXTable table) {
super(graphModelProvider, table);
}
@Override
public TimeIntervalGraphicsParameters getTimeIn... |
IntervalSet intervalSet = (IntervalSet) value;
double[] intervals = intervalSet.getIntervals();
double[] starts = new double[intervals.length / 2];
double[] ends = new double[intervals.length / 2];
for (int i = 0, startIndex = 0; startIndex < intervals.length; i++, startI... | 98 | 151 | 249 | <methods>public void <init>(org.gephi.desktop.datalab.utils.GraphModelProvider, JXTable) ,public double getMax() ,public double getMin() ,public abstract org.gephi.desktop.datalab.utils.componentproviders.AbstractTimeSetGraphicsComponentProvider.TimeIntervalGraphicsParameters getTimeIntervalGraphicsParameters(TimeSet) ... |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/TimestampMapSparklinesGraphicsComponentProvider.java | TimestampMapSparklinesGraphicsComponentProvider | getSparklinesXAndYNumbers | class TimestampMapSparklinesGraphicsComponentProvider extends AbstractSparklinesGraphicsComponentProvider {
public TimestampMapSparklinesGraphicsComponentProvider(GraphModelProvider graphModelProvider, JXTable table) {
super(graphModelProvider, table);
}
@Override
public String getTextF... |
TimestampMap timestampMap = (TimestampMap) value;
Double[] timestamps = timestampMap.toKeysArray();
Number[] values = (Number[]) timestampMap.toValuesArray();
return new Number[][] {timestamps, values};
| 214 | 72 | 286 | <methods>public void <init>(org.gephi.desktop.datalab.utils.GraphModelProvider, JXTable) ,public abstract java.lang.Number[][] getSparklinesXAndYNumbers(java.lang.Object) ,public abstract java.lang.String getTextFromValue(java.lang.Object) ,public void setImagePainter(java.lang.Object, boolean) <variables>protected sta... |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/componentproviders/TimestampSetGraphicsComponentProvider.java | TimestampSetGraphicsComponentProvider | getTimeIntervalGraphicsParameters | class TimestampSetGraphicsComponentProvider extends AbstractTimeSetGraphicsComponentProvider {
public TimestampSetGraphicsComponentProvider(GraphModelProvider graphModelProvider, JXTable table) {
super(graphModelProvider, table);
}
@Override
public TimeIntervalGraphicsParameters getTime... |
TimestampSet timestampSet = (TimestampSet) value;
double[] timestamps = timestampSet.toPrimitiveArray();
double[] starts = new double[timestamps.length];
double[] ends = new double[timestamps.length];
for (int i = 0; i < timestamps.length; i++) {
starts[i] ... | 98 | 143 | 241 | <methods>public void <init>(org.gephi.desktop.datalab.utils.GraphModelProvider, JXTable) ,public double getMax() ,public double getMin() ,public abstract org.gephi.desktop.datalab.utils.componentproviders.AbstractTimeSetGraphicsComponentProvider.TimeIntervalGraphicsParameters getTimeIntervalGraphicsParameters(TimeSet) ... |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/stringconverters/ArrayStringConverter.java | ArrayStringConverter | getString | class ArrayStringConverter implements StringValue {
@Override
public String getString(Object value) {<FILL_FUNCTION_BODY>}
} |
String str = null;
if (value != null) {
str = AttributeUtils.printArray(value);
}
return str;
| 39 | 42 | 81 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/stringconverters/DefaultStringRepresentationConverter.java | DefaultStringRepresentationConverter | getString | class DefaultStringRepresentationConverter implements StringValue {
@Override
public String getString(Object value) {<FILL_FUNCTION_BODY>}
} |
String str = null;
if (value != null) {
str = value.toString();
}
return str;
| 42 | 37 | 79 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/stringconverters/DoubleStringConverter.java | DoubleStringConverter | getString | class DoubleStringConverter implements StringValue {
/**
* Formatter for limiting precision to 6 decimals, avoiding precision errors (epsilon).
*/
public static final DecimalFormat FORMAT = new DecimalFormat("0.0#####");
static {
DecimalFormatSymbols symbols = DecimalFormatSymbols.getIns... |
String str = null;
if (value != null) {
str = FORMAT.format(value);
}
return str;
| 151 | 41 | 192 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/stringconverters/TimeMapStringConverter.java | TimeMapStringConverter | getString | class TimeMapStringConverter implements StringValue {
private final GraphModelProvider graphModelProvider;
public TimeMapStringConverter(GraphModelProvider graphModelProvider) {
this.graphModelProvider = graphModelProvider;
}
@Override
public String getString(Object value) {<FILL_FUNCTION... |
String str = null;
if (value != null) {
TimeMap timeMap = (TimeMap) value;
str = timeMap.toString(graphModelProvider.getGraphModel().getTimeFormat(),
graphModelProvider.getGraphModel().getTimeZone());
}
return str;
| 84 | 77 | 161 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopDataLaboratory/src/main/java/org/gephi/desktop/datalab/utils/stringconverters/TimeSetStringConverter.java | TimeSetStringConverter | getString | class TimeSetStringConverter implements StringValue {
private final GraphModelProvider graphModelProvider;
public TimeSetStringConverter(GraphModelProvider graphModelProvider) {
this.graphModelProvider = graphModelProvider;
}
@Override
public String getString(Object value) {<FILL_FUNCTION... |
String str = null;
if (value != null) {
TimeSet timeSet = (TimeSet) value;
str = timeSet.toString(graphModelProvider.getGraphModel().getTimeFormat(),
graphModelProvider.getGraphModel().getTimeZone());
}
return str;
| 84 | 77 | 161 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopExport/src/main/java/org/gephi/desktop/io/export/DesktopExportController.java | MultipleWorkspacesExporter | run | class MultipleWorkspacesExporter implements Runnable, LongTask {
private final Exporter exporter;
private final FileObject folder;
private final String extension;
private boolean cancel = false;
private ProgressTicket progressTicket;
public MultipleWorkspacesExporter(Ex... |
Project project = Lookup.getDefault().lookup(ProjectController.class).getCurrentProject();
if (project != null) {
Collection<Workspace> workspaceCollection = project.getWorkspaces();
Progress.start(progressTicket, workspaceCollection.size());
for... | 207 | 391 | 598 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopExport/src/main/java/org/gephi/desktop/io/export/Export.java | Export | createMenu | class Export extends AbstractAction implements DynamicMenuContent {
public Export() {
super(NbBundle.getMessage(Export.class, "CTL_Export"));
}
@Override
public void actionPerformed(ActionEvent e) {
// does nothing, this is a popup menu
}
@Override
public JComponent[] get... |
JMenu menu = new JMenu(NbBundle.getMessage(Export.class, "CTL_Export"));
menu.setEnabled(Lookup.getDefault().lookup(ProjectController.class).hasCurrentProject());
// Graph and image
menu.add(new JMenuItem(
Actions.forID("File", "org.gephi.desktop.io.export.ExportGraph")));
... | 161 | 265 | 426 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopExport/src/main/java/org/gephi/desktop/io/export/GraphFileAction.java | GraphFileAction | actionPerformed | class GraphFileAction extends AbstractAction {
private final AbstractExporterUI<GraphFileExporterBuilder> exporterUI;
public GraphFileAction() {
super(NbBundle.getMessage(GraphFileAction.class, "CTL_ExportGraphAction"));
exporterUI = new AbstractExporterUI<>("GraphFileExporterUI", GraphFileEx... |
if(e.getSource() instanceof GraphFileExporterBuilder[]) {
exporterUI.action(Arrays.asList((GraphFileExporterBuilder[]) e.getSource()));
} else {
exporterUI.action();
}
| 125 | 63 | 188 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopExport/src/main/java/org/gephi/desktop/io/export/GraphFileExporterUIPanel.java | GraphFileExporterUIPanel | initComponents | class GraphFileExporterUIPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton fullGraphRadio;
private javax.swing.ButtonGroup graphButtonGroup;
private javax.swing.JLabel labelFullgraph;
private javax.swing.JLabel labelGra... |
graphButtonGroup = new javax.swing.ButtonGroup();
labelGraph = new javax.swing.JLabel();
fullGraphRadio = new javax.swing.JRadioButton();
visibleOnlyRadio = new javax.swing.JRadioButton();
labelFullgraph = new javax.swing.JLabel();
labelVisibleOnly = new javax.swing.JLa... | 391 | 1,056 | 1,447 | <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/DesktopFilters/src/main/java/org/gephi/desktop/filters/FilterPanelPanel.java | FilterPanelPanel | setQuery | class FilterPanelPanel extends JPanel implements ChangeListener {
private final String settingsString;
private Query selectedQuery;
private FilterUIModel uiModel;
public FilterPanelPanel() {
super(new BorderLayout());
settingsString = NbBundle.getMessage(FilterPanelPanel.class, "Filter... |
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
//UI update
removeAll();
setBorder(null);
if (query != null) {
FilterController filterController = Lookup.getDefault().lookup(Fi... | 354 | 253 | 607 | <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/DesktopFilters/src/main/java/org/gephi/desktop/filters/FilterUIModel.java | FilterUIModel | getSelectedRoot | class FilterUIModel {
private final Workspace workspace;
private final List<Query> expandedQueryNodes;
private final List<Query> expandedParametersNodes;
private final List<Category> expandedCategoryNodes;
private final List<ChangeListener> listeners;
private Query selectedQuery;
public Fi... |
if (selectedQuery != null) {
Query root = selectedQuery;
while (root.getParent() != null) {
root = root.getParent();
}
return root;
}
return null;
| 628 | 61 | 689 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/FiltersTopComponent.java | FiltersTopComponent | run | class FiltersTopComponent extends TopComponent {
private static final long AUTO_REFRESH_RATE_MILLISECONDS = 3000;
//Panel
private final FiltersPanel panel;
//Models
private FilterModel filterModel;
private WorkspaceColumnsObservers observers;
private FilterUIModel uiModel;
private java.... |
if (observers != null) {
if (observers.hasChanges()) {
refreshModel();
}
}
... | 1,028 | 37 | 1,065 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/WorkspaceColumnsObservers.java | WorkspaceColumnsObservers | initialize | class WorkspaceColumnsObservers {
private final GraphModel graphModel;
private TableObserver nodesTableObserver;
private TableObserver edgesTableObserver;
public WorkspaceColumnsObservers(Workspace workspace) {
this.graphModel = Lookup.getDefault().lookup(GraphController.class).getGra... |
if (nodesTableObserver != null) {
return;
}
nodesTableObserver = graphModel.getNodeTable().createTableObserver(true);
edgesTableObserver = graphModel.getEdgeTable().createTableObserver(true);
| 350 | 68 | 418 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/CategoryChildFactory.java | CategoryChildFactory | compare | class CategoryChildFactory extends ChildFactory<Object> {
private final Category category;
private final FiltersExplorer.Utils utils;
public CategoryChildFactory(FiltersExplorer.Utils utils, Category category) {
this.utils = utils;
this.category = category;
}
@Override
protect... |
String s1;
String s2;
if (o1 == FiltersExplorer.QUERIES || o2 == FiltersExplorer.QUERIES) {
return o1 == FiltersExplorer.QUERIES ? 1 : -1;
} else if (o1 instanceof Category && o2 instanceof Category) {
s1 = ((Catego... | 292 | 261 | 553 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/CategoryNode.java | CategoryNode | getIcon | class CategoryNode extends AbstractNode {
private final Category category;
public CategoryNode(FiltersExplorer.Utils utils, Category category) {
super(
utils.isLeaf(category) ? Children.LEAF : Children.create(new CategoryChildFactory(utils, category), true));
this.category = catego... |
try {
if (category.getIcon() != null) {
return ImageUtilities.icon2Image(category.getIcon());
}
} catch (Exception e) {
}
if (category == null) {
return ImageUtilities.loadImage("DesktopFilters/library.png", false);
} else {
... | 452 | 109 | 561 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/FilterBuilderNode.java | FilterBuilderNode | getIcon | class FilterBuilderNode extends AbstractNode {
public static final DataFlavor DATA_FLAVOR = new DataFlavor(FilterBuilder.class, "filterbuilder");
private final FilterBuilder filterBuilder;
private final FilterTransferable transferable;
public FilterBuilderNode(FilterBuilder filterBuilder) {
su... |
try {
if (filterBuilder.getIcon() != null) {
return ImageUtilities.icon2Image(filterBuilder.getIcon());
}
} catch (Exception e) {
}
return ImageUtilities.loadImage("DesktopFilters/funnel.png", false);
| 495 | 75 | 570 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/FilterBuilderNodeDefaultAction.java | FilterBuilderNodeDefaultAction | actionPerformed | class FilterBuilderNodeDefaultAction extends SystemAction {
public static FilterBuilderNodeDefaultAction instance = new FilterBuilderNodeDefaultAction();
@Override
public String getName() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HelpCtx getHe... |
FilterBuilderNode node = (FilterBuilderNode) ev.getSource();
FilterBuilder builder = node.getBuilder();
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
Query function = filterController.createQuery(builder);
filterController.add(function);... | 124 | 74 | 198 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/FiltersExplorer.java | FiltersExplorer | setup | class FiltersExplorer extends BeanTreeView {
public static final Category QUERIES = new Category(
NbBundle.getMessage(FiltersExplorer.class, "FiltersExplorer.Queries"),
null,
null);
private final Category UNSORTED = new Category(
NbBundle.getMessage(FiltersExplorer.class, "Filte... |
this.manager = manager;
this.uiModel = uiModel;
if (model != null) {
this.filterLibrary = model.getLibrary();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
manager.setRootContext(new Catego... | 1,538 | 208 | 1,746 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/SavedQueryNode.java | RemoveAction | actionPerformed | class RemoveAction extends AbstractAction {
public RemoveAction() {
super(NbBundle.getMessage(SavedQueryNode.class, "SavedQueryNode.actions.remove"));
}
@Override
public void actionPerformed(ActionEvent e) {<FILL_FUNCTION_BODY>}
} |
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
FilterLibrary filterLibrary = filterController.getModel().getLibrary();
filterLibrary.deleteQuery(query);
| 79 | 50 | 129 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/library/SavedQueryNodeDefaultAction.java | SavedQueryNodeDefaultAction | actionPerformed | class SavedQueryNodeDefaultAction extends SystemAction {
public static SavedQueryNodeDefaultAction instance = new SavedQueryNodeDefaultAction();
@Override
public String getName() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HelpCtx getHelpCtx() {... |
SavedQueryNode node = (SavedQueryNode) ev.getSource();
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
filterController.add(node.getQuery());
| 127 | 55 | 182 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/query/QueryChildren.java | QueryChildren | initCollection | class QueryChildren extends Children.Array {
private Query query;
private Query[] topQuery;
public QueryChildren(Query query) {
this.query = query;
}
public QueryChildren(Query[] topQuery) { //Only for root node
if (topQuery.length > 0) {
this.topQuery = topQuery;
... |
Collection<Node> nodesChildren = new ArrayList<>();
if (query == null && topQuery == null) {
nodesChildren.add(new HelpNode());
} else {
Query[] children = topQuery != null ? topQuery : query.getChildren();
boolean hasParameters = query != null && query.getPr... | 436 | 255 | 691 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/query/QueryExplorer.java | QueryExplorer | propertyChange | class QueryExplorer extends BeanTreeView implements PropertyChangeListener, ChangeListener {
private ExplorerManager manager;
private FilterModel model;
private FilterUIModel uiModel;
private FilterController filterController;
//state
private boolean listenSelectedNodes = false;
public Que... |
if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
if (uiModel == null) {
return;
}
Node[] nodeArray = (Node[]) evt.getNewValue();
if (nodeArray.length > 0) {
Node node = ((Node[]) evt.getNewValue())[0];
... | 1,122 | 319 | 1,441 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/query/QueryNode.java | DuplicateAction | duplicateQuery | class DuplicateAction extends AbstractAction {
public DuplicateAction() {
super(NbBundle.getMessage(QueryNode.class, "QueryNode.actions.duplicate"));
}
@Override
public void actionPerformed(ActionEvent e) {
FilterController filterController = Lookup.getDefault()... |
Filter filter = child.getFilter();
FilterBuilder builder = filterController.getModel().getLibrary().getBuilder(filter);
Query childQuery = filterController.createQuery(builder);
childQuery.setName(child.getName());
Filter filterCopy = childQuery.getFilter()... | 173 | 255 | 428 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/query/RootNode.java | RootNode | getDropType | class RootNode extends AbstractNode {
public RootNode(Children children) {
super(children);
setName(NbBundle.getMessage(RootNode.class, "RootNode.name"));
setIconBaseWithExtension("DesktopFilters/queries.png");
}
@Override
public PasteType getDropType(Transferable t, int action... |
final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
try {
final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
return new PasteType(... | 136 | 452 | 588 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopFilters/src/main/java/org/gephi/desktop/filters/query/SlotNode.java | SlotNode | getDropType | class SlotNode extends AbstractNode {
private final Query parent;
public SlotNode(Query parent) {
super(Children.LEAF);
this.parent = parent;
setIconBaseWithExtension("DesktopFilters/drop.png");
setShortDescription(NbBundle.getMessage(SlotNode.class, "SlotNode.description"));
... |
final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
if (dropNode != null && dropNode instanceof QueryNode) {
Query q = ((QueryNode) dropNode).getQuery();
if (!Arrays.asList(q.getDescendantsAndSelf()).contains(parent)) { //Check if not parent
... | 199 | 360 | 559 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopGenerate/src/main/java/org/gephi/desktop/generate/DesktopGeneratorController.java | DesktopGeneratorController | generate | class DesktopGeneratorController implements GeneratorController {
private final LongTaskExecutor executor;
public DesktopGeneratorController() {
executor = new LongTaskExecutor(true, "Generator");
}
@Override
public Generator[] getGenerators() {
return Lookup.getDefault().lookupAl... |
String title = generator.getName();
GeneratorUI ui = generator.getUI();
if (ui != null) {
ui.setup(generator);
JPanel panel = ui.getPanel();
final DialogDescriptor dd = DialogDescriptorWithValidation.dialog(panel, title);
Object result = DialogDi... | 190 | 324 | 514 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopGenerate/src/main/java/org/gephi/desktop/generate/Generate.java | Generate | getMenuPresenter | class Generate extends CallableSystemAction {
@Override
public void performAction() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getName() {
return "generate";
}
@Override
public HelpCtx getHelpCtx() {
return null;
... |
JMenu menu = new JMenu(NbBundle.getMessage(Generate.class, "CTL_Generate"));
final GeneratorController generatorController = Lookup.getDefault().lookup(GeneratorController.class);
if (generatorController != null) {
for (final Generator gen : generatorController.getGenerators()) {
... | 117 | 171 | 288 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/DesktopImportControllerUI.java | FinishImport | run | class FinishImport implements LongTask, Runnable {
private final List<Container> containers;
private final ImportErrorHandler errorHandler;
private ProgressTicket progressTicket;
public FinishImport(List<Container> containers, ImportErrorHandler errorHandler) {
this.contain... |
// If exceptions were thrown we show them in the processor panel
if (errorHandler != null) {
Report errorReport = errorHandler.closeAndGetReport();
if (errorHandler.countErrors() > 0) {
showProcessorIssues(errorReport);
ret... | 171 | 853 | 1,024 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/EdgesMergeStrategyWrapper.java | EdgesMergeStrategyWrapper | equals | class EdgesMergeStrategyWrapper {
private final EdgeMergeStrategy instance;
public EdgesMergeStrategyWrapper(EdgeMergeStrategy instance) {
this.instance = instance;
}
public EdgeMergeStrategy getInstance() {
return instance;
}
@Override
public int hashCode() {
int ... |
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final EdgesMergeStrategyWrapper other = (EdgesMergeStrategyWrapper) obj;
return this.instance == o... | 197 | 92 | 289 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/ImportDB.java | ImportDB | getMenuPresenter | class ImportDB extends CallableSystemAction {
@Override
public void performAction() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getName() {
return "importDB";
}
@Override
public HelpCtx getHelpCtx() {
return null;
... |
JMenu menu = new JMenu(NbBundle.getMessage(ImportDB.class, "CTL_ImportDB"));
final ImportControllerUI importController = Lookup.getDefault().lookup(ImportControllerUI.class);
if (importController != null) {
for (final DatabaseImporterBuilder dbb : Lookup.getDefault().lookupAll(Data... | 118 | 236 | 354 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/ImportWizard.java | ImportWizard | actionPerformed | class ImportWizard implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {<FILL_FUNCTION_BODY>}
} |
WizardIterator wizardIterator = new WizardIterator();
WizardDescriptor wizardDescriptor = new WizardDescriptor(wizardIterator);
wizardDescriptor.setTitleFormat(new MessageFormat("{0} ({1})"));
wizardDescriptor.setTitle(NbBundle.getMessage(getClass(), "ImportWizard.wizard.title"));
... | 41 | 422 | 463 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/WizardIterator.java | WizardIterator | previousPanel | class WizardIterator implements WizardDescriptor.Iterator {
private int index;
private WizardDescriptor.Panel[] originalPanels;
private WizardDescriptor.Panel[] panels;
private ImporterWizardUI currentWizardUI;
/**
* Initialize panels representing individual wizard's steps and sets various
... |
//change panel if the previous panel is the first
if (!hasPrevious()) {
throw new NoSuchElementException();
}
if (index == 1) {
panels = originalPanels;
repaintLeftComponent();
}
index--;
| 1,440 | 67 | 1,507 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/WizardPanel1.java | WizardPanel1 | isValid | class WizardPanel1 implements WizardDescriptor.ValidatingPanel {
// public final void addChangeListener(ChangeListener l) {
// }
//
// public final void removeChangeListener(ChangeListener l) {
// }
private final Set<ChangeListener> listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.... |
WizardVisualPanel1 panel = (WizardVisualPanel1) getComponent();
return !panel.emptyList();
// If it is always OK to press Next or Finish, then:
// If it depends on some condition (form filled out...), then:
// return someCondition();
// and when this condition changes (last form... | 664 | 106 | 770 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/WizardPanel2.java | WizardPanel2 | isValid | class WizardPanel2 implements WizardDescriptor.Panel {
/**
* The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent().
*/
private Component component;
public WizardPanel2() {
super();
}
// Get the visual c... |
// If it is always OK to press Next or Finish, then:
return true;
// If it depends on some condition (form filled out...), then:
// return someCondition();
// and when this condition changes (last form field filled in...) then:
// fireChangeEvent();
// and uncomm... | 620 | 84 | 704 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopImport/src/main/java/org/gephi/desktop/importer/WizardVisualPanel2.java | WizardVisualPanel2 | initComponents | class WizardVisualPanel2 extends JPanel {
public WizardVisualPanel2() {
initComponents();
}
@Override
public String getName() {
return "...";
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The con... |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 500, Short.MAX_VALUE)
);
layout.setVerticalGroup(
... | 204 | 145 | 349 | <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/DesktopLayout/src/main/java/org/gephi/desktop/layout/LayoutNode.java | LayoutNode | getPropertySets | class LayoutNode extends AbstractNode {
private final Layout layout;
private PropertySet[] propertySets;
public LayoutNode(Layout layout) {
super(Children.LEAF);
this.layout = layout;
setName(layout.getBuilder().getName());
}
@Override
public PropertySet[] getPropertyS... |
if (propertySets == null) {
try {
Map<String, Sheet.Set> sheetMap = new HashMap<>();
for (LayoutProperty layoutProperty : layout.getProperties()) {
Sheet.Set set = sheetMap.get(layoutProperty.getCategory());
if (set == null) {
... | 121 | 196 | 317 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopLayout/src/main/java/org/gephi/desktop/layout/LayoutTopComponent.java | LayoutTopComponent | writeProperties | class LayoutTopComponent extends TopComponent {
private final LayoutPanel layoutPanel;
private LayoutModel model;
public LayoutTopComponent() {
initComponents();
setName(NbBundle.getMessage(LayoutTopComponent.class, "CTL_LayoutTopComponent"));
putClientProperty(TopComponent.PROP_M... |
// 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
| 670 | 55 | 725 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/PresetUtils.java | PresetUtils | savePreset | class PresetUtils {
private List<PreviewPreset> presets;
public void savePreset(PreviewPreset preset) {<FILL_FUNCTION_BODY>}
public PreviewPreset[] getPresets() {
if (presets == null) {
presets = new ArrayList<>();
loadPresets();
}
return presets.toArray(ne... |
int exist = -1;
for (int i = 0; i < presets.size(); i++) {
PreviewPreset p = presets.get(i);
if (p.getName().equals(preset.getName())) {
exist = i;
break;
}
}
if (exist == -1) {
addPreset(preset);
} ... | 1,019 | 473 | 1,492 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/PreviewNode.java | PreviewNode | createSheet | class PreviewNode extends AbstractNode implements PropertyChangeListener {
private final PropertySheet propertySheet;
public PreviewNode(PropertySheet propertySheet) {
super(Children.LEAF);
this.propertySheet = propertySheet;
setDisplayName(NbBundle.getMessage(PreviewNode.class, "Previ... |
Sheet sheet = Sheet.createDefault();
PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
Set<Renderer> enabledRenderers = null;
if (controller.getModel() != null && controller.getModel().getManagedRenderers() != null) {
enabledRenderers = new... | 927 | 822 | 1,749 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/PreviewSketch.java | RefreshLoop | run | class RefreshLoop {
private final long DELAY = 100;
private final AtomicBoolean running = new AtomicBoolean();
private final AtomicBoolean refresh = new AtomicBoolean();
//Timer
private long timeout = DELAY * 10;
private Timer timer;
public RefreshLoop() {
... |
if (refresh.getAndSet(false)) {
target.refresh();
repaint();
} else if (timeout == 0) {
timeout = DELAY * 10;
stopTimer();
} else {
timeout... | 231 | 72 | 303 | <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/DesktopPreview/src/main/java/org/gephi/desktop/preview/PreviewUIControllerImpl.java | PreviewUIControllerImpl | refreshPreview | class PreviewUIControllerImpl implements PreviewUIController {
private final List<PropertyChangeListener> listeners;
private final PreviewController previewController;
private final GraphController graphController;
private final PresetUtils presetUtils = new PresetUtils();
private PreviewUIModelImp... |
if (model != null) {
Thread refreshThread = new Thread(new Runnable() {
@Override
public void run() {
model.setRefreshing(true);
fireEvent(REFRESHING, true);
previewController.getModel().getProperties()
... | 1,673 | 170 | 1,843 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/PreviewUIModelImpl.java | PreviewUIModelImpl | readXML | class PreviewUIModelImpl implements PreviewUIModel {
private final PreviewModel previewModel;
//Data
private float visibilityRatio = 1f;
private PreviewPreset currentPreset;
private boolean refreshing;
public PreviewUIModelImpl(PreviewModel model) {
previewModel = model;
if (U... |
boolean end = false;
while (reader.hasNext() && !end) {
int type = reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
String name = reader.getLocalName();
if ("currentpreset".equalsIgnoreCase(name)) {
... | 746 | 255 | 1,001 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/PreviewUIPersistenceProvider.java | PreviewUIPersistenceProvider | readXML | class PreviewUIPersistenceProvider implements WorkspaceXMLPersistenceProvider {
@Override
public void writeXML(XMLStreamWriter writer, Workspace workspace) {
PreviewUIModelImpl model = workspace.getLookup().lookup(PreviewUIModelImpl.class);
if (model != null) {
try {
... |
PreviewUIModelImpl model = workspace.getLookup().lookup(PreviewUIModelImpl.class);
PreviewModel previewModel = workspace.getLookup().lookup(PreviewModel.class);
if (previewModel == null) {
PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);
... | 184 | 180 | 364 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopPreview/src/main/java/org/gephi/desktop/preview/propertyeditors/DependantColorPanel.java | DependantColorPanel | initComponents | class DependantColorPanel extends javax.swing.JPanel implements ItemListener {
private DependantColorPropertyEditor propertyEditor;
// Variables declaration - do not modify
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JButton colorButton;
private javax.swin... |
buttonGroup1 = new javax.swing.ButtonGroup();
colorButton = new JColorButton(Color.BLACK);
customRadio = new javax.swing.JRadioButton();
parentRadio = new javax.swing.JRadioButton();
jXHeader1 = new org.jdesktop.swingx.JXHeader();
darkerButton = new javax.swing.JRadioBu... | 742 | 877 | 1,619 | <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/DesktopPreview/src/main/java/org/gephi/desktop/preview/propertyeditors/DependantOriginalColorPanel.java | DependantOriginalColorPanel | initComponents | class DependantOriginalColorPanel extends javax.swing.JPanel implements ItemListener {
private DependantOriginalColorPropertyEditor propertyEditor;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JButton colorButton;
pr... |
buttonGroup1 = new javax.swing.ButtonGroup();
jXHeader1 = new org.jdesktop.swingx.JXHeader();
colorButton = new JColorButton(Color.BLACK, false, true);
customRadio = new javax.swing.JRadioButton();
originalRadio = new javax.swing.JRadioButton();
parentRadio = new javax.... | 812 | 934 | 1,746 | <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/DesktopProject/src/main/java/org/gephi/desktop/project/Installer.java | Installer | closing | class Installer extends ModuleInstall {
@Override
public void restored() {
ProjectControllerUIImpl projectControllerUI = Lookup.getDefault().lookup(ProjectControllerUIImpl.class);
projectControllerUI.loadProjects();
}
@Override
public boolean closing() {<FILL_FUNCTION_BODY>}
} |
ProjectControllerUIImpl projectControllerUI = Lookup.getDefault().lookup(ProjectControllerUIImpl.class);
if (Lookup.getDefault().lookup(ProjectController.class).getCurrentProject() == null) {
//Close directly if no project open
projectControllerUI.saveProjects();
re... | 87 | 123 | 210 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/desktop/project/actions/DeleteOtherWorkspaces.java | DeleteOtherWorkspaces | actionPerformed | class DeleteOtherWorkspaces extends AbstractAction {
DeleteOtherWorkspaces() {
super(NbBundle.getMessage(DeleteOtherWorkspaces.class, "CTL_DeleteOtherWorkspaces"));
}
@Override
public void actionPerformed(ActionEvent ev) {<FILL_FUNCTION_BODY>}
@Override
public boolean isEnabled() {
... |
if (isEnabled()) {
ProjectControllerUIImpl cui = Lookup.getDefault().lookup(ProjectControllerUIImpl.class);
Workspace workspace;
if (ev.getSource() != null && ev.getSource() instanceof Workspace) {
workspace = (Workspace) ev.getSource();
} else {
... | 121 | 184 | 305 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/desktop/project/actions/DeleteWorkspace.java | DeleteWorkspace | actionPerformed | class DeleteWorkspace extends AbstractAction {
DeleteWorkspace() {
super(NbBundle.getMessage(DeleteWorkspace.class, "CTL_DeleteWorkspace"),
ImageUtilities.loadImageIcon("DesktopProject/deleteWorkspace.png", false));
}
@Override
public void actionPerformed(ActionEvent ev) {<FILL_FUN... |
if (isEnabled()) {
ProjectControllerUIImpl cui = Lookup.getDefault().lookup(ProjectControllerUIImpl.class);
if (ev.getSource() != null && ev.getSource() instanceof Workspace) {
Workspace workspace = (Workspace) ev.getSource();
cui.deleteWorkspace(workspac... | 138 | 109 | 247 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/desktop/project/actions/OpenFile.java | OpenFile | actionPerformed | class OpenFile extends AbstractAction {
private static final String GEPHI_EXTENSION = "gephi";
OpenFile() {
super(NbBundle.getMessage(OpenFile.class, "CTL_OpenFile"));
}
@Override
public boolean isEnabled() {
return Lookup.getDefault().lookup(ProjectControllerUIImpl.class).canOpen... |
if (isEnabled()) {
if (ev != null && ev.getSource() != null && ev.getSource() instanceof File) {
FileObject fileObject = FileUtil.toFileObject((File) ev.getSource());
if (fileObject.hasExt(GEPHI_EXTENSION)) {
Lookup.getDefault().lookup(ProjectCont... | 131 | 409 | 540 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/desktop/project/actions/RecentFiles.java | RecentFiles | createMenu | class RecentFiles extends AbstractAction implements DynamicMenuContent {
RecentFiles() {
super(NbBundle.getMessage(RecentFiles.class, "CTL_OpenRecentFiles"));
}
@Override
public void actionPerformed(ActionEvent e) {
// does nothing, this is a popup menu
}
@Override
public ... |
JMenu menu = new JMenu(NbBundle.getMessage(RecentFiles.class, "CTL_OpenRecentFiles"));
JComponent[] menuItems = createSubMenus();
for (JComponent item : menuItems) {
menu.add(item);
}
return new JComponent[] {menu};
| 831 | 78 | 909 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/desktop/project/actions/RenameWorkspace.java | RenameWorkspace | actionPerformed | class RenameWorkspace extends AbstractAction {
RenameWorkspace() {
super(NbBundle.getMessage(DeleteWorkspace.class, "CTL_RenameWorkspace"),
ImageUtilities.loadImageIcon("DesktopProject/renameWorkspace.png", false));
}
@Override
public void actionPerformed(ActionEvent e) {<FILL_FUNC... |
if (isEnabled()) {
String name = "";
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
name = pc.getCurrentWorkspace().getLookup().lookup(WorkspaceInformation.class).getName();
DialogDescriptor.InputLine dd = new DialogDescriptor.InputLi... | 143 | 193 | 336 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopProject/src/main/java/org/gephi/ui/project/ProjectList.java | ProjectCellRenderer | initComponents | class ProjectCellRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
JLabel c = (JLabel) super.getListCellRendererComponent(lis... |
jScrollPane2 = new javax.swing.JScrollPane();
projectList = new javax.swing.JList<>();
openProjectButton = new javax.swing.JButton();
removeProjectButton = new javax.swing.JButton();
projectList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScroll... | 321 | 802 | 1,123 | <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/DesktopSearch/src/main/java/org/gephi/desktop/search/SearchAction.java | SearchAction | actionPerformed | class SearchAction extends AbstractAction {
// Singleton so it persists when the dialog is closed
private final SearchUIModel uiModel;
SearchAction() {
super(NbBundle.getMessage(SearchAction.class, "CTL_Search"),
ImageUtilities.loadImageIcon("DesktopSearch/search.png", false));
... |
if (isEnabled()) {
SearchDialog panel = new SearchDialog(uiModel);
JDialog dialog = new JDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(SearchAction.class, "SearchDialog.title"), false);
// Close behavior
dialog.getRootPan... | 217 | 274 | 491 | <methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, javax.swing.Icon) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object[] getKeys() ,public synchronized java.beans.PropertyChangeListener[] getPropertyChan... |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/filter/SearchFilterBuilder.java | SearchFilter | filter | class SearchFilter implements ComplexFilter {
private String query;
private String type;
public SearchFilter() {
type = SearchCategoryImpl.NODES().getId();
}
@Override
public Graph filter(Graph graph) {<FILL_FUNCTION_BODY>}
public String getName() ... |
if (query == null || query.isEmpty()) {
return graph;
}
SearchRequest request =
SearchRequest.builder().query(query).graph(graph).parallel(false).limitResults(false).build();
SearchController searchController = Lookup.getDefault().lookup(S... | 286 | 253 | 539 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/filter/SearchPanel.java | SearchPanel | initComponents | class SearchPanel extends javax.swing.JPanel {
public SearchPanel() {
initComponents();
// Combo
DefaultComboBoxModel<SearchCategory> comboBoxModel = new DefaultComboBoxModel<>();
comboBoxModel.addElement(SearchCategoryImpl.NODES());
comboBoxModel.addElement(SearchCategoryI... |
searchField = new javax.swing.JTextField();
typeCombo = new javax.swing.JComboBox<>();
searchButton = new javax.swing.JButton();
searchInLabel = new javax.swing.JLabel();
org.openide.awt.Mnemonics.setLocalizedText(searchButton,
org.openide.util.NbBundle.getMessage(... | 455 | 746 | 1,201 | <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/DesktopSearch/src/main/java/org/gephi/desktop/search/impl/SearchCategoryImpl.java | EdgeSearchCategoryImpl | equals | class EdgeSearchCategoryImpl extends SearchCategoryImpl {
@Override
public String getId() {
return EDGE_ID;
}
}
public static SearchCategory NODES() {
return Lookup.getDefault().lookupAll(SearchCategory.class).stream()
.filter(c -> c.getId().equals(NODE_... |
if (this == o) {
return true;
}
if (!(o instanceof SearchCategoryImpl)) {
return false;
}
SearchCategory that = (SearchCategory) o;
return getId().equals(that.getId());
| 269 | 66 | 335 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/impl/SearchControllerImpl.java | SearchControllerImpl | search | class SearchControllerImpl implements SearchController {
private final ExecutorService pool;
private final List<Future<Void>> currentSearch = new ArrayList<>();
private SearchSession currentSession;
private SearchListener currentListener;
private final static int MAX_RESULTS = 10;
public Searc... |
SearchSession<T> session = new SearchSession<>(request, Collections.singleton(typeFilter));
if (request.inParallel()) {
ForkJoinPool commonPool = ForkJoinPool.commonPool();
getProviderTasks(request, session).stream().map(commonPool::submit).forEach(ForkJoinTask::join);
... | 1,244 | 120 | 1,364 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/impl/SearchResultImpl.java | SearchResultImpl | equals | class SearchResultImpl<T> implements SearchResult<T>, Comparable<SearchResultImpl<T>> {
private final T result;
private final SearchProvider<T> provider;
private final int position;
private final String htmlDisplay;
private final String matchLocation;
public SearchResultImpl(SearchProvider<T>... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SearchResultImpl<?> that = (SearchResultImpl<?>) o;
return result.equals(that.result);
| 400 | 80 | 480 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/impl/SearchResultsBuilderImpl.java | SearchResultsBuilderImpl | addResult | class SearchResultsBuilderImpl<T> implements SearchResultsBuilder<T> {
private boolean obsolete = false;
private final int maxResults;
private final List<SearchResultImpl<T>> resultsList;
private final SearchProvider<T> provider;
private int position;
public SearchResultsBuilderImpl(SearchProv... |
if (result == null) {
throw new NullPointerException("Result cannot be null");
}
resultsList.add(new SearchResultImpl<>(provider, position, result, htmlDisplayText, matchLocation));
return !obsolete && resultsList.size() < maxResults;
| 247 | 71 | 318 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/plugin/EdgeIdSearchProvider.java | EdgeIdSearchProvider | search | class EdgeIdSearchProvider implements SearchProvider<Edge> {
@Override
public void search(SearchRequest request, SearchResultsBuilder<Edge> resultsBuilder) {<FILL_FUNCTION_BODY>}
private String toHtmlDisplay(Edge edge) {
return NbBundle.getMessage(EdgeIdSearchProvider.class,
"EdgeIdSea... |
if (request.isCategoryIncluded(SearchCategoryImpl.EDGES())) {
Edge edge = request.getGraph().getEdge(request.getQuery());
if (edge != null) {
resultsBuilder.addResult(edge, toHtmlDisplay(edge), NbBundle.getMessage(EdgeIdSearchProvider.class,
"EdgeIdS... | 98 | 97 | 195 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/plugin/ElementLabelSearchProvider.java | ElementLabelSearchProvider | search | class ElementLabelSearchProvider implements SearchProvider<Element> {
@Override
public void search(SearchRequest request, SearchResultsBuilder<Element> resultsBuilder) {<FILL_FUNCTION_BODY>}
protected void matchElementLabel(ElementIterable<? extends Element> iterable, String query,
... |
String query = request.getQuery();
// Exact node label
if (request.isCategoryIncluded(SearchCategoryImpl.NODES())) {
matchElementLabel(request.getGraph().getNodes(), query, resultsBuilder);
}
// Exact edge label
if (request.isCategoryIncluded(SearchCatego... | 331 | 115 | 446 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/plugin/FuzzyElementLabelSearchProvider.java | FuzzyElementLabelSearchProvider | toHtmlDisplay | class FuzzyElementLabelSearchProvider extends ElementLabelSearchProvider {
@Override
protected boolean match(Element element, String query) {
return element.getLabel() != null && element.getLabel().toLowerCase().contains(query.toLowerCase()) &&
!super.match(element, query);
}
@Over... |
String label = element.getLabel();
int index = label.toLowerCase().indexOf(query.toLowerCase());
String before = label.substring(0, index);
String match = label.substring(index, index + query.length());
String after = label.substring(index + query.length());
return NbBu... | 158 | 121 | 279 | <methods>public non-sealed void <init>() ,public void search(org.gephi.desktop.search.api.SearchRequest, SearchResultsBuilder<Element>) <variables> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/plugin/NodeIdSearchProvider.java | NodeIdSearchProvider | search | class NodeIdSearchProvider implements SearchProvider<Node> {
@Override
public void search(SearchRequest request, SearchResultsBuilder<Node> resultsBuilder) {<FILL_FUNCTION_BODY>}
public static String toHtmlDisplay(Node node) {
return NbBundle.getMessage(NodeIdSearchProvider.class,
"Nod... |
if (request.isCategoryIncluded(SearchCategoryImpl.NODES())) {
Node node = request.getGraph().getNode(request.getQuery());
if (node != null) {
resultsBuilder.addResult(node, toHtmlDisplay(node), NbBundle.getMessage(NodeIdSearchProvider.class,
"NodeIdS... | 99 | 96 | 195 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/plugin/StartWithElementLabelSearchProvider.java | StartWithElementLabelSearchProvider | toHtmlDisplay | class StartWithElementLabelSearchProvider extends ElementLabelSearchProvider {
@Override
protected boolean match(Element element, String query) {
return element.getLabel() != null && element.getLabel().toLowerCase().startsWith(query.toLowerCase()) &&
!super.match(element, query);
}
... |
String label = element.getLabel();
String match = label.substring(0, query.length());
String after = label.substring(query.length());
return NbBundle.getMessage(StartWithElementLabelSearchProvider.class,
"StartWithElementLabelSearchProvider.result",
match, after... | 159 | 80 | 239 | <methods>public non-sealed void <init>() ,public void search(org.gephi.desktop.search.api.SearchRequest, SearchResultsBuilder<Element>) <variables> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/popup/ActionPopup.java | ActionPopup | maybePopup | class ActionPopup extends MouseAdapter {
private final JList<SearchResult> list;
public ActionPopup(JList<SearchResult> list) {
super();
this.list = list;
}
@Override
public void mousePressed(MouseEvent e) {
maybePopup(e);
}
@Override
public void mouseReleased... |
if (e.isPopupTrigger()) {
SwingUtilities.invokeLater(() -> {
final Point p = e.getPoint();
int row = list.locationToIndex(e.getPoint());
list.setSelectedIndex(row);
final JPopupMenu pop = createPopup(p);
if (pop != null... | 328 | 117 | 445 | <methods>public void mouseClicked(java.awt.event.MouseEvent) ,public void mouseDragged(java.awt.event.MouseEvent) ,public void mouseEntered(java.awt.event.MouseEvent) ,public void mouseExited(java.awt.event.MouseEvent) ,public void mouseMoved(java.awt.event.MouseEvent) ,public void mousePressed(java.awt.event.MouseEven... |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/popup/EdgePopup.java | EdgePopup | createPopup | class EdgePopup {
protected static final Set<Class<? extends Manipulator>> excludedManipulators = Set.copyOf(List.of(
CopyEdgeDataToOtherEdges.class));
protected static final Set<Class<? extends Manipulator>> graphManipulators = Set.copyOf(List.of(
SelectOnGraph.class,
SelectSourceOnGr... |
boolean graphOpened = SearchDialog.isGraphOpened();
boolean datalabOpened = SearchDialog.isDataLabOpened();
JPopupMenu contextMenu = new JPopupMenu();
DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
Integer lastManipulatorType = null;
for (EdgesManipulato... | 180 | 339 | 519 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopSearch/src/main/java/org/gephi/desktop/search/popup/NodePopup.java | NodePopup | createPopup | class NodePopup {
protected static final Set<Class<? extends Manipulator>> excludedManipulators = Set.copyOf(List.of(
MergeNodes.class,
LinkNodes.class,
CopyNodeDataToOtherNodes.class));
protected static final Set<Class<? extends Manipulator>> graphManipulators = Set.copyOf(List.of(
... |
boolean graphOpened = SearchDialog.isGraphOpened();
boolean datalabOpened = SearchDialog.isDataLabOpened();
JPopupMenu contextMenu = new JPopupMenu();
DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
Integer lastManipulatorType = null;
for (NodesManipulato... | 189 | 336 | 525 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/AvailableStatisticsChooser.java | AvailableStatisticsChooser | unsetup | class AvailableStatisticsChooser extends javax.swing.JPanel {
private final JSqueezeBoxPanel squeezeBoxPanel = new JSqueezeBoxPanel();
private final Map<JCheckBox, StatisticsUI> uiMap = new HashMap<>();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel metricsPane... |
//Only called when OK
StatisticsControllerUI controller = Lookup.getDefault().lookup(StatisticsControllerUI.class);
for (Map.Entry<JCheckBox, StatisticsUI> entry : uiMap.entrySet()) {
controller.setStatisticsUIVisible(entry.getValue(), entry.getKey().isSelected());
}
| 1,148 | 86 | 1,234 | <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/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/DynamicSettingsPanel.java | DateRangeValidator | validate | class DateRangeValidator implements Validator<String> {
private final ComboBoxModel combo;
public DateRangeValidator(ComboBoxModel comboBoxModel) {
this.combo = comboBoxModel;
}
@Override
public void validate(Problems prblms, String string, String t) {<FILL_FUNCTIO... |
Integer i = 0;
try {
i = Integer.parseInt(t);
} catch (NumberFormatException e) {
prblms.add("Number can't be parsed");
}
TimeUnit tu = getSelectedTimeUnit(combo);
long timeInMilli = (long) getTimeInMilliseconds(t, ... | 115 | 188 | 303 | <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/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/StatisticsControllerUIImpl.java | StatisticsControllerUIImpl | execute | class StatisticsControllerUIImpl implements StatisticsControllerUI {
// private final DynamicModelListener dynamicModelListener;
private StatisticsModelUIImpl model;
public StatisticsControllerUIImpl() {
// dynamicModelListener = new DynamicModelListener() {
//
// public void dynamicM... |
StatisticsController controller = Lookup.getDefault().lookup(StatisticsController.class);
final StatisticsUI[] uis = getUI(statistics);
for (StatisticsUI s : uis) {
s.setup(statistics);
}
model.setRunning(statistics, true);
controller.execute(statistics, ne... | 895 | 199 | 1,094 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/StatisticsModelUIImpl.java | StatisticsModelUIImpl | readXML | class StatisticsModelUIImpl implements StatisticsModelUI {
private final Workspace workspace;
private final List<StatisticsUI> invisibleList;
private final Map<StatisticsUI, String> resultMap;
private final List<Statistics> runningList;
//Listeners
private final List<ChangeListener> listeners;
... |
Collection<? extends StatisticsUI> uis = Lookup.getDefault().lookupAll(StatisticsUI.class);
boolean end = false;
while (reader.hasNext() && !end) {
int type = reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
String ... | 1,024 | 277 | 1,301 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/StatisticsPanel.java | StatisticsPanel | initCategories | class StatisticsPanel extends JPanel {
//Data
private StatisticsCategory[] categories;
private List<UIFrontEnd> frontEnds;
//UI
private JSqueezeBoxPanel squeezeBoxPanel;
public StatisticsPanel() {
initComponents();
initCategories();
initFrontEnds();
}
public vo... |
Map<String, StatisticsCategory> cats = new LinkedHashMap<>();
cats.put(StatisticsUI.CATEGORY_NETWORK_OVERVIEW,
new StatisticsCategory(StatisticsUI.CATEGORY_NETWORK_OVERVIEW, 100));
cats.put(StatisticsUI.CATEGORY_COMMUNITY_DETECTION,
new StatisticsCategory(StatisticsUI.CA... | 1,351 | 384 | 1,735 | <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/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/StatisticsTopComponent.java | StatisticsTopComponent | select | class StatisticsTopComponent extends TopComponent implements ChangeListener {
//Model
private transient StatisticsModelUIImpl model;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton settingsButton;
private javax.swing.JPanel statisticsPanel;
private java... |
StatisticsModelUIImpl model = workspace.getLookup().lookup(StatisticsModelUIImpl.class);
if (model == null) {
model = new StatisticsModelUIImpl(workspace);
workspace.add(model);
}
refreshModel(model);
| 1,626 | 75 | 1,701 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopStatistics/src/main/java/org/gephi/desktop/statistics/StatisticsUIPersistenceProvider.java | StatisticsUIPersistenceProvider | writeXML | class StatisticsUIPersistenceProvider implements WorkspaceXMLPersistenceProvider {
@Override
public void writeXML(XMLStreamWriter writer, Workspace workspace) {<FILL_FUNCTION_BODY>}
@Override
public void readXML(XMLStreamReader reader, Workspace workspace) {
StatisticsModelUIImpl statModel = w... |
StatisticsModelUIImpl statModel = workspace.getLookup().lookup(StatisticsModelUIImpl.class);
if (statModel != null) {
try {
statModel.writeXML(writer);
} catch (XMLStreamException ex) {
throw new RuntimeException(ex);
}
}
| 211 | 84 | 295 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/DateTick.java | DateTick | create | class DateTick {
//Consts
protected final static int MIN_PIXELS = 10;
//Fields
private final DateTime min;
private final DateTime max;
private final TickPeriod[] tickPeriods;
public DateTick(DateTime min, DateTime max, DateTimeFieldType[] types) {
this.min = min;
this.max =... |
DateTime minDate = new DateTime((long) min);
DateTime maxDate = new DateTime((long) max);
Period period = new Period(minDate, maxDate, PeriodType.yearMonthDayTime());
int years = period.getYears();
int months = period.getMonths();
int days = period.getDays();
i... | 774 | 673 | 1,447 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/DrawerSettings.java | DrawerSettings | update | class DrawerSettings {
public Background background = new Background();
public SelectionBox selection = new SelectionBox();
public Stroke defaultStroke;
public Color defaultStrokeColor;
public Color shadowColor;
public int hookLength;
public RenderingHints renderingHints;
public Kernel ... |
if (lastWidth == width && lastHeight == height) {
return;
}
lastWidth = width;
lastHeight = height;
// background.paint = new GradientPaint(0, 0, background.top, 0, height, background.bottom, true);
selection.paint = new GradientPaint(0, 0, selection.top, 0, ... | 1,419 | 193 | 1,612 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/Sparkline.java | Sparkline | draw | class Sparkline {
private double min;
private double max;
private SparklineParameters parameters;
private TimelineChart chart;
private BufferedImage image;
public BufferedImage getImage(TimelineModel model, int width, int height) {
double newMin = model.getCustomMin();
double n... |
BufferedImage img =
SparklineGraph.draw(chart.getX(), chart.getY(), chart.getMinY(), chart.getMaxY(), parameters);
return img;
| 425 | 48 | 473 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/StartEndTick.java | StartEndTick | getEndValue | class StartEndTick {
private final DecimalFormat decimalFormat;
private final int exponentMin;
private final int exponentMax;
private final double min;
private final double max;
public StartEndTick(double min, double max, int exponentMin, int exponentMax) {
decimalFormat = new DecimalF... |
if (exponentMax > 0) {
return String.valueOf((long) max);
}
decimalFormat.setMaximumFractionDigits(Math.abs(exponentMax) + 2);
return decimalFormat.format(max);
| 399 | 63 | 462 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/TimeFormatDialog.java | TimeFormatDialog | setup | class TimeFormatDialog extends javax.swing.JPanel {
private TimelineController timelineController;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup;
private javax.swing.JRadioButton dateRadio;
private javax.swing.JRadioButton dateTimeRadio;
... |
this.timelineController = Lookup.getDefault().lookup(TimelineController.class);
TimeFormat timeFormat = model.getTimeFormat();
switch (timeFormat) {
case DATE:
dateRadio.setSelected(true);
break;
case DATETIME:
dateTimeRad... | 1,196 | 119 | 1,315 | <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/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/TimelineTooltip.java | TimelineTooltip | buildData | class TimelineTooltip {
private static final int DELAY = 500;
private TimelineModel model;
private String position;
private String min;
private String max;
private String y;
private Timer timer;
private RichTooltip tooltip;
private final Lock lock = new ReentrantLock();
public ... |
switch (model.getTimeFormat()) {
case DOUBLE:
int exponentMin = (int) Math.round(Math.log10(model.getCustomMin()));
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setRoundingMode(RoundingMode.HALF_EVEN);
if (exponentM... | 757 | 515 | 1,272 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTimeline/src/main/java/org/gephi/desktop/timeline/TimelineWindowAction.java | TimelineWindowAction | actionPerformed | class TimelineWindowAction implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {<FILL_FUNCTION_BODY>}
} |
BottomComponentImpl bottomComponent = Lookup.getDefault().lookup(BottomComponentImpl.class);
if (bottomComponent != null) {
bottomComponent.setVisible(!bottomComponent.isVisible());
}
| 46 | 60 | 106 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopTools/src/main/java/org/gephi/desktop/tools/MouseSelectionPopupPanel.java | MouseSelectionPopupPanel | initComponents | class MouseSelectionPopupPanel extends javax.swing.JPanel {
private ChangeListener changeListener;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JSlider diameterSlider;
private javax.swing.JLabel labelDiameter;
private javax.swing.JLabel labelValue;
private j... |
java.awt.GridBagConstraints gridBagConstraints;
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
labelDiameter = new javax.swing.JLabel();
diameterSlider = new javax.swing.JSlider();
labelValue = new javax.swing.JLabel();
proportionnalZoomCheckbox = new java... | 650 | 984 | 1,634 | <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/DesktopTools/src/main/java/org/gephi/desktop/tools/PropertiesBar.java | PropertiesBar | getFullScreenIcon | class PropertiesBar extends JPanel {
private final SelectionBar selectionBar;
private JPanel propertiesBar;
public PropertiesBar() {
super(new BorderLayout());
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.setOpaque(true);
leftPanel.add(getFullScreenIcon(), B... |
int logoWidth = 27;
int logoHeight = 28;
//fullscreen icon size
if (UIUtils.isAquaLookAndFeel()) {
logoWidth = 34;
}
JPanel c = new JPanel(new BorderLayout());
c.setBackground(Color.WHITE);
if (!UIUtils.isAquaLookAndFeel()) {
JButt... | 442 | 447 | 889 | <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/DesktopTools/src/main/java/org/gephi/desktop/tools/SelectionBar.java | SelectionBar | refresh | class SelectionBar extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.jdesktop.swingx.JXHyperlink configureLink;
private javax.swing.JSeparator endSeparator;
private javax.swing.JLabel statusLabel;
// End of variables declaration//GEN-END:variable... |
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
SelectionManager manager = VizController.getInstance().getSelectionManager();
if (manager.isSelectionEnabled()) {
if (manager.isRectangleSelection()) {
... | 1,387 | 280 | 1,667 | <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/DesktopTools/src/main/java/org/gephi/desktop/tools/Toolbar.java | Toolbar | setEnabled | class Toolbar extends JToolBar {
private final ButtonGroup buttonGroup;
public Toolbar() {
initDesign();
buttonGroup = new ButtonGroup();
}
private void initDesign() {
setFloatable(false);
setOrientation(JToolBar.VERTICAL);
putClientProperty("JToolBar.isRollove... |
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Component c : getComponents()) {
c.setEnabled(enabled);
}
}
});
| 266 | 62 | 328 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, int) ,public javax.swing.JButton add(javax.swing.Action) ,public void addSeparator() ,public void addSeparator(java.awt.Dimension) ,public javax.accessibility.AccessibleContext getAccessibl... |
gephi_gephi | gephi/modules/DesktopWindow/src/main/java/org/gephi/desktop/banner/BannerComponent.java | BannerComponent | initComponents | class BannerComponent extends javax.swing.JPanel {
private final transient PerspectiveController perspectiveController;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel buttonsPanel;
private javax.swing.JPanel mainPanel;
private javax.swing.ButtonGroup perspe... |
perspectivesButtonGroup = new javax.swing.ButtonGroup();
mainPanel = new javax.swing.JPanel();
workspacePanel = new org.gephi.desktop.banner.workspace.WorkspacePanel();
buttonsPanel = new javax.swing.JPanel();
setBackground(new java.awt.Color(255, 255, 255));
setLayout... | 837 | 267 | 1,104 | <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/DesktopWindow/src/main/java/org/gephi/desktop/banner/Installer.java | Installer | run | class Installer extends ModuleInstall {
@Override
public void restored() {
//Initialize the perspective controller
Lookup.getDefault().lookup(PerspectiveController.class);
// Init Banner
initBanner();
}
private void initBanner() {
WindowManager.getDefault().inv... |
final JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
Container contentPane = ((JRootPane) frame.getComponents()[0]).getContentPane();
//Add Banner
JComponent toolbar = new BannerComponent();
frame.getContentPane().add... | 123 | 372 | 495 | <no_super_class> |
gephi_gephi | gephi/modules/DesktopWindow/src/main/java/org/gephi/desktop/progress/ProgressTicketImpl.java | ProgressTicketImpl | finish | class ProgressTicketImpl implements ProgressTicket {
private final ProgressHandle handle;
private String displayName;
private int progress100 = 0;
private int progressTotal;
private int currentUnit = 0;
private boolean started = false;
private boolean finished = false;
public ProgressT... |
if (handle != null && started && !finished) {
try {
handle.finish();
finished = true;
} catch (Exception e) {
}
StatusDisplayer.getDefault().setStatusText(finishMessage);
}
| 1,285 | 67 | 1,352 | <no_super_class> |
gephi_gephi | gephi/modules/ExportAPI/src/main/java/org/gephi/io/exporter/impl/ExportControllerImpl.java | ExportControllerImpl | exportFile | class ExportControllerImpl implements ExportController {
private final FileExporterBuilder[] fileExporterBuilders;
private final ExporterUI[] uis;
public ExportControllerImpl() {
Lookup.getDefault().lookupAll(GraphFileExporterBuilder.class);
Lookup.getDefault().lookupAll(VectorFileExporter... |
if (fileExporter.getWorkspace() == null) {
ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
Workspace workspace = projectController.getCurrentWorkspace();
fileExporter.setWorkspace(workspace);
}
if (fileExporter insta... | 1,277 | 400 | 1,677 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.