コード例 #1
0
ファイル: JSlider.java プロジェクト: CodeingBoy/Java8CN
      public void propertyChange(PropertyChangeEvent e) {
        if (e.getPropertyName().equals("minimum") && startAtMin) {
          start = getMinimum();
        }

        if (e.getPropertyName().equals("minimum") || e.getPropertyName().equals("maximum")) {

          Enumeration keys = getLabelTable().keys();
          Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>();

          // Save the labels that were added by the developer
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            Object value = labelTable.get(key);
            if (!(value instanceof LabelUIResource)) {
              hashtable.put(key, value);
            }
          }

          clear();
          createLabels();

          // Add the saved labels
          keys = hashtable.keys();
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            put(key, hashtable.get(key));
          }

          ((JSlider) e.getSource()).setLabelTable(this);
        }
      }
コード例 #2
0
  @Override
  public void componentLayoutChanged(int index, PropertyChangeEvent ev)
      throws PropertyVetoException {
    RADVisualComponent<?> radComp = radContainer.getSubComponent(index);

    if (ev != null && ev.getPropertyName() != null) {
      layoutDelegate.acceptComponentLayoutChange(index, ev);

      FormModel formModel = radContainer.getFormModel();
      formModel.fireComponentLayoutChanged(
          radComp, ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());

      if (radComp.getNodeReference() != null) // propagate the change to node
      {
        radComp
            .getNodeReference()
            .firePropertyChangeHelper(ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());
      }
    } else {
      if (radComp.getNodeReference() != null) // propagate the change to node
      {
        radComp.getNodeReference().fireComponentPropertySetsChange();
      }
      radComp.resetConstraintsProperties();
    }
  }
コード例 #3
0
ファイル: Notepad.java プロジェクト: ArcherSys/ArcherSysRuby
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
コード例 #4
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     // System.out.println("Debug:TextViewer: ActionChangedListener enabled");
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
コード例 #5
0
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  Keep the row table in sync with the main table

    if ("selectionModel".equals(e.getPropertyName())) {
      setSelectionModel(main.getSelectionModel());
    }

    if ("rowHeight".equals(e.getPropertyName())) {
      repaint();
    }

    if ("model".equals(e.getPropertyName())) {
      main.getModel().addTableModelListener(this);
      revalidate();
    }
  }
コード例 #6
0
  public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (isVisible()
        && (e.getSource() == optionPane)
        && (JOptionPane.VALUE_PROPERTY.equals(prop)
            || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
      Object value = optionPane.getValue();

      if (value == JOptionPane.UNINITIALIZED_VALUE) return;
      optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);

      if (button1.equals(value)) {
        try {
          double a = Double.parseDouble(left.getText());
          double b = Double.parseDouble(right.getText());
          double err = Double.parseDouble(error.getText());

          if (a > b) {
            JOptionPane.showMessageDialog(this, "A < B!!!", null, JOptionPane.ERROR_MESSAGE);
          } else {
            hideIt();
            graphic.startApplyingMethod(parentFrame.getSelectedMethod(), err, a, b);
          }
        } catch (Exception ex) {
          JOptionPane.showMessageDialog(
              this, "Trebuie sa fie numar real!", null, JOptionPane.ERROR_MESSAGE);
        }
      } else if (button2.equals(value)) {
        hideIt();
      }
    }
  }
コード例 #7
0
ファイル: AnimationWidget.java プロジェクト: nbearson/IDV
  /**
   * The animation changed. Handle the change.
   *
   * @param evt The event
   */
  private void handleAnimationPropertyChange(PropertyChangeEvent evt) {
    //        System.err.println ("Handlechange:" +evt.getPropertyName());
    if (evt.getPropertyName().equals(Animation.ANI_VALUE)) {
      debug("handleAnimationPropertyChange value :" + evt.getPropertyName());
      Real eventValue = (Real) evt.getNewValue();
      // if there's nothing to do, return;
      if ((eventValue == null) || eventValue.isMissing()) {
        return;
      }

      /** The Animation associated with this widget */
      DateTime time = null;
      try {
        time = new DateTime(eventValue);
      } catch (VisADException ve) {;
      }
      final DateTime theDateTime = time;
      final int theIndex = ((anime != null) ? anime.getCurrent() : -1);
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              boolean oldValue = ignoreTimesCbxEvents;
              try {
                ignoreTimesCbxEvents = true;
                //                        synchronized (timesCbxMutex) {
                xcnt++;

                timesCbx.setSelectedItem(theDateTime);
                //                        }
                if ((boxPanel != null) && (theIndex >= 0)) {
                  boxPanel.setOnIndex(theIndex);
                }
                timesCbx.repaint();
              } finally {
                ignoreTimesCbxEvents = oldValue;
              }
            }
          });
      shareValue();
    } else if (evt.getPropertyName().equals(Animation.ANI_SET)) {
      if (ignoreAnimationSetChange) {
        return;
      }
      updateIndicatorInner((Set) evt.getNewValue(), true);
    }
  }
コード例 #8
0
 public void propertyChange(PropertyChangeEvent e) {
   String prop = e.getPropertyName();
   if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
     filters = (FileFilter[]) e.getNewValue();
     fireContentsChanged(this, -1, -1);
   } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
     fireContentsChanged(this, -1, -1);
   }
 }
コード例 #9
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   String strPropertyName = evt.getPropertyName();
   if ("progress".equals(strPropertyName)) {
     progressBar.setIndeterminate(false);
     int progress = (Integer) evt.getNewValue();
     progressBar.setValue(progress);
   }
 }
コード例 #10
0
 public void propertyChange(PropertyChangeEvent e) {
   String prop = e.getPropertyName();
   if (prop == JFileChooser.SELECTED_FILE_CHANGED_PROPERTY) {
     if (isShowing()) {
       loadImage((File) e.getNewValue());
       repaint();
     }
   }
 }
コード例 #11
0
ファイル: JPopupMenu.java プロジェクト: benzonico/ruling_java
    /**
     * This method gets called when a bound property is changed.
     *
     * @param e A <code>PropertyChangeEvent</code> object describing the event source and the
     *     property that has changed. Must not be null.
     * @throws NullPointerException if the parameter is null.
     * @since 1.5
     */
    public void propertyChange(PropertyChangeEvent e) {
      String propertyName = e.getPropertyName();
      if (propertyName == "visible") {
        if (e.getOldValue() == Boolean.FALSE && e.getNewValue() == Boolean.TRUE) {
          handlePopupIsVisibleEvent(true);

        } else if (e.getOldValue() == Boolean.TRUE && e.getNewValue() == Boolean.FALSE) {
          handlePopupIsVisibleEvent(false);
        }
      }
    }
コード例 #12
0
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  When the TableModel changes we need to update the listeners
    //  and column widths

    if ("model".equals(e.getPropertyName())) {
      TableModel model = (TableModel) e.getOldValue();
      model.removeTableModelListener(this);

      model = (TableModel) e.getNewValue();
      model.addTableModelListener(this);
      adjustColumns();
    }
  }
コード例 #13
0
  @Override
  public void containerLayoutChanged(PropertyChangeEvent ev) throws PropertyVetoException {
    if (ev != null && ev.getPropertyName() != null) {
      layoutDelegate.acceptContainerLayoutChange(ev);

      FormModel formModel = radContainer.getFormModel();
      formModel.fireContainerLayoutChanged(
          radContainer, ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());
    } else {
      propertySets = null;
    }

    LayoutNode node = radContainer.getLayoutNodeReference();
    if (node != null) {
      // propagate the change to node
      if (ev != null && ev.getPropertyName() != null) {
        node.fireLayoutPropertiesChange();
      } else {
        node.fireLayoutPropertySetsChange();
      }
    }
  }
コード例 #14
0
    @Override
    public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException {
      Object source = ev.getSource();
      String eventName = ev.getPropertyName();
      if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) {
        ev =
            new PropertyChangeEvent(
                layoutDelegate,
                ((FormProperty<?>) source).getName(),
                ev.getOldValue(),
                ev.getNewValue());

        containerLayoutChanged(ev);
      }
    }
コード例 #15
0
ファイル: AquaCaret.java プロジェクト: FauxFaux/jdk9-jdk
  @Override
  public void propertyChange(final PropertyChangeEvent evt) {
    final String propertyName = evt.getPropertyName();

    if (AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(propertyName)) {
      final JTextComponent comp = ((JTextComponent) evt.getSource());

      if (evt.getNewValue() == Boolean.TRUE) {
        setVisible(comp.hasFocus());
      } else {
        setVisible(false);
      }

      if (getDot() != getMark()) comp.getUI().damageRange(comp, getDot(), getMark());
    }
  }
コード例 #16
0
    @Override
    public void propertyChange(PropertyChangeEvent ev) {
      Object source = ev.getSource();
      String eventName = ev.getPropertyName();
      if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) {
        ev =
            new PropertyChangeEvent(
                layoutDelegate,
                ((FormProperty<?>) source).getName(),
                ev.getOldValue(),
                ev.getNewValue());

        try {
          containerLayoutChanged(ev);
        } catch (PropertyVetoException ex) {
          // should not happen
        }
      }
    }
コード例 #17
0
ファイル: Plotter.java プロジェクト: susotajuraj/jdk8u-jdk
  // Called on EDT
  public void propertyChange(PropertyChangeEvent ev) {
    String prop = ev.getPropertyName();

    if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) {
      ConnectionState newState = (ConnectionState) ev.getNewValue();

      switch (newState) {
        case DISCONNECTED:
          synchronized (this) {
            long time = System.currentTimeMillis();
            times.add(time);
            for (Sequence seq : seqs) {
              seq.add(Long.MIN_VALUE);
            }
          }
          break;
      }
    }
  }
コード例 #18
0
 public void propertyChange(PropertyChangeEvent e) {
   if (e.getSource() instanceof PanelThreadMonitor) {
     if (e.getPropertyName().equals("Status")) {
       PanelThreadMonitor mntTmp = (PanelThreadMonitor) e.getSource();
       int iMonitorIndex = pnlThread.indexOfComponent(mntTmp);
       if (iMonitorIndex >= 0) {
         if (e.getNewValue().equals("Started")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(COLOR_STARTED)) {
             pnlThread.setBackgroundAt(iMonitorIndex, COLOR_STARTED);
             pnlThread.setForegroundAt(iMonitorIndex, COLOR_STARTED_FG);
           }
         } else if (e.getNewValue().equals("Stopped")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(SystemColor.controlShadow)) {
             pnlThread.setBackgroundAt(iMonitorIndex, UIManager.getColor("TabbedPane.background"));
             pnlThread.setForegroundAt(iMonitorIndex, SystemColor.textText);
           }
         }
       }
     }
   }
 }
コード例 #19
0
ファイル: Outline.java プロジェクト: ShifuCifuentes/ridixcr
  /**
   * Called with a DjVuBean property has changed.
   *
   * @param e the PropertyChangeEvent.
   */
  public void propertyChange(final PropertyChangeEvent e) {
    try {
      final String name = e.getPropertyName();

      if ("page".equalsIgnoreCase(name)) {
        final Object object = e.getNewValue();

        if (object instanceof Number) {
          setCheckedPage(((Number) object).intValue() - 1);
        }
      } else if ("propertyName".equalsIgnoreCase(name)) {
        final String propertyName = (String) e.getNewValue();

        if ("navpane".equalsIgnoreCase(propertyName)) {
          setVisible("Outline".equalsIgnoreCase(djvuBean.properties.getProperty(propertyName)));
        }
      }
    } catch (final Throwable exp) {
      exp.printStackTrace(DjVuOptions.err);
      System.gc();
    }
  }
コード例 #20
0
 public void propertyChange(PropertyChangeEvent evt) {
   String name = evt.getPropertyName();
   if (name.equals("audioEnabled")) {
     audioButton.setSelected(player.isAudioEnabled());
   } else if (name.equals("audioAvailable")) {
     audioButton.setVisible(player.isAudioAvailable());
     validate();
     repaint();
   } else if (name.equals("colorCyclingStarted")) {
     colorCyclingButton.setSelected(
         (player instanceof ColorCyclePlayer)
             ? ((ColorCyclePlayer) player).isColorCyclingStarted()
             : false);
   } else if (name.equals("colorCyclingAvailable")) {
     colorCyclingButton.setVisible(
         (player instanceof ColorCyclePlayer)
             ? ((ColorCyclePlayer) player).isColorCyclingAvailable()
             : false);
     validate();
     repaint();
   } else if (name.equals("cached")) {
     setPlayerControlsVisible(player.getTimeModel().getMaximum() > 0);
   }
 }
コード例 #21
0
  public void propertyChange(PropertyChangeEvent e) {
    boolean update = false;
    String prop = e.getPropertyName();

    // If the directory changed, don't show an image.
    if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) {
      file = null;
      update = true;

      // If a file became selected, find out which one.
    } else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop)) {
      file = (File) e.getNewValue();
      update = true;
    }

    // Update the preview accordingly.
    if (update) {
      thumbnail = null;
      if (isShowing()) {
        loadImage();
        repaint();
      }
    }
  }
コード例 #22
0
 /**
  * Notifies this instance about a change in the value of a property of a source which of interest
  * to this instance. For example, <tt>OneToOneCallPeerPanel</tt> updates its user
  * interface-related properties upon changes in the value of the {@link
  * CallContainer#PROP_FULL_SCREEN} property of its associated {@link #callRenderer}.
  *
  * @param ev a <tt>PropertyChangeEvent</tt> which identifies the source, the name of the property
  *     and the old and new values
  */
 public void propertyChange(PropertyChangeEvent ev) {
   if (CallContainer.PROP_FULL_SCREEN.equals(ev.getPropertyName())) updateViewFromModel();
 }
コード例 #23
0
 public void propertyChange(PropertyChangeEvent evt) {
   String propertyName = evt.getPropertyName();
   if ("desktopManager" == propertyName) {
     installDesktopManager();
   }
 }
コード例 #24
0
 /**
  * Notifies this instance about a change in the value of a property of a source which of interest
  * to this instance. For example, <tt>FullScreenButton</tt> updates its user interface-related
  * properties upon changes in the value of the {@link CallContainer#PROP_FULL_SCREEN} property of
  * its associated {@link #callContainer}.
  *
  * @param ev a <tt>PropertyChangeEvent</tt> which identifies the source, the name of the property
  *     and the old and new values
  */
 public void propertyChange(PropertyChangeEvent ev) {
   if (CallContainer.PROP_FULL_SCREEN.equals(ev.getPropertyName())
       && this.callContainer.equals(ev.getSource())) {
     loadSkin();
   }
 }
コード例 #25
0
ファイル: LoginBox.java プロジェクト: timburrow/ovj3
 public void propertyChange(PropertyChangeEvent e) {
   String strProp = e.getPropertyName();
   if (strProp == null) return;
   strProp = strProp.toLowerCase();
   if (strProp.indexOf("heading3") >= 0 || strProp.indexOf("plaintext") >= 0) setPref();
 }
コード例 #26
0
    public void propertyChange(PropertyChangeEvent e) {
      String strPropName = e.getPropertyName();
      if (strPropName.equals(WGlobal.USER_CHANGE)) {
        String strName = (String) e.getNewValue();
        String strAccount = null;
        VDetailArea objDetailArea = m_adminIF.getDetailArea1();
        if (objDetailArea != null) strAccount = objDetailArea.getItemValue("itype");
        if (strAccount == null) strAccount = "";
        strAccount = strAccount.trim();

        String strDir = getPathDir() + strName;
        if (this instanceof DisplayTemplate) {
          if (strAccount.equals(Global.IMGIF)) strDir = strDir + ".img";
          else if (strAccount.equals(Global.WALKUPIF)) strDir = strDir + ".walkup";
        }
        String strPath = FileUtil.openPath(strDir);
        boolean bDefaultFile = false;
        if (strPath == null) {
          strPath = FileUtil.openPath(getDefaultFile(strAccount));
          bDefaultFile = true;
        }
        clear(this);
        layoutUIComponents(strPath, bDefaultFile);
      } else if (strPropName.indexOf(WGlobal.IMGDIR) >= 0) {
        String strName = (String) e.getNewValue();
        StringTokenizer strTokenizer = new StringTokenizer(strPropName);
        String strInterface = null;
        boolean bDefaultFile = false;
        if (strTokenizer.hasMoreTokens()) strTokenizer.nextToken();
        if (strTokenizer.hasMoreTokens()) strInterface = strTokenizer.nextToken();
        if (strInterface == null) strInterface = "";
        strInterface = strInterface.trim();

        String strDir = getPathDir() + strName;
        if (this instanceof DisplayTemplate) {
          if (strInterface.equals(WGlobal.IMGDIR)) strDir = strDir + ".img";
          else if (strInterface.equals(WGlobal.WALKUPDIR)) strDir = strDir + ".walkup";
        }
        String strPath = FileUtil.openPath(strDir);
        if (strPath == null) {
          String strAccount = Global.WALKUPIF;
          if (strInterface.equals(WGlobal.IMGDIR)) strAccount = Global.IMGIF;
          else if (strInterface.equals(WGlobal.WALKUPDIR)) strAccount = Global.WALKUPIF;
          strPath = FileUtil.openPath(getDefaultFile(strAccount));
          bDefaultFile = true;
        }
        clear(this);
        layoutUIComponents(strPath, bDefaultFile);
      } else if (strPropName.indexOf(WGlobal.SAVEUSER_NOERROR) >= 0) {
        Object objValue = e.getNewValue();
        String strName = "";
        if (objValue instanceof String) strName = (String) objValue;
        else if (objValue instanceof WItem) strName = ((WItem) objValue).getText();

        VDetailArea objDetail = m_adminIF.getDetailArea1();
        String strAccount = null;
        if (objDetail != null) strAccount = objDetail.getItemValue("itype");
        if (strAccount == null) strAccount = "";
        strAccount = strAccount.trim();

        String strDir = getPathDir() + strName;
        if (this instanceof DisplayTemplate) {
          if (strAccount.equals(Global.IMGIF)) strDir = strDir + ".img";
          else if (strAccount.equals(Global.WALKUPIF)) strDir = strDir + ".walkup";
        }
        TextFieldValues objTxf = getTxfValues();
        writeFile(strName, strDir, objTxf.getTxfLabel(), objTxf.getTxfValue());
      } else if (strPropName.indexOf(WGlobal.DELETE_USER) >= 0) {
        clear(this);
        String strPath = FileUtil.openPath(getDefaultFile(""));
        layoutUIComponents(strPath, true);
      }
    }