|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object GPositional GComponent
An AWT component with position hints for integration in the graphics.
Typical usage:
// Create an AWT component that should be integrated JButton button = new JButton ("Start"); button.addActionListener (this); // Create the GComponent wrapper w/positioning hint GComponent gbutton = new GComponent (button, GPosition.TOP); // Create the GSegment the component is attached to GSegment segment = new GSegment(); segment.setComponent (gbutton);The component will be positioned in the canvas according to the location of its owner GSegment and th position hint.
Constructor Summary | |
GComponent(Component component)
Create an AWT component wrapper suitable for integration in the graphics and with default position hints. |
|
GComponent(Component component,
int positionHint)
Create an AWT component wrapper suitable for integration in the graphics. |
Method Summary | |
Component |
getComponent()
Return the AWT component of this GComponent. |
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 |
Constructor Detail |
public GComponent(Component component, int positionHint)
component
- AWT component.positionHint
- Position hints.GPositional.setPositionHint(int)
,
GPosition
public GComponent(Component component)
component
- AWT component.Method Detail |
public Component getComponent()
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 |