Search in sources :

Example 6 with DataModel

use of edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataModel in project clusterMaker2 by RBVI.

the class ViewFrame method showSubDataModel.

public void showSubDataModel(int[] indexes, String source, String name) {
    if (indexes.length == 0) {
        JOptionPane.showMessageDialog(this, "No Genes to show summary of!");
        return;
    }
    ReorderedDataModel dataModel = new ReorderedDataModel(getDataModel(), indexes);
    if (source != null)
        dataModel.setSource(source);
    if (name != null)
        dataModel.setName(name);
    ViewFrame window = getApp().openNew();
    window.setDataModel(dataModel);
    window.setLoaded(true);
    window.setVisible(true);
}
Also used : ReorderedDataModel(edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.ReorderedDataModel)

Example 7 with DataModel

use of edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataModel in project clusterMaker2 by RBVI.

the class TreeView method startup.

protected void startup() {
    CyProperty cyProperty = manager.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)");
    // Get our data model
    dataModel = new TreeViewModel(monitor, myNetwork, myView, manager);
    // Set up the global config
    setConfigDefaults(new PropertyConfig(cyProperty, globalConfigName(), "ProgramConfig"));
    // Set up our configuration
    PropertyConfig documentConfig = new PropertyConfig(cyProperty, getShortName(), "DocumentConfig");
    dataModel.setDocumentConfig(documentConfig);
    // Create our view frame
    TreeViewFrame frame = new TreeViewFrame(this, appName);
    // Set the data model
    frame.setDataModel(dataModel);
    frame.setLoaded(true);
    frame.addWindowListener(this);
    frame.setVisible(true);
    geneSelection = frame.getGeneSelection();
    geneSelection.addObserver(this);
    arraySelection = frame.getArraySelection();
    arraySelection.addObserver(this);
    manager.registerService(this, RowsSetListener.class, new Properties());
}
Also used : CyProperty(org.cytoscape.property.CyProperty) TreeViewFrame(edu.ucsf.rbvi.clusterMaker2.internal.treeview.TreeViewFrame) PropertyConfig(edu.ucsf.rbvi.clusterMaker2.internal.treeview.PropertyConfig) TreeViewModel(edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.TreeViewModel) Properties(java.util.Properties)

Example 8 with DataModel

use of edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataModel in project clusterMaker2 by RBVI.

the class KnnDendroView method setupViews.

/**
 *  This method should be called only during initial setup of the modelview
 *
 *  It sets up the views and binds them all to config nodes.
 */
protected void setupViews() {
    DataModel knnModel = getDataModel();
    hintpanel = new MessagePanel("Usage Hints");
    statuspanel = new MessagePanel("View Status");
    colorPresets = new ColorPresets(root);
    cpresetEditor = new ColorPresetEditor(colorPresets);
    ColorExtractor colorExtractor = new ColorExtractor();
    colorExtractor.setDefaultColorSet(colorPresets.getDefaultColorSet());
    colorExtractor.bindConfig(root);
    colorExtractor.setMissing(DataModel.NODATA, DataModel.EMPTY);
    KnnArrayDrawer kArrayDrawer = new KnnArrayDrawer();
    kArrayDrawer.setColorExtractor(colorExtractor);
    arrayDrawer = kArrayDrawer;
    // XXX shouldn't need to observer, should be immuable?
    ((Observable) getDataModel()).addObserver(arrayDrawer);
    globalview = new GlobalView();
    // scrollbars, mostly used by maps
    globalXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0, 1, 0, 1);
    globalYscrollbar = new JScrollBar(JScrollBar.VERTICAL, 0, 1, 0, 1);
    zoomXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0, 1, 0, 1);
    zoomYscrollbar = new JScrollBar(JScrollBar.VERTICAL, 0, 1, 0, 1);
    zoomXmap = new MapContainer();
    zoomXmap.setDefaultScale(12.0);
    zoomXmap.setScrollbar(zoomXscrollbar);
    zoomYmap = new MapContainer();
    zoomYmap.setDefaultScale(12.0);
    zoomYmap.setScrollbar(zoomYscrollbar);
    // globalmaps tell globalview, atrview, and gtrview
    // where to draw each data point.
    // the scrollbars "scroll" by communicating with the maps.
    globalXmap = new MapContainer();
    globalXmap.setDefaultScale(2.0);
    globalXmap.setScrollbar(globalXscrollbar);
    globalYmap = new MapContainer();
    globalYmap.setDefaultScale(2.0);
    globalYmap.setScrollbar(globalYscrollbar);
    globalview.setXMap(globalXmap);
    globalview.setYMap(globalYmap);
    globalview.setZoomYMap(getZoomYmap());
    globalview.setZoomXMap(getZoomXmap());
    arraynameview = new ArrayNameView(getDataModel().getArrayHeaderInfo());
    leftTreeDrawer = new LeftTreeDrawer();
    gtrview = new GTRView();
    gtrview.setMap(globalYmap);
    gtrview.setLeftTreeDrawer(leftTreeDrawer);
    invertedTreeDrawer = new InvertedTreeDrawer();
    atrview = new ATRView();
    atrview.setMap(globalXmap);
    atrview.setInvertedTreeDrawer(invertedTreeDrawer);
    atrzview = new ATRZoomView();
    atrzview.setZoomMap(getZoomXmap());
    atrzview.setInvertedTreeDrawer(invertedTreeDrawer);
    zoomview = new ZoomView();
    zoomview.setYMap(getZoomYmap());
    zoomview.setXMap(getZoomXmap());
    zoomview.setArrayDrawer(arrayDrawer);
    globalview.setArrayDrawer(arrayDrawer);
    arraynameview.setMapping(getZoomXmap());
    textview = new TextViewManager(getDataModel().getGeneHeaderInfo());
    textview.setMap(getZoomYmap());
    doDoubleLayout();
    // reset persistent popups
    settingsFrame = null;
    // color extractor
    colorExtractor.bindConfig(getFirst("ColorExtractor"));
    // set data first to avoid adding auto-genereated contrast to documentConfig.
    kArrayDrawer.setDataMatrix(knnModel.getDataMatrix());
    kArrayDrawer.bindConfig(getFirst("ArrayDrawer"));
    // responsible for adding and removing components...
    bindTrees();
    globalXmap.bindConfig(getFirst("GlobalXMap"));
    globalYmap.bindConfig(getFirst("GlobalYMap"));
    getZoomXmap().bindConfig(getFirst("ZoomXMap"));
    getZoomYmap().bindConfig(getFirst("ZoomYMap"));
    textview.bindConfig(getFirst("TextViewParent"));
    arraynameview.bindConfig(getFirst("ArrayNameView"));
    // perhaps I could remember this stuff in the MapContainer...
    DataMatrix dataMatrix = getDataModel().getDataMatrix();
    globalXmap.setIndexRange(0, dataMatrix.getNumCol() - 1);
    globalYmap.setIndexRange(0, dataMatrix.getNumRow() - 1);
    getZoomXmap().setIndexRange(-1, -1);
    getZoomYmap().setIndexRange(-1, -1);
    globalXmap.notifyObservers();
    globalYmap.notifyObservers();
    getZoomXmap().notifyObservers();
    getZoomYmap().notifyObservers();
}
Also used : DataMatrix(edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataMatrix) Observable(java.util.Observable) JScrollBar(javax.swing.JScrollBar) DataModel(edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataModel) MessagePanel(edu.ucsf.rbvi.clusterMaker2.internal.treeview.MessagePanel)

Aggregations

PropertyConfig (edu.ucsf.rbvi.clusterMaker2.internal.treeview.PropertyConfig)4 Properties (java.util.Properties)4 CyProperty (org.cytoscape.property.CyProperty)4 TreeViewModel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.TreeViewModel)3 DataModel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataModel)2 HeaderInfo (edu.ucsf.rbvi.clusterMaker2.internal.treeview.HeaderInfo)2 KnnViewFrame (edu.ucsf.rbvi.clusterMaker2.internal.treeview.KnnViewFrame)2 TreeViewFrame (edu.ucsf.rbvi.clusterMaker2.internal.treeview.TreeViewFrame)2 KnnViewModel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.KnnViewModel)2 ReorderedDataModel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.ReorderedDataModel)2 ClusterManager (edu.ucsf.rbvi.clusterMaker2.internal.api.ClusterManager)1 DataMatrix (edu.ucsf.rbvi.clusterMaker2.internal.treeview.DataMatrix)1 LoadException (edu.ucsf.rbvi.clusterMaker2.internal.treeview.LoadException)1 MessagePanel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.MessagePanel)1 ModelessSettingsDialog (edu.ucsf.rbvi.clusterMaker2.internal.treeview.ModelessSettingsDialog)1 DataModelWriter (edu.ucsf.rbvi.clusterMaker2.internal.treeview.model.DataModelWriter)1 NetworkColorDialog (edu.ucsf.rbvi.clusterMaker2.internal.ui.NetworkColorDialog)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1