MCPcopy Index your code
hub / github.com/processing/processing / statusToolTip

Method statusToolTip

app/src/processing/app/ui/Editor.java:3184–3203  ·  view source on GitHub ↗
(JComponent comp, String message, boolean error)

Source from the content-addressed store, hash-verified

3182
3183
3184 public void statusToolTip(JComponent comp, String message, boolean error) {
3185 if (font == null) {
3186 font = Toolkit.getSansFont(Toolkit.zoom(9), Font.PLAIN);
3187 textColor = mode.getColor("errors.selection.fgcolor");
3188 bgColorWarning = mode.getColor("errors.selection.warning.bgcolor");
3189 bgColorError = mode.getColor("errors.selection.error.bgcolor");
3190 }
3191
3192 Color bgColor = error ? bgColorError : bgColorWarning;
3193 int m = Toolkit.zoom(3);
3194 String css =
3195 String.format("margin: %d %d %d %d; ", -m, -m, -m, -m) +
3196 String.format("padding: %d %d %d %d; ", m, m, m, m) +
3197 "background: #" + PApplet.hex(bgColor.getRGB(), 8).substring(2) + ";" +
3198 "font-family: " + font.getFontName() + ", sans-serif;" +
3199 "font-size: " + font.getSize() + "px;";
3200 String content =
3201 "<html> <div style='" + css + "'>" + message + "</div> </html>";
3202 comp.setToolTipText(content);
3203 }
3204
3205
3206 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 2

getToolTipTextMethod · 0.80
showMarkerHoverMethod · 0.80

Calls 6

getSansFontMethod · 0.95
zoomMethod · 0.95
hexMethod · 0.95
getSizeMethod · 0.80
formatMethod · 0.65
getColorMethod · 0.45

Tested by

no test coverage detected