zAxisPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
JPanel p1 = new JPanel(); p1.add(new JLabel("Min panel"));
JPanel p2 = new JPanel(); p2.add(new JLabel("Max panel"));
final PlotSettingsAxisGroup timeGroup = new PlotSettingsAxisGroup(true) {
private static final long serialVersionUID = -7135071044865840006L;
@Override
public void setBounds(PlotConfiguration settings, double min,
double max) {
settings.setMinTime((long) min);
settings.setMaxTime((long) max);
}
@Override
public double getBoundMinimum(PlotConfiguration settings) {
return settings.getMinTime();
}
@Override
public double getBoundMaximum(PlotConfiguration settings) {
return settings.getMaxTime();
}
@Override
public double getActualMinimum(PlotViewManifestation view) {
AbstractAxis axis = view.getPlot().getPlotTimeAxis();
return Math.min(axis.getStart(), axis.getEnd());
}
@Override
public double getActualMaximum(PlotViewManifestation view) {
AbstractAxis axis = view.getPlot().getPlotTimeAxis();
return Math.max(axis.getStart(), axis.getEnd());
}
};
final PlotSettingsAxisGroup nonTimeGroup = new PlotSettingsAxisGroup(false) {
private static final long serialVersionUID = 506645956367162100L;
@Override
public void setBounds(PlotConfiguration settings, double min,
double max) {
settings.setMinNonTime(min);
settings.setMaxNonTime(max);
}
@Override
public double getBoundMinimum(PlotConfiguration settings) {
return settings.getMinNonTime();
}
@Override
public double getBoundMaximum(PlotConfiguration settings) {
return settings.getMaxNonTime();
}
@Override
public double getActualMinimum(PlotViewManifestation view) {
return view.getMinFeedValue();
}
@Override
public double getActualMaximum(PlotViewManifestation view) {
return view.getMaxFeedValue();
}
};
final PlotSettingsAxisGroup otherNonTimeGroup = new PlotSettingsAxisGroup(false) {
private static final long serialVersionUID = -635180790760328411L;
@Override
public void setBounds(PlotConfiguration settings, double min,
double max) {
settings.setMinDependent(min);
settings.setMaxDependent(max);
}
@Override
public double getBoundMinimum(PlotConfiguration settings) {
return settings.getMinDependent();
}
@Override
public double getBoundMaximum(PlotConfiguration settings) {
return settings.getMaxDependent();
}
@Override
public double getActualMinimum(PlotViewManifestation view) {
return view.getMinFeedValue();
}
@Override
public double getActualMaximum(PlotViewManifestation view) {
return view.getMaxFeedValue();
}
};
timeGroup.updateFrom(plotViewManifestation);
nonTimeGroup.updateFrom(plotViewManifestation);
otherNonTimeGroup.updateFrom(plotViewManifestation);
this.plotViewManifestation.addFeedCallback(new Runnable() {
@Override
public void run() {
timeGroup.updateFrom(plotViewManifestation);
nonTimeGroup.updateFrom(plotViewManifestation);
otherNonTimeGroup.updateFrom(plotViewManifestation);
}
});
addSubPanel(timeGroup);
addSubPanel(nonTimeGroup);
addSubPanel(otherNonTimeGroup);
timeGroup.setTitle("TIME");
nonTimeGroup.setTitle("NON-TIME");
otherNonTimeGroup.setTitle("DEPENDENT");
PlotSettingsPanel panel = new PlotSettingsPanel() {
private static final long serialVersionUID = 1730870211575829997L;
@Override