|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jcgm.core.CGMDisplay
public class CGMDisplay
This class is responsible for displaying the parsed commands of a CGM file into a graphic context.
Field Summary | |
---|---|
protected CGM |
Cgm
|
Constructor Summary | |
---|---|
CGMDisplay(CGM cgm)
|
Method Summary | |
---|---|
void |
addLineType(int lineType,
int[] dashElements,
double dashCycleRepeatLength)
|
protected double |
angle(double x,
double y)
|
boolean |
drawEdge()
Returns true if edge should be drawn |
void |
fill(java.awt.Shape s)
Checks the interior style and fills the given shape accordingly if necessary |
CGM |
getCGM()
|
double |
getCharacterHeight()
|
java.awt.geom.Point2D.Double |
getCharacterOrientationBaselineVector()
|
java.awt.geom.Point2D.Double |
getCharacterOrientationUpVector()
|
double |
getCharacterSpacing()
|
boolean |
getClipFlag()
|
double |
getContinuousHorizontalAlignment()
|
double |
getContinuousVerticalAlignment()
|
protected java.awt.geom.AffineTransform |
getCoordinateSystemTransformation(java.awt.geom.Point2D.Double op,
java.awt.geom.Point2D.Double ip,
java.awt.geom.Point2D.Double jp)
Returns a transformation to apply to transform from the given coordinate system |
java.awt.Color |
getEdgeColor()
|
java.awt.BasicStroke |
getEdgeStroke()
|
java.awt.geom.Point2D.Double[] |
getExtent()
Returns the extent of the drawing. |
java.awt.Color |
getFillColor()
|
java.awt.Graphics2D |
getGraphics2D()
|
net.sf.jcgm.core.TextAlignment.HorizontalAlignment |
getHorizontalTextAlignment()
|
java.awt.Color |
getIndexedColor(int i)
|
net.sf.jcgm.core.InteriorStyle.Style |
getInteriorStyle()
|
java.awt.Color |
getLineColor()
|
java.awt.BasicStroke |
getLineStroke()
|
java.awt.Color |
getMarkerColor()
|
double |
getMarkerSize()
|
net.sf.jcgm.core.MarkerType.Type |
getMarkerType()
|
java.awt.Color |
getTextColor()
|
net.sf.jcgm.core.TextPath.Type |
getTextPath()
|
java.awt.geom.AffineTransform |
getTextTransform()
AWT always expect increasing X to the right and increasing Y to the bottom. |
net.sf.jcgm.core.TextAlignment.VerticalAlignment |
getVerticalTextAlignment()
|
boolean |
isBeforeBeginPictureBody()
|
boolean |
isFilled()
|
boolean |
isScaled()
|
boolean |
isTransparent()
|
boolean |
isViewCleared()
|
protected double |
normalizeAngle(double a)
Normalizes an angle in the range -pi..pi to 0..2pi |
double[] |
normalizeAngleRange(double startAngle,
double endAngle)
|
void |
paint(java.awt.Graphics g)
|
double |
radiansToDegrees(double angle)
|
void |
reachedBeginPictureBody()
|
void |
reset()
Resets the parameters to default settings. |
void |
scale(java.awt.Graphics g,
int w,
int h)
|
void |
setCharacterHeight(double h)
|
void |
setCharacterOrientation(java.awt.geom.Point2D.Double upVector,
java.awt.geom.Point2D.Double baselineVector)
|
void |
setCharacterSpacing(double additionalInterCharacterSpace)
|
void |
setClipFlag(boolean flag)
|
void |
setEdge(boolean flag)
|
void |
setEdgeCap(LineCapIndicator lineIndicator)
|
void |
setEdgeColor(java.awt.Color c)
|
void |
setEdgeColorIndex(int colorIndex)
|
void |
setEdgeJoin(JoinIndicator type)
|
void |
setEdgeType(int type)
|
void |
setEdgeWidth(double width)
|
void |
setFillColor(java.awt.Color c)
|
void |
setFillColorIndex(int colorIndex)
|
void |
setFilled(boolean flag)
|
void |
setFontIndex(int fontIndex)
Sets the font to use |
void |
setFonts(FontWrapper[] fontWrappers)
|
void |
setHatchStyle(net.sf.jcgm.core.HatchIndex.HatchType type)
|
void |
setIndexedColor(int i,
java.awt.Color color)
|
void |
setInteriorStyle(net.sf.jcgm.core.InteriorStyle.Style interiorStyle)
|
void |
setLineCap(LineCapIndicator lineIndicator)
|
void |
setLineColor(java.awt.Color c)
|
void |
setLineColorIndex(int colorIndex)
|
void |
setLineJoin(JoinIndicator type)
|
void |
setLineType(int type)
|
void |
setLineWidth(double width)
|
void |
setMarkerColor(java.awt.Color c)
|
void |
setMarkerColorIndex(int colorIndex)
|
void |
setMarkerSize(double width)
|
void |
setMarkerType(net.sf.jcgm.core.MarkerType.Type type)
|
void |
setMaximumColorIndex(int maxColorIndex)
|
void |
setTextAlignment(net.sf.jcgm.core.TextAlignment.HorizontalAlignment horizontalAlignment,
net.sf.jcgm.core.TextAlignment.VerticalAlignment verticalAlignment,
double continuousHorizontalAlignment,
double continuousVerticalAlignment)
|
void |
setTextColor(java.awt.Color c)
|
void |
setTextColorIndex(int colorIndex)
|
void |
setTextPath(net.sf.jcgm.core.TextPath.Type path)
|
void |
setTransparent(boolean transparent)
|
void |
setViewCleared(boolean b)
|
boolean |
useSymbolEncoding()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CGM Cgm
Constructor Detail |
---|
public CGMDisplay(CGM cgm)
Method Detail |
---|
public CGM getCGM()
public void paint(java.awt.Graphics g)
public java.awt.Graphics2D getGraphics2D()
public void setTransparent(boolean transparent)
public boolean isTransparent()
public void setFillColor(java.awt.Color c)
public void setFillColorIndex(int colorIndex)
public java.awt.Color getFillColor()
public void setFilled(boolean flag)
public boolean isFilled()
public void setEdgeColor(java.awt.Color c)
public void setEdgeColorIndex(int colorIndex)
public java.awt.Color getEdgeColor()
public void setEdge(boolean flag)
public boolean drawEdge()
public void setLineColor(java.awt.Color c)
public void setLineColorIndex(int colorIndex)
public java.awt.Color getLineColor()
public void setMarkerColor(java.awt.Color c)
public void setMarkerColorIndex(int colorIndex)
public java.awt.Color getMarkerColor()
public void setTextColor(java.awt.Color c)
public void setTextColorIndex(int colorIndex)
public java.awt.Color getTextColor()
public void setCharacterHeight(double h)
public double getCharacterHeight()
public void scale(java.awt.Graphics g, int w, int h)
public boolean isScaled()
public java.awt.geom.Point2D.Double[] getExtent()
extent[1].x,[1].y ----------* | | | | * --------- [0].x,[0].y
protected final double angle(double x, double y)
protected final double normalizeAngle(double a)
a
-
protected final java.awt.geom.AffineTransform getCoordinateSystemTransformation(java.awt.geom.Point2D.Double op, java.awt.geom.Point2D.Double ip, java.awt.geom.Point2D.Double jp)
op
- The origin of the coordinate systemip
- The first axis vectorjp
- The second axis vector
public void setFonts(FontWrapper[] fontWrappers)
public void setFontIndex(int fontIndex)
fontIndex
- Font index starts from onepublic boolean useSymbolEncoding()
public net.sf.jcgm.core.TextAlignment.HorizontalAlignment getHorizontalTextAlignment()
public net.sf.jcgm.core.TextAlignment.VerticalAlignment getVerticalTextAlignment()
public double getContinuousHorizontalAlignment()
public double getContinuousVerticalAlignment()
public void setTextAlignment(net.sf.jcgm.core.TextAlignment.HorizontalAlignment horizontalAlignment, net.sf.jcgm.core.TextAlignment.VerticalAlignment verticalAlignment, double continuousHorizontalAlignment, double continuousVerticalAlignment)
public void reset()
public void addLineType(int lineType, int[] dashElements, double dashCycleRepeatLength)
public void setLineType(int type)
public java.awt.BasicStroke getLineStroke()
public void setEdgeType(int type)
public java.awt.BasicStroke getEdgeStroke()
public void setMaximumColorIndex(int maxColorIndex)
public void setIndexedColor(int i, java.awt.Color color)
public java.awt.Color getIndexedColor(int i)
public net.sf.jcgm.core.InteriorStyle.Style getInteriorStyle()
public void setInteriorStyle(net.sf.jcgm.core.InteriorStyle.Style interiorStyle)
public boolean isBeforeBeginPictureBody()
public void reachedBeginPictureBody()
public double[] normalizeAngleRange(double startAngle, double endAngle)
startAngle
- endAngle
- normalizedStartAngle
- normalizedEndAngle
- public double radiansToDegrees(double angle)
d
-
public java.awt.geom.AffineTransform getTextTransform()
public void setCharacterSpacing(double additionalInterCharacterSpace)
additionalInterCharacterSpace
- public double getCharacterSpacing()
public void setCharacterOrientation(java.awt.geom.Point2D.Double upVector, java.awt.geom.Point2D.Double baselineVector)
upVector
- baselineVector
- public java.awt.geom.Point2D.Double getCharacterOrientationUpVector()
public java.awt.geom.Point2D.Double getCharacterOrientationBaselineVector()
public void setLineWidth(double width)
public void setEdgeWidth(double width)
public void setLineCap(LineCapIndicator lineIndicator)
public void setEdgeCap(LineCapIndicator lineIndicator)
public void setLineJoin(JoinIndicator type)
public void setEdgeJoin(JoinIndicator type)
public void setMarkerType(net.sf.jcgm.core.MarkerType.Type type)
public net.sf.jcgm.core.MarkerType.Type getMarkerType()
public void setMarkerSize(double width)
public double getMarkerSize()
public void setTextPath(net.sf.jcgm.core.TextPath.Type path)
public net.sf.jcgm.core.TextPath.Type getTextPath()
public void fill(java.awt.Shape s)
s
- The shape to fillpublic void setHatchStyle(net.sf.jcgm.core.HatchIndex.HatchType type)
type
- public void setClipFlag(boolean flag)
flag
- public boolean getClipFlag()
public boolean isViewCleared()
public void setViewCleared(boolean b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |