sgtplot
Interface LabelDrawer
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- LabelDrawer2D
public interface LabelDrawer extends java.io.SerializableDefines the methods that implement label drawing in sgtplot. This interface is necessary since sgtplot v2.0 will use Java2D functionality to draw labels if it is available.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voiddraw(org.freehep.graphics2d.VectorGraphics g)Used internally by sgtplot.doublegetAngle()Get label drawing angle.java.awt.RectanglegetBounds()Get the label bounds in device units.Rectangle2D.DoublegetBoundsP()Get the label reference location in physcial coordinates.java.awt.ColorgetColor()Get the color.java.awt.FontgetFont()Get the font.intgetHAlign()Get the horizontal alignment.doublegetHeightP()Get the label height in physical coordinates.LayergetLayer()Get the layer.java.awt.PointgetLocation()Get the label position in device coordinates.Point2D.DoublegetLocationP()Get the label reference location in physcial coordinates.intgetOrientation()Get the origentation.floatgetStringHeight(org.freehep.graphics2d.VectorGraphics g)Get the string height in device units.floatgetStringWidth(org.freehep.graphics2d.VectorGraphics g)Get the string width in device units.java.lang.StringgetText()Get the label text.intgetVAlign()Get the vertical alignment.booleanisVisible()Is label visible?voidsetAngle(double angle)Draw label at arbitrary rotation.voidsetBounds(int x, int y, int width, int height)Set the label bounds in device units.voidsetColor(java.awt.Color clr)Set the color.voidsetFont(java.awt.Font font)Set the font.voidsetHAlign(int halign)Set the horizontal alignment.voidsetHeightP(double hgt)Set the height of the label in physical coordinates.voidsetLayer(Layer layer)Used internally by sgtplot.voidsetLocation(java.awt.Point loc)Set the label position in device coordinates.voidsetLocationP(Point2D.Double loc)Set the label reference location in physcial coordinates.voidsetOrientation(int orient)Set the orientation.voidsetText(java.lang.String lbl)Set the label text.voidsetVAlign(int valign)Set the vertical alignment.voidsetVisible(boolean vis)Set visibility of label.
-
-
-
Method Detail
-
draw
void draw(org.freehep.graphics2d.VectorGraphics g) throws LayerNotFoundException
Used internally by sgtplot.- Throws:
LayerNotFoundException
-
setText
void setText(java.lang.String lbl)
Set the label text.- Parameters:
lbl- the label text
-
getText
java.lang.String getText()
Get the label text.- Returns:
- the label text
-
getColor
java.awt.Color getColor()
Get the color.- Returns:
- The current color of the label.
-
setColor
void setColor(java.awt.Color clr)
Set the color.- Parameters:
color- The color of the label.- See Also:
Color
-
setFont
void setFont(java.awt.Font font)
Set the font.- Parameters:
fnt- The Font to use to draw the label.- See Also:
Font
-
getFont
java.awt.Font getFont()
Get the font.- Returns:
- The current font for the label.
-
setLayer
void setLayer(Layer layer)
Used internally by sgtplot.
-
getLayer
Layer getLayer()
Get the layer.- Returns:
- the layer object.
-
setOrientation
void setOrientation(int orient)
Set the orientation. The orientation can be HORIZONTAL or VERTICAL.- Parameters:
orient- The orientation.
-
getOrientation
int getOrientation()
Get the origentation.- Returns:
- the orientation
-
setHAlign
void setHAlign(int halign)
Set the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT.- Parameters:
horz- The horizontal alignment.
-
getHAlign
int getHAlign()
Get the horizontal alignment.- Returns:
- the horizontal alignment.
-
setVAlign
void setVAlign(int valign)
Set the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM.- Parameters:
vert- The vertical alignment.
-
getVAlign
int getVAlign()
Get the vertical alignment.- Returns:
- the vertical alignment.
-
setLocation
void setLocation(java.awt.Point loc)
Set the label position in device coordinates.- Parameters:
loc- label position
-
getLocation
java.awt.Point getLocation()
Get the label position in device coordinates.- Returns:
- the label position
-
setBounds
void setBounds(int x, int y, int width, int height)Set the label bounds in device units.- Parameters:
x- x location of labely- y location of labelwidth- label widthheight- label height
-
getBounds
java.awt.Rectangle getBounds()
Get the label bounds in device units.- Returns:
- the label bounds
-
setLocationP
void setLocationP(Point2D.Double loc)
Set the label reference location in physcial coordinates.- Parameters:
loc- physical location of label
-
getLocationP
Point2D.Double getLocationP()
Get the label reference location in physcial coordinates.- Returns:
- the labels position.
-
getBoundsP
Rectangle2D.Double getBoundsP()
Get the label reference location in physcial coordinates.- Returns:
- the labels position.
-
setAngle
void setAngle(double angle)
Draw label at arbitrary rotation. Warning: Rotated labels are not drawn very well when using JDK1.1. For best results use JDK1.2 or newer.
-
getAngle
double getAngle()
Get label drawing angle.
-
setHeightP
void setHeightP(double hgt)
Set the height of the label in physical coordinates.- Parameters:
hgt- The label height.
-
getHeightP
double getHeightP()
Get the label height in physical coordinates.- Returns:
- The label height.
-
setVisible
void setVisible(boolean vis)
Set visibility of label.
-
isVisible
boolean isVisible()
Is label visible?
-
getStringWidth
float getStringWidth(org.freehep.graphics2d.VectorGraphics g)
Get the string width in device units.
-
getStringHeight
float getStringHeight(org.freehep.graphics2d.VectorGraphics g)
Get the string height in device units.
-
-
DMelt 3.0 © DataMelt by jWork.ORG