Package nu.fw.jeti.plugins

Examples of nu.fw.jeti.plugins.Word


        List wordList = ChatSplitPane.createWordList(message);
              links.translate(wordList);
              // Insert words from wordlist
              Document doc = jTextArea1.getDocument();
        for(Iterator i = wordList.iterator();i.hasNext();) {
          Word w = (Word) i.next();
          doc.insertString(doc.getLength(),w.toString(),
                                   w.getAttributes());
        }
      }
      else jTextArea1.setText(message);
      jTextArea1.setEditable(false);
      txtSubject.setText(subject);
View Full Code Here


 
  public void translate(List wordList)
  {
      for(Iterator i = wordList.iterator();i.hasNext();
      {
        Word word = (Word)i.next();
        StyleConstants.setFontSize(word.getAttributes(),Preferences.getInteger("fontsize", "font-size", 14));
      }
  }
View Full Code Here

  {
    if(currentIconSet != null)
    {//no icons selected
      for(int i=0;i<wordList.size();i++)
      {
        Word word =(Word) wordList.get(i);
        String token = word.word;
        if(token.length()>1)
        { 
          //System.out.println(token);
          //System.out.println(i);
          for(Iterator j=currentIconSet.iterator();j.hasNext();)
          { 
            //Map.Entry entry =(Map.Entry) j.next();
            Emoticon emoticon = (Emoticon)j.next();
            String toCheck = emoticon.toString();
            if (token.equals(toCheck))
            {
              setIcon(sas,emoticon);
              word.addAttributes(sas);
              break;
            }
            else if (token.startsWith(toCheck))
            {
              word.word = "o";
              setIcon(sas,emoticon);
              word.addAttributes(sas);
              //split smiley and word
              wordList.add(i+1,new Word(" "));
              wordList.add(i+2,new Word(token.substring(toCheck.length())));
              i++;//don't check inserted space
              break;
            }
            else if (token.endsWith(toCheck))
            {
              word.word = token.substring(0,token.length()-toCheck.length());           
              //split smiley and word
              wordList.add(i+1,new Word(" "));
              setIcon(sas,emoticon);
              wordList.add(i+2,new Word("o",(SimpleAttributeSet)sas.clone()));
              i--;//check if there was another smiley in front
              break;
            }
          }
        }
View Full Code Here

     
    public void translate(List wordList)
  {
    for(int i=0;i<wordList.size();i++)
      {
      Word word = (Word)wordList.get(i);
           String token = word.word;
           if(token.startsWith("xmpp:"))
           {
             linkAttributeSet.addAttribute("xmpp", token);
             word.addAttributes(linkAttributeSet);
           }
      }
  }
View Full Code Here

    System.out.println(cycle);
    MutableAttributeSet set = new SimpleAttributeSet();
    StyleConstants.setForeground(set, colors[cycle]);
    for (Iterator iter = wordList.iterator(); iter.hasNext();)
    {
      Word word =(Word) iter.next();
      word.addAttributes(set);
    }
    cycle++;
    if(cycle==colors.length)cycle=0;
  }
View Full Code Here

   
    public void translate(List wordList)
  {
    for(int i=0;i<wordList.size();i++)
      {
      Word word = (Word)wordList.get(i);
           String token = word.word;
           if(token.startsWith("http"))
           {
             checkIfURL(word,"");
           }
View Full Code Here

  public void translate(List wordList)
  {
    for (Iterator iter = wordList.iterator(); iter.hasNext();)
    {
      Word word =(Word) iter.next();
   
    }
  }
View Full Code Here

    for(int i = 0;i<text.length();i++)
    {//split text up in words
      char c = text.charAt(i);
      switch (c)
      {
        case ' ':  addWordFromTemp(temp, wordList, currentAttributes); wordList.add(new Word(" ", (SimpleAttributeSet)currentAttributes.clone())); temp = new StringBuffer(); break;
        case '\n':  addWordFromTemp(temp, wordList, currentAttributes); temp = new StringBuffer(); break;
        case '\t':  addWordFromTemp(temp, wordList, currentAttributes); wordList.add(new Word("\t", (SimpleAttributeSet)currentAttributes.clone()));temp = new StringBuffer();break;
        default:  temp.append(c);
      }
    }
    addWordFromTemp(temp, wordList, currentAttributes);
  }
View Full Code Here

    addWordFromTemp(temp, wordList, currentAttributes);
  }
 
  private void addWordFromTemp(StringBuffer temp, List wordList, SimpleAttributeSet currentAttributes)
  {
    if(temp.length()>0)wordList.add(new Word(temp,(SimpleAttributeSet)currentAttributes.clone()));
  }
View Full Code Here

    attr.addAttributes(set);
    if (elem.getName().equals("paragraph"))
    {
      if (elem.getStartOffset() != 0)
      {//only <br/>?
        wordList.add(new Word("\n",(SimpleAttributeSet)attr.clone()));
      }
    }
    if (elem.getName().equals("content"))
    {
      if (elem.getElementCount() > 0)
View Full Code Here

TOP

Related Classes of nu.fw.jeti.plugins.Word

Copyright © 2018 www.massapicom. 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.