sgtplot.beans
Class Label
- java.lang.Object
-
- sgtplot.beans.Label
-
- All Implemented Interfaces:
- java.io.Serializable
public class Label extends java.lang.Object implements java.io.SerializableEncapsulatesSGLabelproperties.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Label()Default constructor.Label(java.lang.String id, Point2D.Double loc, double wid, double hgt)Label constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddChangeListener(javax.swing.event.ChangeListener l)Rectangle2D.DoublegetBoundsP()Get Label bounds.java.awt.ColorgetColor()Get label color.java.awt.FontgetFont()Get label font.doublegetHeightP()Get Label height.java.lang.StringgetId()Get Label identifier.intgetJustification()Get label justification.Point2D.DoublegetLocationP()Get Label locationintgetOrientation()Get label orientation.PanelHoldergetPanelHolder()Get panel holder.java.lang.StringgetText()Get label text.doublegetWidthP()Get label width.booleanisInstantiated()Is SGLabel instatiated?booleanisSelectable()Is label selectable?booleanisVisible()Is Label visible?voidremoveAllChangeListeners()Remove all change listeners.voidremoveChangeListener(javax.swing.event.ChangeListener l)Remove change listener.voidremoveDesignChangeListeners()Remove change listeners that implementDesignListener.voidsetBoundsP(Rectangle2D.Double bounds)Set Label bounds.voidsetColor(java.awt.Color color)Set label color.voidsetFont(java.awt.Font font)Set label font.voidsetHeightP(double heightP)Set Label height.voidsetId(java.lang.String id)Set label identifier.voidsetInstantiated(boolean instantiated)Set instantiation for label.voidsetJustification(int justification)Set label justification.voidsetLocationP(Point2D.Double locationP)Set Label location.voidsetOrientation(int orientation)Set label orientation.voidsetPanelHolder(PanelHolder pHolder)Set panelholder.voidsetSelectable(boolean selectable)Set label selectable.voidsetText(java.lang.String text)Set label text.voidsetVisible(boolean visible)Set label visiblity.voidsetWidthP(double widthP)Set label width.
-
-
-
Constructor Detail
-
Label
public Label()
Default constructor. Width and height are set to 0.0, name and location arenull.
-
Label
public Label(java.lang.String id, Point2D.Double loc, double wid, double hgt)Label constructor.- Parameters:
id- label identifierloc- location in physical coordinateswid- width in physical coordinateshgt- height in physical coorindates.
-
-
Method Detail
-
getId
public java.lang.String getId()
Get Label identifier.- Returns:
- identification
-
setId
public void setId(java.lang.String id)
Set label identifier.- Parameters:
id- identifier
-
setBoundsP
public void setBoundsP(Rectangle2D.Double bounds)
Set Label bounds.- Parameters:
bounds- bounds in physical coordinates.
-
getBoundsP
public Rectangle2D.Double getBoundsP()
Get Label bounds.- Returns:
- bounds
-
setLocationP
public void setLocationP(Point2D.Double locationP)
Set Label location. Updates x and y in bounds.- Parameters:
locationP- location in physical coordinates.
-
getLocationP
public Point2D.Double getLocationP()
Get Label location- Returns:
- location in physical coordinates
-
setHeightP
public void setHeightP(double heightP)
Set Label height. Updates height in bounds.- Parameters:
heightP- height in physical coordinates
-
getHeightP
public double getHeightP()
Get Label height.- Returns:
- height
-
setWidthP
public void setWidthP(double widthP)
Set label width. Updates width in bounds.- Parameters:
widthP- width in physcial coordinates
-
getWidthP
public double getWidthP()
Get label width.- Returns:
- width
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove change listener.- Parameters:
l- change listener.
-
removeAllChangeListeners
public void removeAllChangeListeners()
Remove all change listeners.
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
-
removeDesignChangeListeners
public void removeDesignChangeListeners()
Remove change listeners that implementDesignListener.
-
setText
public void setText(java.lang.String text)
Set label text.- Parameters:
text- label text
-
getText
public java.lang.String getText()
Get label text.- Returns:
- text
-
setVisible
public void setVisible(boolean visible)
Set label visiblity. Visible if true. Default = true.- Parameters:
visible- label visiblity
-
isVisible
public boolean isVisible()
Is Label visible?- Returns:
- true, if label is visible
-
setInstantiated
public void setInstantiated(boolean instantiated)
Set instantiation for label. Used internally. Set when SGLabel is instantiated from Label.- Parameters:
instantiated- SGLabel instantiated
-
isInstantiated
public boolean isInstantiated()
Is SGLabel instatiated?- Returns:
- true, if SGLabel is instantiated
-
setPanelHolder
public void setPanelHolder(PanelHolder pHolder)
Set panelholder.- Parameters:
pHolder- panel holder
-
getPanelHolder
public PanelHolder getPanelHolder()
Get panel holder.- Returns:
- panel holder
-
getJustification
public int getJustification()
Get label justification.- Returns:
- justification.
-
setJustification
public void setJustification(int justification)
Set label justification. Justification can be SGLabel.LEFT, SGLabel.RIGHT, or SGLabel.CENTER. Default = SGLabel.LEFT.- Parameters:
justification- label justification- See Also:
SGLabel
-
getColor
public java.awt.Color getColor()
Get label color.- Returns:
- color
-
getFont
public java.awt.Font getFont()
Get label font.- Returns:
- font
-
setColor
public void setColor(java.awt.Color color)
Set label color. Default = Color.black.- Parameters:
color- label color
-
setFont
public void setFont(java.awt.Font font)
Set label font. Default = Helvectia, PLAIN- Parameters:
font- label font
-
getOrientation
public int getOrientation()
Get label orientation.- Returns:
- orientation
-
setOrientation
public void setOrientation(int orientation)
Set label orientation. Legal values are SGLabel.HORIZONTAL and SGLabel.VERTICAL. Default = SGLabel.HORIZONTAL.- Parameters:
orientation- label orientation- See Also:
SGLabel
-
isSelectable
public boolean isSelectable()
Is label selectable?- Returns:
- true if label is selectable
-
setSelectable
public void setSelectable(boolean selectable)
Set label selectable.- Parameters:
selectable- true if label is selectable
-
-
DMelt 3.0 © DataMelt by jWork.ORG