Package org.takadb.editor.database.entities

Examples of org.takadb.editor.database.entities.CharacterEntity


              return "0-1";
            case 3:
              DBIdentifier lCharId = dbcontroller.findCharacterByJaElementId(elementId.intValue());
              if ( lCharId != null )
              {
                CharacterEntity lChar = (CharacterEntity)dbcontroller.getCharacter(new Integer(((CharacterEntity.Identifier)lCharId).characterId));
                return Integer.toString(lChar.jaJisCode, 16).toUpperCase();
              }
              break;
          }
        }
View Full Code Here


    RandomAccessFile file = new RandomAccessFile (exportFilename, "rw");

    file.writeInt (characters.size());
    while (iter.hasNext()) {
      CharacterEntity character = (CharacterEntity)iter.next();
      file.writeShort (character.characterId);
      file.writeShort (character.jaElementId);
      long readingMeaningLengthPosition = file.getFilePointer();
      file.writeByte (0);
      int nReadingMeaningListsWritten = 0;
View Full Code Here

    int  lKanjiCount      = new Integer(0);
    int  lEucCode      = new Integer(0);
    file.writeShort(0);
    while (iterChar.hasNext())
    {
      CharacterEntity character = (CharacterEntity)iterChar.next();
      if( character.jaElementId != 0 && character.jaJisCode != 0)
      {
        lEucCode   = character.jaJisCode;
        lEucCode  |= 0x8080;
        file.writeShort (lEucCode);
View Full Code Here

    }
    public int getColumnCount() {
      return columnNames.length;
    }
    public Object getValueAt (int row, int column) {
      CharacterEntity character = dbcontroller.getCharacter ((Integer)characterIds.get (row));
      switch (column) {
      case 0:
        return character.jaElementId + "-" + 1;
      case 1:
        return character.meanings.get ("ja", "en").destMeaning;
View Full Code Here

    public boolean isCellEditable (int row, int column) {
      return false;
    }

    public DBIdentifier getCharacterIdAtRow (int row) {
      CharacterEntity character = dbcontroller.getCharacter ((Integer)characterIds.get (row));
      return character.getIdentifier();
    }
View Full Code Here

    String savePath = TakaEditorClientPreferences.getDataPath() + "/xml/character/";
    new File(savePath).mkdirs();

    Iterator iter = getAllCharacters().iterator();
    while (iter.hasNext()) {
      CharacterEntity character = (CharacterEntity)iter.next();
      character.persist();
    }

  }
View Full Code Here

    lOut.print("//Character index:  list of characters.  [WORD: RecordID] [WORD: RecordOffset] [WORD: JisCode]\n");
    lOut.print("//the RecordID and RecordOffset is where to find the glyph description for this character\n");

    for (Iterator lIter = lSortedCharacters.iterator(); lIter.hasNext();)
    {
      CharacterEntity lCurChar = (CharacterEntity) lIter.next();
      GlyphAddress lCurAddress =  _GlyphMappingTable[lCurChar.jaElementId][1];
      lOut.print("\t" + lCurAddress._RecordID + " ");
      if (sVersion >= 5)
        lOut.print(lCurAddress._Offset + " ");
     
View Full Code Here

        String type = "";
        if (identifier instanceof ElementEntity.Identifier) {
          elementId = new Integer(((ElementEntity.Identifier)identifier).elementId);
          type = "Element";
        } else if (identifier instanceof CharacterEntity.Identifier) {
          CharacterEntity character = dbcontroller.getCharacter (new Integer (((CharacterEntity.Identifier)identifier).characterId));
          elementId = new Integer (character.jaElementId);
          type = "Character";
        }
        switch (column) {
          case 0:
View Full Code Here

      // characters
      System.out.println ("+ Saving characters...");
      iter = this.dbcontroller.getAllCharacters().iterator();
      while (iter.hasNext()) {
        CharacterEntity iterCharacter = (CharacterEntity)iter.next();
        sqlSaveCharacter (conn, iterCharacter);
      }

      // elements
      System.out.println ("+ Saving elements...");
View Full Code Here

      Statement statement = conn.createStatement();

      // characters
      ResultSet rs = statement.executeQuery ("SELECT * FROM characters");
      while (rs.next()) {
        CharacterEntity character = new CharacterEntity (
            rs.getInt ("character_id"),
            rs.getInt ("ja_ucs_code"),
            rs.getInt ("ja_element_id"),
            rs.getInt ("ja_jis_code"),
            rs.getInt ("ja_jouyou_grade"),
            rs.getInt ("zh_simplified_ucs_code"),
            rs.getInt ("zh_simplified_element_id"),
            rs.getInt ("zh_traditional_ucs_code"),
            rs.getInt ("zh_traditional_element_id")
        );
        allCharacters.put (new Integer (character.characterId), character);     
      }

      // character_readings
      rs = statement.executeQuery ("SELECT * FROM character_readings");
      while (rs.next()) {
        int characterId = rs.getInt("character_id");
        CharacterEntity character = (CharacterEntity)allCharacters.get (new Integer (characterId));
        character.readings.set (
            rs.getString("source_language_code"),
            new Integer (rs.getInt("reading_index")),
            new Reading (
                rs.getString("source_reading"),
                rs.getString("jp_reading_type")
            )
        );
      }

      // character_reading_meanings
      rs = statement.executeQuery ("SELECT * FROM character_reading_meanings");
      while (rs.next()) {
        int characterId = rs.getInt("character_id");
        CharacterEntity character = (CharacterEntity)allCharacters.get (new Integer (characterId));
        Reading reading = character.readings.get (rs.getString("source_language_code"), new Integer (rs.getInt("reading_index")));
        reading.meanings.set (
            rs.getString("dest_language_code"),
            new Reading.Meaning (
                rs.getString("dest_reading_meaning")
            )
        );
      }

      // character_meanings
      rs = statement.executeQuery ("SELECT * FROM character_meanings");
      while (rs.next()) {
        int characterId = rs.getInt("character_id");
        CharacterEntity character = (CharacterEntity)allCharacters.get (new Integer (characterId));
        character.meanings.set (
            rs.getString ("source_language_code"),
            rs.getString ("dest_language_code"),
            new Meaning (
                rs.getString ("dest_meaning")
View Full Code Here

TOP

Related Classes of org.takadb.editor.database.entities.CharacterEntity

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.