Package de.sciss.meloncillo.util

Examples of de.sciss.meloncillo.util.MapManager$Context


  {
    super.init();
   
//    final NumberSpace  spcCoord  = new NumberSpace( 0.0, 1.0, 0.0001, 0.5, 0.1 );
    final NumberSpace  spcCoord  = new NumberSpace( 0.0, 2.0, 0.0, 0, 4, 0.5 );
    final MapManager  map      = getMap();

    map.putContext( null, MAP_KEY_WIDTH, new MapManager.ContextMapManager.Context.FLAG_OBSERVER_DISPLAY |
                                    MapManager.Context.FLAG_VISUAL,
                                    MapManager.Context.TYPE_DOUBLE, spcCoord, "labelW",
                                    null, new Double( 1.0 )));
    map.putContext( null, MAP_KEY_HEIGHT, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY |
                                    MapManager.Context.FLAG_VISUAL,
                                    MapManager.Context.TYPE_DOUBLE, spcCoord, "labelH",
                                    null, new Double( 1.0 )));
  }
View Full Code Here


   
//    final NumberSpace  spcDiam    = new NumberSpace( 0.0, 1.0, 0.0001, 0.5, 0.1 );
    final NumberSpace  spcDiam    = new NumberSpace( 0.0, 2.0, 0, 0, 4, 0.5 );
//    final NumberSpace  spcArc    = new NumberSpace( -360.0, 360.0, 0.0001, 0.0, 0.1 );
    final NumberSpace  spcArc    = new NumberSpace( -360.0, 360.0, 0.0, 0, 4, 0.1 );
    final MapManager  map      = getMap();

    map.putContext( null, MAP_KEY_INNERDIAM, new MapManager.ContextMapManager.Context.FLAG_OBSERVER_DISPLAY |
                                      MapManager.Context.FLAG_VISUAL,
                                      MapManager.Context.TYPE_DOUBLE, spcDiam,
                                      "labelInnerDiam", null, new Double( 0.5 )));
    map.putContext( null, MAP_KEY_OUTERDIAM, new MapManager.ContextMapManager.Context.FLAG_OBSERVER_DISPLAY |
                                      MapManager.Context.FLAG_VISUAL,
                                      MapManager.Context.TYPE_DOUBLE, spcDiam,
                                      "labelOuterDiam", null, new Double( 1.5 )));
    map.putContext( null, MAP_KEY_ANGLESTART, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY |
                                      MapManager.Context.FLAG_VISUAL,
                                      MapManager.Context.TYPE_DOUBLE, spcArc,
                                      "labelAngleStart", null, new Double( 0.0 )));
    map.putContext( null, MAP_KEY_ANGLEEXTENT, new MapManager.Context(MapManager.Context.FLAG_OBSERVER_DISPLAY |
                                      MapManager.Context.FLAG_VISUAL,
                                      MapManager.Context.TYPE_DOUBLE, spcArc,
                                      "labelAngleExtent", null, new Double( 90.0 )));
  }
View Full Code Here

  {
    super.init();
   
//    final NumberSpace    spcCoord  = new NumberSpace( 0.0, 1.0, 0.0001, 0.5, 0.1 );
    final NumberSpace    spcCoord  = new NumberSpace( -1.0, 1.0, 0.0, 0, 4, 0.5 );
    final MapManager    map      = getMap();
   
    map.putContext( null, MAP_KEY_X, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY |
                                 MapManager.Context.FLAG_VISUAL,
                                 MapManager.Context.TYPE_DOUBLE, spcCoord, "labelX",
                                 null, new Double( 0.0 )));
    map.putContext( null, MAP_KEY_Y, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY |
                                 MapManager.Context.FLAG_VISUAL,
                                 MapManager.Context.TYPE_DOUBLE, spcCoord, "labelY",
                                 null, new Double( 0.0 )));
  }
View Full Code Here

 
  // sync: to be called with sync on 'sync' and on doors
  // this method invokes model.fireTableDataChanged()
  private void updateKeysAndContexts()
  {
    MapManager      map;
    Object        o;
    MapManager.Context  c;
    SessionObject    so;

    if( isEditing() ) editor.cancelCellEditing();

    keys.clear();
    contexts.clear();
    if( !collObjects.isEmpty() ) {
      so  = (SessionObject) collObjects.get( 0 );
      map  = so.getMap();
      keys.addAll( map.keySet( MapManager.Context.FLAG_OBSERVER_DISPLAY,
                   MapManager.Context.NONE_EXCLUSIVE ));

      for( int i = keys.size() - 1; i >= 0 ; i-- ) {
        o  = keys.get( i );
        c  = map.getContext( o.toString() );
        contexts.put( o, c );
        // remove fields that belong to inactive plug-ins
        if( (c.dynamic != null) &&
          (PlugInManager.getInstance().getValue( c.dynamic.toString() ) == null) ) {
          keys.remove( o );
        }
      }
    }
    for( int i = 1; i < collObjects.size(); i++ ) {
      so  = (SessionObject) collObjects.get( i )// only common fields are displayed
      map  = so.getMap();
      keys.retainAll( map.keySet( MapManager.Context.FLAG_OBSERVER_DISPLAY,
                    MapManager.Context.NONE_EXCLUSIVE ));
    }
    model.fireTableDataChanged();
  }
View Full Code Here

      if( (doc == null) || (col != 1) || (value == null) ) return;
   
      if( row >= keys.size() ) return;

      SessionObject      so;
      MapManager        map;
      final String      key    = keys.get( row ).toString();
      boolean          addEdit  = false;
      AbstractCompoundEdit  edit  = new BasicCompoundEdit();

      for( int i = 0; i < collObjects.size(); i++ ) {
        so  = (SessionObject) collObjects.get( i );
        map = so.getMap();
        if( map.containsKey( key )) {
          edit.addPerform( new EditPutMapValue( SessionObjectTable.this, map, key, value ));
          addEdit = true;
        }
      }
      if( addEdit ) {
View Full Code Here

    }
  }

  private void sessionObjectToLispHash( SessionObject so, LispHashTable h )
  {
    MapManager      m    = so.getMap();
    Iterator      iter  = m.keySet( MapManager.Context.ALL_INCLUSIVE, MapManager.Context.NONE_EXCLUSIVE ).iterator();
    String        key;
    Object        value;
    MapManager.Context  c;
    LispValue      lispValue;
 
    h.setf_gethash( jatha.makeString( "NAME" ), jatha.makeString( so.getName() ));
    while( iter.hasNext() ) {
      key    = iter.next().toString();
      c    = m.getContext( key );
      if( c == null ) continue;
      value  = m.getValue( key );
      switch( c.type ) {
      case MapManager.Context.TYPE_INTEGER:
        lispValue  = jatha.makeInteger( ((Number) value).intValue() );
        break;
      case MapManager.Context.TYPE_LONG:
View Full Code Here

  {
    super();

    this.doc    = doc;
   
    final MapManager map = getMap();

    map.putContext( this, MAP_KEY_RATE, new MapManager.Context( 0, MapManager.Context.TYPE_DOUBLE, null, null, null,
                                  new Double( 1000 )));
    map.putContext( this, MAP_KEY_LENGTH, new MapManager.Context( 0, MapManager.Context.TYPE_LONG, null, null, null,
                                    new Long( 0 )));
    map.putContext( this, MAP_KEY_POSITION, new MapManager.Context( 0, MapManager.Context.TYPE_LONG, null, null, null,
                                    new Long( 0 )));

//    osc  = new OSCRouterWrapper( doc, this );

    clear( this );
View Full Code Here

            throw new InvokerException(ioe.getMessage(), ioe.getCause());
        } catch (XMLStreamException xse) {
            throw new InvokerException(xse.getMessage(), xse.getCause());
        }
        executor = new SCXMLExecutor(evaluator, new SimpleDispatcher(), new SimpleErrorReporter());
        Context rootCtx = evaluator.newContext(null);
        for (Map.Entry<String, Object> entry : params.entrySet()) {
            rootCtx.setLocal(entry.getKey(), entry.getValue());
        }
        executor.setRootContext(rootCtx);
        try {
            executor.setStateMachine(scxml);
        }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Set<Entry<String, Object>> entrySet() {
        Set<Entry<String, Object>> entrySet = new HashSet<Entry<String, Object>>();
        Context current = leaf;
        while (current != null) {
            entrySet.addAll(current.getVars().entrySet());
            current = current.getParent();
        }
        return entrySet;
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Object get(final Object key) {
        if (key != null) {
            Context current = leaf;
            while (current != null) {
                if (current.getVars().containsKey(key.toString())) {
                    return current.getVars().get(key);
                }
                current = current.getParent();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of de.sciss.meloncillo.util.MapManager$Context

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.