|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object GPositional GImage
Wrapper object for images used with GSegments. A GImage represent both predefined images as well as client specified images.
Typical usage:
GImage image = new GImage (new File (imageFileName), GPosition.SOUTHEAST); GSegment anchor = new GSegment(); anchor.setImage (image);Images can also be associated with every vertex of a polyline. If using one of the predefined images, a typical usage will be:GImage image = new GImage (SYMBOL_CIRCLE1); GSegment segment = new GSegment(); segment.setVertexImage (image);
Field Summary | |
static int |
SYMBOL_CIRCLE1
|
static int |
SYMBOL_CIRCLE2
|
static int |
SYMBOL_CIRCLE3
|
static int |
SYMBOL_CIRCLE4
|
static int |
SYMBOL_SQUARE1
|
static int |
SYMBOL_SQUARE2
|
static int |
SYMBOL_SQUARE3
|
static int |
SYMBOL_SQUARE4
|
Constructor Summary | |
GImage(File file)
Create an image from a file. |
|
GImage(File file,
int positionHint)
Create an image from a file. |
|
GImage(Image image)
Create a GImage from an AWT Image. |
|
GImage(Image image,
int positionHint)
Create a GImage from an AWT Image. |
|
GImage(int symbolType)
Create an image of predefined type and with default position hints. |
|
GImage(int symbolType,
int positionHint)
Create image of a predefined type. |
|
GImage(int width,
int height,
int[] data)
Create a image based on specified color data. |
|
GImage(int width,
int height,
int[] data,
int positionHint)
Create a image based on specified color data. |
Method Summary | |
int |
getPositionHint()
Return position hint of this positional. |
GStyle |
getStyle()
Get style of this GText. |
void |
setPositionHint(int positionHint)
Set position hint for this positional. |
void |
setStyle(GStyle style)
Set new style for this object. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SYMBOL_SQUARE1
public static final int SYMBOL_SQUARE2
public static final int SYMBOL_SQUARE3
public static final int SYMBOL_SQUARE4
public static final int SYMBOL_CIRCLE1
public static final int SYMBOL_CIRCLE2
public static final int SYMBOL_CIRCLE3
public static final int SYMBOL_CIRCLE4
Constructor Detail |
public GImage(int symbolType, int positionHint)
symbolType
- Symbol to create.positionHint
- Position hint.GPositional.setPositionHint(int)
public GImage(int symbolType)
symbolType
- Predefined symbol type.public GImage(int width, int height, int[] data, int positionHint)
width
- Width of image.height
- Height of image.data
- Color values for image.positionHint
- Position hint.GPositional.setPositionHint(int)
public GImage(int width, int height, int[] data)
width
- Width of image.height
- Height of image.data
- Color values for image.public GImage(Image image, int positionHint)
image
- Image.positionHint
- Position hint.GPositional.setPositionHint(int)
public GImage(Image image)
image
- Image.public GImage(File file, int positionHint)
file
- Image file.positionHint
- Position hint.GPositional.setPositionHint(int)
public GImage(File file)
file
- Image file.Method Detail |
public void setPositionHint(int positionHint)
Position hints is a or'ed list of:
Line position hints are interpreted as follows:
For the above, the given point becomes the initial approach for positioning. If this initial position is outside the window (and position hint not explicitly set to GPosition.STATIC) the text is moved along the polyline till it becomes fully visible.
If text position hint is GPosition.MIDDLE, the initial position is the center of the polyline bounding box. If this point is not visble the text is not rendered.
At this point an anchor point is found for the text. Now the point positioning text hints are examined:
If a point positioing hint is not given, the defualt is GPosition.CENTER unless line position hint is GPosition.TOP (implying GPosition.NORTH), GPosition.BOTTOM (implying GPosition.SOUTH), GPosition.LEFT (implying GPosition.WEST) or GPosition:RIGHT (implying GPosition.EAST).
Now, if the text in this location overlap an already positioned text, it is further adjusted (unless position hint is not explicitly set to GPosition.STATIC as discussed above). It is again moved along the polyline till a free location is found. If this cannot be acheived, the text is not rendered
positionHint
- Position hint for this positional.GPosition
public int getPositionHint()
GPositional.setPositionHint(int).
public void setStyle(GStyle style)
style
- Style for this object.public GStyle getStyle()
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |