Package simtools.util

Examples of simtools.util.NamedProperties


    if(c!=null&&cshape!=null){
      Iterator it=c.iterator();
      Iterator itshape=cshape.iterator();
      while(it.hasNext()&& itshape.hasNext()){
        AbstractShape as=(AbstractShape)itshape.next();
        NamedProperties np=(NamedProperties)it.next();
        res |= as.setProperties(np,ce);
      }
    }
   
   
View Full Code Here


      return;
    }
    DiagramSelection sel=sc.getDiagramSelection();
    final Vector v=sel.getSelectedElements();
    // look for properties initial values
    final NamedProperties initalValues=containsValidProperties(v);
    if(initalValues==null){
      return;
    }
    new LongAction(LongAction.LONG_ACTION_SHAPE, sel, e.getSource()) {
      protected void doAction() {
View Full Code Here

   * Check if one object contains one of the valid properties
   * @param v the list of objects
   * @return the first matching object or null if none
   */
  protected NamedProperties containsValidProperties(Vector v) {
    NamedProperties initalValues = null;
    for (int i = 0; i < v.size(); i++) {
      Object o = v.get(i);
      if (o instanceof NamedProperties) {
        NamedProperties np = (NamedProperties) o;
        if (containsValidProperties(np)) {
          setProperties(np);
          initalValues = np;
          break;
        }
View Full Code Here

    /**
     * @param v
     */
    public boolean update(Vector v) {
      NamedProperties np=containsValidProperties(v);
      if(np!=null){
        setProperties(np);
        DiagramSelectionPropertiesPanel.this.update();
        return true;
      }
View Full Code Here

        cbRatio = new JCheckBox(resources.getString("FixedRatio"), false);
        // Transform properties
        lTransformation = new JLabel(resources.getString("transformation"));
        editTransformButton = resources.getButton("editTransform", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                NamedProperties res;
                if (transform == null) {
                    res = AffineTransformDataPanel.showDialog(PropertiesPanel1D.this.getOwner(), resources
                            .getString("transformationTitle"), new AffineTransformData());
                } else {
                    res = AffineTransformDataPanel.showDialog(PropertiesPanel1D.this.getOwner(), resources
                            .getString("transformationTitle"), transform);
                }
                if (res != null) {
                    if (transform == null) {
                        transform = new AffineTransformData();
                    }
                    String[] props = res.getPropertyNames();
                    if (props != null) {
                        for (int j = 0; j < props.length; j++) {
                            String pname = props[j];
                            Object value = res.getPropertyValue(pname);
                            transform.setPropertyValue(pname, value);
                        }
                        // Update transform with last related data
                        // source values
                        transform.notificationEnd(null);
View Full Code Here

        Collection cshape = properties.getInnerProperties();
        if ((c != null) && (cshape != null)) {
            Iterator it = c.iterator();
            Iterator itshape = cshape.iterator();
            while (it.hasNext() && itshape.hasNext()) {
                NamedProperties as = (NamedProperties) itshape.next();
                JPropertiesPanel np = (JPropertiesPanel) it.next();
                np.setProperties(as);
            }
        }
        String[] props = properties.getPropertyNames();
View Full Code Here

TOP

Related Classes of simtools.util.NamedProperties

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.