Populates default settings.

@param record MPX record
@param properties project properties
@throws MPXJException
517807
private void populateDefaultSettings(Record record, ProjectProperties properties) throws MPXJException
   {
      properties.setDefaultDurationUnits(record.getTimeUnit(0));
      properties.setDefaultDurationIsFixed(record.getNumericBoolean(1));
      properties.setDefaultWorkUnits(record.getTimeUnit(2));
      properties.setMinutesPerDay(Double.valueOf(NumberHelper.getDouble(record.getFloat(3)) * 60));
      properties.setMinutesPerWeek(Double.valueOf(NumberHelper.getDouble(record.getFloat(4)) * 60));
      properties.setDefaultStandardRate(record.getRate(5));
      properties.setDefaultOvertimeRate(record.getRate(6));
      properties.setUpdatingTaskStatusUpdatesResourceStatus(record.getNumericBoolean(7));
      properties.setSplitInProgressTasks(record.getNumericBoolean(8));
   }
880347
public void init(RecordOwner recordOwner)
    {
        m_dbEditMode = Constants.EDIT_NONE;
        m_listener = null;
        m_bDisplayOption = true;

        m_depScreens = null;        // List of all Dependent screens (doesn't include m_recordOwner)
        m_recordOwner = recordOwner;
        this.getTable();    // This will set up a table using the recordowner if it exists.

        if (recordOwner != null)
            recordOwner.addRecord(this, false);

        super.init(recordOwner);    // Set up the fields.
        this.selectFields();
        if ((this.getDatabaseType() & DBConstants.BASE_TABLE_CLASS) != 0)
        {
            if ((this.getDatabaseType() & DBConstants.SHARED_TABLE) != 0)  // But not shared (don't need multitable).
            {
                if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)   // Slaves don't need this helper class.
                {
                    if ((this.getRecordOwner() == null)
                        || ((this.getRecordOwner().getMasterSlave() & RecordOwner.MASTER) != 0))
                            new org.jbundle.base.db.shared.SharedBaseRecordTable(null, this);    // Special - base class of a shared table
                }
            }
            else
                new org.jbundle.base.db.shared.MultiTable(null, this);     // Special - base class - Add the overriding classes.
        }
        if (this.getTable() != null)
            if (this.getTable().getDatabase() != null)
                if (this.getTable().getDatabase().getDatabaseOwner() != null)
                if (this.getTable().getDatabase().getDatabaseOwner().getEnvironment() != null)
                if ((DBConstants.YES.equalsIgnoreCase(((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getProperty(DBParams.LOG_TRXS))) || (DBConstants.TRUE.equalsIgnoreCase(((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getProperty(DBParams.LOG_TRXS))))
            if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)   // Slaves do the logging.
                if ((this.getDatabaseType() & DBConstants.DONT_LOG_TRX) == 0)
        {
            if ((this.getRecordOwner() == null)
                || ((this.getRecordOwner().getMasterSlave() & RecordOwner.SLAVE) != 0))
                    new org.jbundle.base.db.util.log.MessageLogTable(null, this);    // Special - base class of a shared table
        }
        m_iDefaultOrder = Constants.MAIN_KEY_AREA;      // Key Area to use on next operation
        this.addListeners();
    }
1283911
private void populateModel()
   {
      if (m_count != 0)
      {
         m_count = 0;
         Arrays.fill(m_flags, false);
      }

      for (Resource resource : m_parentFile.getResources())
      {
         for (int loop = 0; loop < MPXResourceField.MAX_FIELDS; loop++)
         {
            if (resource.getCachedValue(MPXResourceField.getMpxjField(loop)) != null)
            {
               if (m_flags[loop] == false)
               {
                  m_flags[loop] = true;
                  m_fields[m_count] = loop;
                  ++m_count;
               }
            }
         }
      }

      //
      // Ensure the the model fields always appear in the same order
      //
      Arrays.sort(m_fields);
      System.arraycopy(m_fields, m_fields.length - m_count, m_fields, 0, m_count);
   }
1346140
protected static void setStaticProperties(Properties properties){
        //defaultCount，这是一个全局生效的参数，多数据源时也是统一的行为
        if(properties != null){
            DEFAULT_COUNT = Boolean.valueOf(properties.getProperty("defaultCount", "true"));
        }
    }
972348
private void populateCurrencySettings(Record record, ProjectProperties properties)
   {
      properties.setCurrencySymbol(record.getString(0));
      properties.setSymbolPosition(record.getCurrencySymbolPosition(1));
      properties.setCurrencyDigits(record.getInteger(2));

      Character c = record.getCharacter(3);
      if (c != null)
      {
         properties.setThousandsSeparator(c.charValue());
      }

      c = record.getCharacter(4);
      if (c != null)
      {
         properties.setDecimalSeparator(c.charValue());
      }
   }
942010
private void writeProjectHeader(ProjectProperties properties) throws IOException
   {
      m_buffer.setLength(0);

      //
      // Currency Settings Record
      //
      m_buffer.append(MPXConstants.CURRENCY_SETTINGS_RECORD_NUMBER);
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getCurrencySymbol()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getSymbolPosition()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getCurrencyDigits()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Character.valueOf(properties.getThousandsSeparator())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Character.valueOf(properties.getDecimalSeparator())));
      stripTrailingDelimiters(m_buffer);
      m_buffer.append(MPXConstants.EOL);

      //
      // Default Settings Record
      //
      m_buffer.append(MPXConstants.DEFAULT_SETTINGS_RECORD_NUMBER);
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Integer.valueOf(properties.getDefaultDurationUnits().getValue())));
      m_buffer.append(m_delimiter);
      m_buffer.append(properties.getDefaultDurationIsFixed() ? "1" : "0");
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Integer.valueOf(properties.getDefaultWorkUnits().getValue())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDecimal(NumberHelper.getDouble(properties.getMinutesPerDay()) / 60)));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDecimal(NumberHelper.getDouble(properties.getMinutesPerWeek()) / 60)));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatRate(properties.getDefaultStandardRate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatRate(properties.getDefaultOvertimeRate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(properties.getUpdatingTaskStatusUpdatesResourceStatus() ? "1" : "0");
      m_buffer.append(m_delimiter);
      m_buffer.append(properties.getSplitInProgressTasks() ? "1" : "0");
      stripTrailingDelimiters(m_buffer);
      m_buffer.append(MPXConstants.EOL);

      //
      // Date Time Settings Record
      //
      m_buffer.append(MPXConstants.DATE_TIME_SETTINGS_RECORD_NUMBER);
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getDateOrder()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getTimeFormat()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(getIntegerTimeInMinutes(properties.getDefaultStartTime())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Character.valueOf(properties.getDateSeparator())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(Character.valueOf(properties.getTimeSeparator())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getAMText()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getPMText()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getDateFormat()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getBarTextDateFormat()));
      stripTrailingDelimiters(m_buffer);
      m_buffer.append(MPXConstants.EOL);
      m_writer.write(m_buffer.toString());

      //
      // Write project calendars
      //
      for (ProjectCalendar cal : m_projectFile.getCalendars())
      {
         writeCalendar(cal);
      }

      //
      // Project Header Record
      //
      m_buffer.setLength(0);
      m_buffer.append(MPXConstants.PROJECT_HEADER_RECORD_NUMBER);
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getProjectTitle()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getCompany()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getManager()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getDefaultCalendarName()));
      m_buffer.append(m_delimiter);

      m_buffer.append(format(formatDateTime(properties.getStartDate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getFinishDate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getScheduleFrom()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getCurrentDate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getComments()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatCurrency(properties.getCost())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatCurrency(properties.getBaselineCost())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatCurrency(properties.getActualCost())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getWork())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getBaselineWork())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getActualWork())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatPercentage(properties.getWork2())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getDuration())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getBaselineDuration())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getActualDuration())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatPercentage(properties.getPercentageComplete())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getBaselineStart())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getBaselineFinish())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getActualStart())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDateTime(properties.getActualFinish())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getStartVariance())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDuration(properties.getFinishVariance())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getSubject()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getAuthor()));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(properties.getKeywords()));
      stripTrailingDelimiters(m_buffer);
      m_buffer.append(MPXConstants.EOL);

      m_writer.write(m_buffer.toString());
   }
1284624
private void populateCalendarException(Record record, ProjectCalendar calendar) throws MPXJException
   {
      Date fromDate = record.getDate(0);
      Date toDate = record.getDate(1);
      boolean working = record.getNumericBoolean(2);

      // I have found an example MPX file where a single day exception is expressed with just the start date set.
      // If we find this for we assume that the end date is the same as the start date.
      if (fromDate != null && toDate == null)
      {
         toDate = fromDate;
      }

      ProjectCalendarException exception = calendar.addCalendarException(fromDate, toDate);
      if (working)
      {
         addExceptionRange(exception, record.getTime(3), record.getTime(4));
         addExceptionRange(exception, record.getTime(5), record.getTime(6));
         addExceptionRange(exception, record.getTime(7), record.getTime(8));
      }
   }
1048158
protected static void loadPropertiesOverrides (
        PropRecord prec, Map<String,PropRecord> records, Map<String,PropRecord> applied,
        ClassLoader loader, Properties target)
        throws IOException
    {
        if (applied.containsKey(prec._package)) {
            return;
        }

        // first load up properties from all of our parent nodes
        if (prec._overrides != null) {
            for (String override : prec._overrides) {
                PropRecord parent = records.get(override);
                loadPropertiesOverrides(parent, records, applied, loader, target);
            }
        }

        // now apply our properties values
        InputStream in = prec.sourceURL.openStream();
        target.load(in);
        in.close();
        applied.put(prec._package, prec);
    }
808251
@Override
    public void initialize(Settings settings) {
        this.settings = settings;
        final String key = getAnalyzerEnabledSettingKey();
        try {
            this.setEnabled(settings.getBoolean(key, true));
        } catch (InvalidSettingException ex) {
            final String msg = String.format("Invalid setting for property '%s'", key);
            LOGGER.warn(msg);
            LOGGER.debug(msg, ex);
        }
    }
1113056
private void populateRecurringTask(Record record, RecurringTask task) throws MPXJException
   {
      //System.out.println(record);
      task.setStartDate(record.getDateTime(1));
      task.setFinishDate(record.getDateTime(2));
      task.setDuration(RecurrenceUtility.getDuration(m_projectFile.getProjectProperties(), record.getInteger(3), record.getInteger(4)));
      task.setOccurrences(record.getInteger(5));
      task.setRecurrenceType(RecurrenceUtility.getRecurrenceType(record.getInteger(6)));
      task.setUseEndDate(NumberHelper.getInt(record.getInteger(8)) == 1);
      task.setWorkingDaysOnly(NumberHelper.getInt(record.getInteger(9)) == 1);
      task.setWeeklyDaysFromBitmap(RecurrenceUtility.getDays(record.getString(10)), RecurrenceUtility.RECURRING_TASK_DAY_MASKS);

      RecurrenceType type = task.getRecurrenceType();
      if (type != null)
      {
         switch (task.getRecurrenceType())
         {
            case DAILY:
            {
               task.setFrequency(record.getInteger(13));
               break;
            }

            case WEEKLY:
            {
               task.setFrequency(record.getInteger(14));
               break;
            }

            case MONTHLY:
            {
               task.setRelative(NumberHelper.getInt(record.getInteger(11)) == 1);
               if (task.getRelative())
               {
                  task.setFrequency(record.getInteger(17));
                  task.setDayNumber(record.getInteger(15));
                  task.setDayOfWeek(RecurrenceUtility.getDay(record.getInteger(16)));
               }
               else
               {
                  task.setFrequency(record.getInteger(19));
                  task.setDayNumber(record.getInteger(18));
               }
               break;
            }

            case YEARLY:
            {
               task.setRelative(NumberHelper.getInt(record.getInteger(12)) != 1);
               if (task.getRelative())
               {
                  task.setDayNumber(record.getInteger(20));
                  task.setDayOfWeek(RecurrenceUtility.getDay(record.getInteger(21)));
                  task.setMonthNumber(record.getInteger(22));
               }
               else
               {
                  task.setYearlyAbsoluteFromDate(record.getDateTime(23));
               }
               break;
            }
         }
      }

      //System.out.println(task);
   }
26363
protected void addDefaults() {
    try {
      Parser.CNode.addIdentifier("inner", InnerJoinRecordReader.class);
      Parser.CNode.addIdentifier("outer", OuterJoinRecordReader.class);
      Parser.CNode.addIdentifier("override", OverrideRecordReader.class);
      Parser.WNode.addIdentifier("tbl", WrappedRecordReader.class);
    } catch (NoSuchMethodException e) {
      throw new RuntimeException("FATAL: Failed to init defaults", e);
    }
  }
805278
public void setMapperProperties(Properties properties) {
        if (this.mapperHelper == null) {
            this.mapperHelper = new MapperHelper();
        }
        this.mapperHelper.setProperties(properties);
    }
520669
public void init(Object parent, Object record)
    {
        m_parent = parent;
        this.setOpaque(false);
        
        if (this.getBaseApplet() != null)
        {
            String strScreenDesc = this.getScreenDesc();
            this.getBaseApplet().setStatusText(strScreenDesc);   // Display screen desc or clear screen desc.
            if (strScreenDesc != null)
                if (this.getTargetScreen(JBaseFrame.class) != null)
                    ((JBaseFrame)this.getTargetScreen(JBaseFrame.class)).setTitle(strScreenDesc);
        }
    }
940636
public void setConfiguration( Dictionary<?,?> properties ) {

		// Ignore iPojo properties
		final List<String> propertiesToSkip = Arrays.asList(
				"component",
				"felix.fileinstall.filename" );

		// Convert the dictionary into a map
		Map<String,String> map = new LinkedHashMap<> ();
		for( Enumeration<?> en = properties.keys(); en.hasMoreElements(); ) {

			Object key = en.nextElement();
			String keyAsString = String.valueOf( key );
			if( propertiesToSkip.contains( keyAsString ))
				continue;

			// "null" are not acceptable values in dictionaries
			// (OSGi often use Hash tables)
			Object value = properties.get( key );
			map.put( keyAsString, String.valueOf( value ));
		}

		// Invoked by iPojo => the messaging type is the right one in this method
		map.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, FACTORY_RABBITMQ );
		setConfiguration( map );
	}
721851
public static void configure(Properties props) {
        Properties defaultProperties = new Properties();

        HashMap<String, Properties> driversProps = new HashMap<>();
        for (Enumeration<?> enumeration = props.propertyNames(); enumeration.hasMoreElements();) {
            String propertyName = (String) enumeration.nextElement();
            String value = props.getProperty(propertyName);
            int idx = propertyName.lastIndexOf('.');
            if (idx < 0) {
                defaultProperties.put(propertyName, value);
            } else {
                String prefix = propertyName.substring(0, idx);
                String name = propertyName.substring(idx + 1);
                Properties driverProperties = driversProps.get(prefix);
                if (driverProperties == null) {
                    driverProperties = new Properties();
                    driversProps.put(prefix, driverProperties);
                }
                driverProperties.put(name, value);
            }
        }

        // Merge with default properties
        Map<String, Driver> newInstances = new HashMap<>();
        for (Entry<String, Properties> entry : driversProps.entrySet()) {
            String name = entry.getKey();
            Properties properties = new Properties();
            properties.putAll(defaultProperties);
            properties.putAll(entry.getValue());
            newInstances.put(name, createDriver(name, properties));
        }
        if (newInstances.get(DEFAULT_INSTANCE_NAME) == null
                && Parameters.REMOTE_URL_BASE.getValue(defaultProperties) != null) {

            newInstances.put(DEFAULT_INSTANCE_NAME, createDriver(DEFAULT_INSTANCE_NAME, defaultProperties));
        }

        instances = new IndexedInstances(newInstances);
    }
974715
public static void setProperties(SystemStoreClient<String, String> versionStore,
                                     Properties props) {
        if (props == null) {
            logger.info("Ignoring set for empty properties");
            return;
        }

        try {
            String versionString = getPropertiesString(props);
            versionStore.putSysStore(SystemStoreConstants.VERSIONS_METADATA_KEY,
                                     versionString);
        } catch(Exception e) {
            logger.info("Got exception in setting properties : ", e);
        }
    }
1167797
public void setMethodDefaults(String method)
  {
        String defaultMethod = m_properties.getProperty(OutputKeys.METHOD);
 
        if((null == defaultMethod) || !defaultMethod.equals(method)
         // bjm - add the next condition as a hack
         // but it is because both output_xml.properties and
         // output_unknown.properties have the same method=xml
         // for their default. Otherwise we end up with
         // a ToUnknownStream wraping a ToXMLStream even
         // when the users says method="xml"
         //
         || defaultMethod.equals("xml")
         )
        {
            Properties savedProps = m_properties;
            Properties newDefaults = 
                OutputPropertiesFactory.getDefaultMethodProperties(method);
            m_properties = new Properties(newDefaults);
            copyFrom(savedProps, false);
        }
  }