Package java.awt

Examples of java.awt.Font.deriveFont()


        private final Color col_observe = new Color(0x00, 0xD0, 0x00);
        private final Color col_bad     = new Color(0xFF, 0x00, 0x00);

        public StringCellRenderer() {
            final Font baseFont = getIdentitiesTable().getFont();
            normalFont = baseFont.deriveFont(Font.PLAIN);
            boldFont = baseFont.deriveFont(Font.BOLD);

            setVerticalAlignment(CENTER);
        }
View Full Code Here


        private final Color col_bad     = new Color(0xFF, 0x00, 0x00);

        public StringCellRenderer() {
            final Font baseFont = getIdentitiesTable().getFont();
            normalFont = baseFont.deriveFont(Font.PLAIN);
            boldFont = baseFont.deriveFont(Font.BOLD);

            setVerticalAlignment(CENTER);
        }

        @Override
View Full Code Here

       
        //String[] fnames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
        //for (String fname: fnames) System.out.println("font: " + fname);
       
        Font font = Font.decode("SansSerif");
        if (font != null) font = font.deriveFont((float) 14.0);
        //if (font != null) font = font.deriveFont(Font.BOLD);

        SearchBox = new JTextField();
        SearchBox.setText("search...");
        SearchBox.setCaretPosition(0);
View Full Code Here

        SearchBox = new JTextField();
        SearchBox.setText("search...");
        SearchBox.setCaretPosition(0);
        SearchBox.moveCaretPosition(9);
        SearchBox.setFont(font.deriveFont((float) 14.0).deriveFont(Font.BOLD));
        SearchBox.setSize(width + 4, textHeight);
        SearchBox.setBorder(BorderFactory.createEmptyBorder());
        SearchBox.setBackground(Color.decode("#EEEEDD"));
        SearchBox.getDocument().addDocumentListener(listener);
        InputMap im = SearchBox.getInputMap();
View Full Code Here

        Switchboard.InfoBox.setBorder(BorderFactory.createTitledBorder(""));
        Switchboard.InfoBox.setSize(width, textHeight);
        Switchboard.InfoBox.setBorder(BorderFactory.createEmptyBorder());
        Switchboard.InfoBox.setBackground(Color.decode("#EEEEDD"));
        Switchboard.InfoBox.setText("search window initialized");
        Switchboard.InfoBox.setFont(font.deriveFont((float) 11.0));
       
        // make the scroll pane that contains the search result
        JComponent mainText = new JEditorPane();
        mainText.setPreferredSize(new java.awt.Dimension(480, 590));
        String infotext =
View Full Code Here

        font = new Font(fontName, fallbackFont.getStyle(), fallbackFont.getSize());
      }

      if (font.canDisplayUpTo(text) == -1) {
        logger.info("Font '{}' was capable, returning", fontName);
        font = font.deriveFont(fallbackFont.getSize2D());
        return font;
      }
    }

    logger.warn("Didn't find any capable fonts for text '{}'", text);
View Full Code Here

        fontName = defaultFont.getName();
      } else {
        fontName = null;
      }
      font = new Font(fontName, fontStyle, 1);
      font = font.deriveFont(textStyle.getFontSize());
      this.fonts.put(textStyle, font);
    }
    return font;
  }
View Full Code Here

    public StatLabel() {
      // unbold
      Font f = getFont();
      if ((f.getStyle() & Font.BOLD) != 0) {
        setFont(f.deriveFont(f.getStyle() ^ Font.BOLD));
      }
    }
  }
}
View Full Code Here

    label.setOpaque(false);
    renderer.add(label);
    Font f = label.getFont();
    if ((f.getStyle() & Font.BOLD) != 0) {
      boldFont = f;
      normalFont = f.deriveFont(f.getStyle() ^ Font.BOLD);
    } else {
      normalFont = f;
      boldFont = f.deriveFont(f.getStyle() | Font.BOLD);
    }
   
View Full Code Here

    if ((f.getStyle() & Font.BOLD) != 0) {
      boldFont = f;
      normalFont = f.deriveFont(f.getStyle() ^ Font.BOLD);
    } else {
      normalFont = f;
      boldFont = f.deriveFont(f.getStyle() | Font.BOLD);
    }
   
    hpBar = new HPBar();
    renderer.add(hpBar, SBoxLayout.constraint(SLayout.EXPAND_X));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.