Search in sources :

Example 1 with HeaderSummary

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

the class DendroView 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() {
    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);
    hintpanel = new MessagePanel("Usage Hints");
    statuspanel = new MessagePanel("View Status");
    DoubleArrayDrawer dArrayDrawer = new DoubleArrayDrawer();
    dArrayDrawer.setColorExtractor(colorExtractor);
    arrayDrawer = dArrayDrawer;
    ((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());
    globalview.setArrayDrawer(arrayDrawer);
    arraynameview = new ArrayNameView(getDataModel().getArrayHeaderInfo());
    arraynameview.setDataModel(getDataModel());
    leftTreeDrawer = new LeftTreeDrawer();
    gtrview = new GTRView();
    gtrview.setMap(globalYmap);
    gtrview.setLeftTreeDrawer(leftTreeDrawer);
    gtrview.getHeaderSummary().setIncluded(new int[] { 0, 3 });
    invertedTreeDrawer = new InvertedTreeDrawer();
    atrview = new ATRView();
    atrview.setMap(globalXmap);
    atrview.setInvertedTreeDrawer(invertedTreeDrawer);
    atrview.getHeaderSummary().setIncluded(new int[] { 0, 3 });
    atrzview = new ATRZoomView();
    atrzview.setZoomMap(getZoomXmap());
    atrzview.setHeaderSummary(atrview.getHeaderSummary());
    atrzview.setInvertedTreeDrawer(invertedTreeDrawer);
    zoomview = new ZoomView();
    zoomview.setYMap(getZoomYmap());
    zoomview.setXMap(getZoomXmap());
    zoomview.setArrayDrawer(arrayDrawer);
    arraynameview.setMapping(getZoomXmap());
    textview = new TextViewManager(getDataModel().getGeneHeaderInfo());
    textview.setMap(getZoomYmap());
    doDoubleLayout();
    // reset persistent popups
    settingsFrame = null;
    // urls
    colorExtractor.bindConfig(getFirst("ColorExtractor"));
    // set data first to avoid adding auto-genereated contrast to documentConfig.
    dArrayDrawer.setDataMatrix(getDataModel().getDataMatrix());
    dArrayDrawer.bindConfig(getFirst("ArrayDrawer"));
    // this is here because my only subclass shares this code.
    bindTrees();
    zoomview.setHeaders(getDataModel().getGeneHeaderInfo(), getDataModel().getArrayHeaderInfo());
    globalXmap.bindConfig(getFirst("GlobalXMap"));
    globalYmap.bindConfig(getFirst("GlobalYMap"));
    getZoomXmap().bindConfig(getFirst("ZoomXMap"));
    getZoomYmap().bindConfig(getFirst("ZoomYMap"));
    textview.bindConfig(getFirst("TextView"));
    arraynameview.bindConfig(getFirst("ArrayNameView"));
    HeaderSummary atrSummary = atrview.getHeaderSummary();
    atrzview.setHeaderSummary(atrSummary);
    atrSummary.bindConfig(getFirst("AtrSummary"));
    gtrview.getHeaderSummary().bindConfig(getFirst("GtrSummary"));
    // perhaps I could remember this stuff in the MapContainer...
    globalXmap.setIndexRange(0, dataModel.getDataMatrix().getNumCol() - 1);
    globalYmap.setIndexRange(0, dataModel.getDataMatrix().getNumRow() - 1);
    getZoomXmap().setIndexRange(-1, -1);
    getZoomYmap().setIndexRange(-1, -1);
    globalXmap.notifyObservers();
    globalYmap.notifyObservers();
    getZoomXmap().notifyObservers();
    getZoomYmap().notifyObservers();
}
Also used : Observable(java.util.Observable) HeaderSummary(edu.ucsf.rbvi.clusterMaker2.internal.treeview.HeaderSummary) MessagePanel(edu.ucsf.rbvi.clusterMaker2.internal.treeview.MessagePanel)

Aggregations

HeaderSummary (edu.ucsf.rbvi.clusterMaker2.internal.treeview.HeaderSummary)1 MessagePanel (edu.ucsf.rbvi.clusterMaker2.internal.treeview.MessagePanel)1 Observable (java.util.Observable)1