Examples of StyleMapEntry


Examples of org.apache.uima.tools.stylemap.StyleMapEntry

      StyleMapEditor sedit = new StyleMapEditor(this, cas);
      String sXml = readStylemapFile(prefsMed.getStylemapFile());
      ArrayList sme = sedit.parseStyleList(sXml);
      currentTaeOutputTypes = new String[sme.size()];
      for (int i = 0; i < sme.size(); i++) {
        StyleMapEntry e = (StyleMapEntry) sme.get(i);
        currentTaeOutputTypes[i] = e.getAnnotationTypeName();
      }
    }
    show_analysis(aOutputDir);
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

      RutaBasic each = (RutaBasic) iterator.get();
      String replace = each.getReplacement() == null ? each.getCoveredText() : each
              .getReplacement();
      Type type = getColorType(each, coloredTypes, cas);
      if (type != null && !"".equals(replace)) {
        StyleMapEntry entry = styleMap.get(type.getName());
        String backgroundColor = "#"
                + Integer.toHexString(entry.getBackground().getRGB()).substring(2);
        String newStartTag = startTag.replaceAll("&bgcolor", backgroundColor);
        tokens.add(newStartTag);
        tokens.add(replace);
        tokens.add(endTag);
      } else {
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

    List<StyleMapEntry> result = new ArrayList<StyleMapEntry>();
    Type type = jcas.getCasType(RutaColoring.type);
    FSIterator<FeatureStructure> iterator = jcas.getFSIndexRepository().getAllIndexedFS(type);
    while (iterator.hasNext()) {
      RutaColoring each = (RutaColoring) iterator.next();
      StyleMapEntry entry = new StyleMapEntry();
      entry.setAnnotationTypeName(each.getTargetType());
      String fgColor = each.getFgColor();
      entry.setForeground(parseColorBackground(fgColor));
      String bgColor = each.getBgColor();
      entry.setBackground(parseColorBackground(bgColor));
      entry.setChecked(each.getSelected());
      result.add(entry);
    }

    return result;
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

    for (int i = 0; i < smxp.annotType.size(); i++) {
      String typeName = ((String) smxp.annotType.elementAt(i));
      String labelString = ((String) smxp.styleLabel.elementAt(i));
      String featureValue = ((String) smxp.featureValue.elementAt(i));
      String styleColor = smxp.styleColor.elementAt(i).toString();
      StyleMapEntry e = cp.parseAndAssignColors(typeName, featureValue, labelString, styleColor);
      result.put(typeName, e);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

        } else if (childName.equals("style")) { //$NON-NLS-1$
          colorText = getTextValue(child);
        }
      }

      StyleMapEntry styleMapEntry = getStyleMapEntry(type, label, colorText);
      result.put(styleMapEntry.getAnnotationTypeName(), styleMapEntry);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

    }
    return result;
  }

  protected StyleMapEntry getStyleMapEntry(String type, String label, String styleColor) {
    StyleMapEntry result = new StyleMapEntry();
    result.setAnnotationTypeName(type);
    result.setLabel(label);
    StringTokenizer token = new StringTokenizer(styleColor, ":;");
    if (!token.hasMoreTokens()) {
      return null; // No token
    }

    token.nextToken();
    String fgString = token.nextToken().toLowerCase().trim();
    result.setForeground(parseColorForeground(fgString));

    token.nextToken();
    String bgString = token.nextToken().toLowerCase().trim();
    result.setBackground(parseColorBackground(bgString));

    boolean checked = false; // default to Checked
    if (token.hasMoreTokens()) {
      String ck = token.nextToken();
      String tf = token.nextToken();
      if (ck.equals("checked")) {
        if (tf.equals("false")) {
          checked = false;
        } else if (tf.equals("true")) {
          checked = true;
        }
      }
    }
    result.setChecked(checked);

    boolean hidden = false;
    if (token.hasMoreTokens()) {
      String ck = token.nextToken();
      String tf = token.nextToken();
      if (ck.equals("hidden")) {
        if (tf.equals("true")) {
          hidden = true;
        }
      }
    }
    result.setHidden(hidden);
    return result;
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

        String nodeName = node.getNodeName();
        if (nodeName.equals("rule")) {
          NodeList childrenList = node.getChildNodes();
          String type = "";
          String label = "";
          StyleMapEntry sme = null;
          String colorText = "";
          for (int j = 0; j < childrenList.getLength(); j++) {
            Node child = childrenList.item(j);
            String childName = child.getNodeName();
            if (childName.equals("pattern")) {
              type = getTextValue(child);
            }
            if (childName.equals("label")) {
              label = getTextValue(child);
            }
            if (childName.equals("style")) {
              colorText = getTextValue(child);
            }

          }
          sme = cParser.parseAndAssignColors(type, label, label, colorText);
          if (!sme.getChecked()) {
            notCheckedList.add(sme.getAnnotationTypeName());
          }
          if (!sme.getHidden()) {
            colorList.add(sme.getBackground());
            typeList.add(sme.getAnnotationTypeName());
          } else {
            hiddenList.add(sme.getAnnotationTypeName());
          }

        }
      }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

      StyleMapEditor sedit = new StyleMapEditor(this, cas);
      String sXml = readStylemapFile(prefsMed.getStylemapFile());
      ArrayList sme = sedit.parseStyleList(sXml);
      currentTaeOutputTypes = new String[sme.size()];
      for (int i = 0; i < sme.size(); i++) {
        StyleMapEntry e = (StyleMapEntry) sme.get(i);
        currentTaeOutputTypes[i] = e.getAnnotationTypeName();
      }
    }
    show_analysis(aOutputDir);
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

      StyleMapEditor sedit = new StyleMapEditor(this, cas);
      String sXml = readStylemapFile(prefsMed.getStylemapFile());
      ArrayList sme = sedit.parseStyleList(sXml);
      currentTaeOutputTypes = new String[sme.size()];
      for (int i = 0; i < sme.size(); i++) {
        StyleMapEntry e = (StyleMapEntry) sme.get(i);
        currentTaeOutputTypes[i] = e.getAnnotationTypeName();
      }
    }
    show_analysis(aOutputDir);
  }
View Full Code Here

Examples of org.apache.uima.tools.stylemap.StyleMapEntry

        String nodeName = node.getNodeName();
        if (nodeName.equals("rule")) {
          NodeList childrenList = node.getChildNodes();
          String type = "";
          String label = "";
          StyleMapEntry sme = null;
          String colorText = "";
          for (int j = 0; j < childrenList.getLength(); j++) {
            Node child = childrenList.item(j);
            String childName = child.getNodeName();
            if (childName.equals("pattern")) {
              type = getTextValue(child);
            }
            if (childName.equals("label")) {
              label = getTextValue(child);
            }
            if (childName.equals("style")) {
              colorText = getTextValue(child);
            }

          }
          sme = cParser.parseAndAssignColors(type, label, label, colorText);
          if (!sme.getChecked()) {
            notCheckedList.add(sme.getAnnotationTypeName());
          }
          if (!sme.getHidden()) {
            colorList.add(sme.getBackground());
            typeList.add(sme.getAnnotationTypeName());
          } else {
            hiddenList.add(sme.getAnnotationTypeName());
          }

        }
      }
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.