メインコンテンツへスキップ
Visual Components は、Windows 版 FRE に実装されています。
Component Synchronizer は、Visual Components で発生するさまざまなイベントに自動的に応答する特別なコンポーネントです。複数の Visual Components を Synchronizer に接続すると、それらを 1 つのアプリケーションとして動作させることができます。 接続されているコンポーネントすべてを Component Synchronizer で使用する必要はなく、必要なものだけを接続できます。たとえば、Image Viewer は ImageViewer プロパティを介して、Text Editor は TextEditor プロパティを介して接続できます。 Component Synchronizer にはユーザーインターフェイスがありません。また、Visual Components の内部機能は使用せず、各コンポーネントの COM API のみを使用します。Component Synchronizer は以下のように動作します。

コンポーネントが API を介して Synchronizer に接続された場合

コンポーネントまたはオブジェクトが、次のいずれかを介して Component Synchronizer に接続されている場合:
この場合、IComponentSynchronizer::ImageViewer プロパティは指定された ImageViewer オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
IImageViewer::ZoomRectEnabledTrue
IImageViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IImageViewer::FRPageIComponentSynchronizer::Document 内で IComponentSynchronizer::PageIndex インデックスに対応するページ
この場合、IComponentSynchronizer::ZoomViewer プロパティは指定された ZoomViewer オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
IZoomViewer::SymbolRectEnabledTrue
IZoomViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IZoomViewer::FRPageIComponentSynchronizer::Document 内で IComponentSynchronizer::PageIndex インデックスに対応するページ
この場合、IComponentSynchronizer::TextEditor プロパティは指定された TextEditor オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
ITextEditor::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams オブジェクトの SynthesisParamsForDocument プロパティの値
ITextEditor::FRPageIComponentSynchronizer::Document 内で IComponentSynchronizer::PageIndex インデックスに対応するページ
この場合、IComponentSynchronizer::TextValidator プロパティは指定された TextValidator オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
ITextValidator::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams オブジェクトの SynthesisParamsForDocument プロパティの値
ITextValidator::FRDocumentIComponentSynchronizer::Document
この場合、IComponentSynchronizer::DocumentViewer プロパティは指定された DocumentViewer オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
IDocumentViewer::FRDocumentIComponentSynchronizer::Document
IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IDocumentViewer::ActivePageIComponentSynchronizer::Document 内で IComponentSynchronizer::PageIndex インデックスに対応するページ
この場合、IComponentSynchronizer::Document プロパティは指定された FRDocument オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageIComponentSynchronizer::Document の最初のページ
IComponentSynchronizer::PageIndex0
IDocumentViewer::FRDocument ITextValidator::FRDocumentIComponentSynchronizer::Document
この場合、IComponentSynchronizer::DocumentProcessingParams プロパティは指定された DocumentProcessingParams オブジェクトに設定され、その後、次の操作が実行されます:
プロパティ設定値
IImageViewer::DocumentProcessingParams IZoomViewer::DocumentProcessingParams IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
ITextEditor::SynthesisParamsForDocument ITextValidator::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams オブジェクトの SynthesisParamsForDocument プロパティの値
この場合、IComponentSynchronizer::PageIndex プロパティは指定された値に設定され、その後、次の操作が実行されます:
プロパティ設定値
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageIComponentSynchronizer::Document 内で IComponentSynchronizer::PageIndex インデックスに対応するページ

接続されたコンポーネントがイベントを発生させた場合

接続された Image Viewer のイベント:
Image Viewer で OnMouseButtonUp イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( mouseButton == MBU_LeftButton && ZoomViewer != 0 ) {
 int documentX = 0;
 int documentY = 0;
 ImageViewer->ScreenToDocument( x, y, &documentX, &documentY );
 ZoomViewer->CenterOnDocumentPoint( documentX, documentY );
}
Image Viewer で OnBlockSelectionChanged イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
Image Viewer で OnTableCellsSelected イベントが発生すると、Component Synchronizer は、選択されたブロックのインデックスと右下セルのインデックスを指定して、TextEditor オブジェクトの ShowBlock メソッドを呼び出します。
Image Viewer で OnAfterDblClick イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
Image Viewer で OnActivePageChanged イベントが発生し、さらに ComponentSynchronizer オブジェクトの ZoomViewer、TextEditor、DocumentViewer プロパティがすでに設定されている場合は、対応するコンポーネントの FRPage または ActivePage プロパティが、文書内の指定されたページに設定されます。
Image Viewer で OnSelectTool イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( ZoomViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ZoomViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ZoomViewer->put_ActiveTool( selectedTool );
}
Image Viewer で OnOptionsChanged イベントが発生し、さらに ComponentSynchronizer オブジェクトの ZoomViewer、DocumentViewer、TextEditor、TextValidator プロパティがすでに設定されている場合は、ZoomViewer、DocumentViewer、TextEditor、TextValidator オブジェクトの UpdateOptions メソッドが呼び出されます。
接続された Zoom Viewer のイベント:
Zoom Viewer で OnVisibleDocumentAreaChange イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( ImageViewer != 0 ) {
 ImageViewer->put_ZoomRect( visibleRect );
 if( isInFocus ) {
  ImageViewer->ShowDocumentArea( visibleRect );
 }
}
Zoom Viewer で OnBlockSelectionChanged イベントが発生すると、Component Synchronizer は次の処理を実行します:
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
Zoom Viewer で OnTableCellsSelected イベントが発生すると、Component Synchronizer は、選択されたブロックのインデックスと右下セルのインデックスを指定して、TextEditor オブジェクトの ShowBlock メソッドを呼び出します。
Zoom Viewer で OnAfterDblClick イベントが発生すると、Component Synchronizer は次の処理を実行します。
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
Zoom Viewer で OnActivePageChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、TextEditor、DocumentViewer プロパティがすでに設定されている場合、対応するコンポーネントの FRPage または ActivePage プロパティは、Document 内の指定されたページに設定されます。
Zoom Viewer で OnSelectTool イベントが発生すると、Component Synchronizer は次の処理を実行します。
if( ImageViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ImageViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ImageViewer->put_ActiveTool( selectedTool );
}
Zoom Viewer で OnOptionsChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、DocumentViewer、TextEditor、TextValidator プロパティがすでに設定されている場合、ImageViewer、DocumentViewer、TextEditor、TextValidator オブジェクトの UpdateOptions メソッドが呼び出されます。
接続された Document Viewer のイベント:
Document Viewer で OnActivePageChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor プロパティがすでに設定されている場合、対応するコンポーネントの FRPage プロパティは、Document 内の指定されたページに設定されます。
Document Viewer で OnDocumentChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor、TextValidator プロパティがすでに設定されている場合:
  • TextValidator オブジェクトの FRDocument プロパティが新しいDocumentに設定されます
  • ImageViewer、ZoomViewer、TextEditor オブジェクトの FRPage プロパティと、DocumentViewer オブジェクトの ActivePage プロパティが、新しいDocumentの最初のページに設定されます
Document Viewer で OnOptionsChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor、TextValidator プロパティがすでに設定されている場合、ImageViewer、ZoomViewer、TextEditor、TextValidator オブジェクトの UpdateOptions メソッドが呼び出されます。
接続された Text Editor のイベント:
Text Editor で OnEditorBlockChanged イベントが発生すると、ComponentSynchronizer は次の処理を実行します。
  1. ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer プロパティがすでに設定されている場合、指定されたブロックに対して、ImageViewer オブジェクトおよび ZoomViewer オブジェクトの SetSelectedBlocksIndices メソッドが呼び出されます。
  2. それがテーブルブロックの場合は、選択されたセルに対して、ImageViewer オブジェクトおよび ZoomViewer オブジェクトの SetSelectedCells メソッドが呼び出されます。
  3. その後、ImageViewer オブジェクトおよび ZoomViewer オブジェクトの ShowDocumentArea メソッドが呼び出されます。
Text Editor で OnSymbolSelected イベントが発生すると、Component Synchronizer は次の処理を実行します。
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRect );
}
if( ImageViewer != 0 ) {
 ImageViewer->ShowDocumentArea( symbolRect );
}
if( ZoomViewer != 0 ) {
 ZoomViewer->ShowDocumentArea( symbolRect );
}
Text Editor で OnActivePageChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、DocumentViewer プロパティがすでに設定されている場合、対応するコンポーネントの FRPage または ActivePage プロパティが、Document 内の指定されたページに設定されます。
Text Editor で OnOptionsChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、DocumentViewer、TextValidator プロパティがすでに設定されている場合、ImageViewer、ZoomViewer、DocumentViewer、TextValidator オブジェクトの UpdateOptions メソッドが呼び出されます。
接続されている Text Validator のイベント:
Text Validator で OnSymbolSelected イベントが発生すると、Component Synchronizer は次の処理を実行します。
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRectangle );
}
Text Validator で OnSelectionChanged イベントが発生すると、Component Synchronizer は次の処理を実行します。
int symbolPos;
IEditorPosition* nextPosition;
position->get_Symbol( &symbolPos );
nextPosition->put_Symbol( symbolPos + length );
if( textEditor != 0 ) {
 textEditor->SetSelection( position, nextPosition );
}
Text Validator で OnActivePageChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor、DocumentViewer プロパティがすでに設定されている場合、対応するコンポーネントの FRPage または ActivePage プロパティが、Document 内の指定されたページに設定されます。
Text Validator で OnDocumentChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor、DocumentViewer プロパティがすでに設定されている場合:
  • DocumentViewer オブジェクトの FRDocument プロパティが新しいDocumentに設定されます
  • ImageViewer、ZoomViewer、TextEditor オブジェクトの FRPage プロパティと、DocumentViewer オブジェクトの ActivePage プロパティが、新しいDocumentの最初のページに設定されます
Text Validator で OnOptionsChanged イベントが発生し、ComponentSynchronizer オブジェクトの ImageViewer、ZoomViewer、TextEditor、DocumentViewer プロパティがすでに設定されている場合、ImageViewer、ZoomViewer、TextEditor、DocumentViewer オブジェクトの UpdateOptions メソッドが呼び出されます。

関連項目

ComponentSynchronizer