/// <summary>
 /// Initializes this dialog with the required and optional contexts</summary>
 /// <param name="selectionContext">Selection context -- required</param>
 /// <param name="namingContext">Naming context -- required</param>
 /// <param name="transactionContext">Transaction context -- optional</param>
 /// <remarks>Combine with the constructor? This separate Set() only makes sense if this dialog box
 /// is floating or dockable.</remarks>
 public void Set(
     ISelectionContext selectionContext,
     INamingContext namingContext,
     ITransactionContext transactionContext)
 {
     m_selectionContext = selectionContext;
     m_namingContext = namingContext;
     m_transactionContext = transactionContext;
     UpdatePreview();
 }
 /// <summary>
 /// Initializes this dialog with the required and optional contexts</summary>
 /// <param name="selectionContext">Selection context -- required</param>
 /// <param name="namingContext">Naming context -- required</param>
 /// <param name="transactionContext">Transaction context -- optional</param>
 /// <remarks>Combine with the constructor? This separate Set() only makes sense if this dialog box
 /// is floating or dockable.</remarks>
 public void Set(
     ISelectionContext selectionContext,
     INamingContext namingContext,
     ITransactionContext transactionContext)
 {
     m_selectionContext   = selectionContext;
     m_namingContext      = namingContext;
     m_transactionContext = transactionContext;
     UpdatePreview();
 }
Exemple #3
0
        private void PrepareForEdit()
        {
            if (!AdaptedControl.Capture)
            {
                INamingContext namingContext = AdaptedControl.ContextAs <INamingContext>();
                BeginEdit(
                    namingContext,
                    m_itemHitRecord.Item,
                    m_hitLabel);
            }

            m_itemHitRecord = null;
            m_hitLabel      = null;
        }
Exemple #4
0
        /// <summary>
        /// Begins a label editing operation</summary>
        /// <param name="namingContext">Naming context that performs naming operations</param>
        /// <param name="item">Item with label</param>
        /// <param name="label">Information about label</param>
        public void BeginEdit(INamingContext namingContext, object item, DiagramLabel label)
        {
            m_namingContext = namingContext;
            m_item          = item;
            m_label         = label;
            m_labelBounds   = label.Bounds;
            float fontScale = 1.0f;

            if (m_transformAdapter != null)
            {
                Matrix transform = m_transformAdapter.Transform;
                m_labelBounds = GdiUtil.Transform(transform, m_labelBounds);
                // in case of non-uniform scaling, prefer vertical (y) scale for magnification factor;
                //  Timeline control is the only example of non-uniform scale right now, and y-scale works
                //  better in this case.
                fontScale *= transform.Elements[3];
            }

            m_textBox.Text = m_namingContext.GetName(m_item);

            Font font = this.AdaptedControl.Font;

            m_textBox.Font = new Font(font.FontFamily, (int)(font.SizeInPoints * fontScale));

            TextFormatFlags flags = m_label.Format;

            m_textBox.Multiline = (flags & TextFormatFlags.SingleLine) == 0;

            HorizontalAlignment alignment = HorizontalAlignment.Left;

            if ((flags & TextFormatFlags.Right) != 0)
            {
                alignment = HorizontalAlignment.Right;
            }
            else if ((flags & TextFormatFlags.HorizontalCenter) != 0)
            {
                alignment = HorizontalAlignment.Center;
            }
            m_textBox.TextAlign = alignment;

            SizeTextBox();

            m_textBox.Visible = true;
            m_textBox.Focus();
            m_textBox.SelectAll();
        }
Exemple #5
0
        /// <summary>
        /// Called when the underlying ListView raises the NodeLabelEdited event</summary>
        /// <param name="e">Event args from the underlying ListView's NodeLabelEdited event</param>
        protected virtual void OnNodeLabelEdited(LabelEditEventArgs e)
        {
            IListView      listView      = m_listViewAdapter.ListView;
            ListViewItem   item          = m_listView.Items[e.Item];
            INamingContext namingContext = listView.As <INamingContext>();

            if (namingContext != null &&
                namingContext.CanSetName(item.Tag))
            {
                ITransactionContext transactionContext = listView.As <ITransactionContext>();
                transactionContext.DoTransaction(
                    delegate
                {
                    namingContext.SetName(item.Tag, e.Label);
                }, "Edit Label".Localize());
            }
        }
Exemple #6
0
        private void selectionAdapter_SelectedItemHit(object sender, DiagramHitEventArgs e)
        {
            m_itemHitRecord = e.HitRecord;
            // hit on diagram label part?
            DiagramLabel hitLabel = e.HitRecord.Part.As <DiagramLabel>();

            if (hitLabel != null)
            {
                INamingContext namingContext = AdaptedControl.ContextAs <INamingContext>();
                if (namingContext != null)
                {
                    // if label editing is enabled, mouse is over label, and item can be named, open it for edit
                    if (namingContext.CanSetName(e.HitRecord.Item))
                    {
                        m_hitLabel = hitLabel;
                        m_labelEditTimer.Interval = SystemInformation.DoubleClickTime;
                        m_labelEditTimer.Enabled  = true;
                    }
                }
            }
        }
        /// <summary>
        /// Begins a label editing operation</summary>
        /// <param name="namingContext">Naming context that performs naming operations</param>
        /// <param name="item">Item with label</param>
        /// <param name="label">Information about label</param>
        public void BeginEdit(INamingContext namingContext, object item, DiagramLabel label)
        {
            m_namingContext = namingContext;
            m_item = item;
            m_label = label;
            m_labelBounds = label.Bounds;
            float fontScale = 1.0f;
            if (m_transformAdapter != null)
            {
                Matrix transform = m_transformAdapter.Transform;
                m_labelBounds = GdiUtil.Transform(transform, m_labelBounds);
                // in case of non-uniform scaling, prefer vertical (y) scale for magnification factor;
                //  Timeline control is the only example of non-uniform scale right now, and y-scale works
                //  better in this case.
                fontScale *= transform.Elements[3];
            }

            m_textBox.Text = m_namingContext.GetName(m_item);

            Font font = this.AdaptedControl.Font;
            m_textBox.Font = new Font(font.FontFamily, (int)(font.SizeInPoints * fontScale));

            TextFormatFlags flags = m_label.Format;
            m_textBox.Multiline = (flags & TextFormatFlags.SingleLine) == 0;

            HorizontalAlignment alignment = HorizontalAlignment.Left;
            if ((flags & TextFormatFlags.Right) != 0)
                alignment = HorizontalAlignment.Right;
            else if ((flags & TextFormatFlags.HorizontalCenter) != 0)
                alignment = HorizontalAlignment.Center;
            m_textBox.TextAlign = alignment;

            SizeTextBox();

            m_textBox.Visible = true;
            m_textBox.Focus();
                m_textBox.SelectAll();
        }
 public StatementContextRuntimeServices(
     IContainer container,
     ContextManagementService contextManagementService,
     ContextServiceFactory contextServiceFactory,
     DatabaseConfigServiceRuntime databaseConfigService,
     DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter,
     EPDataFlowServiceImpl dataflowService,
     string runtimeURI,
     INamingContext runtimeEnvContext,
     ImportServiceRuntime importServiceRuntime,
     RuntimeSettingsService runtimeSettingsService,
     RuntimeExtensionServices runtimeExtensionServices,
     object epRuntime,
     EPRenderEventService epRuntimeRenderEvent,
     EventServiceSendEventCommon eventServiceSendEventInternal,
     EPRuntimeEventProcessWrapped epRuntimeEventProcessWrapped,
     EventBeanService eventBeanService,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     EventTableIndexService eventTableIndexService,
     EventTypeAvroHandler eventTypeAvroHandler,
     PathRegistry<string, EventType> eventTypePathRegistry,
     EventTypeRepositoryImpl eventTypeRepositoryPreconfigured,
     EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory,
     ExceptionHandlingService exceptionHandlingService,
     ExpressionResultCacheService expressionResultCacheService,
     FilterBooleanExpressionFactory filterBooleanExpressionFactory,
     FilterSharedBoolExprRepository filterSharedBoolExprRepository,
     FilterSharedLookupableRepository filterSharedLookupableRepository,
     HistoricalDataCacheFactory historicalDataCacheFactory,
     InternalEventRouter internalEventRouter,
     MetricReportingService metricReportingService,
     NamedWindowConsumerManagementService namedWindowConsumerManagementService,
     NamedWindowManagementService namedWindowManagementService,
     PathRegistry<string, ContextMetaData> pathContextRegistry,
     PathRegistry<string, NamedWindowMetaData> pathNamedWindowRegistry,
     RowRecogStateRepoFactory rowRecogStateRepoFactory,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     StatementAgentInstanceLockFactory statementAgentInstanceLockFactory,
     StatementResourceHolderBuilder statementResourceHolderBuilder,
     TableExprEvaluatorContext tableExprEvaluatorContext,
     TableManagementService tableManagementService,
     VariableManagementService variableManagementService,
     ViewFactoryService viewFactoryService,
     ViewServicePreviousFactory viewServicePreviousFactory)
 {
     Container = container;
     ContextManagementService = contextManagementService;
     ContextServiceFactory = contextServiceFactory;
     DatabaseConfigService = databaseConfigService;
     DataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter;
     DataflowService = dataflowService;
     RuntimeURI = runtimeURI;
     RuntimeEnvContext = runtimeEnvContext;
     ImportServiceRuntime = importServiceRuntime;
     RuntimeSettingsService = runtimeSettingsService;
     RuntimeExtensionServices = runtimeExtensionServices;
     Runtime = epRuntime;
     EPRuntimeRenderEvent = epRuntimeRenderEvent;
     EventServiceSendEventInternal = eventServiceSendEventInternal;
     EPRuntimeEventProcessWrapped = epRuntimeEventProcessWrapped;
     EventBeanService = eventBeanService;
     EventBeanTypedEventFactory = eventBeanTypedEventFactory;
     EventTableIndexService = eventTableIndexService;
     EventTypeAvroHandler = eventTypeAvroHandler;
     EventTypePathRegistry = eventTypePathRegistry;
     EventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured;
     EventTypeResolvingBeanFactory = eventTypeResolvingBeanFactory;
     ExceptionHandlingService = exceptionHandlingService;
     ExpressionResultCacheService = expressionResultCacheService;
     FilterBooleanExpressionFactory = filterBooleanExpressionFactory;
     FilterSharedBoolExprRepository = filterSharedBoolExprRepository;
     FilterSharedLookupableRepository = filterSharedLookupableRepository;
     HistoricalDataCacheFactory = historicalDataCacheFactory;
     InternalEventRouter = internalEventRouter;
     MetricReportingService = metricReportingService;
     NamedWindowConsumerManagementService = namedWindowConsumerManagementService;
     NamedWindowManagementService = namedWindowManagementService;
     PathContextRegistry = pathContextRegistry;
     PathNamedWindowRegistry = pathNamedWindowRegistry;
     RowRecogStateRepoFactory = rowRecogStateRepoFactory;
     ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
     StatementAgentInstanceLockFactory = statementAgentInstanceLockFactory;
     StatementResourceHolderBuilder = statementResourceHolderBuilder;
     TableExprEvaluatorContext = tableExprEvaluatorContext;
     TableManagementService = tableManagementService;
     VariableManagementService = variableManagementService;
     ViewFactoryService = viewFactoryService;
     ViewServicePreviousFactory = viewServicePreviousFactory;
 }