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

Method paintImpl

CodenameOne/src/com/codename1/ui/Label.java:878–904  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

876 }
877
878 void paintImpl(Graphics g) {
879 initAutoResize();
880 Object icn = null;
881 Image i = getIconFromState();
882 if (i != null) {
883 icn = i.getImage();
884 } else {
885 // optimize away a common usage pattern for drawing the background only
886 if (text == null || "".equals(text) || " ".equals(text)) {
887 return;
888 }
889 }
890 //getUIManager().getLookAndFeel().drawLabel(g, this);
891 int cmpX = getX() + g.getTranslateX();
892 int cmpY = getY() + g.getTranslateY();
893 int cmpHeight = getHeight();
894 int cmpWidth = getWidth();
895 Style s = getStyle();
896 Font f = s.getFont();
897 String t = text;
898 if (text == null) {
899 t = "";
900 }
901 Display.impl.drawLabelComponent(g.getGraphics(), cmpX, cmpY, cmpHeight, cmpWidth, s, t,
902 icn, null, 0, gap, isRTL(), false, textPosition, getStringWidth(f), tickerRunning, shiftText,
903 endsWith3Points, valign);
904 }
905
906 /// Allows us to limit the maximum size for the autosize mode
907 ///

Callers 2

paintMethod · 0.95
paintMethod · 0.80

Calls 15

initAutoResizeMethod · 0.95
getIconFromStateMethod · 0.95
getImageMethod · 0.95
getFontMethod · 0.95
getStringWidthMethod · 0.95
equalsMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getHeightMethod · 0.65
getWidthMethod · 0.65
getStyleMethod · 0.65
getGraphicsMethod · 0.65

Tested by

no test coverage detected