Sweet Home 3D 4.1

com.eteks.sweethome3d.model
Class Label

java.lang.Object
  extended by com.eteks.sweethome3d.model.Label
All Implemented Interfaces:
Elevatable, Selectable, Serializable, Cloneable

public class Label
extends Object
implements Selectable, Serializable, Elevatable

A free label.

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Nested Class Summary
static class Label.Property
          The properties of a label that may change.
 
Constructor Summary
Label(String text, float x, float y)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds the property change listener in parameter to this label.
 Label clone()
          Returns a clone of this label.
 boolean containsPoint(float x, float y, float margin)
          Returns true if this text is at the point at (x, y) with a given margin.
 float getAngle()
          Returns the angle in radians used to display this label.
 Level getLevel()
          Returns the level which this label belongs to.
 float[][] getPoints()
          Returns the point of this label.
 TextStyle getStyle()
          Returns the style used to display the text of this label.
 String getText()
          Returns the text of this label.
 float getX()
          Returns the abscissa of the text of this label.
 float getY()
          Returns the ordinate of the text of this label.
 boolean intersectsRectangle(float x0, float y0, float x1, float y1)
          Returns true if the point of this label is contained in the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).
 boolean isAtLevel(Level level)
          Returns true if this label is at the given level.
 void move(float dx, float dy)
          Moves this label of (dx, dy) units.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the property change listener in parameter from this label.
 void setAngle(float angle)
          Sets the angle in radians used to display this label.
 void setLevel(Level level)
          Sets the level of this label.
 void setStyle(TextStyle style)
          Sets the style used to display the text of this label.
 void setText(String text)
          Sets the text of this label.
 void setX(float x)
          Sets the abscissa of the text of this label.
 void setY(float y)
          Sets the ordinate of the text of this label.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Label

public Label(String text,
             float x,
             float y)
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds the property change listener in parameter to this label.


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the property change listener in parameter from this label.


getText

public String getText()
Returns the text of this label.


setText

public void setText(String text)
Sets the text of this label. Once this label is updated, listeners added to this label will receive a change notification.


getX

public float getX()
Returns the abscissa of the text of this label.


setX

public void setX(float x)
Sets the abscissa of the text of this label. Once this label is updated, listeners added to this label will receive a change notification.


getY

public float getY()
Returns the ordinate of the text of this label.


setY

public void setY(float y)
Sets the ordinate of the text of this label. Once this label is updated, listeners added to this label will receive a change notification.


getStyle

public TextStyle getStyle()
Returns the style used to display the text of this label.


setStyle

public void setStyle(TextStyle style)
Sets the style used to display the text of this label. Once this label is updated, listeners added to this label will receive a change notification.


getAngle

public float getAngle()
Returns the angle in radians used to display this label.

Since:
3.6

setAngle

public void setAngle(float angle)
Sets the angle in radians used to display this label. Once this piece is updated, listeners added to this piece will receive a change notification.

Since:
3.6

getLevel

public Level getLevel()
Returns the level which this label belongs to.

Specified by:
getLevel in interface Elevatable
Since:
3.4

setLevel

public void setLevel(Level level)
Sets the level of this label. Once this label is updated, listeners added to this label will receive a change notification.

Since:
3.4

isAtLevel

public boolean isAtLevel(Level level)
Returns true if this label is at the given level.

Specified by:
isAtLevel in interface Elevatable
Since:
3.4

getPoints

public float[][] getPoints()
Returns the point of this label.

Specified by:
getPoints in interface Selectable
Returns:
an array of the (x,y) coordinates of this label.

intersectsRectangle

public boolean intersectsRectangle(float x0,
                                   float y0,
                                   float x1,
                                   float y1)
Returns true if the point of this label is contained in the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).

Specified by:
intersectsRectangle in interface Selectable

containsPoint

public boolean containsPoint(float x,
                             float y,
                             float margin)
Returns true if this text is at the point at (x, y) with a given margin.

Specified by:
containsPoint in interface Selectable

move

public void move(float dx,
                 float dy)
Moves this label of (dx, dy) units.

Specified by:
move in interface Selectable

clone

public Label clone()
Returns a clone of this label.

Specified by:
clone in interface Selectable
Overrides:
clone in class Object

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License