protected void populateOperators(){
  registerContentOperator(DEFAULT_OPERATOR,new IgnoreOperator());
  registerContentOperator("q",new PushGraphicsStateOperator());
  registerContentOperator("Q",new PopGraphicsStateOperator());
  registerContentOperator("cm",new ModifyCurrentTransformationMatrixOperator());
  registerContentOperator("Do",new DoOperator());
  registerContentOperator("BMC",new BeginMarkedContentOperator());
  registerContentOperator("BDC",new BeginMarkedContentDictionaryOperator());
  registerContentOperator("EMC",new EndMarkedContentOperator());
  if (supportedEvents == null || supportedEvents.contains(EventType.RENDER_TEXT) || supportedEvents.contains(EventType.RENDER_PATH) || supportedEvents.contains(EventType.CLIP_PATH_CHANGED)) {
    registerContentOperator("g",new SetGrayFillOperator());
    registerContentOperator("G",new SetGrayStrokeOperator());
    registerContentOperator("rg",new SetRGBFillOperator());
    registerContentOperator("RG",new SetRGBStrokeOperator());
    registerContentOperator("k",new SetCMYKFillOperator());
    registerContentOperator("K",new SetCMYKStrokeOperator());
    registerContentOperator("cs",new SetColorSpaceFillOperator());
    registerContentOperator("CS",new SetColorSpaceStrokeOperator());
    registerContentOperator("sc",new SetColorFillOperator());
    registerContentOperator("SC",new SetColorStrokeOperator());
    registerContentOperator("scn",new SetColorFillOperator());
    registerContentOperator("SCN",new SetColorStrokeOperator());
    registerContentOperator("gs",new ProcessGraphicsStateResourceOperator());
  }
  if (supportedEvents == null || supportedEvents.contains(EventType.RENDER_IMAGE)) {
    registerContentOperator("EI",new EndImageOperator());
  }
  if (supportedEvents == null || supportedEvents.contains(EventType.RENDER_TEXT) || supportedEvents.contains(EventType.BEGIN_TEXT) || supportedEvents.contains(EventType.END_TEXT)) {
    registerContentOperator("BT",new BeginTextOperator());
    registerContentOperator("ET",new EndTextOperator());
  }
  if (supportedEvents == null || supportedEvents.contains(EventType.RENDER_TEXT)) {
    SetTextCharacterSpacingOperator tcOperator=new SetTextCharacterSpacingOperator();
    registerContentOperator("Tc",tcOperator);
    SetTextWordSpacingOperator twOperator=new SetTextWordSpacingOperator();
    registerContentOperator("Tw",twOperator);
    registerContentOperator("Tz",new SetTextHorizontalScalingOperator());
    SetTextLeadingOperator tlOperator=new SetTextLeadingOperator();
    registerContentOperator("TL",tlOperator);
    registerContentOperator("Tf",new SetTextFontOperator());
    registerContentOperator("Tr",new SetTextRenderModeOperator());
    registerContentOperator("Ts",new SetTextRiseOperator());
    TextMoveStartNextLineOperator tdOperator=new TextMoveStartNextLineOperator();
    registerContentOperator("Td",tdOperator);
    registerContentOperator("TD",new TextMoveStartNextLineWithLeadingOperator(tdOperator,tlOperator));
    registerContentOperator("Tm",new TextSetTextMatrixOperator());
    TextMoveNextLineOperator tstarOperator=new TextMoveNextLineOperator(tdOperator);
    registerContentOperator("T*",tstarOperator);
    ShowTextOperator tjOperator=new ShowTextOperator();
    registerContentOperator("Tj",tjOperator);
    MoveNextLineAndShowTextOperator tickOperator=new MoveNextLineAndShowTextOperator(tstarOperator,tjOperator);
    registerContentOperator("'",tickOperator);
    registerContentOperator("\"",new MoveNextLineAndShowTextWithSpacingOperator(twOperator,tcOperator,tickOperator));
    registerContentOperator("TJ",new ShowTextArrayOperator());
  }
  if (supportedEvents == null || supportedEvents.contains(EventType.CLIP_PATH_CHANGED) || supportedEvents.contains(EventType.RENDER_PATH)) {
    registerContentOperator("w",new SetLineWidthOperator());
    registerContentOperator("J",new SetLineCapOperator());
    registerContentOperator("j",new SetLineJoinOperator());
    registerContentOperator("M",new SetMiterLimitOperator());
    registerContentOperator("d",new SetLineDashPatternOperator());
    int fillStroke=PathRenderInfo.FILL | PathRenderInfo.STROKE;
    registerContentOperator("m",new MoveToOperator());
    registerContentOperator("l",new LineToOperator());
    registerContentOperator("c",new CurveOperator());
    registerContentOperator("v",new CurveFirstPointDuplicatedOperator());
    registerContentOperator("y",new CurveFourhPointDuplicatedOperator());
    registerContentOperator("h",new CloseSubpathOperator());
    registerContentOperator("re",new RectangleOperator());
    registerContentOperator("S",new PaintPathOperator(PathRenderInfo.STROKE,-1,false));
    registerContentOperator("s",new PaintPathOperator(PathRenderInfo.STROKE,-1,true));
    registerContentOperator("f",new PaintPathOperator(PathRenderInfo.FILL,PdfCanvasConstants.FillingRule.NONZERO_WINDING,false));
    registerContentOperator("F",new PaintPathOperator(PathRenderInfo.FILL,PdfCanvasConstants.FillingRule.NONZERO_WINDING,false));
    registerContentOperator("f*",new PaintPathOperator(PathRenderInfo.FILL,PdfCanvasConstants.FillingRule.EVEN_ODD,false));
    registerContentOperator("B",new PaintPathOperator(fillStroke,PdfCanvasConstants.FillingRule.NONZERO_WINDING,false));
    registerContentOperator("B*",new PaintPathOperator(fillStroke,PdfCanvasConstants.FillingRule.EVEN_ODD,false));
    registerContentOperator("b",new PaintPathOperator(fillStroke,PdfCanvasConstants.FillingRule.NONZERO_WINDING,true));
    registerContentOperator("b*",new PaintPathOperator(fillStroke,PdfCanvasConstants.FillingRule.EVEN_ODD,true));
    registerContentOperator("n",new PaintPathOperator(PathRenderInfo.NO_OP,-1,false));
    registerContentOperator("W",new ClipPathOperator(PdfCanvasConstants.FillingRule.NONZERO_WINDING));
    registerContentOperator("W*",new ClipPathOperator(PdfCanvasConstants.FillingRule.EVEN_ODD));
  }
}

protected void populateOperators ( ) { registerContentOperator ( DEFAULT_OPERATOR , new IgnoreOperator ( ) ) ; registerContentOperator ( "q" , new PushGraphicsStateOperator ( ) ) ; registerContentOperator ( "Q" , new PopGraphicsStateOperator ( ) ) ; registerContentOperator ( "cm" , new ModifyCurrentTransformationMatrixOperator ( ) ) ; registerContentOperator ( "Do" , new DoOperator ( ) ) ; registerContentOperator ( "BMC" , new BeginMarkedContentOperator ( ) ) ; registerContentOperator ( "BDC" , new BeginMarkedContentDictionaryOperator ( ) ) ; registerContentOperator ( "EMC" , new EndMarkedContentOperator ( ) ) ; if ( supportedEvents == null || supportedEvents . contains ( EventType . RENDER_TEXT ) || supportedEvents . contains ( EventType . RENDER_PATH ) || supportedEvents . contains ( EventType . CLIP_PATH_CHANGED ) ) { registerContentOperator ( "g" , new SetGrayFillOperator ( ) ) ; registerContentOperator ( "G" , new SetGrayStrokeOperator ( ) ) ; registerContentOperator ( "rg" , new SetRGBFillOperator ( ) ) ; registerContentOperator ( "RG" , new SetRGBStrokeOperator ( ) ) ; registerContentOperator ( "k" , new SetCMYKFillOperator ( ) ) ; registerContentOperator ( "K" , new SetCMYKStrokeOperator ( ) ) ; registerContentOperator ( "cs" , new SetColorSpaceFillOperator ( ) ) ; registerContentOperator ( "CS" , new SetColorSpaceStrokeOperator ( ) ) ; registerContentOperator ( "sc" , new SetColorFillOperator ( ) ) ; registerContentOperator ( "SC" , new SetColorStrokeOperator ( ) ) ; registerContentOperator ( "scn" , new SetColorFillOperator ( ) ) ; registerContentOperator ( "SCN" , new SetColorStrokeOperator ( ) ) ; registerContentOperator ( "gs" , new ProcessGraphicsStateResourceOperator ( ) ) ; } if ( supportedEvents == null || supportedEvents . contains ( EventType . RENDER_IMAGE ) ) { registerContentOperator ( "EI" , new EndImageOperator ( ) ) ; } if ( supportedEvents == null || supportedEvents . contains ( EventType . RENDER_TEXT ) || supportedEvents . contains ( EventType . BEGIN_TEXT ) || supportedEvents . contains ( EventType . END_TEXT ) ) { registerContentOperator ( "BT" , new BeginTextOperator ( ) ) ; registerContentOperator ( "ET" , new EndTextOperator ( ) ) ; } if ( supportedEvents == null || supportedEvents . contains ( EventType . RENDER_TEXT ) ) { SetTextCharacterSpacingOperator tcOperator = new SetTextCharacterSpacingOperator ( ) ; registerContentOperator ( "Tc" , tcOperator ) ; SetTextWordSpacingOperator twOperator = new SetTextWordSpacingOperator ( ) ; registerContentOperator ( "Tw" , twOperator ) ; registerContentOperator ( "Tz" , new SetTextHorizontalScalingOperator ( ) ) ; SetTextLeadingOperator tlOperator = new SetTextLeadingOperator ( ) ; registerContentOperator ( "TL" , tlOperator ) ; registerContentOperator ( "Tf" , new SetTextFontOperator ( ) ) ; registerContentOperator ( "Tr" , new SetTextRenderModeOperator ( ) ) ; registerContentOperator ( "Ts" , new SetTextRiseOperator ( ) ) ; TextMoveStartNextLineOperator tdOperator = new TextMoveStartNextLineOperator ( ) ; registerContentOperator ( "Td" , tdOperator ) ; registerContentOperator ( "TD" , new TextMoveStartNextLineWithLeadingOperator ( tdOperator , tlOperator ) ) ; registerContentOperator ( "Tm" , new TextSetTextMatrixOperator ( ) ) ; TextMoveNextLineOperator tstarOperator = new TextMoveNextLineOperator ( tdOperator ) ; registerContentOperator ( "T*" , tstarOperator ) ; ShowTextOperator tjOperator = new ShowTextOperator ( ) ; registerContentOperator ( "Tj" , tjOperator ) ; MoveNextLineAndShowTextOperator tickOperator = new MoveNextLineAndShowTextOperator ( tstarOperator , tjOperator ) ; registerContentOperator ( "'" , tickOperator ) ; registerContentOperator ( "\"" , new MoveNextLineAndShowTextWithSpacingOperator ( twOperator , tcOperator , tickOperator ) ) ; registerContentOperator ( "TJ" , new ShowTextArrayOperator ( ) ) ; } if ( supportedEvents == null || supportedEvents . contains ( EventType . CLIP_PATH_CHANGED ) || supportedEvents . contains ( EventType . RENDER_PATH ) ) { registerContentOperator ( "w" , new SetLineWidthOperator ( ) ) ; registerContentOperator ( "J" , new SetLineCapOperator ( ) ) ; registerContentOperator ( "j" , new SetLineJoinOperator ( ) ) ; registerContentOperator ( "M" , new SetMiterLimitOperator ( ) ) ; registerContentOperator ( "d" , new SetLineDashPatternOperator ( ) ) ; int fillStroke = PathRenderInfo . FILL | PathRenderInfo . STROKE ; registerContentOperator ( "m" , new MoveToOperator ( ) ) ; registerContentOperator ( "l" , new LineToOperator ( ) ) ; registerContentOperator ( "c" , new CurveOperator ( ) ) ; registerContentOperator ( "v" , new CurveFirstPointDuplicatedOperator ( ) ) ; registerContentOperator ( "y" , new CurveFourhPointDuplicatedOperator ( ) ) ; registerContentOperator ( "h" , new CloseSubpathOperator ( ) ) ; registerContentOperator ( "re" , new RectangleOperator ( ) ) ; registerContentOperator ( "S" , new PaintPathOperator ( PathRenderInfo . STROKE , - 1 , false ) ) ; registerContentOperator ( "s" , new PaintPathOperator ( PathRenderInfo . STROKE , - 1 , true ) ) ; registerContentOperator ( "f" , new PaintPathOperator ( PathRenderInfo . FILL , PdfCanvasConstants . FillingRule . NONZERO_WINDING , false ) ) ; registerContentOperator ( "F" , new PaintPathOperator ( PathRenderInfo . FILL , PdfCanvasConstants . FillingRule . NONZERO_WINDING , false ) ) ; registerContentOperator ( "f*" , new PaintPathOperator ( PathRenderInfo . FILL , PdfCanvasConstants . FillingRule . EVEN_ODD , false ) ) ; registerContentOperator ( "B" , new PaintPathOperator ( fillStroke , PdfCanvasConstants . FillingRule . NONZERO_WINDING , false ) ) ; registerContentOperator ( "B*" , new PaintPathOperator ( fillStroke , PdfCanvasConstants . FillingRule . EVEN_ODD , false ) ) ; registerContentOperator ( "b" , new PaintPathOperator ( fillStroke , PdfCanvasConstants . FillingRule . NONZERO_WINDING , true ) ) ; registerContentOperator ( "b*" , new PaintPathOperator ( fillStroke , PdfCanvasConstants . FillingRule . EVEN_ODD , true ) ) ; registerContentOperator ( "n" , new PaintPathOperator ( PathRenderInfo . NO_OP , - 1 , false ) ) ; registerContentOperator ( "W" , new ClipPathOperator ( PdfCanvasConstants . FillingRule . NONZERO_WINDING ) ) ; registerContentOperator ( "W*" , new ClipPathOperator ( PdfCanvasConstants . FillingRule . EVEN_ODD ) ) ; } }
loads all the supported graphics and text state operators in a map .
