Skip to content

Commit

Permalink
ttools: namespace multi-point layer types
Browse files Browse the repository at this point in the history
Rename similar-sounding but different layer types, e.g. the Plane
and Sky variants of ellipse both used to be called "Ellipse", but
now they are "XYEllipse" and "SkyEllipse".
This means that they can have separately named, and separate sections
in the user document without needing complicated schemes to distinguish
them.
  • Loading branch information
mbtaylor committed Oct 3, 2014
1 parent c8a2a40 commit c563931
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
Expand Up @@ -66,10 +66,12 @@ public Plotter[] getPlotters() {
MarkForm.SINGLE,
SizeForm.getInstance(),
MultiPointForm
.createVectorForm( new CartesianVectorCoordSet( axisNames_ ),
.createVectorForm( "XYZVector",
new CartesianVectorCoordSet( axisNames_ ),
true ),
MultiPointForm
.createErrorForm( CartesianErrorCoordSet
.createErrorForm( "XYZError",
CartesianErrorCoordSet
.createAllAxesErrorCoordSet( axisNames_ ),
StyleKeys.ERROR_SHAPE_3D ),
PairLinkForm.getInstance(),
Expand Down
Expand Up @@ -66,13 +66,15 @@ public Plotter[] getPlotters() {
MarkForm.SINGLE,
SizeForm.getInstance(),
MultiPointForm
.createVectorForm( new CartesianVectorCoordSet( axisNames_ ), true ),
.createVectorForm( "XYVector",
new CartesianVectorCoordSet( axisNames_ ), true ),
MultiPointForm
.createErrorForm( CartesianErrorCoordSet
.createErrorForm( "XYError",
CartesianErrorCoordSet
.createAllAxesErrorCoordSet( axisNames_ ),
StyleKeys.ERROR_SHAPE_2D ),
MultiPointForm
.createEllipseForm( new PlaneEllipseCoordSet(), true ),
.createEllipseForm( "XYEllipse", new PlaneEllipseCoordSet(), true ),
PairLinkForm.getInstance(),
MarkForm.PAIR,
};
Expand Down
Expand Up @@ -57,9 +57,11 @@ public Plotter[] getPlotters() {
ShapeForm[] forms = new ShapeForm[] {
MarkForm.SINGLE,
SizeForm.getInstance(),
MultiPointForm.createVectorForm( new SkyVectorCoordSet( true ),
MultiPointForm.createVectorForm( "SkyVector",
new SkyVectorCoordSet( true ),
true ),
MultiPointForm.createEllipseForm( new SkyEllipseCoordSet(), true ),
MultiPointForm.createEllipseForm( "SkyEllipse",
new SkyEllipseCoordSet(), true ),
PairLinkForm.getInstance(),
MarkForm.PAIR,
};
Expand Down
Expand Up @@ -47,7 +47,7 @@ public Plotter[] getPlotters() {
"</p>",
} );
MultiPointForm errorForm =
new MultiPointForm( "Error", ResourceIcon.FORM_ERROR1, descrip,
new MultiPointForm( "YError", ResourceIcon.FORM_ERROR1, descrip,
CartesianErrorCoordSet
.createSingleAxisErrorCoordSet( 2, 1, "Y" ),
false, StyleKeys.ERROR_SHAPE_1D );
Expand Down
Expand Up @@ -126,14 +126,16 @@ public Outliner createOutliner( ConfigMap config ) {
* Returns a MultiPointForm instance for drawing arrows from the
* central position to another position.
*
* @param name form name
* @param extraCoordSet nDataDim-element coord set that defines one
* extra data position, the (unscaled) endpoint
* of the vector
* @param canScale whether to offer vector size scaling
* @return new vector form instance
*/
public static MultiPointForm
createVectorForm( MultiPointCoordSet extraCoordSet,
createVectorForm( String name,
MultiPointCoordSet extraCoordSet,
boolean canScale ) {
String descrip = PlotUtil.concatLines( new String[] {
"<p>Plots directed lines from the data position",
Expand All @@ -155,7 +157,7 @@ public Outliner createOutliner( ConfigMap config ) {
"auto-scaling options.",
"</p>",
} );
return new MultiPointForm( "Vector", ResourceIcon.FORM_VECTOR,
return new MultiPointForm( name, ResourceIcon.FORM_VECTOR,
descrip, extraCoordSet, canScale,
StyleKeys.VECTOR_SHAPE );
}
Expand All @@ -164,35 +166,39 @@ public Outliner createOutliner( ConfigMap config ) {
* Returns a MultiPointForm instance for drawing ellipses around the
* central position.
*
* @param name form name
* @param extraCoordSet 3-element coord set containing major/minor
* radius (order not significant) and
* position angle in degrees
* @param canScale whether to offer vector size scaling
* @return new vector form instance
*/
public static MultiPointForm
createEllipseForm( MultiPointCoordSet extraCoordSet,
createEllipseForm( String name,
MultiPointCoordSet extraCoordSet,
boolean canScale ) {
String descrip = PlotUtil.concatLines( new String[] {
"<p>Plots an ellipse (or rectangle or other similar figure)",
"defined by two principal radii and",
"an optional rotation angle.",
"</p>",
} );
return new MultiPointForm( "Ellipse", ResourceIcon.FORM_ELLIPSE,
return new MultiPointForm( name, ResourceIcon.FORM_ELLIPSE,
descrip, extraCoordSet, canScale,
StyleKeys.ELLIPSE_SHAPE );
}

/**
* Returns a MultiPointForm for drawing error bars.
*
* @param name form name
* @param extraCoordSet coord set specifying error bar position endpoints
* @param rendererKey config key for specifying error renderers
* @return new error form instance
*/
public static MultiPointForm
createErrorForm( MultiPointCoordSet extraCoordSet,
createErrorForm( String name,
MultiPointCoordSet extraCoordSet,
MultiPointConfigKey rendererKey ) {
String descrip = PlotUtil.concatLines( new String[] {
"<p>Plots symmetric or asymmetric error bars in some or",
Expand All @@ -202,7 +208,7 @@ public Outliner createOutliner( ConfigMap config ) {
"ellipses, rectangles etc aligned with the axes.",
"</p>",
} );
return new MultiPointForm( "Error", ResourceIcon.FORM_ERROR, descrip,
return new MultiPointForm( name, ResourceIcon.FORM_ERROR, descrip,
extraCoordSet, false, rendererKey );
}

Expand Down

0 comments on commit c563931

Please sign in to comment.