/*
* Copyright (c) 2009 The Jackson Laboratory
*
* This software was developed by Gary Churchill's Lab at The Jackson
* Laboratory (see http://research.jax.org/faculty/churchill).
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jax.qtl.gui;
import org.jax.analyticgraph.framework.AbstractGraph2DWithAxes;
import org.jax.analyticgraph.framework.Graph2DComponent;
/**
* A simple graph container that has pretty general capabilities that you'd
* want for almost any graph.
* @author <A HREF="mailto:keith.sheppard@jax.org">Keith Sheppard</A>
*/
public class SimpleGraphContainerPanel extends javax.swing.JPanel
{
/**
* every {@link java.io.Serializable} has one of these
*/
private static final long serialVersionUID = 620035769691305930L;
private final Graph2DComponent graphPanel;
/**
* Constructor
* @param graphPanel
* the graph panel to contain
* @param graph
* the graph that we're showing
*/
public SimpleGraphContainerPanel(
Graph2DComponent graphPanel,
AbstractGraph2DWithAxes graph)
{
this.graphPanel = graphPanel;
this.initComponents();
this.postGuiInit(graph);
}
/**
* Take care of the GUI initialization that isn't done by the GUI builder
* @param graph
* the graph to use during initialization
*/
private void postGuiInit(AbstractGraph2DWithAxes graph)
{
this.toolbar.add(new EditSimpleGraphSettingsAction(graph));
this.toolbar.add(new SaveGraphImageAction(this.graphPanel));
}
/**
* 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.
*/
@SuppressWarnings("all")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
toolbar = new javax.swing.JToolBar();
graphPanelDownCast = this.graphPanel;
setLayout(new java.awt.BorderLayout());
toolbar.setRollover(true);
add(toolbar, java.awt.BorderLayout.NORTH);
add(graphPanelDownCast, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel graphPanelDownCast;
private javax.swing.JToolBar toolbar;
// End of variables declaration//GEN-END:variables
}