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);
}
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());
}
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();
}
Aggregations