|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.renderer.j2d.RenderedLayer org.geotools.renderer.j2d.RenderedLegend org.geotools.renderer.j2d.RenderedMapScale
A map scale in linear units (for example kilometres) to be painted over others layers. The map scale can be draw on top of projected or geographic coordinate system. Note that because of deformations related to the projection of a curved surface on a flat screen, the map scale is not valid everywhere in the widget area. More specifically:
setForceGeodesic(boolean)
.
Field Summary |
Fields inherited from class org.geotools.renderer.j2d.RenderedLayer |
listeners |
Constructor Summary | |
RenderedMapScale()
Construct a new map scale located in the lower left corner. |
Method Summary | |
java.awt.Paint |
getBackground()
Gets the background color. |
boolean |
getForceGeodesic()
Tells if the map scale should use orthodromic distance computation even for projected coordinate system. |
java.awt.Paint |
getForeground()
Gets the foreground color. |
int |
getMaximumLength()
Returns the maximum length of map scale in pixels. |
java.lang.String |
getName(java.util.Locale locale)
Returns this layer's name. |
int |
getThickness()
Returns the map scale thickness. |
protected java.lang.String |
getTitle(CoordinateSystem cs)
Returns the title to paint with the map scale. |
protected java.lang.String |
getToolTipText(GeoMouseEvent event)
Returns the map scale as a tool tip text. |
Unit |
getUnits()
Returns the map scale units. |
protected void |
paint(RenderingContext context)
Draw the map scale. |
void |
setBackground(java.awt.Paint background)
Sets the background color. |
void |
setForceGeodesic(boolean forceGeodesic)
Tells if the map scale should use orthodromic distance computation even for projected coordinate system. |
void |
setForeground(java.awt.Paint foreground)
Sets the foreground color. |
void |
setMaximumLength(int maximumLength)
Set the maximum length of map scale in pixels. |
void |
setThickness(int thickness)
Sets the map scale thickness. |
void |
setUnits(Unit units)
Set the map scale units. |
Methods inherited from class org.geotools.renderer.j2d.RenderedLegend |
getInsets, getMargin, getPosition, getText, setInsets, setMargin, setPosition, setText |
Methods inherited from class org.geotools.renderer.j2d.RenderedLayer |
addPropertyChangeListener, addPropertyChangeListener, dispose, getAction, getCoordinateSystem, getLocale, getPreferredArea, getPreferredPixelSize, getRenderer, getTreeLock, getZOrder, isVisible, prefetch, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, setCoordinateSystem, setPreferredArea, setPreferredPixelSize, setVisible, setZOrder, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RenderedMapScale()
RenderedLegend.setPosition(org.geotools.renderer.j2d.LegendPosition)
and RenderedLegend.setMargin(java.awt.Insets)
.
Method Detail |
public java.lang.String getName(java.util.Locale locale)
getName
in class RenderedLayer
locale
- The desired locale, or null
for a default locale.
RenderedLayer.getLocale()
,
Renderer.getName(java.util.Locale)
public boolean getForceGeodesic()
false
.
public void setForceGeodesic(boolean forceGeodesic)
public Unit getUnits()
public void setUnits(Unit units) throws UnitException
units
- New map scale units. Must not be null
.
UnitException
- if units
is not compatible with the map scale.public int getMaximumLength()
RenderedMapScale
will try to round the logical length (e.g. in
order to format round labels in kilometres). The logical length is zoom dependent
and will be computed at rendering time from the length in pixels.
public void setMaximumLength(int maximumLength)
maximumLength
- The maximum length for the map scale, in pixels (or dots).public int getThickness()
public void setThickness(int thickness)
thickness
- The new map scale thickness, in dots.public java.awt.Paint getBackground()
null
for a completly transparent background.public void setBackground(java.awt.Paint background)
background
- The new background color, or null
for a completly transparent background.public java.awt.Paint getForeground()
public void setForeground(java.awt.Paint foreground)
foreground
- The new foreground color.protected java.lang.String getTitle(CoordinateSystem cs)
cs
- The rendering coordinate system, or null
.
null
if none.protected void paint(RenderingContext context) throws org.opengis.referencing.operation.TransformException
paint
in class RenderedLegend
context
- Information relatives to the rendering context.
org.opengis.referencing.operation.TransformException
- If a coordinate transformation failed
during the rendering process.protected java.lang.String getToolTipText(GeoMouseEvent event)
getToolTipText
in class RenderedLayer
event
- Coordonn?es du curseur de la souris.
Renderer.getToolTipText(org.geotools.renderer.j2d.GeoMouseEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |