Class MultiScalarTableViewer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
fr.esrf.tangoatk.widget.attribute.MultiScalarTableViewer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable
Direct Known Subclasses:
MultiAttAndCmdTableViewer

public class MultiScalarTableViewer extends JTable
A MultiScalarTableViewer is a Swing JTable which displays the "read value" of several scalar attributes each of them in one cell of the table. The table cells are not editable, but a double click on any cell will display a panel to set the attribute value only if the attribute is writable.
See Also:
  • Field Details

  • Constructor Details

    • MultiScalarTableViewer

      public MultiScalarTableViewer()
  • Method Details

    • getCellRenderer

      public TableCellRenderer getCellRenderer(int row, int column)
      Overrides:
      getCellRenderer in class JTable
    • getCellEditor

      public TableCellEditor getCellEditor(int row, int column)
      Overrides:
      getCellEditor in class JTable
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Overrides:
      isCellEditable in class JTable
    • getPanelBackground

      public Color getPanelBackground()
    • setPanelBackground

      public void setPanelBackground(Color bg)
    • getNbRows

      public int getNbRows()
      getNbRows returns the number of rows
      Returns:
      a int[] Number of rows
    • setNbRows

      public void setNbRows(int nr)
      setNbRows sets the number of rows. The number of rows can only be set when there is no attribute model for the viewer. No call to setModelAt yet.
      Parameters:
      nr - Number of rows
    • getNbColumns

      public int getNbColumns()
      getNbColumns returns the number of columns
      Returns:
      a int[] Number of columns
    • setNbColumns

      public void setNbColumns(int nc)
      setNbColumns sets the number of columns. The number of columns can only be set when there is no attribute model for the viewer. No call to setModelAt yet.
      Parameters:
      nc - Number of columns
    • getColumnIdents

      public String[] getColumnIdents()
      getColumnIdents returns a String Array corresponding to the column identifiers
      Returns:
      a String[] value
    • setColumnIdents

      public void setColumnIdents(String[] colIds)
      setColumnIdents sets the table's column identifiers The size of the colIds array must be exactly the same as the number of columns for the attribute models.If the attribute model is not set yet the size of the colIds will change the nbColumns property as well.
      Parameters:
      colIds - Column Ids
    • getRowIdents

      public String[] getRowIdents()
      getRowIdents returns a String Array corresponding to the row identifiers
      Returns:
      a String[] value
    • setRowIdents

      public void setRowIdents(String[] rowIds)
      setRowIdents sets the table's row identifiers The RowIdents can only be set when there is no attribute model for the viewer. No call to setModelAt yet.If the attribute model is not set yet the size of the rowIds will change the nbRow sproperty as well.
      Parameters:
      rowIds - Row ids
    • getAlarmEnabled

      public boolean getAlarmEnabled()
      getAlarmEnabled returns a boolean : true if the quality factor is displayed in the scalarviewers
      Returns:
      a boolean value
    • setAlarmEnabled

      public void setAlarmEnabled(boolean alarm)
      setAlarmEnabled sets the quality factor display to on or off
      Parameters:
      alarm - boolean if true the attribute quality factor will be displayed as the background colour of the cell
    • getUnitVisible

      public boolean getUnitVisible()
      Detemines whether the unit is visible
      Returns:
      true if unit is visible
    • setUnitVisible

      public void setUnitVisible(boolean b)
      Displays or hides the unit.
      Parameters:
      b - true to display the unit, false otherwise
    • getRowIdCellRenderer

      public JLabel getRowIdCellRenderer()
    • getEntityModels

      public fr.esrf.tangoatk.core.IEntity[][] getEntityModels()
    • setModelAt

      public void setModelAt(fr.esrf.tangoatk.core.IAttribute iatt, int r, int c)
    • clearModelAt

      public void clearModelAt(int r, int c)
    • clearModel

      public void clearModel()
    • initAttModels

      protected void initAttModels()
    • initColumnHeaderRenderers

      protected void initColumnHeaderRenderers()
    • main

      public static void main(String[] args)