|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jfimagine.jfgraph.shape.base.AbstractObject
|
+--com.jfimagine.jfgraph.shape.base.Label
Label Class. A label is to label the text of a shape.
| Field Summary | |
protected java.awt.Font |
m_font
A font format of this label. |
protected JFPoint |
m_labelPoint
A point for x,y coordinates of the left-top corner of the label. |
protected boolean |
m_movable
Label movable. e.g. |
protected AbstractObject |
m_parent
A parent object of this label. |
protected java.lang.String |
m_text
Label text. |
protected boolean |
m_visible
Label visible or invisible. |
static java.lang.String |
XML_LABEL
A XML string tag represents a jflabel |
static java.lang.String |
XML_MOVABLE
A XML string tag represents the if movable of this label |
static java.lang.String |
XML_TEXT
A XML string tag represents the text of this label |
static java.lang.String |
XML_VISIBLE
A XML string tag represents the if visible of this label |
static java.lang.String |
XML_XOFFSET
A XML string tag represents the x coordinate offset of this label |
static java.lang.String |
XML_YOFFSET
A XML string tag represents the y coordinate offset of this label |
| Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
m_lastError, XML_OBJECTID, XML_OBJECTTYPE |
| Constructor Summary | |
Label()
Constructor for Label |
|
Label(double x,
double y)
Constructor for Label |
|
Label(JFPoint pnt)
Constructor for Label |
|
| Method Summary | |
protected void |
appendChildToDOM(Element element,
JFVersion version)
Append necessary xml child for current element, this method will be called internally by toDOM. |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
protected AbstractObject |
cloneMe()
Creates a new AbstractObject of the same class and with the same contents as this object. |
void |
draw(java.awt.Graphics g)
Draw current object on graphic canvas. |
protected void |
drawLabel(java.awt.Graphics g)
Draw current label on graphic canvas. |
void |
drawPicked(java.awt.Graphics g,
boolean isXorMode)
Draw picked state of current object on graphic canvas. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
protected void |
extractChildFromDOM(Element element,
JFVersion version)
Extract needed xml child from current element, this method will be called internally by fromDOM. |
Rect |
getBounds()
Get the bounds of this label. |
java.awt.Font |
getFont()
Get the font of current label. |
JFPoint |
getLabelPoint()
Get the point of current label. |
boolean |
getMovable()
Get if movable of current label. |
AbstractObject |
getParent()
Get parent object of this label. |
java.lang.String |
getText()
Get the text of current label. |
boolean |
getVisible()
Get if visible of current label. |
double |
getXOffset()
Get the x offset of current label. |
double |
getYOffset()
Get the y offset of current label. |
java.awt.Font |
getZoomedFont()
Get a zoomed font of current label. |
int |
hashCode()
Returns the hashcode for this Object. |
boolean |
intersects(java.awt.Graphics g,
JFPoint pnt)
Test if current object intersects with a specified point. |
boolean |
intersects(java.awt.Graphics g,
Rect rect)
Test if current object intersects with a specified point. |
void |
loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
Load label data from a binary stream |
void |
moveBy(double x,
double y)
Move current object by an x and y offset. |
void |
saveToStream(JFWriter stream,
JFVersion version)
Save this label to a binary stream |
void |
setFont(java.awt.Font aFont)
Set the font of current label. |
void |
setLabelPoint(JFPoint pnt)
Set the point of current label. |
void |
setMovable(boolean movable)
Set the movable of current label. |
void |
setParent(AbstractObject obj)
Set parent object of this label. |
void |
setText(java.lang.String text)
Set the text of current label. |
void |
setValue(Label aLabel)
Set the value of current label. |
void |
setVisible(boolean visible)
Set the visible of current label. |
void |
setXOffset(double xOffset)
Set the x offset of current label. |
void |
setYOffset(double yOffset)
Set the y offset of current label. |
java.lang.String |
toString()
Convert this label to String |
| Methods inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
fromDOM, getLastError, getMaxObjectId, getObjectId, getObjectType, getXMLTag, getZoomScale, isShowDesign, setLastError, setObjectId, setObjectType, setShowDesign, setValue, setXMLTag, setZoomScale, toDOM |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String XML_LABEL
public static final java.lang.String XML_XOFFSET
public static final java.lang.String XML_YOFFSET
public static final java.lang.String XML_TEXT
public static final java.lang.String XML_VISIBLE
public static final java.lang.String XML_MOVABLE
protected JFPoint m_labelPoint
protected java.lang.String m_text
protected boolean m_visible
protected boolean m_movable
protected AbstractObject m_parent
protected java.awt.Font m_font
| Constructor Detail |
public Label()
public Label(double x,
double y)
public Label(JFPoint pnt)
| Method Detail |
public AbstractObject getParent()
public void setParent(AbstractObject obj)
public double getXOffset()
public void setXOffset(double xOffset)
xOffset - The x offset of current label.
public double getYOffset()
public void setYOffset(double yOffset)
yOffset - The y offset of current label.public JFPoint getLabelPoint()
public void setLabelPoint(JFPoint pnt)
pnt - The point of current label.public boolean getVisible()
public void setVisible(boolean visible)
visible - A new visible state of current label.public boolean getMovable()
public void setMovable(boolean movable)
movable - A new movable state of current label.public java.lang.String getText()
public void setText(java.lang.String text)
text - The text of current label.public java.awt.Font getFont()
public java.awt.Font getZoomedFont()
public void setFont(java.awt.Font aFont)
public void setValue(Label aLabel)
aLabel - A new label value.public Rect getBounds()
protected void drawLabel(java.awt.Graphics g)
g - A graphic canvas.
public void drawPicked(java.awt.Graphics g,
boolean isXorMode)
g - A graphic canvas.isXorMode - If is in xor mode now.public void draw(java.awt.Graphics g)
g - A graphic canvas.
public boolean intersects(java.awt.Graphics g,
JFPoint pnt)
g - A graphics context necessary used to measure intersection.pnt - A JFPoint used to test intersection.
public boolean intersects(java.awt.Graphics g,
Rect rect)
g - A graphics context necessary used to measure intersection.rect - A rectangle used to test intersection.
public void moveBy(double x,
double y)
public java.lang.String toString()
toString in class AbstractObject
protected AbstractObject cloneMe()
throws java.lang.CloneNotSupportedException
cloneMe in class AbstractObjectjava.lang.CloneNotSupportedException
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AbstractObjectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class AbstractObjectpublic boolean equals(java.lang.Object obj)
equals in class AbstractObjectobj - an object to be compared with this object
protected void appendChildToDOM(Element element,
JFVersion version)
appendChildToDOM in class AbstractObjectelement - A XML element to append child xml labelsversion - A file version notification so this object can obey the rules to save data.
protected void extractChildFromDOM(Element element,
JFVersion version)
extractChildFromDOM in class AbstractObjectelement - An element used to extract needed xml childversion - A file version notification so this object can obey the rules to fetch data.
public void saveToStream(JFWriter stream,
JFVersion version)
throws java.io.IOException
saveToStream in class AbstractObjectstream - An binary output streamversion - A file version notification so this object can obey the rules to save data.
java.io.IOException
public void loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
throws java.io.IOException
loadFromStream in class AbstractObjectstream - An binary input streamskipHead - Skip head 'TYPE' check, an shape object should always
has its own shape-type stored, if this shape-type has already been readed,
this loadFromStream should/could not read the type anymore.version - A file version notification so this object can obey the rules to fetch data.
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||