@Override public void setFont(Font font) { super.setFont(!fontSizeSet&&Prefs.getGuiScale()!=1.0?font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())):font); fontSizeSet = true; }
@Override public void setFont(Font font) { super.setFont(!fontSizeSet&&Prefs.getGuiScale()!=1.0?font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())):font); fontSizeSet = true; }
public void init() { dscale = Prefs.getGuiScale(); scale = (int)Math.round(dscale); if ((dscale>=1.5&&dscale<2.0) || (dscale>=2.5&&dscale<3.0)) dscale = scale; if (dscale>1.0) { buttonWidth = (int)((BUTTON_WIDTH-2)*dscale); buttonHeight = (int)((BUTTON_HEIGHT-2)*dscale); offset = (int)Math.round((OFFSET-1)*dscale); //IJ.log(dscale+" "+BUTTON_WIDTH+" "+buttonWidth+" "+offset); } else { buttonWidth = BUTTON_WIDTH; buttonHeight = BUTTON_HEIGHT; offset = OFFSET; } gapSize = GAP_SIZE; ps = new Dimension(buttonWidth*NUM_BUTTONS-(buttonWidth-gapSize), buttonHeight); }
public void init() { dscale = Prefs.getGuiScale(); scale = (int)Math.round(dscale); if ((dscale>=1.5&&dscale<2.0) || (dscale>=2.5&&dscale<3.0)) dscale = scale; if (dscale>1.0) { buttonWidth = (int)((BUTTON_WIDTH-2)*dscale); buttonHeight = (int)((BUTTON_HEIGHT-2)*dscale); offset = (int)Math.round((OFFSET-1)*dscale); //IJ.log(dscale+" "+BUTTON_WIDTH+" "+buttonWidth+" "+offset); } else { buttonWidth = BUTTON_WIDTH; buttonHeight = BUTTON_HEIGHT; offset = OFFSET; } gapSize = GAP_SIZE; ps = new Dimension(buttonWidth*NUM_BUTTONS-(buttonWidth-gapSize), buttonHeight); }
public void resize() { double scale = Prefs.getGuiScale(); toolbar.init(); statusLine.setFont(new Font("SansSerif", Font.PLAIN, (int)(13*scale))); progressBar.init((int)(ProgressBar.WIDTH*scale), (int)(ProgressBar.HEIGHT*scale)); pack(); }
public void resize() { double scale = Prefs.getGuiScale(); toolbar.init(); statusLine.setFont(new Font("SansSerif", Font.PLAIN, (int)(13*scale))); progressBar.init((int)(ProgressBar.WIDTH*scale), (int)(ProgressBar.HEIGHT*scale)); pack(); }
public static void updateFont() { scale = (int)Math.round(Prefs.getGuiScale()); Font font = getFont(); mbar.setFont(font); if (ij!=null) ij.setMenuBar(mbar); popup.setFont(font); }
public static void updateFont() { scale = (int)Math.round(Prefs.getGuiScale()); Font font = getFont(); mbar.setFont(font); if (ij!=null) ij.setMenuBar(mbar); popup.setFont(font); }
/** Adds a message consisting of one or more lines of text, which will be displayed using the specified font and color. */ public void addMessage(String text, Font font, Color color) { theLabel = null; if (text.indexOf('\n')>=0) theLabel = new MultiLineLabel(text); else theLabel = new Label(text); if (addToSameRow) { c.gridx = GridBagConstraints.RELATIVE; addToSameRow = false; } else { c.gridx = 0; c.gridy++; c.insets = getInsets("".equals(text)?0:10, 20, 0, 0); // top, left, bottom, right } c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; if (font!=null) { if (Prefs.getGuiScale()>1.0) font = font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())); theLabel.setFont(font); } if (color!=null) theLabel.setForeground(color); add(theLabel, c); c.fill = GridBagConstraints.NONE; }
/** Adds a message consisting of one or more lines of text, which will be displayed using the specified font and color. */ public void addMessage(String text, Font font, Color color) { theLabel = null; if (text.indexOf('\n')>=0) theLabel = new MultiLineLabel(text); else theLabel = new Label(text); if (addToSameRow) { c.gridx = GridBagConstraints.RELATIVE; addToSameRow = false; } else { c.gridx = 0; c.gridy++; c.insets = getInsets("".equals(text)?0:10, 20, 0, 0); // top, left, bottom, right } c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; if (font!=null) { if (Prefs.getGuiScale()>1.0) font = font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())); theLabel.setFont(font); } if (color!=null) theLabel.setForeground(color); add(theLabel, c); c.fill = GridBagConstraints.NONE; }
private void showInfo() { String s = new String(""); if (IJ.getInstance()!=null) s += IJ.getInstance().getInfo()+"\n \n"; s += "No images are open\n"; Dimension screen = IJ.getScreenSize(); s += "ImageJ home: "+IJ.getDir("imagej")+"\n"; s += "Java home: "+System.getProperty("java.home")+"\n"; s += "Screen size: "+screen.width+"x"+screen.height+"\n"; s += "GUI scale: "+IJ.d2s(Prefs.getGuiScale(),2)+"\n"; if (IJ.isMacOSX()) { String time = " ("+ImageWindow.setMenuBarTime+"ms)"; s += "SetMenuBarCount: "+Menus.setMenuBarCount+time+"\n"; } new TextWindow("Info", s, 600, 300); }
private void showInfo() { String s = new String(""); if (IJ.getInstance()!=null) s += IJ.getInstance().getInfo()+"\n \n"; s += "No images are open\n"; Dimension screen = IJ.getScreenSize(); s += "ImageJ home: "+IJ.getDir("imagej")+"\n"; s += "Java home: "+System.getProperty("java.home")+"\n"; s += "Screen size: "+screen.width+"x"+screen.height+"\n"; s += "GUI scale: "+IJ.d2s(Prefs.getGuiScale(),2)+"\n"; if (IJ.isMacOSX()) { String time = " ("+ImageWindow.setMenuBarTime+"ms)"; s += "SetMenuBarCount: "+Menus.setMenuBarCount+time+"\n"; } new TextWindow("Info", s, 600, 300); }
if (message==null) message = ""; Font font = null; double scale = Prefs.getGuiScale(); if (scale>1.0) { font = getFont();
if (message==null) message = ""; Font font = null; double scale = Prefs.getGuiScale(); if (scale>1.0) { font = getFont();
Font font = getFont(); if (IJ.debugMode) IJ.log("GenericDialog font: "+fontSizeSet+" "+font); if (!fontSizeSet && font!=null && Prefs.getGuiScale()!=1.0) { fontSizeSet = true; setFont(font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())));
Font font = getFont(); if (IJ.debugMode) IJ.log("GenericDialog font: "+fontSizeSet+" "+font); if (!fontSizeSet && font!=null && Prefs.getGuiScale()!=1.0) { fontSizeSet = true; setFont(font.deriveFont((float)(font.getSize()*Prefs.getGuiScale())));
statusBar.setBackground(backgroundColor); statusLine = new JLabel(); double scale = Prefs.getGuiScale(); statusLine.setFont(new Font("SansSerif", Font.PLAIN, (int)(13*scale))); statusLine.addKeyListener(this);
statusBar.setBackground(backgroundColor); statusLine = new JLabel(); double scale = Prefs.getGuiScale(); statusLine.setFont(new Font("SansSerif", Font.PLAIN, (int)(13*scale))); statusLine.addKeyListener(this);
gd.addNumericField("Menu font size:", Menus.getFontSize(), 0, 3, "points"); gd.setInsets(0, 0, 0); gd.addNumericField("GUI scale (0.5-3.0):", Prefs.getGuiScale(), 2, 4, ""); Font font = new Font("SansSerif", Font.PLAIN, 9); gd.setInsets(2,20,0); double scale = Prefs.getGuiScale(); if (scale!=saveScale) { if (!IJ.isMacOSX()) {
gd.addNumericField("Menu font size:", Menus.getFontSize(), 0, 3, "points"); gd.setInsets(0, 0, 0); gd.addNumericField("GUI scale (0.5-3.0):", Prefs.getGuiScale(), 2, 4, ""); Font font = new Font("SansSerif", Font.PLAIN, 9); gd.setInsets(2,20,0); double scale = Prefs.getGuiScale(); if (scale!=saveScale) { if (!IJ.isMacOSX()) {