ConForM.CoopnTools.CoKer.Visual
Class GraphicalMIFExporter

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.Visual.GraphicalExporter
        |
        +--ConForM.CoopnTools.CoKer.Visual.GraphicalMIFExporter

public class GraphicalMIFExporter
extends GraphicalExporter

MIF Graphical Exportation class. This class defines MIF graphical exporters (MIF is an intermediary form for FrameMaker), intended to be used with graphical visualisations. All interactions with an exporter object are made in the logical coordinate space, where 1 inch corresponds to 81,92 logical units.


Field Summary
protected  java.io.StringWriter colorString
           
protected  java.io.PrintWriter colorWriter
           
protected  java.io.PrintWriter finalStream
           
protected  java.io.StringWriter headerString
           
protected  java.io.PrintWriter headerWriter
           
protected  java.io.StringWriter mainString
           
protected  java.io.PrintWriter mainWriter
           
 
Fields inherited from class ConForM.CoopnTools.CoKer.Visual.GraphicalExporter
bounds, color, dash, dashed, env, EPS, insets, MIF, phase, POSTSCRIPT, RTF, stream, title, translationX, translationY, zoom
 
Constructor Summary
GraphicalMIFExporter(java.io.PrintWriter stream, java.lang.String title, java.awt.Rectangle bounds, java.awt.Insets insets, int zoom, CoopnEnv env)
           
 
Method Summary
 void dispose()
          Terminates an exportation, and dispose the exporter object.
 void drawArc(double x, double y, double width, double height, int startAngle, int arcAngle)
          Draw an elliptical arc, given by its bounding rectangle.
 void drawArrow(java.awt.geom.GeneralPath path, boolean fill, int tipAngle, int baseAngle, int length, java.awt.geom.GeneralPath arrowPath)
          Draw a path with a plain arrow at its end.
 void drawArrow(java.awt.geom.GeneralPath path, boolean fill, int tipAngle, int baseAngle, int length, java.awt.geom.GeneralPath sarrowPath, java.awt.geom.GeneralPath earrowPath)
          Draw a path with a plain arrow at both ends.
 void drawArrow(java.awt.geom.GeneralPath path, int tipAngle, int baseAngle, int length, java.awt.geom.GeneralPath arrowPath)
          Draw a path with a stick arrow at its end.
 void drawArrow(java.awt.geom.GeneralPath path, int tipAngle, int baseAngle, int length, java.awt.geom.GeneralPath sarrowPath, java.awt.geom.GeneralPath earrowPath)
          Draw a path with a stick arrow at both ends.
 void drawLine(double x1, double y1, double x2, double y2)
          Draw a line.
 void drawPath(java.awt.geom.GeneralPath path)
          Draw a path.
 void drawPolygon(java.awt.geom.Point2D[] points)
          Draw a polygon.
 void drawRectangle(double x, double y, double width, double height)
          Draw a rectangle.
 void drawRectangle(double x, double y, double width, double height, int angle)
          Draw a rotated rectangle.
 void drawText(double x, double y, java.lang.String text, java.awt.Font font)
          Draw a text.
 void endElement()
          End an element.
 void fillArc(double x, double y, double width, double height, int startAngle, int arcAngle)
          Fill an elliptical arc, given by its bounding rectangle.
 void fillArc(double x, double y, double width, double height, int startAngle, int arcAngle, float grayValue)
          Fill an elliptical arc, given by its bounding rectangle.
 void fillPolygon(java.awt.geom.Point2D[] points)
          Fill a polygon.
 void fillPolygon(java.awt.geom.Point2D[] points, float grayValue)
          Fill a polygon.
 void fillRectangle(double x, double y, double width, double height)
          Fill a rectangle.
 void fillRectangle(double x, double y, double width, double height, float grayValue)
          Fill a rectangle.
 void fillRectangle(double x, double y, double width, double height, float grayValue, int angle)
          Fill a rotated rectangle.
 void fillRectangle(double x, double y, double width, double height, int angle)
          Fill a rotated rectangle.
protected  void header()
           
 void startElement(GraphicalVisualElement element)
          Start an element.
protected  void trailer()
           
 
Methods inherited from class ConForM.CoopnTools.CoKer.Visual.GraphicalExporter
drawArc, drawArc, drawLine, drawPolygon, drawRectangle, drawRectangle, drawRectangle, drawRectangle, drawText, fillArc, fillArc, fillArc, fillArc, fillPolygon, fillPolygon, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRectangle, fillRectangle, getExporter, setColor, setDashed, setPlain, supportedFormats, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

finalStream

protected java.io.PrintWriter finalStream

mainString

protected java.io.StringWriter mainString

mainWriter

protected java.io.PrintWriter mainWriter

headerString

protected java.io.StringWriter headerString

headerWriter

protected java.io.PrintWriter headerWriter

colorString

protected java.io.StringWriter colorString

colorWriter

protected java.io.PrintWriter colorWriter
Constructor Detail

GraphicalMIFExporter

public GraphicalMIFExporter(java.io.PrintWriter stream,
                            java.lang.String title,
                            java.awt.Rectangle bounds,
                            java.awt.Insets insets,
                            int zoom,
                            CoopnEnv env)
Method Detail

dispose

public void dispose()
Terminates an exportation, and dispose the exporter object. This routine does not dispose the stream, nor the bounds.
Overrides:
dispose in class GraphicalExporter

header

protected void header()
Overrides:
header in class GraphicalExporter

trailer

protected void trailer()
Overrides:
trailer in class GraphicalExporter

startElement

public void startElement(GraphicalVisualElement element)
Start an element.
Overrides:
startElement in class GraphicalExporter
Parameters:
element - the element to start

endElement

public void endElement()
End an element.
Overrides:
endElement in class GraphicalExporter
Parameters:
element - the element to end

drawText

public void drawText(double x,
                     double y,
                     java.lang.String text,
                     java.awt.Font font)
Draw a text.
Overrides:
drawText in class GraphicalExporter
Parameters:
x1 - x-coordinate of starting point
y1 - y-coordinate of starting point
text - text
font - font

drawLine

public void drawLine(double x1,
                     double y1,
                     double x2,
                     double y2)
Draw a line.
Overrides:
drawLine in class GraphicalExporter
Parameters:
x1 - x-coordinate of starting point
y1 - y-coordinate of starting point
x2 - x-coordinate of ending point
y2 - y-coordinate of ending point

drawRectangle

public void drawRectangle(double x,
                          double y,
                          double width,
                          double height,
                          int angle)
Draw a rotated rectangle.
Overrides:
drawRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
angle - the rotation angle

fillRectangle

public void fillRectangle(double x,
                          double y,
                          double width,
                          double height,
                          int angle)
Fill a rotated rectangle.
Overrides:
fillRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
angle - the rotation angle

fillRectangle

public void fillRectangle(double x,
                          double y,
                          double width,
                          double height,
                          float grayValue,
                          int angle)
Fill a rotated rectangle. The shape is filled with a grey texture, the tint of which is given by a real number.
Overrides:
fillRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
grayValue - the gray value. 0 means black while 1 means white
angle - the rotation angle

drawRectangle

public void drawRectangle(double x,
                          double y,
                          double width,
                          double height)
Draw a rectangle.
Overrides:
drawRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height

fillRectangle

public void fillRectangle(double x,
                          double y,
                          double width,
                          double height)
Fill a rectangle.
Overrides:
fillRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height

fillRectangle

public void fillRectangle(double x,
                          double y,
                          double width,
                          double height,
                          float grayValue)
Fill a rectangle. The shape is filled with a grey texture, the tint of which is given by a real number.
Overrides:
fillRectangle in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
grayValue - the gray value. 0 means black while 1 means white

drawArc

public void drawArc(double x,
                    double y,
                    double width,
                    double height,
                    int startAngle,
                    int arcAngle)
Draw an elliptical arc, given by its bounding rectangle.
Overrides:
drawArc in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
startAngle - the starting angle in degree, trigonometrical sense
arcAngle - the angular extend of the arc

fillArc

public void fillArc(double x,
                    double y,
                    double width,
                    double height,
                    int startAngle,
                    int arcAngle)
Fill an elliptical arc, given by its bounding rectangle.
Overrides:
fillArc in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
startAngle - the starting angle in degree, trigonometrical sense
arcAngle - the angular extend of the arc

fillArc

public void fillArc(double x,
                    double y,
                    double width,
                    double height,
                    int startAngle,
                    int arcAngle,
                    float grayValue)
Fill an elliptical arc, given by its bounding rectangle. The shape is filled with a grey texture, the tint of which is given by a real number.
Overrides:
fillArc in class GraphicalExporter
Parameters:
x - x-coordinate of starting point
y - y-coordinate of starting point
width - width
height - height
startAngle - the starting angle in degree, trigonometrical sense
arcAngle - the angular extend of the arc
grayValue - the gray value. 0 means black while 1 means white

drawPolygon

public void drawPolygon(java.awt.geom.Point2D[] points)
Draw a polygon.
Overrides:
drawPolygon in class GraphicalExporter
Parameters:
points - the points of the polygon

fillPolygon

public void fillPolygon(java.awt.geom.Point2D[] points)
Fill a polygon.
Overrides:
fillPolygon in class GraphicalExporter
Parameters:
points - the points of the polygon

fillPolygon

public void fillPolygon(java.awt.geom.Point2D[] points,
                        float grayValue)
Fill a polygon. The shape is filled with a grey texture, the tint of which is given by a real number.
Overrides:
fillPolygon in class GraphicalExporter
Parameters:
points - the points of the polygon
grayValue - the gray value. 0 means black while 1 means white

drawPath

public void drawPath(java.awt.geom.GeneralPath path)
Draw a path.
Overrides:
drawPath in class GraphicalExporter
Parameters:
path - the path to draw

drawArrow

public void drawArrow(java.awt.geom.GeneralPath path,
                      boolean fill,
                      int tipAngle,
                      int baseAngle,
                      int length,
                      java.awt.geom.GeneralPath arrowPath)
Draw a path with a plain arrow at its end.
Overrides:
drawArrow in class GraphicalExporter
Parameters:
path - the path to draw
fill - true iff the arrow is filled
tipAngle - the tip angle
baseAngle - the base angle
length - the length of the arrow
arrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters

drawArrow

public void drawArrow(java.awt.geom.GeneralPath path,
                      boolean fill,
                      int tipAngle,
                      int baseAngle,
                      int length,
                      java.awt.geom.GeneralPath sarrowPath,
                      java.awt.geom.GeneralPath earrowPath)
Draw a path with a plain arrow at both ends.
Overrides:
drawArrow in class GraphicalExporter
Parameters:
path - the path to draw
fill - true iff the start arrow is filled
tipAngle - the tip angle of start arrow
baseAngle - the base angle of start arrow
length - the length of the start arrow
sarrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters
earrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters

drawArrow

public void drawArrow(java.awt.geom.GeneralPath path,
                      int tipAngle,
                      int baseAngle,
                      int length,
                      java.awt.geom.GeneralPath arrowPath)
Draw a path with a stick arrow at its end.
Overrides:
drawArrow in class GraphicalExporter
Parameters:
path - the path to draw
tipAngle - the tip angle
baseAngle - the base angle
length - the length of the arrow
arrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters

drawArrow

public void drawArrow(java.awt.geom.GeneralPath path,
                      int tipAngle,
                      int baseAngle,
                      int length,
                      java.awt.geom.GeneralPath sarrowPath,
                      java.awt.geom.GeneralPath earrowPath)
Draw a path with a stick arrow at both ends.
Overrides:
drawArrow in class GraphicalExporter
Parameters:
path - the path to draw
tipAngle - the tip angle of start arrow
baseAngle - the base angle of start arrow
length - the length of the start arrow
sarrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters
earrowPath - an already constructed path equivalent to the parameters tipangle, baseAngle and length; exporters should use (and draw) this parameter only if the format does not support structural structural descriptions of arrows based on above parameters