Java 类javax.swing.event.TableColumnModelListener 实例源码

项目:universal-java-matrix-package    文件:DefaultTableColumnModel64.java   
protected void fireColumnMarginChanged() {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener64.class) {

            if (changeEvent == null) {
                changeEvent = new ChangeEvent(this);
            }
            ((TableColumnModelListener64) listeners[i + 1]).columnMarginChanged(changeEvent);
        } else if (listeners[i] == TableColumnModelListener.class) {

            if (changeEvent == null) {
                changeEvent = new ChangeEvent(this);
            }
            ((TableColumnModelListener) listeners[i + 1]).columnMarginChanged(changeEvent);
        }
    }
}
项目:AppWoksUtils    文件:ExtColumnModel.java   
/**
 * @param columnModel
 */
public ExtColumnModel(final TableColumnModel org) {
    super();
    this.setColumnMargin(org.getColumnMargin());
    this.setColumnSelectionAllowed(org.getColumnSelectionAllowed());
    this.setSelectionModel(org.getSelectionModel());
    for (int i = 0; i < org.getColumnCount(); i++) {
        this.addColumn(org.getColumn(i));
    }
    if (org instanceof DefaultTableColumnModel) {
        for (final TableColumnModelListener cl : ((DefaultTableColumnModel) org).getColumnModelListeners()) {
            this.addColumnModelListener(cl);
        }
    }

}
项目:findbugs-all-the-bugs    文件:SorterTableColumnModel.java   
public void moveColumn(int fromIndex, int toIndex) {

        if (!MainFrame.getInstance().canNavigateAway())
            return;
        MainFrame.getInstance().updateDesignationDisplay();
        TableColumn from = columnList.get(fromIndex);
        TableColumn to = columnList.get(toIndex);

        columnList.set(fromIndex, to);
        to.setModelIndex(fromIndex);

        columnList.set(toIndex, from);
        from.setModelIndex(toIndex);

        orderUpdate();

        for (TableColumnModelListener w : new ArrayList<TableColumnModelListener>(watchers)) {
            w.columnMoved(new TableColumnModelEvent(this, fromIndex, toIndex));
        }
    }
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
protected void fireColumnAdded(TableColumnModelEvent e) {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener.class) {
            ((TableColumnModelListener) listeners[i + 1]).columnAdded(e);
        }
    }
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
protected void fireColumnRemoved(TableColumnModelEvent e) {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener.class) {
            ((TableColumnModelListener) listeners[i + 1]).columnRemoved(e);
        }
    }
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
protected void fireColumnMoved(TableColumnModelEvent e) {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener.class) {
            ((TableColumnModelListener) listeners[i + 1]).columnMoved(e);
        }
    }
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
protected void fireColumnSelectionChanged(ListSelectionEvent e) {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener.class) {
            ((TableColumnModelListener) listeners[i + 1]).columnSelectionChanged(e);
        }
    }
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
protected void fireColumnMarginChanged() {
    Object[] listeners = listenerList.getListenerList();
    ChangeEvent changeEvent = null;
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == TableColumnModelListener.class) {
            if (changeEvent == null)
                changeEvent = new ChangeEvent(this);
            ((TableColumnModelListener) listeners[i + 1])
                    .columnMarginChanged(changeEvent);
        }
    }
}
项目:javify    文件:DefaultTableColumnModel.java   
/**
 * Sends a {@link ChangeEvent} to the model's registered listeners to
 * indicate that the column margin was changed.
 *
 * @see #setColumnMargin(int)
 */
protected void fireColumnMarginChanged()
{
  EventListener[] listeners = getListeners(TableColumnModelListener.class);
  if (changeEvent == null && listeners.length > 0)
    changeEvent = new ChangeEvent(this);
  for (int i = 0; i < listeners.length; ++i)
    ((TableColumnModelListener) listeners[i]).columnMarginChanged(changeEvent);
}
项目:jvm-stm    文件:DefaultTableColumnModel.java   
/**
 * Sends a {@link ChangeEvent} to the model's registered listeners to 
 * indicate that the column margin was changed.  
 * 
 * @see #setColumnMargin(int)
 */
protected void fireColumnMarginChanged()
{
  EventListener[] listeners = getListeners(TableColumnModelListener.class);
  if (changeEvent == null && listeners.length > 0)
    changeEvent = new ChangeEvent(this);
  for (int i = 0; i < listeners.length; ++i)
    ((TableColumnModelListener) listeners[i]).columnMarginChanged(changeEvent);
}
项目:swingx    文件:ColumnControlButton.java   
/**
 * Returns the listener to table's column model. The listener is 
 * lazily created if necessary. 
 * @return the <code>TableColumnModelListener</code> for use with the 
 *  table's column model, guaranteed to be not <code>null</code>.
 */
protected TableColumnModelListener getColumnModelListener() {
    if (columnModelListener == null) {
        columnModelListener = createColumnModelListener();
    }
    return columnModelListener;
}
项目:swingx    文件:DefaultTableColumnModelExt.java   
/**
 * {@inheritDoc} <p>
 * 
 * Overridden to uninstall enhanced notification of listeners of type.
 * TableColumnModelListenerExt about property changes of contained columns.
 */
@Override
public void removeColumnModelListener(TableColumnModelListener x) {
    super.removeColumnModelListener(x);
    if (x instanceof TableColumnModelExtListener) {
        listenerList.remove(TableColumnModelExtListener.class, (TableColumnModelExtListener) x);
    }
}
项目:universal-java-matrix-package    文件:DefaultTableColumnModel64.java   
public void addColumnModelListener(TableColumnModelListener x) {
    if (x instanceof TableColumnModelListener64) {
        super.addColumnModelListener(x);
    } else {
        throw new IllegalArgumentException("use TableColumnModelListener64");
    }
}
项目:universal-java-matrix-package    文件:DefaultTableColumnModel64.java   
public void removeColumnModelListener(TableColumnModelListener x) {
    if (x instanceof TableColumnModelListener64) {
        super.removeColumnModelListener(x);
    } else {
        throw new IllegalArgumentException("use TableColumnModelListener64");
    }
}
项目:metasfresh    文件:CColumnControlButton.java   
/**
 * Returns the listener to table's column model. The listener is lazily created if necessary.
 * 
 * @return the <code>TableColumnModelListener</code> for use with the table's column model, guaranteed to be not <code>null</code>.
 */
private TableColumnModelListener getColumnModelListener()
{
    if (columnModelListener == null)
    {
        columnModelListener = createColumnModelListener();
    }
    return columnModelListener;
}
项目:JBroTable    文件:JBroTableColumnModel.java   
@Override
public void propertyChange( PropertyChangeEvent e ) {
  String name = e.getPropertyName();
  if ( ( "width".equals( name ) || "preferredWidth".equals( name ) ) && table.getAutoResizeMode() != JTable.AUTO_RESIZE_ALL_COLUMNS && e.getSource() instanceof JBroTableColumn && e.getNewValue() instanceof Integer && e.getOldValue() instanceof Integer ) {
    if ( ( ( Integer )e.getNewValue() ).intValue() == ( Integer )e.getOldValue() )
      return;
    totalColumnWidth = -1;
    Object listeners[] = listenerList.getListenerList();
    WidthChangeEvent changeEvent = new WidthChangeEvent( this, ( JBroTableColumn )e.getSource(), ( Integer )e.getOldValue(), ( Integer )e.getNewValue(), "preferredWidth".equals( name ) );
    for ( int i = listeners.length - 2; i >= 0; i -= 2 )
      if ( listeners[ i ] == TableColumnModelListener.class )
        ( ( TableColumnModelListener )listeners[ i + 1 ] ).columnMarginChanged( changeEvent );
  } else
    super.propertyChange( e );
}
项目:aibench-project    文件:ColumnControlButton.java   
/**
 * Returns the listener to table's column model. The listener is 
 * lazily created if necessary. 
 * @return the <code>TableColumnModelListener</code> for use with the 
 *  table's column model, guaranteed to be not <code>null</code>.
 */
protected TableColumnModelListener getColumnModelListener() {
    if (columnModelListener == null) {
        columnModelListener = createColumnModelListener();
    }
    return columnModelListener;
}
项目:aibench-project    文件:DefaultTableColumnModelExt.java   
/**
 * {@inheritDoc} <p>
 * 
 * Overridden to uninstall enhanced notification of listeners of type.
 * TableColumnModelListenerExt about property changes of contained columns.
 */
@Override
public void removeColumnModelListener(TableColumnModelListener x) {
    super.removeColumnModelListener(x);
    if (x instanceof TableColumnModelExtListener) {
        listenerList.remove(TableColumnModelExtListener.class, (TableColumnModelExtListener) x);
    }
}
项目:cn1    文件:DefaultTableColumnModelTest.java   
public void testAddRemoveGetTableColumnModelListener() throws Exception {
    assertEquals(0, model.getColumnModelListeners().length);
    TableColumnModelListener listener = new TestTableColumnModelListener();
    model.addColumnModelListener(listener);
    model.addColumnModelListener(new TestTableColumnModelListener());
    assertEquals(2, model.getColumnModelListeners().length);
    model.removeColumnModelListener(listener);
    assertEquals(1, model.getColumnModelListeners().length);
}
项目:JamVM-PH    文件:DefaultTableColumnModel.java   
/**
 * Sends a {@link ChangeEvent} to the model's registered listeners to 
 * indicate that the column margin was changed.  
 * 
 * @see #setColumnMargin(int)
 */
protected void fireColumnMarginChanged()
{
  EventListener[] listeners = getListeners(TableColumnModelListener.class);
  if (changeEvent == null && listeners.length > 0)
    changeEvent = new ChangeEvent(this);
  for (int i = 0; i < listeners.length; ++i)
    ((TableColumnModelListener) listeners[i]).columnMarginChanged(changeEvent);
}
项目:classpath    文件:DefaultTableColumnModel.java   
/**
 * Sends a {@link ChangeEvent} to the model's registered listeners to
 * indicate that the column margin was changed.
 *
 * @see #setColumnMargin(int)
 */
protected void fireColumnMarginChanged()
{
  EventListener[] listeners = getListeners(TableColumnModelListener.class);
  if (changeEvent == null && listeners.length > 0)
    changeEvent = new ChangeEvent(this);
  for (int i = 0; i < listeners.length; ++i)
    ((TableColumnModelListener) listeners[i]).columnMarginChanged(changeEvent);
}
项目:freeVM    文件:DefaultTableColumnModelTest.java   
public void testAddRemoveGetTableColumnModelListener() throws Exception {
    assertEquals(0, model.getColumnModelListeners().length);
    TableColumnModelListener listener = new TestTableColumnModelListener();
    model.addColumnModelListener(listener);
    model.addColumnModelListener(new TestTableColumnModelListener());
    assertEquals(2, model.getColumnModelListeners().length);
    model.removeColumnModelListener(listener);
    assertEquals(1, model.getColumnModelListeners().length);
}
项目:freeVM    文件:DefaultTableColumnModelTest.java   
public void testAddRemoveGetTableColumnModelListener() throws Exception {
    assertEquals(0, model.getColumnModelListeners().length);
    TableColumnModelListener listener = new TestTableColumnModelListener();
    model.addColumnModelListener(listener);
    model.addColumnModelListener(new TestTableColumnModelListener());
    assertEquals(2, model.getColumnModelListeners().length);
    model.removeColumnModelListener(listener);
    assertEquals(1, model.getColumnModelListeners().length);
}
项目:VisualDCT    文件:SpreadsheetColumnViewModel.java   
public void addColumnModelListener(TableColumnModelListener x) {
    columnModel.addColumnModelListener(x);
}
项目:VisualDCT    文件:SpreadsheetColumnViewModel.java   
public void removeColumnModelListener(TableColumnModelListener x) {
    columnModel.removeColumnModelListener(x);
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
public void addColumnModelListener(TableColumnModelListener x) {
    listenerList.add(TableColumnModelListener.class, x);
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
public void removeColumnModelListener(TableColumnModelListener x) {
    listenerList.remove(TableColumnModelListener.class, x);
}
项目:j2se_for_android    文件:DefaultTableColumnModel.java   
public TableColumnModelListener[] getColumnModelListeners() {
    return listenerList.getListeners(TableColumnModelListener.class);
}
项目:JBroTable    文件:JBroTableColumnModel.java   
@Override
public void addColumnModelListener( TableColumnModelListener x ) {
  JBroTableColumnModel.this.addColumnModelListener( x );
}
项目:JBroTable    文件:JBroTableColumnModel.java   
@Override
public void removeColumnModelListener( TableColumnModelListener x ) {
  JBroTableColumnModel.this.removeColumnModelListener( x );
}
项目:platypus-js    文件:InsettedColumnModel.java   
/**
 * {@inheritDoc}
 */
@Override
public void addColumnModelListener(TableColumnModelListener l) {
    listeners.add(l);
}
项目:platypus-js    文件:InsettedColumnModel.java   
/**
 * {@inheritDoc}
 */
@Override
public void removeColumnModelListener(TableColumnModelListener l) {
    listeners.remove(l);
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
/**
 * {@inheritDoc}
 */
@Override
public void addColumnModelListener(TableColumnModelListener l) {
    listeners.add(l);
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
/**
 * {@inheritDoc}
 */
@Override
public void removeColumnModelListener(TableColumnModelListener l) {
    listeners.remove(l);
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
protected void fireColumnSelectionChanged(ListSelectionEvent e) {
    for(TableColumnModelListener l : listeners.toArray(new TableColumnModelListener[]{})){
        l.columnSelectionChanged(e);
    }
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
public void fireColumnMarginChanged(int aMargin) {
    ChangeEvent event = new ChangeEvent(this);
    for(TableColumnModelListener l : listeners.toArray(new TableColumnModelListener[]{})){
        l.columnMarginChanged(event);
    }
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
protected void fireColumnRemoved(int aPosition) {
    TableColumnModelEvent event = new TableColumnModelEvent(this, aPosition, 0);
    for(TableColumnModelListener l : listeners.toArray(new TableColumnModelListener[]{})){
        l.columnRemoved(event);
    }
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
protected void fireColumnAdded(int aPosition) {
    TableColumnModelEvent event = new TableColumnModelEvent(this, 0, aPosition);
    for(TableColumnModelListener l : listeners.toArray(new TableColumnModelListener[]{})){
        l.columnAdded(event);
    }
}
项目:platypus-js    文件:ConstrainedColumnModel.java   
protected void fireColumnMoved(int sourceIndex, int destIndex) {
    TableColumnModelEvent event = new TableColumnModelEvent(this, sourceIndex, destIndex);
    for(TableColumnModelListener l : listeners.toArray(new TableColumnModelListener[]{})){
        l.columnMoved(event);
    }
}
项目:cn1    文件:DefaultTableColumnModel.java   
public void addColumnModelListener(final TableColumnModelListener listener) {
    listenerList.add(TableColumnModelListener.class, listener);
}