MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / drawString

Method drawString

CodenameOne/src/com/codename1/ui/Graphics.java:807–822  ·  view source on GitHub ↗
(String str, int x, int y, int textDecoration)

Source from the content-addressed store, hash-verified

805 ///
806 /// - `textDecoration`: Text decoration bitmask (See Style's TEXT_DECORATION_* constants)
807 public void drawString(String str, int x, int y, int textDecoration) {
808 // remove a commonly used trick to create a spacer label from the paint queue
809 if (str.length() == 0 || (str.length() == 1 && str.charAt(0) == ' ')) {
810 return;
811 }
812
813 Object nativeFont = null;
814 if (current != null) {
815 nativeFont = current.getNativeFont();
816 }
817 if (current instanceof CustomFont) {
818 current.drawString(this, str, x, y);
819 } else {
820 impl.drawString(nativeGraphics, nativeFont, str, x + xTranslate, y + yTranslate, textDecoration);
821 }
822 }
823
824 /// Draws a string using baseline coordinates.
825 ///

Callers 15

drawStringBaselineMethod · 0.95
drawCharMethod · 0.95
drawCharsMethod · 0.95
makeCountingFrameMethod · 0.95
makeDigitFrameMethod · 0.95
createSampleImageMethod · 0.95
makeFaceMethod · 0.95
loadTextImageMethod · 0.95
loadTextImageMethod · 0.95
drawAttributionMethod · 0.45
drawDebugMethod · 0.45
paintLoadingTextMethod · 0.45

Calls 3

lengthMethod · 0.65
charAtMethod · 0.65
getNativeFontMethod · 0.45

Tested by 15

makeCountingFrameMethod · 0.76
makeDigitFrameMethod · 0.76
loadTextImageMethod · 0.76
loadTextImageMethod · 0.76
drawCellOverlayMethod · 0.36
renderFrameMethod · 0.36
paintGlassPaneMethod · 0.36
renderFrameMethod · 0.36
renderFrameMethod · 0.36
paintMethod · 0.36
drawContentMethod · 0.36
drawContentMethod · 0.36