use of cbit.plot.Plot2D in project vcell by virtualcell.
the class PlotPane method setplot2D1.
/**
* Set the plot2D1 to a new value.
* @param newValue cbit.plot.Plot2D
*/
private void setplot2D1(Plot2D newValue) {
if (ivjplot2D1 != newValue) {
try {
Plot2D oldValue = getplot2D1();
/* Stop listening for events from the current object */
if (ivjplot2D1 != null) {
ivjplot2D1.removeChangeListener(ivjEventHandler);
}
ivjplot2D1 = newValue;
/* Listen for events from the new object */
if (ivjplot2D1 != null) {
ivjplot2D1.addChangeListener(ivjEventHandler);
}
connPtoP4SetSource();
firePropertyChange("plot2D", oldValue, newValue);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
;
}
use of cbit.plot.Plot2D in project vcell by virtualcell.
the class PlotPane method setPlot2D.
/**
* Sets the plot2D property (cbit.plot.Plot2D) value.
* @param plot2D The new value for the property.
* @see #getPlot2D
*/
public void setPlot2D(Plot2D plot2D) {
Plot2D oldValue = fieldPlot2D;
fieldPlot2D = plot2D;
firePropertyChange("plot2D", oldValue, plot2D);
}
use of cbit.plot.Plot2D in project vcell by virtualcell.
the class PlotPane method updateLegend.
/**
* Comment
*/
private void updateLegend() {
Plot2D plot = getPlot2DPanel1().getPlot2D();
SymbolTableEntry[] steList = plot.getSymbolTableEntries();
DataSymbolMetadataResolver metadataResolver = plot.getDataSymbolMetadataResolver();
String[] plotLabels = plot.getVisiblePlotColumnTitles();
int[] plotIndices = plot.getVisiblePlotIndices();
Component[] legends = getJPanelPlotLegends().getComponents();
// add legends if necessarry
if (ml == null) {
ml = new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
String name = ((JLabel) evt.getSource()).getText();
getPlot2DPanel1().setCurrentPlot(name);
}
};
}
for (int i = 0; i < plotIndices.length - legends.length / 2; i++) {
JLabel line = new JLabel();
JLabel text = new JLabel();
line.setBorder(new EmptyBorder(6, 0, 0, 0));
text.setBorder(new EmptyBorder(0, 8, 6, 0));
getJPanelPlotLegends().add(line);
getJPanelPlotLegends().add(text);
text.addMouseListener(ml);
}
legends = getJPanelPlotLegends().getComponents();
// update labels and show them,use reverse loop to generate non-repeatable colors
for (int i = (plotIndices.length - 1); i >= 0; i--) {
LineIcon icon = new LineIcon(getPlot2DPanel1().getVisiblePlotPaint(i));
String plotLabel = null;
if (plot instanceof SingleXPlot2D) {
plotLabel = plotLabels[i + 1];
} else {
plotLabel = plotLabels[2 * i + 1];
}
((JLabel) legends[2 * i]).setIcon(icon);
final int head = 20;
final int tail = 0;
String tooltipString = "";
String unitSymbol = "";
if (metadataResolver != null) {
DataSymbolMetadata metaData = metadataResolver.getDataSymbolMetadata(plotLabel);
if (metaData != null && metaData.unit != null) {
VCUnitDefinition ud = metaData.unit;
if (ud != null) {
unitSymbol += ud.getSymbolUnicode();
}
}
if (metaData != null && metaData.tooltipString != null) {
tooltipString = metaData.tooltipString;
}
}
String shortLabel = plotLabel;
if (shortLabel.length() > head + 3 + tail) {
shortLabel = shortLabel.substring(0, head) + "..." + shortLabel.substring(shortLabel.length() - tail, shortLabel.length());
}
// shortLabel = "<html>" + shortLabel + "<font color=\"red\">" + " [" + unitSymbol + "] " + "</font></html>";
shortLabel = "<html>" + shortLabel + "<font color=\"#8B0000\">" + " [" + unitSymbol + "] " + "</font></html>";
tooltipString = "<html>" + plotLabel + "<font color=\"#0000FF\">" + " " + tooltipString + " " + "</font></html>";
((JLabel) legends[2 * i + 1]).setText(shortLabel);
((JLabel) legends[2 * i + 1]).setToolTipText(tooltipString);
legends[2 * i].setVisible(true);
legends[2 * i + 1].setVisible(true);
}
// if extra ones, hide them
for (int i = 2 * plotIndices.length; i < legends.length; i++) {
legends[i].setVisible(false);
}
}
use of cbit.plot.Plot2D in project vcell by virtualcell.
the class Plot2DDataPanel method setPlot2D.
/**
* Sets the plot2D property (cbit.plot.Plot2D) value.
* @param plot2D The new value for the property.
* @see #getPlot2D
*/
public void setPlot2D(Plot2D plot2D) {
Plot2D oldValue = fieldPlot2D;
fieldPlot2D = plot2D;
firePropertyChange("plot2D", oldValue, plot2D);
}
use of cbit.plot.Plot2D in project vcell by virtualcell.
the class Plot2DDataPanel method setplot2D1.
/**
* Set the plot2D1 to a new value.
* @param newValue cbit.plot.Plot2D
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void setplot2D1(Plot2D newValue) {
if (ivjplot2D1 != newValue) {
try {
cbit.plot.Plot2D oldValue = getplot2D1();
/* Stop listening for events from the current object */
if (ivjplot2D1 != null) {
ivjplot2D1.removeChangeListener(ivjEventHandler);
}
ivjplot2D1 = newValue;
/* Listen for events from the new object */
if (ivjplot2D1 != null) {
ivjplot2D1.addChangeListener(ivjEventHandler);
}
connPtoP2SetSource();
connEtoM1(ivjplot2D1);
firePropertyChange("plot2D", oldValue, newValue);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
;
// user code begin {3}
// user code end
}
Aggregations