MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / dialogItemChanged

Method dialogItemChanged

ij/src/main/java/ij/plugin/Text.java:89–118  ·  view source on GitHub ↗
(GenericDialog gd, AWTEvent e)

Source from the content-addressed store, hash-verified

87 }
88
89 public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
90 ImagePlus imp = WindowManager.getCurrentImage();
91 Roi roi = imp!=null?imp.getRoi():null;
92 TextRoi textRoi = roi!=null&&(roi instanceof TextRoi)?(TextRoi)roi:null;
93 font = gd.getNextChoice();
94 style = gd.getNextChoiceIndex();
95 justification = gd.getNextChoiceIndex();
96 String colorName2 = gd.getNextChoice();
97 String fillc = gd.getNextChoice();
98 fontSize = (int)gd.getNextNumber();
99 angle = (int)gd.getNextNumber();
100 antialiased = gd.getNextBoolean();
101 if (colorName!=null && !colorName2.equals(colorName)) {
102 Color color = Colors.decode(colorName2, null);
103 Toolbar.setForegroundColor(color);
104 colorName = colorName2;
105 }
106 TextRoi.setFont(font, fontSize, style, antialiased);
107 TextRoi.setGlobalJustification(justification);
108 Color fillColor = Colors.decode(fillc, null);
109 TextRoi.setDefaultFillColor(fillColor);
110 TextRoi.setDefaultAngle(angle);
111 if (textRoi!=null) {
112 textRoi.setAngle(angle);
113 textRoi.setJustification(justification);
114 textRoi.setFillColor(fillColor);
115 textRoi.setAntiAlias(antialiased);
116 }
117 return true;
118 }
119
120}

Callers

nothing calls this directly

Calls 15

getCurrentImageMethod · 0.95
getRoiMethod · 0.95
decodeMethod · 0.95
setForegroundColorMethod · 0.95
setFontMethod · 0.95
setDefaultFillColorMethod · 0.95
setDefaultAngleMethod · 0.95
setAngleMethod · 0.95
setJustificationMethod · 0.95
setAntiAliasMethod · 0.80
getNextChoiceMethod · 0.45

Tested by

no test coverage detected