示例#1
0
文件: Main.java 项目: clagomess/slg
  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
      System.out.print(e.getMessage());
    }

    /*Slg slg = new Slg();

    slg.setDimencao(800);
    slg.setIMG("C:\\scan.jpg");

    slg.setBrilho(180);

    slg.ajustarIMG();
    //slg.criarArquivoGabarito("C:\\gabarito.slg");
    //slg.lerArquivoGabarito("C:\\gabarito.slg");

    slg.gravarBufferIMG("C:\\gabarito.png","png");
    slg.corrigirprova(slg.lerArquivoGabarito("C:\\gabarito.slg"));
    slg.gravarBufferIMG("C:\\gabarito_.png","png");
    //slg.getGabarito();
    //slg.bitToImg();
    //slg.gravarBufferIMG("C:\\buffer_bit.png","png");
    */
    Ui ui = new Ui();
    ui.home();
    System.out.print("SLG - Versão: " + ui.versao());
  }
示例#2
0
 public void configure(Ui ui) {
   ui.configuring(this);
   LdapObject entry = findEntry();
   if (entry == null)
     env.warn("target " + parent + " should have unknown entry "); // TODO: +entry.getVarName());
   else if (parent.contains(entry))
     env.info("target " + parent + " already has entry " + entry.getVarName());
   else parent.add(entry);
   ui.readyWith(this);
 }
示例#3
0
 public int check(Ui ui) {
   ui.checking(this);
   LdapObject entry = findEntry();
   if (parent.contains(entry)) {
     ui.info(this, "target " + parent + " has entry " + this);
     message = null;
     status = OK;
   } else {
     message = "target " + parent + " should have entry " + this;
     ui.error(this, message);
     status = ERROR;
   }
   ui.readyWith(this);
   return status;
 }
示例#4
0
 /** Dispose stuff created in the details viewer. */
 protected void disposeDetails() {
   if (ui != null) {
     ui.dispose();
   }
   if (this.isDisposed() == false) {
     for (Control control : detailComposite.getChildren()) {
       control.dispose();
     }
   }
 }
示例#5
0
  public void printUI() {
    boolean hasChildren = false;
    if (children.size() > 0) hasChildren = true;
    StringBuffer sb = new StringBuffer(LENGTH);
    // get the current level of the node so that we can do pretty print
    int level = this.getLevel();
    for (int i = 0; i < level; i++) {
      sb.append("  ");
    }
    sb.append(Ui.getType(attributes.get(TAG), attributes, hasChildren))
        .append("(UID: '")
        .append(id)
        .append("', clocator: [");
    if (attributes.size() == 0) {
      sb.append(":");
    } else {
      int count = 0;
      for (String key : attributes.keySet()) {
        if (++count > 1) sb.append(",");
        sb.append(key).append(":").append("'").append(attributes.get(key)).append("'");
      }
    }

    sb.append("]");
    // comment this line out if you do not want xpath to display
    sb.append("[xpath: ").append(xpath).append("]");
    sb.append(")");
    if (hasChildren) sb.append("{");
    System.out.println(sb.toString());
    if (hasChildren) {
      for (Node node : children) {
        node.printUI();
      }
    }
    if (hasChildren) {
      StringBuffer indent = new StringBuffer(LENGTH);
      for (int i = 0; i < level; i++) {
        indent.append("  ");
      }
      indent.append("}");
      System.out.println(indent.toString());
    }
  }
示例#6
0
 @Override
 public void onViewAttachedToWindow(View v) {
   ly = (LinearLayout) v;
   ui.addToolToLayout(ly, ui.createListViews(context, ly, resourceList));
   ui.setTouchListenerToLayoutChilds(ly);
 }