Examples of Font


Examples of java.awt.Font

    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Open Tickets by User", pieData, true, true, false);

    // add the "Total Open Tickets" sub-title
    TextTitle t1 = new TextTitle("Total Open Tickets: " + String.valueOf(totalTickets),
                                 new Font("SansSerif", Font.PLAIN, 11));
    pieChart.addSubtitle(t1);

    // set the chart visual options
    PiePlot plot = (PiePlot)pieChart.getPlot();
    plot.setForegroundAlpha(0.65f);
View Full Code Here

Examples of java.awt.Font

              cellHasFocus);
          // Initialize fonts if not done
          if (this.defaultFont == null) {
            this.defaultFont = getFont();
            this.supportedLanguageFont =
                new Font(this.defaultFont.getFontName(), Font.BOLD, this.defaultFont.getSize());
           
          }
          setFont(library.getSupportedLanguages().contains(locale.toString())
              ? supportedLanguageFont : defaultFont);
          return this;
View Full Code Here

Examples of java.awt.Font

    int theHeight = theAlertIcon.getHeight(this);
    alertY = ((this.getBounds().height - theHeight) / 2);
   
    linkX = alertX + theAlertIcon.getWidth(this) + Integer.parseInt(getParameter("padding-text"));
   
    fontAlert = new Font(getParameter("font-face"), AlertUtil.getFontStyle(getParameter("font-style")), Integer.parseInt(getParameter("font-size")));
    this.setFont(fontAlert);
    linkY = (this.getBounds().height + this.getFontMetrics(this.getFont()).getHeight() / 2) / 2;
    textColor = Color.decode(this.getParameter("text-color"));
    timeSleep = Integer.parseInt(getParameter("time-sleep"));
   
    timeUpdate= Integer.parseInt(getParameter("time-update"));
    noAlerts = getParameter("no-alerts");
    alertLength = Integer.parseInt(getParameter("alert-length"));
   
    dismissPadding = Integer.parseInt(getParameter("dismiss-padding"));
    dismissText = new TextLink(getParameter("dismiss-text"), getParameter("dismiss-tooltip"));
    fontDismiss = new Font(getParameter("dismiss-font-face"), AlertUtil.getFontStyle(getParameter("dismiss-font-style")), Integer.parseInt(getParameter("dismiss-font-size")));
   
    URL hostURL = getCodeBase();
    String hostName = hostURL.getHost();
    int port = hostURL.getPort();
   
View Full Code Here

Examples of java.awt.Font

        super.updateUI();
        setBackground(UIManager.getColor("TextArea.background"));
        setForeground(UIManager.getColor("TextArea.foreground"));
        if (UIManager.getLookAndFeel().getID().equals("MacOS")) {
            setFont(
                new Font("Monospaced",Font.PLAIN,10)
            );
        } else {
            setFont(
                new Font("Monospaced",Font.PLAIN,12)
            );
        }
    }
View Full Code Here

Examples of java.awt.Font

        new Color(143, 0, 0),
        new Color(48, 0, 96),
        new Color(48, 0, 96),
    };
    font = new Font[] {
        new Font("Sans Serif", Font.ITALIC, 20),
        new Font("Sans Serif", Font.BOLD, 24),
        new Font("Sans Serif", Font.BOLD, 18),
    };
    paintSteady = new Paint[colorBase.length];
    for (int i = 0; i < colorBase.length; i++) {
      Color hue = colorBase[i];
      paintSteady[i] = new GradientPaint(0.0f, 0.0f, derive(hue, 0),
View Full Code Here

Examples of java.awt.Font

    } else if (attr == StdAttr.LABEL) {
      String val = (String) value;
      label = val;
      fireAttributeValueChanged(StdAttr.LABEL, val);
    } else if (attr == StdAttr.LABEL_FONT) {
      Font val = (Font) value;
      labelFont = val;
      fireAttributeValueChanged(StdAttr.LABEL_FONT, val);
    } else if (attr == LABEL_LOCATION_ATTR) {
      Direction val = (Direction) value;
      labelLocation = val;
View Full Code Here

Examples of java.awt.Font

    String fontSize = elt.getAttribute("font-size");
    int styleFlags = 0;
    if (fontStyle.equals("italic")) styleFlags |= Font.ITALIC;
    if (fontWeight.equals("bold")) styleFlags |= Font.BOLD;
    int size = Integer.parseInt(fontSize);
    ret.setValue(DrawAttr.FONT, new Font(fontFamily, styleFlags, size));
   
    String alignStr = elt.getAttribute("text-anchor");
    AttributeOption halign;
    if (alignStr.equals("start")) {
      halign = DrawAttr.ALIGN_LEFT;
View Full Code Here

Examples of java.awt.Font

      g.setColor(Color.BLACK);
     
    }
   
    private void paintString(Graphics g, String msg) {
      Font old = g.getFont();
      g.setFont(old.deriveFont(Font.BOLD).deriveFont(18.0f));
      FontMetrics fm = g.getFontMetrics();
      int x = (getWidth() - fm.stringWidth(msg)) / 2;
      if (x < 0) x = 0;
      g.drawString(msg, x, getHeight() - 23);
      g.setFont(old);
View Full Code Here

Examples of java.awt.Font

          ret.append(Integer.toHexString(color.getRed()));
          ret.append(Integer.toHexString(color.getGreen()));
          ret.append(Integer.toHexString(color.getBlue()));
          ret.append('m');
        }
        Font font = txt.getFont();
        if(font != null)
        {
          ret.append("<font face=\"" + font.getFontName() + "\" ");
          ret.append("size=\"" + font.getSize() + "\">");
        }
        ret.append(txt.getSequence());
      }
       else if(comp instanceof SmileyComponent)
       {
View Full Code Here

Examples of java.awt.Font

   */
  private static MessageComponent[] splitFontAndColor(TextComponent comp)
  {
    int currentFontStyle = Font.PLAIN;
    int currentFontSize = 10;
    Font currentFont = new Font(null, currentFontStyle, currentFontSize);
    Color currentColor = Color.black;

    List ret = new ArrayList();
    StringBuffer sb = new StringBuffer();
    sb.append(comp.getSequence());

    Matcher m = fontColorPattern.matcher(sb);
    int txtStart = 0;
    while(m.find())
    {
      int txtEnd = m.end();
      if(txtStart < txtEnd)
      {
        String text = sb.substring(txtStart, txtEnd);
        ret.add(new TextComponent(text, currentFont, currentColor));
      }
      txtStart = txtEnd;

      String fontFace = m.group(3);
      String fontSize = m.group(4);
      String colorCodeStr = m.group(7);
      String colorStr = m.group(9);

      if(fontFace != null)
        currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
      if(fontSize != null)
      {
        currentFontSize = Integer.parseInt(fontSize);
        currentFont = currentFont.deriveFont((float)currentFontSize);
      }
      if(colorCodeStr != null)
      {
        switch(Integer.parseInt(colorCodeStr))
        {
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.