Package net.sf.mpxj

Examples of net.sf.mpxj.FieldType


         pw.println("   Entries for Unique ID: " + uniqueID);
         Map<Integer, Integer> map = m_table.get(uniqueID);
         for (Integer type : map.keySet())
         {
            Integer offset = map.get(type);
            FieldType fieldType = fieldMap == null ? null : fieldMap.getFieldTypeFromVarDataKey(type);
            pw.println("      Type=" + (fieldType == null ? type : fieldType) + " Offset=" + offset);
         }
      }

      pw.println("END: VarMeta");
View Full Code Here


      int index = 0;
      int lastDataBlockOffset = 0;
      int dataBlockIndex = 0;
      while (index < data.length)
      {
         FieldType type = getFieldType(MPPUtility.getInt(data, index + 12));
         int dataBlockOffset = MPPUtility.getShort(data, index + 4);
         int mask = MPPUtility.getInt(data, index + 0);

         int varDataKey;
         if (useTypeAsVarDataKey())
View Full Code Here

    * @param key var data key
    * @return field type
    */
   public FieldType getFieldTypeFromVarDataKey(Integer key)
   {
      FieldType result = null;
      for (Entry<FieldType, FieldMap.FieldItem> entry : m_map.entrySet())
      {
         if (entry.getValue().getFieldLocation() == FieldLocation.VAR_DATA && entry.getValue().getVarDataKey().equals(key))
         {
            result = entry.getKey();
View Full Code Here

                     break;
                  }

                  case DURATION :
                  {
                     FieldType unitsType = m_type.getUnitsType();
                     TimeUnit units = (TimeUnit) getFieldData(id, unitsType, fixedData, varData);
                     if (units == null)
                     {
                        units = TimeUnit.HOURS;
                     }
View Full Code Here

         switch (m_type.getDataType())
         {
            case DURATION :
            {
               FieldType unitsType = m_type.getUnitsType();
               TimeUnit units = (TimeUnit) getFieldData(id, unitsType, fixedData, varData);
               if (units == null)
               {
                  units = TimeUnit.HOURS;
               }
View Full Code Here

   {
      byte[] leftBlock = getChildBlock(block);
      byte[] rightBlock1 = getListNextBlock(leftBlock);
      byte[] rightBlock2 = getListNextBlock(rightBlock1);
      TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - 0x3E7);
      FieldType leftValue = getFieldType(leftBlock);
      Object rightValue1 = getValue(leftValue, rightBlock1);
      Object rightValue2 = rightBlock2 == null ? null : getValue(leftValue, rightBlock2);

      GenericCriteria criteria = new GenericCriteria(m_file);
      criteria.setLeftValue(leftValue);
View Full Code Here

            GroupClause clause = new GroupClause();
            group.addGroupClause(clause);

            int fieldID = MPPUtility.getInt(groupVarData, offset);
            FieldType type = FieldTypeUtility.getInstance(fieldID);
            clause.setField(type);

            // from byte 0 2 byte short int - field type
            // byte 3 - entity type 0b/0c
            // 4th byte in clause is 1=asc 0=desc
            // offset+8=font index, from font bases
            // offset+12=color, byte
            // offset+13=pattern, byte           

            boolean ascending = (MPPUtility.getByte(groupVarData, offset + 4) != 0);
            clause.setAscending(ascending);

            int fontIndex = MPPUtility.getByte(groupVarData, offset + 8);
            FontBase fontBase = fontBases.get(Integer.valueOf(fontIndex));

            int style = MPPUtility.getByte(groupVarData, offset + 9);
            boolean bold = ((style & 0x01) != 0);
            boolean italic = ((style & 0x02) != 0);
            boolean underline = ((style & 0x04) != 0);

            int fontColorIndex = MPPUtility.getByte(groupVarData, offset + 10);
            ColorType fontColor = ColorType.getInstance(fontColorIndex);

            FontStyle fontStyle = new FontStyle(fontBase, italic, bold, underline, false, fontColor.getColor(), null, BackgroundPattern.SOLID);
            clause.setFont(fontStyle);

            int colorIndex = MPPUtility.getByte(groupVarData, offset + 12);
            ColorType color = ColorType.getInstance(colorIndex);
            clause.setCellBackgroundColor(color.getColor());
            clause.setPattern(BackgroundPattern.getInstance(MPPUtility.getByte(groupVarData, offset + 13) & 0x0F));

            // offset+14=group on
            int groupOn = MPPUtility.getShort(groupVarData, offset + 14);
            clause.setGroupOn(groupOn);
            // offset+24=start at
            // offset+40=group interval

            Object startAt = null;
            Object groupInterval = null;

            if (type != null)
            {
               switch (type.getDataType())
               {
                  case DURATION :
                  case NUMERIC :
                  case CURRENCY :
                  {
View Full Code Here

      m_headerOffset += 1;

      m_dataOffset = MPPUtility.getInt(m_data, m_headerOffset);
      m_headerOffset += 4;

      FieldType type = null;
      switch (entityType)
      {
         case 0x0B :
         {
            type = MPPTaskField.getInstance(fieldType);
View Full Code Here

            GroupClause clause = new GroupClause();
            group.addGroupClause(clause);

            int fieldID = MPPUtility.getInt(groupVarData, offset);
            FieldType type = FieldTypeUtility.getInstance14(fieldID);
            clause.setField(type);

            // from byte 0 2 byte short int - field type
            // byte 3 - entity type 0b/0c
            // 4th byte in clause is 1=asc 0=desc
            // offset+8=font index, from font bases
            // offset+12=color, byte
            // offset+13=pattern, byte           

            boolean ascending = (MPPUtility.getByte(groupVarData, offset + 4) != 0);
            clause.setAscending(ascending);

            int fontIndex = MPPUtility.getByte(groupVarData, offset + 8);
            FontBase fontBase = fontBases.get(Integer.valueOf(fontIndex));

            int style = MPPUtility.getByte(groupVarData, offset + 9);
            boolean bold = ((style & 0x01) != 0);
            boolean italic = ((style & 0x02) != 0);
            boolean underline = ((style & 0x04) != 0);
            Color fontColor = MPPUtility.getColor(groupVarData, offset + 10);

            FontStyle fontStyle = new FontStyle(fontBase, italic, bold, underline, false, fontColor, null, BackgroundPattern.SOLID);
            clause.setFont(fontStyle);
            clause.setCellBackgroundColor(MPPUtility.getColor(groupVarData, offset + 22));
            clause.setPattern(BackgroundPattern.getInstance(MPPUtility.getByte(groupVarData, offset + 34) & 0x0F));

            // offset+14=group on
            int groupOn = MPPUtility.getByte(groupVarData, offset + 38);
            clause.setGroupOn(groupOn);
            // offset+24=start at
            // offset+40=group interval

            Object startAt = null;
            Object groupInterval = null;
            if (type != null)
            {
               switch (type.getDataType())
               {
                  case DURATION :
                  case NUMERIC :
                  case CURRENCY :
                  {
View Full Code Here

    * @param fieldID field ID
    * @return FieldType instance
    */
   public static final FieldType getInstanceUnmapped(int fieldID)
   {
      FieldType result;
      int prefix = fieldID & 0xFFFF0000;
      int index = fieldID & 0x0000FFFF;

      switch (prefix)
      {
View Full Code Here

TOP

Related Classes of net.sf.mpxj.FieldType

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.