Exemplo n.º 1
0
 private Drawing createDrawing() {
   DefaultDrawing drawing = new DefaultDrawing();
   LinkedList<InputFormat> inputFormats = new LinkedList<InputFormat>();
   inputFormats.add(new SVGInputFormat());
   inputFormats.add(new SVGZInputFormat());
   inputFormats.add(new ImageInputFormat(new SVGImageFigure()));
   inputFormats.add(new TextInputFormat(new SVGTextFigure()));
   LinkedList<OutputFormat> outputFormats = new LinkedList<OutputFormat>();
   outputFormats.add(new SVGOutputFormat());
   outputFormats.add(new ImageOutputFormat());
   drawing.setInputFormats(inputFormats);
   drawing.setOutputFormats(outputFormats);
   return drawing;
 }
Exemplo n.º 2
0
 public Collection<Handle> createHandles(int detailLevel) {
   LinkedList<Handle> handles = new LinkedList<Handle>();
   switch (detailLevel % 2) {
     case -1: // Mouse hover handles
       handles.add(new BoundsOutlineHandle(this, false, true));
       break;
     case 0:
       handles.add(new BoundsOutlineHandle(this));
       handles.add(new MoveHandle(this, RelativeLocator.northWest()));
       handles.add(new MoveHandle(this, RelativeLocator.northEast()));
       handles.add(new MoveHandle(this, RelativeLocator.southWest()));
       handles.add(new MoveHandle(this, RelativeLocator.southEast()));
       handles.add(new FontSizeHandle(this));
       handles.add(new LinkHandle(this));
       break;
     case 1:
       TransformHandleKit.addTransformHandles(this, handles);
       break;
   }
   return handles;
 }