Examples of Flag


Examples of cl.alejo.jcsim.csim.gates.Flag

    IconGate iconSwitch = new IconGate(switch1);
    circuit.addIconGate(iconSwitch, 300, 50);

    // Una banderita
    GateDescriptor descFlag = new FlagDescriptor();
    Gate flag = new Flag(circuit, descFlag, new ParamVoid());
    IconGate iconFlag = new IconGate(flag);
    circuit.addIconGate(iconFlag, 200, 50); // Superfluo

    // El lector de 7 segmentos
    GateDescriptor descDisp = new SegmentDisplayDescriptor((ParamSegmentDisplay) paramDisp.clone());
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.Flag

      IntParameter P_PARAM = new IntParameter(P_ID, new GreaterConstraint(0));
      if(config.grab(P_PARAM)) {
        p = P_PARAM.getValue();
      }

      Flag NOLOG_FLAG = new Flag(NOLOG_ID);
      if(config.grab(NOLOG_FLAG)) {
        log = !NOLOG_FLAG.getValue();
      }
    }
View Full Code Here

Examples of de.sciss.util.Flag

//    final AudioFileDescr  displayAFD  = doc.getDisplayDescr();
    final String      name;
    final JOptionPane    op;
    final JDialog       d;
    final JRootPane      rp;
    final Flag        dont    = new Flag( false );
    AudioFileDescr[]    afds    = doc.getDescr();
   
    if( doc.getName() == null ) {
      name = getResourceString( "frameUntitled" );
    } else {
      name = doc.getName();
    }
   
//    choice = JOptionPane.showOptionDialog( getWindow(), name + " :\n" + getResourceString( "optionDlgUnsaved" ),
//                         actionName, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null,
//                         options, options[1] );
    op = new JOptionPane( name + " :\n" + getResourceString( "optionDlgUnsaved" ),
                          JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_CANCEL_OPTION, null,
                          options, options[ 1 ]);
    d = op.createDialog( getWindow(), actionName );
    rp = d.getRootPane();
    if( rp != null ) {
      rp.getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW ).put(
        KeyStroke.getKeyStroke( KeyEvent.VK_D, BasicMenuFactory.MENU_SHORTCUT ), "dont" );
      rp.getActionMap().put( "dont", new AbstractAction() {
        public void actionPerformed( ActionEvent e )
        {
          dont.settrue );
          d.dispose();
        }
      });
    }
    BasicWindowHandler.showDialog( d );
//    d.setVisible( true );
    if( dont.isSet() ) {
      choice = 2;
    } else {
      final Object value = op.getValue();
      if( (value == null) || (value == options[ 1 ])) {
        choice = 1;
View Full Code Here

Examples of de.sciss.util.Flag

      perform();
    }
   
    public void perform()
    {
      final ProcessingThread pt = closeDocument( false, new Flag( false ));
      if( pt != null ) doc.start( pt );
    }
View Full Code Here

Examples of de.sciss.util.Flag

 
  private boolean forcedQuit = false;

  public synchronized void quit()
  {
    final Flag        confirmed  = new Flag( false );
    final ProcessingThread  pt      = getMenuFactory().closeAll( forcedQuit, confirmed );

    if( pt != null ) {
      pt.addListener( quitAfterSaveListener );
      ((BasicDocument) pt.getClientArg( "doc" )).start( pt );
    } else if( confirmed.isSet() ) {
      OSCRoot.getInstance().quit();
      SuperColliderClient.getInstance().quit();
      super.quit();
    }
  }
View Full Code Here

Examples of de.sciss.util.Flag

    hideAndDispose();
 
    if( (context == null) || (plugIn == null) || !doc.checkProcess() ) return;
 
    final ConsumerContext  consc;
    final Flag        hasSelectedAudio  = new Flag( false );
    final RenderSource    source;
    final List        tis          = context.getTrackInfos();
    final int        inTrnsLen, outTrnsLen;
    final int        minBlockSize, maxBlockSize, prefBlockSize;
    final Set        newOptions;
    final RandomAccessRequester rar;
    final long        pasteLength, preMaxLen, postMaxLen;
    final Span        span;
//    final int        numClipChannels    = 0;
    boolean          hasSelectedMarkers  = false;
    Track.Info        ti;
    Object          val;

    consc      = new ConsumerContext();
    consc.plugIn  = plugIn;
    consc.doc    = doc;
    context.setOption( KEY_CONSC, consc );
   
    source      = new RenderSource( context );
   
    if( !AudioTracks.checkSyncedAudio( tis, consc.plugIn.getLengthPolicy() == RenderPlugIn.POLICY_MODIFY, null, hasSelectedAudio )) {
      return; // FAILED;
    }
    source.validAudio = (consc.plugIn.getAudioPolicy() == RenderPlugIn.POLICY_MODIFY) && hasSelectedAudio.isSet();
    for( int i = 0; i < tis.size(); i++ ) {
      ti = (Track.Info) tis.get( i );
      if( (ti.trail instanceof MarkerTrail) && ti.selected ) {
        hasSelectedMarkers = true;
        break;
View Full Code Here

Examples of de.sciss.util.Flag

      if( rom.msg.getArgCount() > 1 ) {
        force = ((Number) rom.msg.getArg( 1 )).intValue() != 0;
      } else {
        force = false;
      }
      proc = closeDocument( force, new Flag( false ));
      if( proc != null ) start( proc );
    }
    catch( IndexOutOfBoundsException e1 ) {
      OSCRoot.failedArgCount( rom );
      return;
View Full Code Here

Examples of de.sciss.util.Flag

      if( (insertPos < 0) || (insertPos > timeline.getLength()) ) throw new IllegalArgumentException( String.valueOf( insertPos ));
     
      final ProcessingThread    proc;
      final Span          oldSelSpan, insertSpan, copySpan, cutTimelineSpan;
      final AbstractCompoundEdit  edit;
      final Flag          hasSelectedAudio;
      final List          tis;
      final boolean        expTimeline, cutTimeline;
      final long          docLength, pasteLength, preMaxLen, postMaxLen;
      final BlendContext      bcPre, bcPost;
     
      hasSelectedAudio  = new Flag( false );
      tis          = Track.getInfos( selectedTracks.getAll(), tracks.getAll() );
      if( !AudioTracks.checkSyncedAudio( tis, mode == EDIT_INSERT, null, hasSelectedAudio )) return null;

      expTimeline      = (mode == EDIT_INSERT) && hasSelectedAudio.isSet();
      docLength      = timeline.getLength();
      pasteLength      = expTimeline ? tl.getSpan().getLength() :
        Math.min( tl.getSpan().getLength(), docLength - insertPos );
      if( pasteLength == 0 ) return null;
     
      if( mode == EDIT_INSERT ) {
        /*
         *  before paste:
         *
         *   maxRight / post   maxLeft / pre
         *
         *  |                 |              |
         *  |                 |              |
         *  |                 |              |
         *  |        A        |     B        |
         *  +-----------------+--------------+
         *                    |
         *                 insertPos
         *
         *  after paste:
         *
         *  |                 | B #$$$$# A |              |
         *  |                 |  ##$$$$##  |              |
         *  |                 | ###$$$$### |              |
         *  |        A        |####$$$$####|      B       |
         *  +-----------------+------------+--------------+
         *                    |
         *                 insertPos
         */
        // note: now the discrepancy between postMaxLen and preMaxLen is
        // limited to 100%, so pasting at the very end or beginning of
        // a doc will not produce a single sided xfade any more
        // (answering bug 1922862)
        if( insertPos < (docLength - insertPos) ) {
          postMaxLen  = Math.min( insertPos, pasteLength >> 1 );
//          preMaxLen  = Math.min( docLength - insertPos, pasteLength - postMaxLen );
          preMaxLen  = Math.min( postMaxLen << 1, Math.min( docLength - insertPos, pasteLength - postMaxLen ));
//System.out.println( "A" );
        } else {
          preMaxLen  = Math.min( docLength - insertPos, pasteLength >> 1 );
          postMaxLen  = Math.min( preMaxLen << 1, Math.min( insertPos, pasteLength - preMaxLen ));
//System.out.println( "B" );
        }
      } else {
        preMaxLen  = pasteLength >> 1// note: pasteLength already clipped to be <= docLength - insertPos !
        postMaxLen  = pasteLength - preMaxLen;
//System.out.println( "C" );
      }
      bcPre      = createBlendContext( preMaxLen, 0, hasSelectedAudio.isSet() );
      bcPost      = createBlendContext( postMaxLen, 0, hasSelectedAudio.isSet() );
//System.out.println( "D ; preMaxLen = " + preMaxLen + "; postMaxLen = " + postMaxLen + "; bcPre.getLeftLen() = " + (bcPre == null ? null : String.valueOf( bcPre.getLeftLen())) + "; bcPre.getRightLen() = " + (bcPre == null ? null : String.valueOf( bcPre.getRightLen() )) + "; bcPost.getLeftLen() = " + (bcPost == null ? null : String.valueOf( bcPost.getLeftLen() )) + "; bcPost.getRightLen() = " + (bcPost == null ? null : String.valueOf( bcPost.getRightLen() )));

//      if( bcPre != null )  System.out.println( "bcPre  : " + bcPre.getLen() + ", " + bcPre.getLeftLen() + ", "+ bcPre.getRightLen() );
//      if( bcPost != null ) System.out.println( "bcPost : " + bcPost.getLen() + ", " + bcPost.getLeftLen() + ", "+ bcPost.getRightLen() );
     
      insertSpan      = new Span( insertPos, insertPos + pasteLength );
      copySpan      = new Span( tl.getSpan().start, tl.getSpan().start + pasteLength );
      cutTimeline      = (mode == EDIT_INSERT) && !hasSelectedAudio.isSet();
      cutTimelineSpan    = cutTimeline ? new Span( docLength, docLength + pasteLength ) : null;
     
      edit      = new BasicCompoundEdit( procName );
      oldSelSpan    = timeline.getSelectionSpan();
      if( !oldSelSpan.isEmpty() ) { // deselect
View Full Code Here

Examples of de.sciss.util.Flag

    {
      if( !checkProcess() ) return null;

      final BlendContext      bc;
      final long          cutLength, docLength, newDocLength, maxLen;
      final Flag          hasSelectedAudio;
      final List          tis;
      final AbstractCompoundEdit  edit;
      final boolean         cutTimeline;
      final Span          cutTimelineSpan, selSpan;
      Span            visiSpan;

      hasSelectedAudio  = new Flag( false );
      tis          = Track.getInfos( selectedTracks.getAll(), tracks.getAll() );
      if( !AudioTracks.checkSyncedAudio( tis, mode == EDIT_INSERT, null, hasSelectedAudio )) return null;
     
      docLength      = timeline.getLength();
      cutLength      = span.getLength();
      if( mode == EDIT_INSERT ) {
        /*
         *  before delete:
         *
         *  |,,,,,,,,,,,,,,,,,|$$$$$$$#######|............|
         *  |,,,,,,,,,,,,,,,,,|$$$$$$$#######|............|
         *  |,,,,,,,,,,,,,,,,,|$$$$$$$#######|............|
         *  |,,,,,,,,A,,,,,,,,|$$B1$$$###B2##|......C.....|
         *  +-----------------+--------------+------------+
         *                    |     span     |
         *
         *  after delete:
         *                left right
         *  |,,,,,,,,,,,,,    |            |
         *  |,,,,,,,,,,,,,,,  |            |
         *  |,,,,,,,,,,,,,,,,,|            |
         *  |,,,,,,,,,,,,,,,,,|$$          |
         *  |,,,,,,,,,,,,,,,,,|$$$$        |
         *  |,,,,,,,,A,,,,,,,,|$B2$$$      |
         *  +-----------------+------------+
         *                    |
         *      plus
         *  |                 |    ........|
         *  |                 |  ..........|
         *  |                 |............|
         *  |               ##|............|
         *  |             ####|............|
         *  |           ###B2#|......C.....|
         *  +-----------------+------------+
         *                    |
         *                span.start
         */
        maxLen        = Math.min( cutLength, Math.min( span.start, docLength - span.stop ) << 1 );
        bc          = createBlendContext( maxLen >> 1, (maxLen + 1) >> 1, hasSelectedAudio.isSet() );
      } else {
        /*
         *  after delete:
         *                     blend-   blend-
         *                     Len      Len
         *  |,,,,,,,,,,,,,,,,,|$            #|............|
         *  |,,,,,,,,,,,,,,,,,|$$          ##|............|
         *  |,,,,,,,,,,,,,,,,,|$$$        ###|............|
         *  |,,,,,,,,A,,,,,,,,|$B1$      #B2#|......C.....|
         *  +-----------------+--------------+------------+
         *                    |     span     |
         */
        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( procName );

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

Examples of de.sciss.util.Flag

    final Container          cp          = getContentPane();
    final Application        app          = AbstractApplication.getApplication();
//    final ActionListener      lafActionListener;
    final OSCRoot          osc;
    final PrefCacheManager      cm;
    final Flag            haveWarned      = new Flag( false );
    final String          txtWarnLookAndFeel  = getResourceString( "warnLookAndFeelUpdate" );

    final TreeExpanderButton    ggTreeAudio;
    final List            collAudioAdvanced;
    SpringPanel            tab;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.