Class AreaForm<DG extends DataGeom>
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.AreaForm<DG>
-
- All Implemented Interfaces:
ModePlotter.Form,ShapeForm
public abstract class AreaForm<DG extends DataGeom> extends java.lang.Object implements ShapeForm
ShapeForm that can plot Area coordinates as shapes on a plane or sky plot.- Since:
- 27 Mar 2020
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static AreaForm<PlaneDataGeom>PLANE_INSTANCEInstance for use with Plane plot.static ConfigKey<PolygonShape>POLYSHAPE_KEYConfig key for polygon painting mode option.static ConfigKey<java.lang.Integer>POLYTHICK_KEYConfig key for polygon painting line thickness.static FloatingCoordRADIAL_COORDCoordinate for specifying radial coordinate.static AreaForm<SkyDataGeom>SKY_INSTANCEInstance for use with Sky plot.static AreaForm<SphereDataGeom>SPHERE_INSTANCEInstance for use with Sphere plot.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DataGeomadjustGeom(DataGeom geom, DataSpec dataSpec, ShapeStyle style)Provides a DataGeom to be used by the layer this form makes, given a DataGeom that characterises the plotting environment.OutlinercreateOutliner(ConfigMap config)Returns an object which will do the work of drawing shapes when supplied with the appropriate style information and data.protected abstract PolygonOutlinercreateOutliner(PolygonShape polyShape, int minSize, MarkerShape minShape)Constructs a PolygonOutliner from a glypher for this form.AreaCoord<DG>getAreaCoord()Returns the coordinate associated with this form.intgetBasicPositionCount()Returns the number of basic data positions per tuple used by this form.ConfigKey<?>[]getConfigKeys()Returns style configuration keys specific to this form.Coord[]getExtraCoords()Returns data coordinates additional to the basic position which are required to plot a point.intgetExtraPositionCount()Returns the number of extra coordinates that can be interpreted as positions.java.lang.StringgetFormDescription()Returns a description of this mode as an XML string.javax.swing.IcongetFormIcon()Returns an icon to identify this form in the GUI.java.lang.StringgetFormName()Returns the user-directed name for this form.
-
-
-
Field Detail
-
RADIAL_COORD
public static final FloatingCoord RADIAL_COORD
Coordinate for specifying radial coordinate.
-
PLANE_INSTANCE
public static final AreaForm<PlaneDataGeom> PLANE_INSTANCE
Instance for use with Plane plot.
-
SKY_INSTANCE
public static final AreaForm<SkyDataGeom> SKY_INSTANCE
Instance for use with Sky plot.
-
SPHERE_INSTANCE
public static final AreaForm<SphereDataGeom> SPHERE_INSTANCE
Instance for use with Sphere plot.
-
POLYSHAPE_KEY
public static final ConfigKey<PolygonShape> POLYSHAPE_KEY
Config key for polygon painting mode option.
-
POLYTHICK_KEY
public static final ConfigKey<java.lang.Integer> POLYTHICK_KEY
Config key for polygon painting line thickness.
-
-
Method Detail
-
getFormName
public java.lang.String getFormName()
Description copied from interface:ModePlotter.FormReturns the user-directed name for this form.- Specified by:
getFormNamein interfaceModePlotter.Form- Returns:
- form name
-
getFormIcon
public javax.swing.Icon getFormIcon()
Description copied from interface:ModePlotter.FormReturns an icon to identify this form in the GUI.- Specified by:
getFormIconin interfaceModePlotter.Form- Returns:
- form icon
-
getFormDescription
public java.lang.String getFormDescription()
Description copied from interface:ShapeFormReturns a description of this mode as an XML string. The return value should be one or more <p> elements.- Specified by:
getFormDescriptionin interfaceShapeForm- Returns:
- XML description of form
-
getBasicPositionCount
public int getBasicPositionCount()
Description copied from interface:ShapeFormReturns the number of basic data positions per tuple used by this form.- Specified by:
getBasicPositionCountin interfaceShapeForm- Returns:
- number of basic sets of positional coordinates
-
getExtraCoords
public Coord[] getExtraCoords()
Description copied from interface:ShapeFormReturns data coordinates additional to the basic position which are required to plot a point.- Specified by:
getExtraCoordsin interfaceShapeForm- Returns:
- additional plot coordinates
-
getExtraPositionCount
public int getExtraPositionCount()
Description copied from interface:ShapeFormReturns the number of extra coordinates that can be interpreted as positions.- Specified by:
getExtraPositionCountin interfaceShapeForm- Returns:
- number of positional extra coordinates
-
getConfigKeys
public ConfigKey<?>[] getConfigKeys()
Description copied from interface:ShapeFormReturns style configuration keys specific to this form. These keys will be used in the config map supplied toShapeForm.createOutliner(uk.ac.starlink.ttools.plot2.config.ConfigMap).- Specified by:
getConfigKeysin interfaceShapeForm- Returns:
- config keys
-
createOutliner
public Outliner createOutliner(ConfigMap config)
Description copied from interface:ShapeFormReturns an object which will do the work of drawing shapes when supplied with the appropriate style information and data. The significant keys in the supplied config map are those given byShapeForm.getConfigKeys().- Specified by:
createOutlinerin interfaceShapeForm- Parameters:
config- configuration map from which values for this form's config keys will be extracted- Returns:
- new outliner object
-
createOutliner
protected abstract PolygonOutliner createOutliner(PolygonShape polyShape, int minSize, MarkerShape minShape)
Constructs a PolygonOutliner from a glypher for this form.- Parameters:
polyShape- glyph painterminSize- threshold size for replacment markersminShape- shape for replacement markers- Returns:
- new outliner
-
getAreaCoord
public AreaCoord<DG> getAreaCoord()
Returns the coordinate associated with this form.- Returns:
- coord
-
adjustGeom
public DataGeom adjustGeom(DataGeom geom, DataSpec dataSpec, ShapeStyle style)
Description copied from interface:ShapeFormProvides a DataGeom to be used by the layer this form makes, given a DataGeom that characterises the plotting environment. The output should be similar to the input, for instance implementing the same plotType-specific DataGeom subtype.In most cases the supplied DataGeom instance can be returned unchanged, but instances with special requirements may want to adjust how the data is interpreted.
- Specified by:
adjustGeomin interfaceShapeForm- Parameters:
geom- context geomdataSpec- data specification with which the geom will be usedstyle- style with which the geom will be used- Returns:
- geom to use for data interpretation, the same or similar to the input
-
-