Package org.gephi.data.attributes.api

Examples of org.gephi.data.attributes.api.AttributeModel


        }
        return null;
    }

    public AttributeModel getModel(Workspace workspace) {
        AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
        if (model != null) {
            return model;
        }
        model = new IndexedAttributeModel();
        workspace.add(model);
View Full Code Here


            projectControllerUI.newProject();
        }

        //Add the time interval column if not exist
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        AttributeColumn col = null;
        if ((col = attributeModel.getNodeTable().getColumn(DynamicModel.TIMEINTERVAL_COLUMN)) == null) {
            col = attributeModel.getNodeTable().addColumn(DynamicModel.TIMEINTERVAL_COLUMN, AttributeType.TIME_INTERVAL);
        }

        //Get current graph
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = graphController.getModel();
View Full Code Here

        //Add a element for no column selected
        comboBoxModel.addElement(NO_SELECTION);

        //Get the current attribute columns in the current workspace
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        AttributeUtils utils = AttributeUtils.getDefault();
        for (AttributeColumn col : attributeModel.getNodeTable().getColumns()) {
            if (utils.isNumberColumn(col)) {
                comboBoxModel.addElement(col);
            }
        }
        return comboBoxModel;
View Full Code Here

    @Override
    public FilterBuilder[] getBuilders() {
        List<FilterBuilder> builders = new ArrayList<FilterBuilder>();
       
        //Get all the current attribute columns
        AttributeModel am = Lookup.getDefault().lookup(AttributeController.class).getModel();
        for (AttributeColumn c : am.getNodeTable().getColumns()) {
            //Keep only numerical columns
            if (AttributeUtils.getDefault().isNumberColumn(c)) {
                TopNodesColumnFilterBuilder b = new TopNodesColumnFilterBuilder(c);
                builders.add(b);
            }
View Full Code Here

@ServiceProvider(service = WorkspaceDuplicateProvider.class, position = 10)
public class AttributeModelDuplicateProvider implements WorkspaceDuplicateProvider {

    public void duplicate(Workspace source, Workspace destination) {
        AttributeController controller = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel sourceModel = controller.getModel(source);
        AttributeModel destModel = controller.getModel(destination);
        if (sourceModel != null && destModel != null) {
            destModel.mergeModel(sourceModel);
        }
    }
View Full Code Here

    public AttributeControllerImpl() {
        projectController = Lookup.getDefault().lookup(ProjectController.class);
        projectController.addWorkspaceListener(new WorkspaceListener() {

            public void initialize(Workspace workspace) {
                AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
                if (m == null) {
                    workspace.add(new IndexedAttributeModel(workspace));
                }
            }

            public void select(Workspace workspace) {
            }

            public void unselect(Workspace workspace) {
            }

            public void close(Workspace workspace) {
            }

            public void disable() {
            }
        });
        if (projectController.getCurrentProject() != null) {
            for (Workspace workspace : projectController.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces()) {
                AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
                if (m == null) {
                    workspace.add(new IndexedAttributeModel(workspace));
                }
            }
        }
View Full Code Here

    }

    public synchronized AttributeModel getModel() {
        Workspace workspace = projectController.getCurrentWorkspace();
        if (workspace != null) {
            AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
            if (model != null) {
                return model;
            }
            model = new IndexedAttributeModel(workspace);
            workspace.add(model);
View Full Code Here

        }
        return null;
    }

    public synchronized AttributeModel getModel(Workspace workspace) {
        AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
        if (model != null) {
            return model;
        }
        model = new IndexedAttributeModel(workspace);
        workspace.add(model);
View Full Code Here

*/
@ServiceProvider(service = WorkspacePersistenceProvider.class, position = 10)
public class AttributeModelPersistenceProvider implements WorkspacePersistenceProvider {

    public void writeXML(XMLStreamWriter writer, Workspace workspace) {
        AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
        AttributeModelSerializer serializer = new AttributeModelSerializer();
        if (model instanceof AbstractAttributeModel) {
            try {
                serializer.writeModel(writer, (AbstractAttributeModel) model);
            } catch (XMLStreamException ex) {
View Full Code Here

*/
@ServiceProvider(service = WorkspacePersistenceProvider.class, position = 15000)
public class AttributeRowPersistenceProvider implements WorkspacePersistenceProvider {

    public void writeXML(XMLStreamWriter writer, Workspace workspace) {
        AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
        GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
        AttributeRowSerializer serializer = new AttributeRowSerializer();
        if (model != null && graphModel != null && model instanceof AbstractAttributeModel) {
            try {
                serializer.writeRows(writer, graphModel);
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.api.AttributeModel

Copyright © 2018 www.massapicom. 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.