Package de.sciss.gui

Examples of de.sciss.gui.ParamField$Event


   
    private void perform()
    {
      final SpringPanel      msgPane;
      final int          result;
      final ParamField      ggDuration;
      final Param          durationSmps;
      final DefaultUnitTranslator  timeTrans;
     
      msgPane      = new SpringPanel( 4, 2, 4, 2 );
      timeTrans    = new DefaultUnitTranslator();
      ggDuration    = new ParamField( timeTrans );
      ggDuration.addSpace( ParamSpace.spcTimeHHMMSS );
      ggDuration.addSpace( ParamSpace.spcTimeSmps );
      ggDuration.addSpace( ParamSpace.spcTimeMillis );
      ggDuration.addSpace( ParamSpace.spcTimePercentF );
      msgPane.gridAdd( ggDuration, 0, 0 );
      msgPane.makeCompactGrid();
      GUIUtil.setInitialDialogFocus( ggDuration );

      timeTrans.setLengthAndRate( timeline.getLength(), timeline.getRate() );

      if( value == null ) {
        ggDuration.setValue( new Param( 60.0, ParamSpace.TIME | ParamSpace.SECS ));
      } else {
        ggDuration.setSpace( space );
        ggDuration.setValue( value );
      }

      final JOptionPane op = new JOptionPane( msgPane, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION );
//      result = JOptionPane.showOptionDialog( getFrame() == null ? null : getFrame().getWindow(), msgPane, getValue( NAME ).toString(),
//        JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null );
      result = BasicWindowHandler.showDialog( op, getTimelineFrame() == null ? null : getTimelineFrame().getWindow(), getValue( NAME ).toString() );

      if( result == JOptionPane.OK_OPTION ) {
        value      = ggDuration.getValue();
        space      = ggDuration.getSpace();
        durationSmps  = timeTrans.translate( value, ParamSpace.spcTimeSmps );
        if( durationSmps.val > 0.0 ) {
          final ProcessingThread proc;
         
          proc = initiate( timeline.getPosition(), (long) durationSmps.val );
View Full Code Here


        }
      });

      // XXX sync
      timeTrans    = new DefaultUnitTranslator();
      ggMarkPos    = new ParamField( timeTrans );
      ggMarkPos.addSpace( ParamSpace.spcTimeHHMMSS );
      ggMarkPos.addSpace( ParamSpace.spcTimeSmps );
      ggMarkPos.addSpace( ParamSpace.spcTimeMillis );
      ggMarkPos.addSpace( ParamSpace.spcTimePercentF );
View Full Code Here

    {
      final int          result;
      final Param          positionSmps;
      final Box          msgPane;
      final DefaultUnitTranslator  timeTrans;
      final ParamField      ggPosition;
//      final JComboBox        ggPosCombo;
      final Application      app  = AbstractApplication.getApplication();
     
      msgPane      = Box.createVerticalBox();
      // XXX sync
      timeTrans    = new DefaultUnitTranslator();
      ggPosition    = new ParamField( timeTrans );
      ggPosition.addSpace( ParamSpace.spcTimeHHMMSS );
      ggPosition.addSpace( ParamSpace.spcTimeSmps );
      ggPosition.addSpace( ParamSpace.spcTimeMillis );
      ggPosition.addSpace( ParamSpace.spcTimePercentF );
      timeTrans.setLengthAndRate( doc.timeline.getLength(), doc.timeline.getRate() )// XXX sync
      if( value != null ) {
        ggPosition.setSpace( space );
        ggPosition.setValue( value );
      }
//      ggPosition.setValue( position );
//      lbCurrentTime  = new TimeLabel( new Color( 0xE0, 0xE0, 0xE0 ));

//      ggPosition.setBorder( new ComboBoxEditorBorder() );
//      ggPosCombo = new JComboBox();
//      ggPosCombo.setEditor( ggPosition );
//      ggPosCombo.setEditable( true );

//      msgPane.gridAdd( ggPosCombo, 0, 1, -1, 1 );
      msgPane.add( Box.createVerticalGlue() );
//      msgPane.add( ggPosCombo );
JButton ggCurrent = new JButton( app.getResourceString( "buttonSetCurrent" ))// "Current"
ggCurrent.setFocusable( false );
//JLabel lbArrow = new JLabel( "\u2193" );  // "\u2939"
//Box b = Box.createHorizontalBox();
//b.add( lbArrow );
//b.add( ggCurrent );
ggCurrent.addActionListener( new ActionListener() {
  public void actionPerformed( ActionEvent ae )
  {
    final long pos = transport.isRunning() ? transport.getCurrentFrame() : doc.timeline.getPosition();
    ggPosition.setValue( new Param( pos, ParamSpace.TIME | ParamSpace.SMPS ))// XXX sync
    ggPosition.requestFocusInWindow();
  }
});
//msgPane.add( b );
msgPane.add( ggCurrent );
      msgPane.add( ggPosition );
      msgPane.add( Box.createVerticalGlue() );
     
      GUIUtil.setInitialDialogFocus( ggPosition );
     
//      ggPosCombo.removeAllItems();
//      // XXX sync
//      ggPosCombo.addItem( new StringItem( new Param( doc.timeline.getPosition() / doc.timeline.getRate(), ParamSpace.TIME | ParamSpace.SECS | ParamSpace.HHMMSS ).toString(), "Current" ));

      final JOptionPane op = new JOptionPane( msgPane, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION );
//      result = JOptionPane.showOptionDialog( BasicWindowHandler.getWindowAncestor( lbTime ), msgPane,
//        app.getResourceString( "inputDlgGoToTime" ),
//        JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null );
      result = BasicWindowHandler.showDialog( op, BasicWindowHandler.getWindowAncestor( lbTime ), app.getResourceString( "inputDlgGoToTime" ));
     
      if( result == JOptionPane.OK_OPTION ) {
        value      = ggPosition.getValue();
        space      = ggPosition.getSpace();
        positionSmps  = timeTrans.translate( value, ParamSpace.spcTimeSmps );
        doc.timeline.editPosition( this,
          Math.max( 0, Math.min( doc.timeline.getLength(),
          (long) positionSmps.val )));
      }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.EVENT: {
            Event event = (Event) theEObject;
            T result = caseEvent(event);
            if (result == null)
                result = caseFlowNode(event);
            if (result == null)
                result = caseInteractionNode(event);
View Full Code Here

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);
    TokenEntity tokenEntity = processInstanceImpl.getTokenMap().get(tokenId);
    processInstanceImpl.getContextInstance().setTransientVariableMap(transientVariables);
   
    if(nodeId==null){
      Event event=(Event)tokenEntity.getFlowNode();
      if(event instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)event;
        Activity activity =boundaryEvent.getAttachedToRef();
        boolean isCancelActivity=boundaryEvent.isCancelActivity();
        if(isCancelActivity){
View Full Code Here

    return bo != null && bo instanceof Event;
  }

  @Override
  public Object[] create(ICreateContext context) {
    Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
    EventWithDefinitions event = support.create(e);
    EventDefinition definition = createEventDefinition(context);
    event.getEventDefinitions().add(definition);
    addGraphicalRepresentation(context, definition);
    return new Object[] { definition };
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {
    ContainerShape container = context.getTargetContainer();
    Event event = (Event) getBusinessObjectForPictogramElement(container);

    EventWithDefinitions definitions = support.create(event);
    int size = definitions.getEventDefinitions().size();

    if (size > 1) {
View Full Code Here

    return intoDiagram || intoLane || intoParticipant || intoFlowELementContainer;
  }

  @Override
  public PictogramElement add(IAddContext context) {
    Event e = (Event) context.getNewObject();

    IPeService peService = Graphiti.getPeService();
    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);

    IGaService gaService = Graphiti.getGaService();

    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE
            + EVENT_TEXT_AREA);

    Shape ellipseShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(ellipseShape, EVENT_ELEMENT, EVENT_CIRCLE);
    Ellipse ellipse = createEventShape(ellipseShape);
    StyleUtil.applyBGStyle(ellipse, this);
    decorateEllipse(ellipse);

    Shape textShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
    Text text = gaService.createDefaultText(getDiagram(), textShape, e.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    gaService.setLocationAndSize(text, 0, EVENT_SIZE, EVENT_SIZE, EVENT_TEXT_AREA);
View Full Code Here

    public boolean canCreate(ICreateContext context) {
      if (!super.canCreate(context)) {
        return false;
      }

      Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());

      if (e instanceof StartEvent) {
        EObject container = context.getTargetContainer().eContainer();
        if (container instanceof Shape) {
          Object o = getBusinessObjectForPictogramElement((Shape) container);
View Full Code Here

    public boolean canCreate(ICreateContext context) {
      if (!super.canCreate(context)) {
        return false;
      }

      Event e = (Event) getBusinessObjectForPictogramElement(context.getTargetContainer());
      if (e instanceof ThrowEvent) {
        return false;
      }

      return true;
View Full Code Here

TOP

Related Classes of de.sciss.gui.ParamField$Event

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.