Package gov.nasa.arc.mct.table.model

Examples of gov.nasa.arc.mct.table.model.ComponentTableModel


  @Override
  public Integer getCellFontStyle() {
    if (isSelectionContainsEmptyCells()) {
      return null;
    }
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
    if (isSingleCellSelection()) {
      AbstractComponent component = (AbstractComponent) model.getStoredValueAt(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      String id = tableModel.getKey(component);
      TableCellSettings settings = tableModel.getCellSettings(id);
      return Integer.valueOf(settings.getFontStyle());
    }
    Integer defaultFontStyle = TableFormattingConstants.defaultFontStyle;
    Integer commonCellFontStyle = null;
    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        Integer aCellFontStyle = settings.getFontStyle();
        // determine default decimal places
        if (aCellFontStyle == null) {
          aCellFontStyle = defaultFontStyle;
        }
View Full Code Here


  @Override
  public Integer getCellFontTextAttribute() {
    if (isSelectionContainsEmptyCells()) {
      return null;
    }
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
    if (isSingleCellSelection()) {
      AbstractComponent component = (AbstractComponent) model.getStoredValueAt(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      String id = tableModel.getKey(component);
      TableCellSettings settings = tableModel.getCellSettings(id);
      return Integer.valueOf(settings.getTextAttributeUnderline());
    }
    Integer defaultFontTextAttribute = TableFormattingConstants.UNDERLINE_OFF;
    Integer commonCellFontTextAttribute = null;
    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        Integer aCellFontTextAttribute = settings.getTextAttributeUnderline();
        // determine default decimal places
        if (aCellFontTextAttribute == null) {
          aCellFontTextAttribute = defaultFontTextAttribute;
        }
View Full Code Here

      super.setBackground(background);
    }

    /* Set up a border for the drawn component */
    assert table.getModel() instanceof ComponentTableModel;
    ComponentTableModel m = ComponentTableModel.class.cast(table.getModel());
    AbstractComponent comp = (AbstractComponent)m.getStoredValueAt(row, column);
    Color cellBackgroundColor = null;
    Font cellFont = table.getFont();
    setFont(cellFont);
    if (comp != null)  {
      TableCellSettings s = m.getCellSettings(m.getKey(comp));
      if (s.getCellFont() != null) {
        cellFont = new Font(s.getCellFont().name(),s.getFontStyle(),s.getFontSize());
      }
      if (s.getTextAttributeUnderline() == TextAttribute.UNDERLINE_ON) {
        cellFont = cellFont.deriveFont(TableFormattingConstants.underlineMap);
View Full Code Here

    return commonCellFontTextAttribute;
  }
 
  @Override
  public void setDecimalPlaces(ComboBoxModel comboBoxModel) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setNumberOfDecimals(Integer.class.cast(comboBoxModel.getSelectedItem()).intValue());
      }
    }
   
    tableModel.updateDecimalsForColumns();
    manifestation.saveCellSettings();
  }
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellFont(ComboBoxModel comboBoxModel) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setCellFont(JVMFontFamily.class.cast(comboBoxModel.getSelectedItem()));
       
      }
    }
    manifestation.saveCellSettings();
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellFontColor(Color fontColor) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setForegroundColor(fontColor);
       
      }
    }
    manifestation.saveCellSettings();
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellBackgroundColor(Color backgroundColor) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setBackgroundColor(backgroundColor);
       
      }
    }
    manifestation.saveCellSettings();
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellFontSize(int fontSize) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setFontSize(fontSize);
      }
    }
    manifestation.saveCellSettings();
  }
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellFontStyle(int fontStyle) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setFontStyle(fontStyle);
      }
    }
    manifestation.saveCellSettings();
  }
View Full Code Here

    manifestation.saveCellSettings();
  }
 
  @Override
  public void setCellFontTextAttribute(int fontStyle) {
    ComponentTableModel tableModel = ComponentTableModel.class.cast(model);

    for (Integer row : table.getSelectedRows()) {
      for (Integer col : table.getSelectedColumns()) {
        AbstractComponent component = (AbstractComponent) model.getStoredValueAt(row, col);
        if (component == null) continue; // component-less cells
        String id = tableModel.getKey(component);
        TableCellSettings settings = tableModel.getCellSettings(id);
        settings.setTextAttributeUnderline(fontStyle);
      }
    }
    manifestation.saveCellSettings();
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.table.model.ComponentTableModel

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.