Package megamek.client.ui.widget.picmap
Class PMSimpleLabel
java.lang.Object
megamek.client.ui.widget.picmap.PMSimpleLabel
- Direct Known Subclasses:
PMMultiLineLabel,PMValueLabel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDraws element into specified Graphics.protected voiddrawOutlinedString(Graphics g, String text, int atX, int atY) Draws the label, ringed with a contrasting outline when it is outlined.intgetSize()voidmoveTo(int x, int y) voidvoidsetDrawScale(double scale) Sets the factor the label's text is enlarged by, so it can be drawn at that size rather than magnified through the component's transform, which would leave it blocky.voidsetOutlined(boolean outlined) Rings the label with a contrasting outline, for when what is drawn under it would drown it out.voidvoidsetVisible(boolean v) Sets visibility of elementvoidtranslate(int x, int y) Translates element by x and y.
-
Field Details
-
width
public int width -
outlined
protected boolean outlined -
drawScale
protected double drawScaleThe factor the text is enlarged by, so it is drawn at that size rather than magnified and left blocky.
-
-
Constructor Details
-
PMSimpleLabel
-
-
Method Details
-
setString
-
setColor
-
moveTo
public void moveTo(int x, int y) -
translate
public void translate(int x, int y) Description copied from interface:PMElementTranslates element by x and y. -
drawInto
Description copied from interface:PMElementDraws element into specified Graphics. -
drawOutlinedString
Draws the label, ringed with a contrasting outline when it is outlined. A label over a location striped for a critical hit would otherwise have to compete with the stripes drawn underneath it.When the label is enlarged, its position and font are scaled here and it is drawn at that size, so its text renders crisply rather than being magnified through the component's transform and left blocky.
-
setOutlined
public void setOutlined(boolean outlined) Rings the label with a contrasting outline, for when what is drawn under it would drown it out. -
setDrawScale
public void setDrawScale(double scale) Description copied from interface:PMLabelSets the factor the label's text is enlarged by, so it can be drawn at that size rather than magnified through the component's transform, which would leave it blocky. 1.0 draws it at its natural size.- Specified by:
setDrawScalein interfacePMLabel
-
setVisible
public void setVisible(boolean v) Description copied from interface:PMElementSets visibility of element- Specified by:
setVisiblein interfacePMElement
-
getBounds
-
getSize
-
getDescent
public int getDescent()- Specified by:
getDescentin interfacePMLabel
-