|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.space.GraphicComponent
chemaxon.marvin.space.monitor.Monitor
chemaxon.marvin.space.monitor.Label
public class Label
Label is a special monitor that watches 1 object and shows its description.
| Field Summary | |
|---|---|
static int |
BACKGROUND_MODE_NONE
|
static int |
BACKGROUND_MODE_OWN_COLOR
|
protected byte[] |
backgroundColor
|
protected boolean |
backgroundColorChanged
|
protected int |
backgroundColorMode
|
static int |
BORDER_MODE_BRIGHTER_FOREGROUND
|
static int |
BORDER_MODE_FOREGROUND_COLOR
|
static int |
BORDER_MODE_NONE
|
static int |
BORDER_MODE_OWN_COLOR
|
protected byte[] |
borderColor
|
protected boolean |
borderColorChanged
|
protected int |
borderColorMode
|
protected boolean |
draw2D
|
protected boolean |
drawRelation
|
protected byte[] |
foregroundColor
|
protected boolean |
foregroundColorChanged
|
protected chemaxon.marvin.space.util.GLText |
gltext
This is to draw labels in the viewing plane. |
protected boolean |
ignoreDrawProperties
|
protected static int |
ITEM_COUNT
|
protected float |
labelScale
|
protected int |
labelSize
Size of drawn labels. |
static int |
LARGE_FONT_SIZE
|
static int |
MEDIUM_FONT_SIZE
|
protected float[] |
position
|
protected boolean |
positionInPlane
|
protected double |
relativeX
|
protected double |
relativeY
|
protected int |
shiftx
Relative position of the label of the component with respect to the reference point of the labeled component. |
protected int |
shifty
Relative position of the label of the component with respect to the reference point of the labeled component. |
protected int |
sizeX
|
protected int |
sizeY
|
static int |
SMALL_FONT_SIZE
|
protected java.lang.String |
text
|
protected double |
textPositionX
|
protected double |
textPositionY
|
| Fields inherited from class chemaxon.marvin.space.monitor.Monitor |
|---|
control, mode, selectedItemCoordinates, selectedItems, selectionPointer |
| Fields inherited from class chemaxon.marvin.space.GraphicComponent |
|---|
active, associatedComponents, boundingBox, color, COMPONENT_TYPE_ENTIRE, drawProperties, drawType, gl, glu, graphicCell, irm, modifiesOrigin, motionMode, mousex, mousey, name, pickedItem, RENDERING_QUALITY_HIGH, RENDERING_QUALITY_LOW, RENDERING_QUALITY_MEDIUM, renderingQuality, rm, uoid, visible |
| Constructor Summary | |
|---|---|
Label()
Creates a new Label and sets the size of the font to medium. |
|
| Method Summary | |
|---|---|
void |
draw()
Does nothing, because a label is drawn in plane or as a transparent component. |
void |
draw2DPart()
Draws the label when it is set to be drawn in plane. |
void |
drawTransparentPart()
Renders the label in 3d as a transparent object. |
byte[] |
getBackgroundColor()
Returns the background color of the label. |
byte[] |
getBorderColor()
Returns the border color of the label. |
GraphicComponent |
getComponent()
Returns the GraphicComponent of the only selected item. |
void |
getCoordinates(ComponentElement item,
float[] c)
Returns the coordinates of the selected item as a GeomCalc vector. |
void |
getCoordinates(float[] c)
Returns the coordinates of the selected item as a GeomCalc vector. |
byte[] |
getForegroundColor()
Returns the foreground color of the label. |
ComponentElement |
getSelectedItem()
|
java.lang.String |
getText()
Returns the explicit text of the label, or null if there is no explicit label set. |
float |
getZCoordinateTo2DPart()
Returns a third, z coordinate in order to display 2D parts in proper order. |
boolean |
has2DPart()
Returns true when the label is drawn in plane. |
boolean |
hasInvisibleItem()
Tells weather the label should or should not be drawn. |
boolean |
hasTransparentPart()
The label is rendered as a transparent object in case of drawing in space. |
void |
ignoreDrawProperties(boolean b)
Sets the label whether it accepts draw properties or not. |
double |
locateObject(int x,
int y)
Pickes the label in x, y position. |
int |
maximumItemCount()
Returns 1, because this is the maximun number of selected elements. |
protected void |
presetTextDraw()
|
void |
receiveNotificationOnCoordinateChange(GraphicComponent gc)
When the coordinates of the labeled object change, the label refreshes its coordinates relatively. |
void |
refresh()
The monitor refreshes its coordinates from the selected item's coordinates. |
void |
select()
The color of the label changes by selection. |
void |
selectItem(ComponentElement item)
Parameter item will be the selected item of the monitor. |
void |
selectItem(GraphicComponent gc)
The given component will be the selected item of the Label. |
void |
setBackgroundColor(java.awt.Color c)
Sets the background color of the label. |
void |
setBackgroundColorMode(int mode)
Sets the coloring mode of the background. |
void |
setBorderColor(java.awt.Color c)
Sets the border color of the label. |
void |
setBorderColorMode(int mode)
Sets the coloring mode of the border. |
void |
setDrawProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Sets a draw property. |
void |
setForegroundColor(java.awt.Color c)
Sets the color of the characters on the label. |
void |
setLabel2DDrawing(boolean b)
Sets the drawing mode of the label that can be drawing in plane or in exact depth. |
protected void |
setLabelSize(java.lang.String size)
Sets the size of the label font. |
void |
setPosition(float[] position)
Sets the monitor's position defined by 3 coordinates. |
void |
setPosition(float x,
float y)
Sets the monitor's position defined by 2 coordinates. |
void |
setPosition(float x,
float y,
float z)
Sets the monitor's position defined by 3 coordinates. |
void |
setRelativeXCoordinate(float x)
Sets the coordinate considered as the x coordinate of the origin in window coordinates. |
void |
setRelativeYCoordinate(float y)
Sets the coordinate considered as the y coordinate of the origin in window coordinates. |
void |
setText(java.lang.String text)
Sets an explicit text to the label, that has priority to the description of the selected component. |
void |
shift(int x,
int y)
A label can be shifted in x,y direction. |
void |
unSelect()
The color of the label changes by selection. |
void |
unSelect(ComponentElement element)
The color of the label changes by selection. |
| Methods inherited from class chemaxon.marvin.space.monitor.Monitor |
|---|
clear, getSelectedElements, hasControl, isFull, isVisible, onRemoveGraphicComponent, pickedIndicator, receiveNotificationOnInvisibility, receiveNotificationOnVisibility, refersTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int LARGE_FONT_SIZE
public static final int MEDIUM_FONT_SIZE
public static final int SMALL_FONT_SIZE
public static final int BORDER_MODE_NONE
public static final int BORDER_MODE_OWN_COLOR
public static final int BORDER_MODE_FOREGROUND_COLOR
public static final int BORDER_MODE_BRIGHTER_FOREGROUND
public static final int BACKGROUND_MODE_NONE
public static final int BACKGROUND_MODE_OWN_COLOR
protected int borderColorMode
protected int backgroundColorMode
protected static final int ITEM_COUNT
protected float[] position
protected int sizeX
protected int sizeY
protected double textPositionX
protected double textPositionY
protected double relativeX
protected double relativeY
protected boolean draw2D
protected boolean drawRelation
protected boolean positionInPlane
protected boolean ignoreDrawProperties
protected int shiftx
protected int shifty
protected java.lang.String text
protected int labelSize
protected float labelScale
protected byte[] foregroundColor
protected byte[] backgroundColor
protected byte[] borderColor
protected boolean backgroundColorChanged
protected boolean foregroundColorChanged
protected boolean borderColorChanged
protected chemaxon.marvin.space.util.GLText gltext
| Constructor Detail |
|---|
public Label()
| Method Detail |
|---|
protected void presetTextDraw()
public ComponentElement getSelectedItem()
public int maximumItemCount()
maximumItemCount in class Monitorpublic void selectItem(ComponentElement item)
selectItem in class Monitorpublic void selectItem(GraphicComponent gc)
public GraphicComponent getComponent()
public void refresh()
public void getCoordinates(float[] c)
getCoordinates in class GraphicComponentc - allocated array where coordinates will be put
public void getCoordinates(ComponentElement item,
float[] c)
getCoordinates in class GraphicComponentitem - specific part of the componentc - allocated array where coordinates will be putpublic java.lang.String getText()
public void setText(java.lang.String text)
null.
text - Text to display or null to reset the default text.public void select()
select in interface chemaxon.marvin.space.UsableObjectselect in class GraphicComponentpublic void unSelect()
unSelect in interface chemaxon.marvin.space.UsableObjectunSelect in class Monitorpublic void unSelect(ComponentElement element)
unSelect in class GraphicComponentelement - specific part of the component
public void setPosition(float x,
float y,
float z)
public void setPosition(float[] position)
public void setPosition(float x,
float y)
public void shift(int x,
int y)
public void receiveNotificationOnCoordinateChange(GraphicComponent gc)
receiveNotificationOnCoordinateChange in class Monitorgc - component changing coordinatespublic void draw()
draw in class GraphicComponentpublic void drawTransparentPart()
drawTransparentPart in class GraphicComponentpublic boolean hasTransparentPart()
hasTransparentPart in class Monitorpublic boolean has2DPart()
has2DPart in class GraphicComponentpublic float getZCoordinateTo2DPart()
getZCoordinateTo2DPart in class GraphicComponentpublic void draw2DPart()
draw2DPart in class GraphicComponentpublic boolean hasInvisibleItem()
hasInvisibleItem in class Monitor
public double locateObject(int x,
int y)
locateObject in class GraphicComponentx - window coordinate of the mousey - window coordinate of the mouse
protected void setLabelSize(java.lang.String size)
LARGE_FONT_SIZE, MEDIUM_FONT_SIZE, SMALL_FONT_SIZE.
public void setRelativeXCoordinate(float x)
GraphicCell in pixels.
public void setRelativeYCoordinate(float y)
GraphicCell in pixels.
public byte[] getForegroundColor()
public void setForegroundColor(java.awt.Color c)
public byte[] getBackgroundColor()
public void setBackgroundColor(java.awt.Color c)
public void setBackgroundColorMode(int mode)
mode - public byte[] getBorderColor()
public void setBorderColor(java.awt.Color c)
public void setBorderColorMode(int mode)
mode - public void setLabel2DDrawing(boolean b)
setDrawProperty("Label.Draw2D", b);,
but has the real sense when the label ignores the setting of global draw properties.
b - public void ignoreDrawProperties(boolean b)
setDrawProperty(String, String).
b -
public void setDrawProperty(java.lang.String propertyName,
java.lang.String propertyValue)
throws java.lang.Exception
draw property.
StringStringStringString :
If the label is to be drawn connected to the selected element with a line.
setDrawProperty in interface chemaxon.marvin.space.UsableObjectsetDrawProperty in class GraphicComponentpropertyName - identifier of the draw propertypropertyValue - value of the draw property as a String
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||