|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object GStyle
Graphics object apparence properties.
GStyle can be set on GObject, GSegment and GPositionals (GText, GImage, GComponent). It is optional, and when unset the style of the parent component is applied. This is also the case for the individual properties of the GStyle.
Example:
// Define a style with foreground and background color set GStyle style1 = new GStyle(); style1.setForegroundColor (Color.RED); style1.setBackgroundColor (Color.BLUE); // Create an object and apply style1. // It will have foreground color RED and background color BLUE GObject object1 = new GObject(); object1.setStyle (style1); // Create a sub object without style. style1 is inherited from parent // It will have foreground color RED and background color BLUE GObject object2 = new GObject(); object1.add (object2); // Define new style with foreground color set GStyle style2 = new GStyle() style2.setForegroundColor (Color.YELLOW); // Create a sub object and apply style2. // It will have foreground color YELLOW and background color BLUE GObject object3 = new GObject(); object3.setStyle (style2); object1.add (object3);
Field Summary | |
static int |
FILL_10
|
static int |
FILL_25
|
static int |
FILL_50
|
static int |
FILL_75
|
static int |
FILL_DIAGONAL
|
static int |
FILL_HORIZONTAL
|
static int |
FILL_NONE
|
static int |
FILL_SOLID
|
static int |
FILL_VERTICAL
|
static int |
LINESTYLE_DASHDOT
|
static int |
LINESTYLE_DASHED
|
static int |
LINESTYLE_DOTTED
|
static int |
LINESTYLE_INVISIBLE
|
static int |
LINESTYLE_SOLID
|
Constructor Summary | |
GStyle()
Create a new style object. |
Method Summary | |
Object |
clone()
Create a new style object based on this. |
Color |
getBackgroundColor()
Return current background color of this style. |
int |
getCapStyle()
Return current line end cap style of this style. |
BufferedImage |
getFillPattern()
Return current fill pattern. |
Font |
getFont()
Return current font of this style. |
Color |
getForegroundColor()
Return the current foreground color of this style. |
int |
getJoinStyle()
Return current join style of this style. |
float[] |
getLineStyle()
Return current line style of this style. |
int |
getLineWidth()
Return current line width of this style. |
boolean |
isAntialiased()
Return current antialiasing setting of this style. |
void |
setAntialiased(boolean isAntialiased)
Set antialising flag of this style. |
void |
setBackgroundColor(Color backgroundColor)
Set background color. |
void |
setCapStyle(int capStyle)
Set line end cap style of this style. |
void |
setFillPattern(BufferedImage image)
Set image as fill pattern. |
void |
setFillPattern(int fillType)
Set predefined fill pattern of this style. |
void |
setFillPattern(int width,
int height,
int[] data)
Set custom fill pattern of this style. |
void |
setFillPattern(String fileName)
Set image as fill pattern. |
void |
setFont(Font font)
Set font of this style. |
void |
setForegroundColor(Color foregroundColor)
Set foreground color of this style. |
void |
setGradient(Color color1,
Color color2)
TODO: This code is experimental and should not yet be used. |
void |
setJoinStyle(int joinStyle)
Set line end join style of this style. |
void |
setLineStyle(float[] dashPattern)
Set custom line style. |
void |
setLineStyle(int lineStyle)
Set predefined line style of this style. |
void |
setLineWidth(int lineWidth)
Set line width. |
void |
unsetAntialias()
Unset antialias flag. |
void |
unsetBackgroundColor()
Unset background color. |
void |
unsetCapStyle()
Unset cap style of this style. |
void |
unsetFillPattern()
Unset fill pattern. |
void |
unsetFont()
Unset font of this style. |
void |
unsetForegroundColor()
Unset foreground color of this style. |
void |
unsetGradient()
|
void |
unsetJoinStyle()
Unset join style of this style. |
void |
unsetLineStyle()
Unset line style. |
void |
unsetLineWidth()
Unset line width. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LINESTYLE_SOLID
public static final int LINESTYLE_DASHED
public static final int LINESTYLE_DOTTED
public static final int LINESTYLE_DASHDOT
public static final int LINESTYLE_INVISIBLE
public static final int FILL_NONE
public static final int FILL_SOLID
public static final int FILL_10
public static final int FILL_25
public static final int FILL_50
public static final int FILL_75
public static final int FILL_HORIZONTAL
public static final int FILL_VERTICAL
public static final int FILL_DIAGONAL
Constructor Detail |
public GStyle()
Method Detail |
public Object clone()
public void setForegroundColor(Color foregroundColor)
foregroundColor
- New foreground color.public void unsetForegroundColor()
public Color getForegroundColor()
public void setBackgroundColor(Color backgroundColor)
backgroundColor
- New background color.public void unsetBackgroundColor()
public Color getBackgroundColor()
public void setLineWidth(int lineWidth)
lineWidth
- New line width.public void unsetLineWidth()
public int getLineWidth()
public void setFont(Font font)
font
- New font.public void unsetFont()
public Font getFont()
public void setCapStyle(int capStyle)
capStyle
- New line end cap style.public void unsetCapStyle()
public int getCapStyle()
public void setJoinStyle(int joinStyle)
joinStyle
- New join style.public void unsetJoinStyle()
public int getJoinStyle()
public void setAntialiased(boolean isAntialiased)
isAntialiased
- Antialiasing on (true) or off (false) (default).public void unsetAntialias()
public boolean isAntialiased()
public void setGradient(Color color1, Color color2)
color1
- color2
- public void unsetGradient()
public void setFillPattern(int fillType)
fillType
- New fill pattern.public void setFillPattern(int width, int height, int[] data)
width
- Tile width.height
- Tile height.data
- Pattern data (0s and 1s indicating set/unset).public void setFillPattern(BufferedImage image)
image
- Image to use as fill pattern.public void setFillPattern(String fileName)
fileName
- File name of image.public void unsetFillPattern()
public BufferedImage getFillPattern()
public void setLineStyle(float[] dashPattern)
dashPattern
- New dash pattern.public void setLineStyle(int lineStyle)
lineStyle
- New line style.public void unsetLineStyle()
public float[] getLineStyle()
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |