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.util.Timer observersTimer;

    public FiltersTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(FiltersTopComponent.class, "CTL_FiltersTopComponent"));
        putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, Boolean.TRUE);

        panel = new FiltersPanel();
        add(panel, BorderLayout.CENTER);

        //Model management
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        pc.addWorkspaceListener(new WorkspaceListener() {

            @Override
            public void initialize(Workspace workspace) {
                workspace.add(new FilterUIModel(workspace));
            }

            @Override
            public void select(Workspace workspace) {
                activateWorkspace(workspace);
                refreshModel();
            }

            @Override
            public void unselect(Workspace workspace) {
                observers.destroy();
            }

            @Override
            public void close(Workspace workspace) {
            }

            @Override
            public void disable() {
                filterModel = null;
                uiModel = null;
                observers = null;
                refreshModel();
            }
        });

        if (pc.getCurrentWorkspace() != null) {
            Workspace workspace = pc.getCurrentWorkspace();
            activateWorkspace(workspace);
        }
        refreshModel();

        initEvents();
    }

    private void activateWorkspace(Workspace workspace) {
        filterModel = workspace.getLookup().lookup(FilterModel.class);
        uiModel = workspace.getLookup().lookup(FilterUIModel.class);
        if (uiModel == null) {
            uiModel = new FilterUIModel(workspace);
            workspace.add(uiModel);
        }

        observers = workspace.getLookup().lookup(WorkspaceColumnsObservers.class);
        if (observers == null) {
            workspace.add(observers = new WorkspaceColumnsObservers(workspace));
        }
        observers.initialize();
    }

    private void refreshModel() {
        panel.refreshModel(filterModel, uiModel);
    }

    public FilterUIModel getUiModel() {
        return uiModel;
    }

    private void initEvents() {
        observersTimer = new java.util.Timer("DataLaboratoryGraphObservers");
        observersTimer.schedule(new TimerTask() {

                                    @Override
                                    public void run() {<FILL_FUNCTION_BODY>}
                                }
            , 0, AUTO_REFRESH_RATE_MILLISECONDS);//Check graph and tables for changes every 100 ms
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new java.awt.BorderLayout());
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }
}

                                        if (observers != null) {
                                            if (observers.hasChanges()) {
                                                refreshModel();
                                            }
                                        }
                                    
<no_super_class>