4444 */
4545public class EditorHeader extends JComponent {
4646 // height of this tab bar
47- static final int HIGH = 29 ;
47+ static final int HIGH = Toolkit . dpi ( 29 ) ;
4848
49- static final int ARROW_TAB_WIDTH = 18 ;
50- static final int ARROW_TOP = 11 ;
51- static final int ARROW_BOTTOM = 18 ;
52- static final int ARROW_WIDTH = 6 ;
49+ static final int ARROW_TAB_WIDTH = Toolkit . dpi ( 18 ) ;
50+ static final int ARROW_TOP = Toolkit . dpi ( 11 ) ;
51+ static final int ARROW_BOTTOM = Toolkit . dpi ( 18 ) ;
52+ static final int ARROW_WIDTH = Toolkit . dpi ( 6 ) ;
5353
54- static final int CURVE_RADIUS = 6 ;
54+ static final int CURVE_RADIUS = Toolkit . dpi ( 6 ) ;
5555
5656 static final int TAB_TOP = 0 ;
57- static final int TAB_BOTTOM = 27 ;
57+ static final int TAB_BOTTOM = Toolkit . dpi ( 27 ) ;
5858 // amount of extra space between individual tabs
59- static final int TAB_BETWEEN = 3 ;
59+ static final int TAB_BETWEEN = Toolkit . dpi ( 3 ) ;
6060 // amount of margin on the left/right for the text on the tab
61- static final int TEXT_MARGIN = 16 ;
61+ static final int TEXT_MARGIN = Toolkit . dpi ( 16 ) ;
6262 // width of the tab when no text visible
6363 // (total tab width will be this plus TEXT_MARGIN*2)
64- static final int NO_TEXT_WIDTH = 16 ;
64+ static final int NO_TEXT_WIDTH = Toolkit . dpi ( 16 ) ;
6565
66- // Color bgColor;
6766 Color textColor [] = new Color [2 ];
6867 Color tabColor [] = new Color [2 ];
6968 Color modifiedColor ;
@@ -185,11 +184,7 @@ public void paintComponent(Graphics screen) {
185184 sizeH = size .height ;
186185 imageW = sizeW ;
187186 imageH = sizeH ;
188- if (Toolkit .highResDisplay ()) {
189- offscreen = createImage (imageW *2 , imageH *2 );
190- } else {
191- offscreen = createImage (imageW , imageH );
192- }
187+ offscreen = Toolkit .offscreenGraphics (this , imageW , imageH );
193188 }
194189
195190 Graphics g = offscreen .getGraphics ();
@@ -199,6 +194,7 @@ public void paintComponent(Graphics screen) {
199194 }
200195
201196 Graphics2D g2 = Toolkit .prepareGraphics (g );
197+ Toolkit .dpiStroke (g2 );
202198
203199 g .drawImage (gradient , 0 , 0 , imageW , imageH , this );
204200
@@ -265,7 +261,8 @@ public void paintComponent(Graphics screen) {
265261 g .setColor (tabColor [SELECTED ]);
266262 // can't be done with lines, b/c retina leaves tiny hairlines
267263 g .fillRect (Editor .LEFT_GUTTER , TAB_BOTTOM ,
268- editor .getTextArea ().getWidth () - Editor .LEFT_GUTTER , 2 );
264+ editor .getTextArea ().getWidth () - Editor .LEFT_GUTTER ,
265+ Toolkit .dpi (2 ));
269266
270267 // draw the tab for the menu
271268 g .setColor (tabColor [UNSELECTED ]);
0 commit comments