Package java.beans

Examples of java.beans.PropertyChangeListener


   * Adds <code>PropertyChange</code> and {@link FurnitureListener FurnitureListener} listeners
   * to home to update furniture sort in table when <code>furnitureSortedProperty</code>,
   * <code>furnitureAscendingSorted</code> or furniture in <code>home</code> changes.
   */
  private void addHomeListener(final Home home) {
    PropertyChangeListener sortListener =
      new PropertyChangeListener () {
        public void propertyChange(PropertyChangeEvent ev) {
          ((FurnitureTableModel)getModel()).filterAndSortFurniture();
          // Update selected rows
          updateTableSelectedFurniture(home.getSelectedItems());
          getTableHeader().repaint();
        }
      };
    home.addPropertyChangeListener(Home.Property.FURNITURE_SORTED_PROPERTY, sortListener);
    home.addPropertyChangeListener(Home.Property.FURNITURE_DESCENDING_SORTED, sortListener);
   
    final PropertyChangeListener furnitureChangeListener =
      new PropertyChangeListener () {
        public void propertyChange(PropertyChangeEvent ev) {
          // As furniture properties values change may alter sort order, update sort and whole table
          ((FurnitureTableModel)getModel()).filterAndSortFurniture();
          // Update selected rows
          updateTableSelectedFurniture(home.getSelectedItems());
View Full Code Here


          }
        }
      });
   
    // Add a listener on auto save delay that will run auto save timer
    application.getUserPreferences().addPropertyChangeListener(Property.AUTO_SAVE_DELAY_FOR_RECOVERY, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent ev) {
          restartTimer();
        }
      });
    restartTimer();
View Full Code Here

            // Recovered homes are the ones with a name different from the file path
            if (home.getName() == null
                || !file.equals(new File(home.getName()))) {
              home.setRecovered(true);
              // Delete recovered file once home isn't recovered anymore
              home.addPropertyChangeListener(Home.Property.RECOVERED, new PropertyChangeListener() {
                  public void propertyChange(PropertyChangeEvent evt) {
                    if (!home.isRecovered()) {
                      file.delete();
                    }
                  }
View Full Code Here

            frame.dispose();
          }
        };
      });
    // Update title when the name or the modified state of home changes
    PropertyChangeListener frameTitleChangeListener = new PropertyChangeListener () {
        public void propertyChange(PropertyChangeEvent ev) {
          updateFrameTitle(frame, home, application);
        }
      };
    home.addPropertyChangeListener(Home.Property.NAME, frameTitleChangeListener);
View Full Code Here

        super(action);
        Icon i = (Icon) action.getValue(AppAction.SMALL_ICON);
        if (i != null) {
            setIcon(i);
        }
        action.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals("selected")) {
                    boolean sel = ((Boolean) evt.getNewValue()).booleanValue();
                    setSelected(sel);
                    setIcon((Icon) getAction().getValue(AppAction.SMALL_ICON));
View Full Code Here

        } else {
            setHideText(false);
        }
        setVerticalTextPosition(JButton.BOTTOM);
        setHorizontalTextPosition(JButton.CENTER);
        a.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals("selected")) {
                    boolean sel = ((Boolean) evt.getNewValue()).booleanValue();
                    setSelected(sel);
                }
View Full Code Here

        super(action);
        Icon i = (Icon) action.getValue(AppAction.SMALL_ICON);
        if (i != null) {
            setIcon(i);
        }
        action.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals("selected")) {
                    boolean sel = ((Boolean) evt.getNewValue()).booleanValue();
                    setSelected(sel);
                    setIcon((Icon) getAction().getValue(AppAction.SMALL_ICON));
View Full Code Here

                    setForeground(oldForeground);
                    oldForeground = null;
                }
            }
        });
        a.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals(iconKey)) {
                    Icon icon = (Icon) evt.getNewValue();
                    ActionButton.this.setIcon(icon);
                    ActionButton.this.invalidate();
View Full Code Here

                    showAttachedBoardsPopupMenu(e);
                }
            }
        });

        propertyChangeListener = new PropertyChangeListener() {
            public void propertyChange(final PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals(SettingsClass.MESSAGE_BODY_ANTIALIAS)) {
                    messageTextArea.setAntiAliasEnabled(Core.frostSettings.getBoolValue(SettingsClass.MESSAGE_BODY_ANTIALIAS));
                } else if (evt.getPropertyName().equals(SettingsClass.MESSAGE_BODY_FONT_NAME)) {
                    fontChanged();
View Full Code Here

              ? null
              : preferences.getFurnitureCatalog().getCategories().get(0), true);
    }

    controller.addPropertyChangeListener(ImportedFurnitureWizardController.Property.STEP,
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            updateStep(controller);
          }
        });
  }
View Full Code Here

TOP

Related Classes of java.beans.PropertyChangeListener

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.