Advertisement
xlrnxnlx

FormatterControll - min

Jul 4th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.77 KB | None | 0 0
  1. package model;import model.topic.CheatTopic;import model.topic.Topic;public class FormatControll{private FormatDefinition def;private Topic topic;private CheatTopic cTopic;private Formatter format;private StringBuilder str;private boolean isTutorial;private boolean central;private final int ONCE=1;private final int TWICE=2;public FormatControll(boolean isTutorial,boolean central,Object topic,FormatDefinition def){if(isTutorial)
  2. this.topic=(Topic)topic;else
  3. this.cTopic=(CheatTopic)topic;this.def=def;this.isTutorial=isTutorial;this.central=central;}
  4. private String buildHeader(){String varDeveloper=!isTutorial?"Desenvolvido por: "+cTopic.getDeveloper():"";String varAuthor=!isTutorial?cTopic.getAuthor():topic.getAuthor();String varIntro=!isTutorial?cTopic.getIntro():topic.getIntro();String fmtLogo=format.setImage(def.getForumLogoUrl());String fmtTitle=format.setTextSize(def.getHighTextSize(),format.setTextColor(def.getHighTextColor(),format.setTextFont(def.getHighTextFont(),topic.getTitle().toUpperCase())));String fmtInfo=format.setFontStyle("ITALIC",format.setTextColor(def.getAuxTextColor(),format.setTextSize(def.getAuxTextSize(),varAuthor.toUpperCase())+
  5. format.nextLine(ONCE)+
  6. varDeveloper.toUpperCase()));str=new StringBuilder();return str.append(format.setHorizontalTextPosition("CENTER",format.setTextColor(def.getTextColor(),format.setTextFont(def.getTextFont(),format.setTextSize(def.getTextSize(),fmtLogo+format.nextLine(ONCE)+
  7. fmtTitle+format.nextLine(ONCE)+
  8. fmtInfo+
  9. separator()+
  10. varIntro+
  11. separator()))))).toString();}
  12. private String buildContent(){str=new StringBuilder();return str.toString();}
  13. private String separator(){str=new StringBuilder();return str.append(format.nextLine(TWICE)).append(format.setImage(def.getSeparator())).append(format.nextLine(TWICE)).toString();}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement