Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[nebula-dev] New topic in forum Nebula, called Nebula Visalization Widgets API , by Adrian G

Title: Eclipse Community Forums
Subject: Nebula Visalization Widgets API Author: Adrian G Date: Thu, 22 May 2014 22:30
While using the visualization widgets API I stumbled accross some hurdles that limited my ability to utilize the xygraph in the way I wanted (multiple linked graphs in a SahForm). To implement as I wanted I modified the source to add more flexibility. The changes I made are discussed below and would welcome their consideration for implementation in the API.

Proposed modifications are divided into type 1 (backwards campatible) and type 2 (non backwards compatible) and are outlined below.

Type 1) compliant with applications that use the org.eclipse.nebula.visulaization plugin.

Created interfaces for all public methods for:
org.eclipse.nebula.visualization.xygraph.figures
Axis → IAxis
Legend → ILegend
XYGraph ->IXYGraph

org.eclipse.nebula.visualization.xygraph.linearscale
AbstractScale → IAbstractScale
LinearScale → ILinearScale

Other Code modifications:
org.eclipse.nebula.visualization.xygraph.figures
Axis Changed visibility of pan and zoomInOut methods to public so they could be added to the IAxis interface.
public void pan(final Range temp, double t1, double t2);
public void zoomInOut(final double center, final double factor);

Type 2) - creates incompatibility with applications that utilize the org.eclipse.nebula.visulaization plugin.

XYGraph - change.
final public IAxis primaryXAxis;
final public IAxis primaryYAxis;
to
private IAxis primaryXAxis;
private IAxis primaryYAxis;
and add getter/setters and add the getters/setters to IXYGraph (and concrete implementations).
public abstract IAxis getPrimaryXAxis();
public abstract void setPrimaryXAxis(IAxis primaryXAxis);
public abstract IAxis getPrimaryYAxis();
public abstract void setPrimaryYAxis(IAxis primaryYAxis);

All other classes that access the public fields to be changed to access the public getter (ie AddAnnotationDialog, AxisConfigPage, and all the examples!).

Rationale for interface extraction and code modification:

To allow me to create SWT-XY-Graph plots inside a SashForm, where an axis can be located in a child of the sashform and the plot itself can be in another child. This way I can have multiple plots that can be resized which all share a common axis.

I can understand if the type 1 changes only are considered, at least these will allow users more flexibility in implemation of the plugin.

I can attach/send the modified source code if required.

-Adrian
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top