Class LabelStyle
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.renderer.style.LabelStyle
-
-
Field Summary
Fields Modifier and Type Field Description static String
ABOVE_LINE
static String
ABOVE_TEXT
static String
BELOW_LINE
static String
BELOW_TEXT
static String
CENTER
static String
CENTER_TEXT
static String
DEFAULT
static String
DEFAULT_TEXT
static String
FID_COLUMN
static int
FONT_BASE_SIZE
String
horizontalPosition
static String[]
horizontalPositionLookup
static int
JUSTIFY_CENTER
static String
JUSTIFY_CENTER_TEXT
static int
JUSTIFY_LEFT
static String
JUSTIFY_LEFT_TEXT
static int
JUSTIFY_RIGHT
static String
JUSTIFY_RIGHT_TEXT
static String
LEFT_SIDE
static String
LEFT_SIDE_TEXT
static String
MIDDLE_TEXT
static String
ON_LINE
static String
RIGHT_SIDE
static String
RIGHT_SIDE_TEXT
String
verticalAlignment
static String[]
verticalAlignmentLookup
-
Constructor Summary
Constructors Constructor Description LabelStyle()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
angle(Feature feature, String angleAttributeName, double defaultAngle)
Object
clone()
org.locationtech.jts.geom.Coordinate
findPoint(org.locationtech.jts.geom.Geometry geometry)
Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope.org.locationtech.jts.geom.Coordinate
findPointForVertexSymbology(org.locationtech.jts.geom.Geometry geometry, int value)
[Giuseppe Aruta 2018-10-29] Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope.String
getAngleAttribute()
String
getAttribute()
Color
getColor()
Font
getFont()
double
getHeight()
String
getHeightAttribute()
boolean
getHideAtScale()
boolean
getHidingOverlappingLabels()
int
getHorizontalAlignment()
double
getHorizontalAlignmentOffset(String text)
String
getHorizontalPosition()
Color
getOutlineColor()
boolean
getOutlineShowing()
double
getOutlineWidth()
double
getScaleToHideAt()
String
getVerticalAlignment()
double
getVerticalAlignmentOffset(int dim)
static double
height(Feature feature, String heightAttributeName, double defaultHeight)
void
initialize(Layer layer)
Called before #paint is applied to each Feature.boolean
isEnabled()
boolean
isHidingAtScale()
boolean
isHidingOverlappingLabels()
boolean
isScaling()
void
paint(Feature f, Graphics2D g, Viewport viewport)
void
paint(Graphics2D g, String text, Viewport viewport, Point2D viewCentre, double angle, double height, int dim)
void
setAngleAttribute(String angleAttribute)
void
setAttribute(String attribute)
void
setColor(Color color)
void
setEnabled(boolean enabled)
void
setFont(Font font)
void
setHeight(double height)
void
setHeightAttribute(String heightAttribute)
void
setHideAtScale(boolean hideAtScale)
void
setHidingOverlappingLabels(boolean hidingOverlappingLabels)
void
setHorizontalAlignment(int horizontalAlignment)
void
setHorizontalPosition(String horizontalPosition)
void
setOutlineColor(Color outlineColor)
void
setOutlineColor(Color outlineColor, int alpha)
void
setOutlineShowing(boolean outlineShowing)
void
setOutlineWidth(double outlineWidth)
void
setScaleToHideAt(double scaleToHideAt)
void
setScaling(boolean scaling)
void
setVerticalAlignment(String verticalAlignment)
-
-
-
Field Detail
-
FONT_BASE_SIZE
public static final int FONT_BASE_SIZE
- See Also:
- Constant Field Values
-
FID_COLUMN
public static final String FID_COLUMN
- See Also:
- Constant Field Values
-
ABOVE_LINE
public static final String ABOVE_LINE
- See Also:
- Constant Field Values
-
ON_LINE
public static final String ON_LINE
- See Also:
- Constant Field Values
-
BELOW_LINE
public static final String BELOW_LINE
- See Also:
- Constant Field Values
-
DEFAULT
public static final String DEFAULT
- See Also:
- Constant Field Values
-
verticalAlignmentLookup
public static final String[] verticalAlignmentLookup
-
LEFT_SIDE
public static final String LEFT_SIDE
- See Also:
- Constant Field Values
-
CENTER
public static final String CENTER
- See Also:
- Constant Field Values
-
RIGHT_SIDE
public static final String RIGHT_SIDE
- See Also:
- Constant Field Values
-
horizontalPositionLookup
public static final String[] horizontalPositionLookup
-
DEFAULT_TEXT
public static String DEFAULT_TEXT
-
ABOVE_TEXT
public static String ABOVE_TEXT
-
MIDDLE_TEXT
public static String MIDDLE_TEXT
-
BELOW_TEXT
public static String BELOW_TEXT
-
LEFT_SIDE_TEXT
public static final String LEFT_SIDE_TEXT
-
CENTER_TEXT
public static final String CENTER_TEXT
-
RIGHT_SIDE_TEXT
public static final String RIGHT_SIDE_TEXT
-
JUSTIFY_CENTER_TEXT
public static final String JUSTIFY_CENTER_TEXT
-
JUSTIFY_LEFT_TEXT
public static final String JUSTIFY_LEFT_TEXT
-
JUSTIFY_RIGHT_TEXT
public static final String JUSTIFY_RIGHT_TEXT
-
JUSTIFY_CENTER
public static final int JUSTIFY_CENTER
- See Also:
- Constant Field Values
-
JUSTIFY_LEFT
public static final int JUSTIFY_LEFT
- See Also:
- Constant Field Values
-
JUSTIFY_RIGHT
public static final int JUSTIFY_RIGHT
- See Also:
- Constant Field Values
-
verticalAlignment
public String verticalAlignment
-
horizontalPosition
public String horizontalPosition
-
-
Method Detail
-
initialize
public void initialize(Layer layer)
Description copied from interface:Style
Called before #paint is applied to each Feature.- Specified by:
initialize
in interfaceStyle
- Parameters:
layer
- the layer on which to apply this style
-
paint
public void paint(Feature f, Graphics2D g, Viewport viewport) throws NoninvertibleTransformException
- Specified by:
paint
in interfaceStyle
- Throws:
NoninvertibleTransformException
-
findPoint
public org.locationtech.jts.geom.Coordinate findPoint(org.locationtech.jts.geom.Geometry geometry)
Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope.
-
findPointForVertexSymbology
public org.locationtech.jts.geom.Coordinate findPointForVertexSymbology(org.locationtech.jts.geom.Geometry geometry, int value)
[Giuseppe Aruta 2018-10-29] Find a point at upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center or lower-right of the geometry envelope. Find right distance to symbol size in order to write the label outside the symbol- Parameters:
geometry
- a Geometry to symbolizevalue
- a symbol size- Returns:
- the position of the symbol according to the Geometry Envelope the symbol size and the horizontal and vertical alignment
-
height
public static double height(Feature feature, String heightAttributeName, double defaultHeight)
-
paint
public void paint(Graphics2D g, String text, Viewport viewport, Point2D viewCentre, double angle, double height, int dim)
-
getVerticalAlignmentOffset
public double getVerticalAlignmentOffset(int dim)
- Returns:
- approximate alignment offset for estimation
-
getHorizontalAlignmentOffset
public double getHorizontalAlignmentOffset(String text)
- Returns:
- approximate alignment offset for estimation
-
getAttribute
public String getAttribute()
-
getAngleAttribute
public String getAngleAttribute()
-
getHeightAttribute
public String getHeightAttribute()
-
isEnabled
public boolean isEnabled()
-
getColor
public Color getColor()
-
getFont
public Font getFont()
-
isScaling
public boolean isScaling()
-
getHeight
public double getHeight()
-
isHidingOverlappingLabels
public boolean isHidingOverlappingLabels()
-
isHidingAtScale
public boolean isHidingAtScale()
-
getHideAtScale
public boolean getHideAtScale()
-
getVerticalAlignment
public String getVerticalAlignment()
-
getHorizontalPosition
public String getHorizontalPosition()
-
getHorizontalAlignment
public int getHorizontalAlignment()
-
getHidingOverlappingLabels
public boolean getHidingOverlappingLabels()
-
getOutlineShowing
public boolean getOutlineShowing()
-
getOutlineWidth
public double getOutlineWidth()
-
getScaleToHideAt
public double getScaleToHideAt()
-
getOutlineColor
public Color getOutlineColor()
-
setVerticalAlignment
public void setVerticalAlignment(String verticalAlignment)
-
setHorizontalPosition
public void setHorizontalPosition(String horizontalPosition)
-
setHorizontalAlignment
public void setHorizontalAlignment(int horizontalAlignment)
-
setAttribute
public void setAttribute(String attribute)
-
setAngleAttribute
public void setAngleAttribute(String angleAttribute)
-
setHeightAttribute
public void setHeightAttribute(String heightAttribute)
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interfaceStyle
-
setColor
public void setColor(Color color)
-
setFont
public void setFont(Font font)
-
setScaling
public void setScaling(boolean scaling)
-
setHeight
public void setHeight(double height)
-
setHidingOverlappingLabels
public void setHidingOverlappingLabels(boolean hidingOverlappingLabels)
-
setOutlineShowing
public void setOutlineShowing(boolean outlineShowing)
-
setOutlineWidth
public void setOutlineWidth(double outlineWidth)
-
setScaleToHideAt
public void setScaleToHideAt(double scaleToHideAt)
-
setOutlineColor
public void setOutlineColor(Color outlineColor, int alpha)
-
setOutlineColor
public void setOutlineColor(Color outlineColor)
-
setHideAtScale
public void setHideAtScale(boolean hideAtScale)
-
-