Oxygen XML Editor 12.2 Author API

ro.sync.exml.view.graphics
Interface Graphics


public interface Graphics

The graphics interface used to draw schema diagram.


Field Summary
static int FILL_PATTERN_SQUARE
          A pattern of squares.
static int ICON_COMMENT_TREE
          Icon code for comment nodes.
static int ICON_PROCESSING_INSTRUCTION_TREE
          Icon code for processing instruction nodes.
static int ICON_TEXT_TREE
          Icon code for text nodes.
static int IMAGE_EXPANSION_BAR_BOTTOM
          Image representing the bottom arrow of the expansion bar.
static int IMAGE_EXPANSION_BAR_COLLAPSED
          Image representing an arrow for the collapsed expansion bar.
static int IMAGE_EXPANSION_BAR_MIDDLE_GRADIENT
          Image representing the middle of the expansion bar gradient.
static int IMAGE_EXPANSION_BAR_TOP
          Image representing the top arrow of the expansion bar.
static int STROKE_DASHED
          Dotted stroke
static int STROKE_DOT_DASH
          Dot-dash stroke
static int STROKE_DOT_DOT_DASH
          Dot-dot-dash stroke
static int STROKE_DOTTED
          Dotted stroke
static int STROKE_NORMAL
          Normal stroke
static int STROKE_WAVY
          Wavy stroke
 
Method Summary
 void activateAntialiasing()
          Activate the antialiasing mode.
 Font deriveSize(Font current, int size)
          Derive the size of the font
 Font deriveStyle(Font current, int style)
          Derive the style of the font
 void disableAntialiasing()
          Disable the antialiasing mode.
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          draws an arc.
 void drawIcon(java.lang.Object hostComponent, int iconCode, int x, int y)
          Draw the icon at (x,y) coordinates.
 void drawImage(java.lang.Object image, int x, int y)
          Draw an image object depending on the platform
 void drawImage(java.lang.Object image, int x, int y, int width, int height)
          Draw an image object depending on the platform.
 void drawLine(int x1, int y1, int x2, int y2)
          Draw a line from (x1, y1) to (x2, y2).
 void drawOval(int x, int y, int width, int height)
          Draw an oval.
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Draw a closed polygon defined by arrays of x and y coordinates.
 void drawPolyline(int[] xpoints, int[] ypoints, int npoints)
          Draws a polyline which is not closed if the last point differs from the first.
 void drawRect(int x, int y, int width, int height)
          Draw a rect with (x,y) top-left corner.
 void drawShadow(Shape shape, int displacement)
          Draws a shadow using the shape of the polygon.
 void drawShape(Shape shape)
          Draw a shape
 void drawString(java.lang.String text, int x, int y)
          Draw a string.
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Fills an arc.
 void fillOval(int x, int y, int width, int height)
          Fill an oval with curent fill color.
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Fills a closed polygon defined by arrays of x and y coordinates.
 void fillRect(int x, int y, int width, int height)
          Fill a rect with (x,y) top-left corner.
 void fillRect(int x, int y, int width, int height, int fillPattern, Color fillColor)
          Fills a rectangle with a pattern.
 void fillRect(Rectangle rectangle)
          Fill a rectangle.
 void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Fills the specified rounded corner rectangle.
 void fillShape(Shape shape)
          Fill a shape
 void fillWithGradient(Ellipse ellipse, Color startColorCode, Color endColorCode, boolean isVertical)
           
 void fillWithGradient(Rectangle rect, Color startColorCode, Color endColorCode, boolean isVertical)
           
 void fillWithGradient(Shape shape, Color startColorCode, Color endColorCode, boolean isVertical)
           
 java.lang.Object getAntialiasing()
           
 Rectangle getClipBounds()
           
 Color getDrawColor()
          Get the current color code.
 Color getFillColor()
          Get the color code for fill shapes.
 Font getFont()
          Get current font.
 FontMetrics getFontMetrics(Font font)
           
 int getStrokeType()
           
 int getStrokeWidth()
           
 void setAntialiasing(java.lang.Object value)
           
 void setDrawColor(Color colorCode)
          Set the color for draw methods.
 void setFillColor(Color colorCode)
          Set the color for fill methods.
 void setFont(Font font)
          Set the new font.
 void setStroke(int width, int type)
          Sets the line width for the stroke.
 

Field Detail

ICON_TEXT_TREE

static final int ICON_TEXT_TREE
Icon code for text nodes.

See Also:
Constant Field Values

ICON_COMMENT_TREE

static final int ICON_COMMENT_TREE
Icon code for comment nodes.

See Also:
Constant Field Values

ICON_PROCESSING_INSTRUCTION_TREE

static final int ICON_PROCESSING_INSTRUCTION_TREE
Icon code for processing instruction nodes.

See Also:
Constant Field Values

IMAGE_EXPANSION_BAR_TOP

static final int IMAGE_EXPANSION_BAR_TOP
Image representing the top arrow of the expansion bar.

See Also:
Constant Field Values

IMAGE_EXPANSION_BAR_BOTTOM

static final int IMAGE_EXPANSION_BAR_BOTTOM
Image representing the bottom arrow of the expansion bar.

See Also:
Constant Field Values

IMAGE_EXPANSION_BAR_MIDDLE_GRADIENT

static final int IMAGE_EXPANSION_BAR_MIDDLE_GRADIENT
Image representing the middle of the expansion bar gradient.

See Also:
Constant Field Values

IMAGE_EXPANSION_BAR_COLLAPSED

static final int IMAGE_EXPANSION_BAR_COLLAPSED
Image representing an arrow for the collapsed expansion bar.

See Also:
Constant Field Values

STROKE_NORMAL

static final int STROKE_NORMAL
Normal stroke

See Also:
Constant Field Values

STROKE_DOTTED

static final int STROKE_DOTTED
Dotted stroke

See Also:
Constant Field Values

STROKE_DASHED

static final int STROKE_DASHED
Dotted stroke

See Also:
Constant Field Values

STROKE_WAVY

static final int STROKE_WAVY
Wavy stroke

See Also:
Constant Field Values

STROKE_DOT_DASH

static final int STROKE_DOT_DASH
Dot-dash stroke

See Also:
Constant Field Values

STROKE_DOT_DOT_DASH

static final int STROKE_DOT_DOT_DASH
Dot-dot-dash stroke

See Also:
Constant Field Values

FILL_PATTERN_SQUARE

static final int FILL_PATTERN_SQUARE
A pattern of squares.

See Also:
Constant Field Values
Method Detail

setFont

void setFont(Font font)
Set the new font.

Parameters:
font - The font to be used.

fillPolygon

void fillPolygon(int[] xPoints,
                 int[] yPoints,
                 int nPoints)
Fills a closed polygon defined by arrays of x and y coordinates.

Parameters:
xPoints - a an array of x coordinates.
yPoints - a an array of y coordinates.
nPoints - a the total number of points.

drawPolygon

void drawPolygon(int[] xPoints,
                 int[] yPoints,
                 int nPoints)
Draw a closed polygon defined by arrays of x and y coordinates.

Parameters:
xPoints - a an array of x coordinates.
yPoints - a an array of y coordinates.
nPoints - a the total number of points.

getFont

Font getFont()
Get current font.

Returns:
The current font.

drawString

void drawString(java.lang.String text,
                int x,
                int y)
Draw a string.

Parameters:
text - The text to be drawn.
x - The x coordinate.
y - The y coordinate(top-left).

getDrawColor

Color getDrawColor()
Get the current color code.

Returns:
The current color code.

drawLine

void drawLine(int x1,
              int y1,
              int x2,
              int y2)
Draw a line from (x1, y1) to (x2, y2).

Parameters:
x1 - x of first point.
y1 - y of first point.
x2 - x of second point.
y2 - y of second point.

fillRect

void fillRect(int x,
              int y,
              int width,
              int height)
Fill a rect with (x,y) top-left corner.

Parameters:
x - The x coordinate.
y - The y coordinate.
width - The rect width.
height - The rect height.

fillRect

void fillRect(Rectangle rectangle)
Fill a rectangle.

Parameters:
rectangle - The rectangle.

drawRect

void drawRect(int x,
              int y,
              int width,
              int height)
Draw a rect with (x,y) top-left corner.

Parameters:
x - The x coordinate.
y - The y coordinate.
width - The rect width.
height - The rect height.

fillRoundRect

void fillRoundRect(int x,
                   int y,
                   int width,
                   int height,
                   int arcWidth,
                   int arcHeight)
Fills the specified rounded corner rectangle.

Parameters:
x - the x coordinate of the rectangle to be filled.
y - the y coordinate of the rectangle to be filled.
width - the width of the rectangle to be filled.
height - the height of the rectangle to be filled.
arcWidth - the horizontal diameter of the arc at the four corners.
arcHeight - the vertical diameter of the arc at the four corners.

drawPolyline

void drawPolyline(int[] xpoints,
                  int[] ypoints,
                  int npoints)
Draws a polyline which is not closed if the last point differs from the first.

Parameters:
xpoints - The xpoints array.
ypoints - The ypoints array.
npoints - The number of points.

drawArc

void drawArc(int x,
             int y,
             int width,
             int height,
             int startAngle,
             int arcAngle)
draws an arc.

Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn.
y - the y coordinate of the upper-left corner of the arc to be drawn.
width - the width of the arc to be drawn.
height - the height of the arc to be drawn.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.

fillArc

void fillArc(int x,
             int y,
             int width,
             int height,
             int startAngle,
             int arcAngle)
Fills an arc.

Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn.
y - the y coordinate of the upper-left corner of the arc to be drawn.
width - the width of the arc to be drawn.
height - the height of the arc to be drawn.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.

setStroke

void setStroke(int width,
               int type)
Sets the line width for the stroke. The line is solid, no dashes.

Parameters:
width - The width value.
type - The stroke type.

getStrokeWidth

int getStrokeWidth()
Returns:
the value of the stroke width.

getStrokeType

int getStrokeType()
Returns:
the value of the stroke type.

getClipBounds

Rectangle getClipBounds()
Returns:
the clipping rectangle.

setFillColor

void setFillColor(Color colorCode)
Set the color for fill methods.

Parameters:
colorCode - The color code used by fill methods.

setDrawColor

void setDrawColor(Color colorCode)
Set the color for draw methods.

Parameters:
colorCode - The color code used by draw methods.

drawIcon

void drawIcon(java.lang.Object hostComponent,
              int iconCode,
              int x,
              int y)
Draw the icon at (x,y) coordinates.

Parameters:
hostComponent - Icon implementations may use the HostComponent argument to get properties useful for painting, e.g. the foreground or background color.
iconCode - The icon code.
x - The x coordinate.
y - The y coordinate.

drawOval

void drawOval(int x,
              int y,
              int width,
              int height)
Draw an oval.

Parameters:
x - The x coordinate.
y - The y coordinate.
width - The width.
height - The height.

getFillColor

Color getFillColor()
Get the color code for fill shapes.

Returns:
The color code for fill shapes.

fillOval

void fillOval(int x,
              int y,
              int width,
              int height)
Fill an oval with curent fill color.

Parameters:
x - The x coordinate.
y - The y coordinate.
width - The width.
height - The height.

fillWithGradient

void fillWithGradient(Rectangle rect,
                      Color startColorCode,
                      Color endColorCode,
                      boolean isVertical)
Parameters:
rect - The rect to fill with a gradient
startColorCode - Start color of gradient
endColorCode - End color of gradient.
isVertical - True if the gradient should be vertical.

fillShape

void fillShape(Shape shape)
Fill a shape

Parameters:
shape - The shape

drawShape

void drawShape(Shape shape)
Draw a shape

Parameters:
shape - The shape

getFontMetrics

FontMetrics getFontMetrics(Font font)
Parameters:
font - The font
Returns:
The font metrics

deriveStyle

Font deriveStyle(Font current,
                 int style)
Derive the style of the font

Parameters:
current - Current font
style - New style
Returns:
The new font

deriveSize

Font deriveSize(Font current,
                int size)
Derive the size of the font

Parameters:
current - Current font
size - New size
Returns:
The new font

drawImage

void drawImage(java.lang.Object image,
               int x,
               int y)
Draw an image object depending on the platform

Parameters:
image - The image data
x - image X
y - image Y

drawImage

void drawImage(java.lang.Object image,
               int x,
               int y,
               int width,
               int height)
Draw an image object depending on the platform. The image is scaled to the width and height specified.

Parameters:
image - The image data
x - image X
y - image Y
width - image width
height - image height

fillRect

void fillRect(int x,
              int y,
              int width,
              int height,
              int fillPattern,
              Color fillColor)
Fills a rectangle with a pattern.

Parameters:
x - The left corner x coordinate.
y - The left corner y coordinate
width - The width of the rectangle.
height - The hight of the rectangle.
fillPattern - One this class constants that begin with FILL_PATTERN_
fillColor - The color for building the pattern.

drawShadow

void drawShadow(Shape shape,
                int displacement)
Draws a shadow using the shape of the polygon. The shadow will move to the right and down, with the size of the shadow.

Parameters:
shape - The shape of the real object.
displacement - The size of the shadow. This is the displacement to the original object, on X and Y.

fillWithGradient

void fillWithGradient(Ellipse ellipse,
                      Color startColorCode,
                      Color endColorCode,
                      boolean isVertical)
Parameters:
ellipse - The ellipse to fill with a gradient
startColorCode - Start color of gradient
endColorCode - End color of gradient.
isVertical - True if the gradient should be vertical.

fillWithGradient

void fillWithGradient(Shape shape,
                      Color startColorCode,
                      Color endColorCode,
                      boolean isVertical)
Parameters:
shape - The shape to fill with a gradient
startColorCode - Start color of gradient
endColorCode - End color of gradient.
isVertical - True if the gradient should be vertical.

setAntialiasing

void setAntialiasing(java.lang.Object value)
Parameters:
value - The antialising value to be set depending on the platform.

getAntialiasing

java.lang.Object getAntialiasing()
Returns:
The antialising value to be set depending on the platform.

activateAntialiasing

void activateAntialiasing()
Activate the antialiasing mode.


disableAntialiasing

void disableAntialiasing()
Disable the antialiasing mode.


Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.