コード例 #1
0
 /**
  * Creates a new UML deployment diagram. Override in subclass.
  *
  * @return Deployment diagram.
  */
 public UMLDeploymentDiagram createDiagram() {
   EPSGraphics2D document =
       new EPSGraphics2D(
           0.0,
           0.0,
           getLayoutAlgorithm().getDiagramWidth(),
           getLayoutAlgorithm().getDiagramHeght());
   document.setColor(Color.darkGray);
   document.setStroke(new BasicStroke(0.2F));
   return new UMLDeploymentDiagram(document);
 }
コード例 #2
0
 private void save(String filePath, EPSGraphics2D document) {
   filePath = filePath + EPS_FILE_EXTENSION;
   FileOutputStream file = null;
   try {
     file = new FileOutputStream(filePath);
     file.write(document.getBytes());
   } catch (IOException e) {
     logger.err("IOException: %s, while writing file", e.getMessage(), filePath);
   } finally {
     try {
       file.close();
     } catch (IOException e) {
       logger.err("IOException: %s, while closing file: %s", e.getMessage(), filePath);
     }
   }
 }