コード例 #1
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
  private boolean fillFromBlank(PosLineCol posLineCol, Tag tag, String csCurrentLanguage) {
    m_Color = new CReservedConstant(null, "GREEN");
    m_HighLight = new CReservedConstant(null, "OFF");
    setName("");
    setLine(ms_nNbBlank++);
    m_Length = 0; // tag.getValAsInt("length");
    m_PosLine = posLineCol.getLine();
    m_PosCol = posLineCol.getCol() + posLineCol.getLength() + 1;

    m_Value = "";

    m_arrATTRB.addElement("ASKIP");
    m_arrATTRB.addElement("NORM");

    return true;
  }
コード例 #2
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
  public boolean setAsClosingHBox(PosLineCol posLineCol) {
    m_Color = new CReservedConstant(null, "GREEN");
    m_HighLight = new CReservedConstant(null, "OFF");
    setName("");
    setLine(0);
    m_Length = 0;
    m_PosLine = posLineCol.getLine();
    m_PosCol = posLineCol.getCol() + posLineCol.getLength() + 1;
    posLineCol.setLineColLength(m_PosLine + 1, 0, 0);
    if (m_PosCol > 80) return false;

    m_Value = "";

    m_arrATTRB.addElement("ASKIP");
    m_arrATTRB.addElement("NORM");
    return true;
  }
コード例 #3
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
 private void manageAttrib(String cs) {
   if (cs.equalsIgnoreCase("autoskip")) m_arrATTRB.addElement("ASKIP");
   else if (cs.equalsIgnoreCase("UNPROTECTED")) m_arrATTRB.addElement("UNPROT");
   else if (cs.equalsIgnoreCase("NUMERIC")) {
     m_arrATTRB.addElement("UNPROT"); // correct ?
     m_arrATTRB.addElement("NUM");
   } else if (cs.equalsIgnoreCase("NORMAL")) m_arrATTRB.addElement("NORM");
   else if (cs.equalsIgnoreCase("DARK")) m_arrATTRB.addElement("DRK");
   else if (cs.equalsIgnoreCase("BRIGHT")) m_arrATTRB.addElement("BRT");
 }
コード例 #4
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
  private boolean fillFromSwitch(
      PosLineCol posLineCol, Tag tag, String csCurrentLanguage, String csAppendColor) {
    if (tag.isValExisting("name")) setName(tag.getVal("name").toUpperCase());
    else setName("");

    m_Length = tag.getValAsInt("length");

    m_PosLine = tag.getValAsInt("line");

    m_PosCol = tag.getValAsInt("col");

    posLineCol.setLineColLength(m_PosLine, m_PosCol, m_Length);

    m_Value = "";

    Tag tagTexts = tag.getChild("texts");
    if (tagTexts != null) {
      TagCursor curText = new TagCursor();
      Tag tagText = tagTexts.getFirstChild(curText, "text");
      while (tagText != null) {
        String csLanguage = tagText.getVal("lang");
        if (csLanguage.equalsIgnoreCase(csCurrentLanguage)) {
          m_Value = tagText.getText();
          break;
        }
        tagText = tagTexts.getNextChild(curText);
      }
    }

    m_arrJustify.addElement(CBMSConstantList.LEFT.m_Name);

    m_arrJustify.addElement(CBMSConstantList.BLANK.m_Name);

    m_arrATTRB.addElement("ASKIP");
    m_arrATTRB.addElement("NORM");

    return true;
  }
コード例 #5
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
  public CBMSElement loadTagParameters(Tag tagCurrent) {
    int nLine = tagCurrent.getValAsInt("Line");
    setLine(nLine);

    setName(tagCurrent.getVal("Name"));

    String csColor = tagCurrent.getVal("Color");
    m_Color = new CReservedConstant(null, csColor);

    String csHighLight = tagCurrent.getVal("HighLight");
    m_HighLight = new CReservedConstant(null, csHighLight);

    m_Length = tagCurrent.getValAsInt("Length");

    m_PosCol = tagCurrent.getValAsInt("PosCol");

    m_PosLine = tagCurrent.getValAsInt("PosLine");

    m_Value = tagCurrent.getVal("Value");

    // Enum all sub tags
    TagCursor curChild = new TagCursor();
    Tag tagChild = tagCurrent.getFirstChild(curChild);
    while (tagChild != null) {
      String csChildName = tagChild.getName();
      if (csChildName.equalsIgnoreCase("ATTRB")) {
        String csVal = tagChild.getVal("Value");
        m_arrATTRB.addElement(csVal);
      } else if (csChildName.equalsIgnoreCase("JUSTIFY")) {
        String csVal = tagChild.getVal("Value");
        m_arrJustify.addElement(csVal);
      }
      tagChild = tagCurrent.getNextChild(curChild);
    }

    return this;
  }
コード例 #6
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
 public boolean loadTagParameters(PosLineCol posLineCol, Tag tag, String csCurrentLanguage) {
   String csTagName = tag.getName();
   if (csTagName.equalsIgnoreCase("edit")) {
     return fillFromEdit(posLineCol, tag, csCurrentLanguage, "");
   } else if (csTagName.equalsIgnoreCase("label")) {
     boolean b = fillFromEdit(posLineCol, tag, csCurrentLanguage, ""); // "_LABEL");
     m_arrATTRB.addElement("ASKIP");
     m_arrATTRB.addElement("NORM");
     setName("");
     return b;
   } else if (csTagName.equalsIgnoreCase("title")) {
     boolean b = fillFromEdit(posLineCol, tag, csCurrentLanguage, "");
     while (m_Value.length() < m_Length) m_Value = m_Value + " ";
     m_arrATTRB.addElement("ASKIP");
     m_arrATTRB.addElement("NORM");
     return b;
   } else if (csTagName.equalsIgnoreCase("blank")) {
     return fillFromBlank(posLineCol, tag, csCurrentLanguage);
   } else if (csTagName.equalsIgnoreCase("switch") && !tag.isValExisting("additem")) {
     boolean b = fillFromSwitch(posLineCol, tag, csCurrentLanguage, "");
     return b;
   }
   return false;
 }
コード例 #7
0
ファイル: CFieldElement.java プロジェクト: rplandgraf/naca
  private boolean fillFromEdit(
      PosLineCol posLineCol, Tag tag, String csCurrentLanguage, String csAppendColor) {
    String csColor = tag.getVal("color");
    m_Color = new CReservedConstant(null, csColor.toUpperCase() + csAppendColor);

    String csHighLight = tag.getVal("highlighting");
    m_HighLight = new CReservedConstant(null, csHighLight.toUpperCase());

    if (tag.isValExisting("namecopy")) {
      setName(tag.getVal("namecopy").toUpperCase().replace('_', '-'));
      m_csDisplayName = tag.getVal("name").toUpperCase();
    } else if (tag.isValExisting("name")) setName(tag.getVal("name").toUpperCase());
    else setName("");

    // int nSourceLine = tag.getValAsInt("sourceline");
    // setLine(nSourceLine);

    m_Length = tag.getValAsInt("length");

    m_PosLine = tag.getValAsInt("line");

    m_PosCol = tag.getValAsInt("col");

    posLineCol.setLineColLength(m_PosLine, m_PosCol, m_Length);

    m_Value = "";

    Tag tagTexts = tag.getChild("texts");
    if (tagTexts != null) {
      TagCursor curText = new TagCursor();
      Tag tagText = tagTexts.getFirstChild(curText, "text");
      while (tagText != null) {
        String csLanguage = tagText.getVal("lang");
        if (csLanguage.equalsIgnoreCase(csCurrentLanguage)) {
          m_Value = tagText.getText();
          break;
        }
        tagText = tagTexts.getNextChild(curText);
      }
    }

    String csJustify = tag.getVal("justify");
    if (csJustify.equalsIgnoreCase("right")) m_arrJustify.addElement(CBMSConstantList.RIGHT.m_Name);
    else if (csJustify.equalsIgnoreCase("left"))
      m_arrJustify.addElement(CBMSConstantList.LEFT.m_Name);

    String csFill = tag.getVal("fill");
    if (csFill.equalsIgnoreCase("blank")) m_arrJustify.addElement(CBMSConstantList.BLANK.m_Name);
    else if (csFill.equalsIgnoreCase("zero")) m_arrJustify.addElement(CBMSConstantList.ZERO.m_Name);

    String csProtection = tag.getVal("protection");
    manageAttrib(csProtection);

    String csIntensity = tag.getVal("intensity");
    manageAttrib(csIntensity);

    boolean bModified = tag.getValAsBoolean("modified");
    if (bModified) m_arrATTRB.addElement("FSET");

    boolean bCursor = tag.getValAsBoolean("cursor");
    if (bCursor) m_arrATTRB.addElement("IC");
    return true;
  }