Example usage for javax.swing.event ChangeEvent ChangeEvent

List of usage examples for javax.swing.event ChangeEvent ChangeEvent

Introduction

In this page you can find the example usage for javax.swing.event ChangeEvent ChangeEvent.

Prototype

public ChangeEvent(Object source) 

Source Link

Document

Constructs a ChangeEvent object.

Usage

From source file:org.nuclos.client.relation.EntityRelationshipModelEditPanel.java

public void fireChangeListenEvent() {
    for (ChangeListener cl : lstChangeListener) {
        cl.stateChanged(new ChangeEvent(this));
    }/*w  ww  .  j  a va  2s  . co  m*/
}

From source file:org.nuclos.client.ui.collect.model.SortableCollectableTableModelImpl.java

private synchronized void fireSortingChanged() {
    final ChangeEvent ev = new ChangeEvent(this);
    for (ChangeListener listener : lstSortingListeners) {
        listener.stateChanged(ev);//from   www  .j  a  va2s.c om
    }
}

From source file:org.nuclos.client.ui.collect.SubForm.java

/**
 * fires a <code>ChangeEvent</code> whenever the model of this <code>SubForm</code> changes.
 *///from   www. j av  a  2s.c  o m
public synchronized void fireStateChanged() {
    if (layer == null || (layer != null && !((LockableUI) layer.getUI()).isLocked())) {
        final ChangeEvent ev = new ChangeEvent(this);
        if (!isDetailsChangedIgnored()) {
            for (ChangeListener changelistener : lstchangelistener) {
                changelistener.stateChanged(ev);
            }
        }
    }
}

From source file:org.nuclos.client.ui.collect.SubForm.java

/**
 * fires a <code>ChangeEvent</code> whenever the model of this <code>SubForm</code> changes.
 *///from w w w.j a va  2  s.c  om
private synchronized void fireParameterChanged() {
    if (layer == null || (layer != null && !((LockableUI) layer.getUI()).isLocked())) {
        final ChangeEvent ev = new ChangeEvent(this);
        for (ChangeListener changelistener : parameterListener) {
            changelistener.stateChanged(ev);
        }
    }
}

From source file:org.nuclos.client.ui.resplan.header.JHeaderGrid.java

protected void fireStateChanged() {
    ChangeEvent changeEvent = null;
    for (ChangeListener listener : listenerList.getListeners(ChangeListener.class)) {
        if (changeEvent == null) {
            changeEvent = new ChangeEvent(this);
        }//from w  w w.jav a2  s.  c om
        listener.stateChanged(changeEvent);
    }
}

From source file:org.openconcerto.task.TodoListPanel.java

private void initTable(int mode) {
    this.t.setBlockRepaint(true);

    this.t.setBlockEventOnColumn(true);
    this.model.setMode(mode);

    this.t.getColumnModel().getColumn(0).setCellRenderer(this.a);
    this.t.getColumnModel().getColumn(0).setCellEditor(this.a);
    this.t.setBlockEventOnColumn(true);
    setIconForColumn(0, this.iconTache);
    setIconForColumn(1, this.iconPriorite);
    this.t.setBlockEventOnColumn(true);

    this.t.getColumnModel().getColumn(1).setCellEditor(this.iconEditor);
    final JTextField textField = new JTextField() {
        @Override// www. ja v a 2  s  .co m
        public void paint(Graphics g) {
            super.paint(g);
            g.setColor(TodoListPanel.this.t.getGridColor());
            g.fillRect(getWidth() - 19, 0, 1, getHeight());
            g.setColor(new Color(250, 250, 250));
            g.fillRect(getWidth() - 18, 0, 18, getHeight());
            g.setColor(Color.BLACK);
            for (int i = 0; i < 3; i++) {
                int x = getWidth() - 14 + i * 4;
                int y = getHeight() - 5;
                g.fillRect(x, y, 1, 2);
            }
        }
    };
    textField.setBorder(BorderFactory.createEmptyBorder());
    final DefaultCellEditor defaultCellEditor = new DefaultCellEditor(textField);
    textField.addMouseListener(new MouseListener() {

        public void mouseClicked(MouseEvent e) {

        }

        public void mouseEntered(MouseEvent e) {
            // TODO Auto-generated method stub

        }

        public void mouseExited(MouseEvent e) {
            // TODO Auto-generated method stub

        }

        public void mousePressed(MouseEvent e) {

        }

        public void mouseReleased(MouseEvent e) {
            if (e.getX() > textField.getWidth() - 19) {
                TodoListElement l = getTaskAt(
                        SwingUtilities.convertPoint(e.getComponent(), e.getPoint(), TodoListPanel.this.t));
                TodoListPanel.this.t.editingCanceled(new ChangeEvent(this));
                JFrame f = new JFrame(TM.tr("details"));
                f.setContentPane(new TodoListElementEditorPanel(l));
                f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                f.setSize(500, 200);
                f.setLocation(50, e.getYOnScreen() + TodoListPanel.this.t.getRowHeight());
                f.setVisible(true);
            }

        }
    });
    this.t.getColumnModel().getColumn(2).setCellEditor(defaultCellEditor);
    this.t.getColumnModel().getColumn(3).setMaxWidth(300);
    this.t.getColumnModel().getColumn(3).setMinWidth(100);

    this.timestampTableCellEditorCreated.stopCellEditing();
    this.timestampTableCellEditorDone.stopCellEditing();
    this.timestampTableCellEditorDeadLine.stopCellEditing();

    if (this.model.getMode() == TodoListModel.EXTENDED_MODE) {
        this.t.getColumnModel().getColumn(3).setCellRenderer(this.timestampTableCellRendererCreated);
        this.t.getColumnModel().getColumn(3).setCellEditor(this.timestampTableCellEditorCreated);

        this.t.getColumnModel().getColumn(4).setCellRenderer(this.timestampTableCellRendererDone);
        this.t.getColumnModel().getColumn(4).setCellEditor(this.timestampTableCellEditorDone);

        this.t.getColumnModel().getColumn(5).setCellRenderer(this.timestampTableCellRendererDeadLine);
        this.t.getColumnModel().getColumn(5).setCellEditor(this.timestampTableCellEditorDeadLine);
    } else {
        this.t.getColumnModel().getColumn(3).setCellRenderer(this.timestampTableCellRendererDeadLine);
        this.t.getColumnModel().getColumn(3).setCellEditor(this.timestampTableCellEditorDeadLine);
    }

    final TableColumn userColumn = this.t.getColumnModel()
            .getColumn(this.t.getColumnModel().getColumnCount() - 1);
    userColumn.setCellRenderer(this.userTableCellRenderer);
    userColumn.setMaxWidth(150);
    userColumn.setMinWidth(100);
    t.setEnabled(false);
    initUserCellEditor(userColumn);

    this.t.setBlockEventOnColumn(false);
    this.t.setBlockRepaint(false);
    this.t.getColumnModel().getColumn(1).setCellRenderer(this.iconRenderer);
    // Better look
    this.t.setShowHorizontalLines(false);
    this.t.setGridColor(new Color(230, 230, 230));
    this.t.setRowHeight(new JTextField(" ").getPreferredSize().height + 4);
    AlternateTableCellRenderer.UTILS.setAllColumns(this.t);
    this.t.repaint();

}

From source file:org.openconcerto.task.TodoListPanel.java

private void removeUserListenerId(int id) {
    this.t.editingCanceled(new ChangeEvent(this));
    this.model.removeIdListener(Integer.valueOf(id));
}

From source file:org.pentaho.reporting.designer.core.util.dnd.ClipboardManager.java

private void fireContentsChanged() {
    final ChangeListener[] changeListeners = listeners.getListeners(ChangeListener.class);
    final ChangeEvent event = new ChangeEvent(this);

    for (int i = 0; i < changeListeners.length; i++) {
        final ChangeListener changeListener = changeListeners[i];
        changeListener.stateChanged(event);
    }/*ww  w  .  j  a  va 2  s  . com*/
}

From source file:org.pentaho.reporting.designer.core.util.undo.UndoManager.java

private void fireChangeEvent() {
    final ChangeListener[] changeListeners = undoListeners.getListeners(ChangeListener.class);
    final ChangeEvent event = new ChangeEvent(this);
    for (int i = 0; i < changeListeners.length; i++) {
        final ChangeListener listener = changeListeners[i];
        listener.stateChanged(event);/*from   www  . j  a  v  a2s .c  o m*/
    }
}

From source file:org.pentaho.reporting.libraries.designtime.swing.date.DateCellEditor.java

protected void fireEditingCanceled() {
    final CellEditorListener[] listeners = this.listeners.getListeners(CellEditorListener.class);
    final ChangeEvent event = new ChangeEvent(this);
    for (int i = 0; i < listeners.length; i++) {
        final CellEditorListener listener = listeners[i];
        listener.editingCanceled(event);
    }//from   w w  w . jav a 2 s . c  o m
}