Package de.sciss.meloncillo.edit

Examples of de.sciss.meloncillo.edit.BasicCompoundEdit


          }
          coll2.add( rcv );
        }
       
        if( !coll3.isEmpty() ) {
          edit = new BasicCompoundEdit();
          final List selectedGroups = doc.getSelectedGroups().getAll();
          if( !selectedGroups.isEmpty() ) {
            for( int i = 0; i < coll3.size(); i++ ) {
              final GroupableSessionObject so = (GroupableSessionObject) coll3.get( i );
              edit.addPerform( new EditAddSessionObjects( this, so.getGroups(), selectedGroups ));
View Full Code Here


        if( num == 0 ) return;
       
        args  = new Object[ 3 ];
       
        coll2.removeAll( coll );
        edit  = new BasicCompoundEdit();
        name  = ggName.getText();
        if( num == 1 ) {
          if( BasicSessionCollection.findByName( coll2, name ) != null ) {
            Session.makeNamePattern( name, args );
            name = BasicSessionCollection.createUniqueName( Session.SO_NAME_PTRN, args, coll2 );
View Full Code Here

          doc.getReceivers().getMap().copyContexts( this, MapManager.Context.FLAG_DYNAMIC,
                             MapManager.Context.NONE_EXCLUSIVE, rcv.getMap() );
          collNewRcv.add( rcv );
          coll2.add( rcv );
        }
        final BasicCompoundEdit edit = new BasicCompoundEdit( getValue( NAME ).toString() );
        if( !doc.getSelectedGroups().isEmpty() ) {
          final List selectedGroups = doc.getSelectedGroups().getAll();
          for( int i = 0; i < collNewRcv.size(); i++ ) {
            final GroupableSessionObject so = (GroupableSessionObject) collNewRcv.get( i );
            edit.addPerform( new EditAddSessionObjects( this, so.getGroups(), selectedGroups ));
          }
        }
        edit.addPerform( new EditAddSessionObjects( this, doc.getMutableReceivers(), collNewRcv ));
        edit.addPerform( new EditAddSessionObjects( this, doc.getMutableSelectedReceivers(), collNewRcv ));
//        for( int i = 0; i < doc.getSelectedGroups().size(); i++ ) {
//          group  = (SessionGroup) doc.getSelectedGroups().get( i );
//          edit.addPerform( new EditAddSessionObjects( this, group.getReceivers(), coll ));
//        }
        edit.perform();
        edit.end();
        doc.getUndoManager().addEdit( edit );
      }
      catch( InstantiationException e1 ) {
        System.err.println( e1.getLocalizedMessage() );
      }
View Full Code Here

      name = JOptionPane.showInputDialog( null, AbstractApplication.getApplication().getResourceString(
        "inputDlgNewGroup" ), name );
       
      if( name == null ) return;
     
      ce = new BasicCompoundEdit( getValue( NAME ).toString() );
     
      try {
        doc.bird.waitExclusive( Session.DOOR_GRP );
        group  = (SessionGroup) doc.getGroups().findByName( name );
        b1    = group == null;
View Full Code Here

         */
        maxLen        = cutLength >> 1;
        bc          = createBlendContext( maxLen, 0, hasSelectedAudio.isSet() );
      }
//      bc          = createBlendContext( Math.min( cutLength, span.start ), Math.min( cutLength, docLength - span.stop ), hasSelectedAudio );
      edit        = new BasicCompoundEdit( name );

//      if( bc != null )  System.out.println( "bc  : " + bc.getLen() + ", " + bc.getLeftLen() + ", "+ bc.getRightLen() );
     
      cutTimeline      = (mode == EDIT_INSERT) && hasSelectedAudio.isSet();
      newDocLength    = cutTimeline ? docLength - cutLength : docLength;
View Full Code Here

    }
   
    protected void perform()
    {
      final Span          selSpan, deleteBefore, deleteAfter;
      final BasicCompoundEdit    edit;
      final List          tis;
      Track.Info          ti;
      boolean            success  = false;

      edit      = new BasicCompoundEdit( getValue( NAME ).toString() );
     
      try {
        selSpan      = timeline.getSelectionSpan();
//        if( selSpan.isEmpty() ) return;
        tis        = Track.getInfos( selectedTracks.getAll(), tracks.getAll() );
        deleteBefore  = new Span( 0, selSpan.start );
        deleteAfter    = new Span( selSpan.stop, timeline.getLength() );

        // deselect
        edit.addPerform( TimelineVisualEdit.select( this, Session.this, new Span() ));
        edit.addPerform( TimelineVisualEdit.position( this, Session.this, 0 ));

        if( !deleteAfter.isEmpty() || !deleteBefore.isEmpty() ) {
          for( int i = 0; i < tis.size(); i++ ) {
            ti = (Track.Info) tis.get( i );
            ti.trail.editBegin( edit );
            try {
              if( !deleteAfter.isEmpty() ) ti.trail.editRemove( this, deleteAfter, edit );
              if!deleteBefore.isEmpty() ) ti.trail.editRemove( this, deleteBefore, edit );
            }
            finally {
              ti.trail.editEnd( edit );
            }
          }
        }

        edit.addPerform( new EditSetTimelineLength( this, Session.this, selSpan.getLength() ));
        edit.addPerform( TimelineVisualEdit.select( this, Session.this, selSpan.shift( -selSpan.start )));

        edit.perform();
        edit.end();
        getUndoManager().addEdit( edit );
        success = true;
      }
      finally {
        if( !success ) edit.cancel();
      }
    }
View Full Code Here

      final AbstractCompoundEdit  edit;
      final Span          oldSelSpan, insertSpan;

      proc = new ProcessingThread( this, getFrame(), getValue( NAME ).toString() );

      edit    = new BasicCompoundEdit( proc.getName() );
      oldSelSpan  = timeline.getSelectionSpan();
      insertSpan  = new Span( pos, pos + numFrames );

      if( !oldSelSpan.isEmpty() ) { // deselect
        edit.addPerform( TimelineVisualEdit.select( this, Session.this, new Span() ));
View Full Code Here

      switch( mode ) {
      case SCROLL_SESSION_START:
        if( timelinePos != 0 ) {
          edit  = TimelineVisualEdit.position( this, doc, 0 ).perform();
          if( !timelineVis.contains( 0 )) {
            final CompoundEdit ce  = new BasicCompoundEdit();
            ce.addEdit( edit );
            newSpan  = new Span( 0, timelineVis.getLength() );
            ce.addEdit( TimelineVisualEdit.scroll( this, doc, newSpan ).perform() );
            ce.end();
            edit  = ce;
          }
        }
        break;
       
View Full Code Here

        span  = doc.timeline.getSelectionSpan();
        if( span.isEmpty() || span.getStop() == doc.timeline.getLength() ) return;
        span  = new Span( span.getStop() - 1, Math.min( doc.timeline.getLength(),
                  span.getStop() - 1 + span.getLength() ));

        edit  = new BasicCompoundEdit( getValue( NAME ).toString() );
        edit.addPerform( TimelineVisualEdit.select( this, doc, span ));
        edit.addPerform( TimelineVisualEdit.position( this, doc, span.getStart() ));
        edit.perform();
        edit.end();
        doc.getUndoManager().addEdit( edit );
View Full Code Here

        doc.bird.waitExclusive( Session.DOOR_TIME );
        span  = doc.timeline.getSelectionSpan();
        if( span.isEmpty() || span.getStart() == 0 ) return;
        span  = new Span( Math.max( 0, span.getStart() + 1 - span.getLength() ), span.getStart() + 1 );

        edit  = new BasicCompoundEdit( getValue( NAME ).toString() );
        edit.addPerform( TimelineVisualEdit.select( this, doc, span ));
        edit.addPerform( TimelineVisualEdit.position( this, doc, span.getStart() ));
        edit.perform();
        edit.end();
        doc.getUndoManager().addEdit( edit );
View Full Code Here

TOP

Related Classes of de.sciss.meloncillo.edit.BasicCompoundEdit

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.