Package gov.nasa.arc.mct.components

Examples of gov.nasa.arc.mct.components.ExtendedProperties


    }
   
    @SuppressWarnings("serial")
    @Test
    public void notifyNewTitleFontStyleTest() {
        final ExtendedProperties viewProps = new ExtendedProperties();
        CanvasManifestation canvas1 = new CanvasManifestation(mockComponent,canvasViewInfo) {
            public ExtendedProperties getViewProperties() {
                return viewProps;
            };
        };
View Full Code Here


    }
   
    @SuppressWarnings("serial")
    @Test
    public void notifyNewTitleFontUnderlineTest() {
        final ExtendedProperties viewProps = new ExtendedProperties();
        CanvasManifestation canvas1 = new CanvasManifestation(mockComponent,canvasViewInfo) {
            public ExtendedProperties getViewProperties() {
                return viewProps;
            };
        };
View Full Code Here

    }
   
    @SuppressWarnings("serial")
    @Test
    public void notifyNewTitleFontForegroundColorTest() {
        final ExtendedProperties viewProps = new ExtendedProperties();
        CanvasManifestation canvas1 = new CanvasManifestation(mockComponent,canvasViewInfo) {
            public ExtendedProperties getViewProperties() {
                return viewProps;
            };
        };
View Full Code Here

    }
   
    @SuppressWarnings("serial")
    @Test
    public void notifyNewTitleFontBackgroundColorTest() {
        final ExtendedProperties viewProps = new ExtendedProperties();
        CanvasManifestation canvas1 = new CanvasManifestation(mockComponent,canvasViewInfo) {
            public ExtendedProperties getViewProperties() {
                return viewProps;
            };
        };
View Full Code Here

      component.setOwner("Fred");
   
    // Add view state
    Map<String, ExtendedProperties> viewRoleProperties =
                       new HashMap<String, ExtendedProperties>();
    ExtendedProperties prop = new ExtendedProperties();
    prop.setProperty("viewType1", "properties1");
    viewRoleProperties.put("test1", prop);
    prop.setProperty("viewType2", "properties2");
    viewRoleProperties.put("test2", prop);
    when(persistenceProvider.getAllProperties(id)).thenReturn(viewRoleProperties);
   
    return component;
  }
View Full Code Here

        panelSelectionProvider.fireManifestationChanged();
        return manifestation;
    }
   
    private boolean viewChanged(ViewInfo viewInfo, MCTViewManifestationInfo oldManifestationInfo, MCTViewManifestationInfo newManifestationInfo) {
        ExtendedProperties oldExtProps = CanvasViewStrategy.CANVAS_OWNED.getExistingProperties(oldManifestationInfo, viewInfo);
        ExtendedProperties newExtProps = CanvasViewStrategy.CANVAS_OWNED.getExistingProperties(newManifestationInfo, viewInfo);
        byte[] existingMD5 = getMessageDigest(oldExtProps);
        byte[] newMD5 = getMessageDigest(newExtProps);
       
        if (existingMD5 == null || newExtProps == null)
            return true;
View Full Code Here

    }
  }

  private boolean saveHeaderSettings(boolean orientationChanged) {
    boolean settingsChanged = orientationChanged;
    ExtendedProperties viewProperties = getViewProperties();
    for (int row = 0; row < model.getRowCount(); ++row) {
      String oldLabelAbbreviations = getViewProperties()
          .getProperty("ROW_LABEL_ABBREVIATIONS_" + row, String.class);
      String newLabelAbbreviations = model.getRowLabelAbbreviations(
          row).toString();
      if (orientationChanged || !newLabelAbbreviations.equals(oldLabelAbbreviations)) {
        viewProperties.setProperty(
            "ROW_LABEL_ABBREVIATIONS_" + row,
            newLabelAbbreviations);
        settingsChanged = true;
      }
    }

    for (int col = 0; col < model.getColumnCount(); ++col) {
      String oldLabelAbbreviations = getViewProperties()
          .getProperty("COLUMN_LABEL_ABBREVIATIONS_" + col, String.class);
      String newLabelAbbreviations = model
          .getColumnLabelAbbreviations(col).toString();
      if (orientationChanged || !newLabelAbbreviations.equals(oldLabelAbbreviations)) {
        viewProperties.setProperty(
            "COLUMN_LABEL_ABBREVIATIONS_" + col,
            newLabelAbbreviations);
        settingsChanged = true;
      }
    }
View Full Code Here

  }

  private void saveSettingsToPersistence() {
    boolean settingsChanged = false;
    TableSettings settings = getCurrentTableSettings(table);
    ExtendedProperties viewProperties = getViewProperties();
    for (TableSettings.AvailableSettings setting : TableSettings.AvailableSettings
        .values()) {
      String currentValue = getViewProperties().getProperty(
          setting.name(), String.class);
      String newValue = settings.getValue(setting);
      assert (newValue != null) : "Table setting for "
          + setting.toString() + " has null value";
      if (!newValue.equals(currentValue)) {
        viewProperties.setProperty(setting.name(),
            newValue);
        settingsChanged = true;
      }
    }
View Full Code Here

    String id = model.getKey(component);
    TableCellSettings cellSettings = model.getCellSettings(id);
    String propertyName = "EVALUATOR_" + id;
    String currentValue = getViewProperties().getProperty(
        propertyName, String.class);
    ExtendedProperties viewProperties = getViewProperties();
    if (currentValue == null) {
      currentValue = "";
    }
    String newValue = (cellSettings.getEvaluator() == null) ? ""
        : cellSettings.getEvaluator().getId();
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }

    LabelAbbreviations abbrevs = model.getCellLabelAbbreviations(id);
    propertyName = "LABEL_ABBREVIATIONS_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = abbrevs.toString();
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }

    propertyName = "DECIMAL_PLACES_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = Integer.toString(cellSettings.getNumberOfDecimals());
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }

    propertyName = "ALIGNMENT_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = cellSettings.getAlignment().toString();
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }

    propertyName = "BORDER_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = cellSettings.getCellBorderState().toString();
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "AS_DATE_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
   
    newValue = cellSettings.getDateFormat().toString();
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "FONT_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = cellSettings.getCellFont().name();
    newValue = (newValue == null ? "" : newValue);
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "FONT_SIZE_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = String.valueOf(cellSettings.getFontSize());
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "FONT_COLOR_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = (cellSettings.getForegroundColor() != null ?
        String.valueOf(cellSettings.getForegroundColor().getRGB()) : "");
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "BG_COLOR_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = (cellSettings.getBackgroundColor() != null ?
        String.valueOf(cellSettings.getBackgroundColor().getRGB()) : "");
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "FONT_STYLE_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = String.valueOf(cellSettings.getFontStyle());
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    propertyName = "FONT_UNDERLINE_" + id;
    currentValue = getViewProperties().getProperty(propertyName, String.class);
    if (currentValue == null) {
      currentValue = "";
    }
    newValue = String.valueOf(cellSettings.getTextAttributeUnderline());
    if (!currentValue.equals(newValue)) {
      viewProperties.setProperty(propertyName, newValue);
      settingsChanged = true;
    }
   
    return settingsChanged;
View Full Code Here

        timeBox.setSelected(false);
    }
  }
 
  private void saveColumnVisibilityStates() {   
    ExtendedProperties viewProperties = multiColView.getViewProperties();
    Set<Object> p = viewProperties.getProperty(MultiColView.HIDDEN_COLUMNS_PROP);
    if (p == null) {
      viewProperties.addProperty(MultiColView.HIDDEN_COLUMNS_PROP, "");
      p = viewProperties.getProperty(MultiColView.HIDDEN_COLUMNS_PROP);
    }
    p.clear();
    for (String id : settings.getHiddenColumnIds())
      p.add(id);
    multiColView.getManifestedComponent().save();
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.ExtendedProperties

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.