Examples of FilterController


Examples of org.gephi.filters.api.FilterController

                final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        Query f = filterController.createQuery(fb.getFilter());
                        filterController.add(f);
                        return null;
                    }
                };
            } catch (UnsupportedFlavorException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        } else if (dropNode != null && dropNode instanceof SavedQueryNode) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    SavedQueryNode node = (SavedQueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    filterController.add(node.getQuery());
                    return null;
                }
            };
        } else if (dropNode != null && dropNode instanceof QueryNode && ((QueryNode) dropNode).getQuery().getParent() != null) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    filterController.removeSubQuery(queryNode.getQuery(), queryNode.getQuery().getParent());
                    filterController.add(queryNode.getQuery());
                    return null;
                }
            };
        }
        return null;
View Full Code Here

Examples of org.gephi.filters.api.FilterController

                    final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                    return new PasteType() {

                        @Override
                        public Transferable paste() throws IOException {
                            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                            Query f = filterController.createQuery(fb.getFilter());
                            filterController.add(f);
                            return null;
                        }
                    };
                } catch (UnsupportedFlavorException ex) {
                    ex.printStackTrace();
View Full Code Here

Examples of org.gephi.filters.api.FilterController

                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        QueryNode queryNode = (QueryNode) dropNode;
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        filterController.setSubQuery(parent, queryNode.getQuery());
                        return null;
                    }
                };
            }
        } else if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    try {
                        FilterBuilder builder = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        Query query = filterController.createQuery(builder.getFilter());
                        filterController.setSubQuery(parent, query);
                    } catch (UnsupportedFlavorException ex) {
                        Exceptions.printStackTrace(ex);
                    }

                    return null;
View Full Code Here

Examples of org.gephi.filters.api.FilterController

    }

    @Override
    public void actionPerformed(ActionEvent ev) {
        SavedQueryNode node = (SavedQueryNode) ev.getSource();
        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
        filterController.add(node.getQuery());
    }
View Full Code Here

Examples of org.gephi.filters.api.FilterController

    @Override
    public void actionPerformed(ActionEvent ev) {
        FilterBuilderNode node = (FilterBuilderNode) ev.getSource();
        FilterBuilder builder = node.getBuilder();
        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
        Query function = filterController.createQuery(builder.getFilter());
        filterController.add(function);
    }
View Full Code Here

Examples of org.gephi.filters.api.FilterController

    public String getHtmlDisplayName() {
        return isSelected() ? "<b>" + (query.getName()) + "</b>" : query.getName();
    }

    private boolean isSelected() {
        FilterController fc = Lookup.getDefault().lookup(FilterController.class);
        FilterModel fm = fc.getModel();
        return (fm.isFiltering() || fm.isSelecting()) && fc.getModel().getCurrentQuery() == query;
        //return FiltersTopComponent.findInstance().getUiModel().getSelectedRoot() == query;
    }
View Full Code Here

Examples of org.gephi.filters.api.FilterController

            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    FilterLibrary library = filterController.getModel().getLibrary();
                    library.saveQuery(queryNode.getQuery());
                    return null;
                }
            };
View Full Code Here

Examples of org.gephi.filters.api.FilterController

        public RemoveAction() {
            super(NbBundle.getMessage(QueryNode.class, "QueryNode.actions.remove"));
        }

        public void actionPerformed(ActionEvent e) {
            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
            if (query.getParent() == null) {
                filterController.remove(query);
            } else {
                filterController.removeSubQuery(query, query.getParent());
            }
        }
View Full Code Here

Examples of org.gephi.filters.api.FilterController

        public RenameAction() {
            super(NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename"));
        }

        public void actionPerformed(ActionEvent e) {
            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
            NotifyDescriptor.InputLine question = new NotifyDescriptor.InputLine(
                    NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename.text"),
                    NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename.title"));
            question.setInputText(query.getName());
            if (DialogDisplayer.getDefault().notify(question) == NotifyDescriptor.OK_OPTION) {
                String input = question.getInputText();
                if (input != null && !input.isEmpty()) {
                    filterController.rename(query, input);
                }
            }
        }
View Full Code Here

Examples of org.gephi.filters.api.FilterController

        public SaveAction() {
            super(NbBundle.getMessage(QueryNode.class, "QueryNode.actions.save"));
        }

        public void actionPerformed(ActionEvent e) {
            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
            FilterLibrary filterLibrary = filterController.getModel().getLibrary();
            if (query.getParent() == null) {
                filterLibrary.saveQuery(query);
            } else {
                filterLibrary.saveQuery(query.getParent());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.