Package breadboards
Class GLabel
- java.lang.Object
-
- breadboards.GObject
-
- breadboards.GLabel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)returns true if (x,y) is inside this GLabelvoiddraw(java.awt.Graphics g)draws the GLabel (generally not called directly)GRectanglegetBounds()returns an empty bounding rectangle for this GLabeljava.awt.ColorgetColor()returns the border color of this GLabeldoublegetHeight()returns the height of this GLabeljava.lang.StringgetText()returns the text of this GLabel as a stringdoublegetWidth()returns the width of this GLabelvoidsetColor(java.awt.Color color)sets the border color of the GLabel to the specified colorvoidsetFont(java.lang.String font)sets the font of the GLabelvoidsetFontSize(int fontSize)sets the font size of the GLabelvoidsetText(java.lang.String text)sets the text of this GLabel-
Methods inherited from class breadboards.GObject
addMouseListener, addMouseMotionListener, getBreadboard, getLocation, getMouseListeners, getMouseMotionListeners, getParent, getX, getY, isVisible, move, movePolar, removeMouseListener, removeMouseMotionListener, sendBackward, sendForward, sendToBack, sendToFront, setLocation, setParent, setVisible, setX, setY, updateBreadboard
-
-
-
-
Constructor Detail
-
GLabel
public GLabel(java.lang.String text)
constructs a GLabel with specified text with lower left corner at (0,0)- Parameters:
text- the specified text
-
GLabel
public GLabel(double x, double y, java.lang.String text)constructs a GLabel with a specified text at a specified location- Parameters:
x- the x-coordinate of the lower left corner of the GLabely- the y-coordinate of the lower left corner of the GLabeltext- the specified text
-
-
Method Detail
-
getText
public java.lang.String getText()
returns the text of this GLabel as a string- Returns:
- the text of this GLabel
-
getBounds
public GRectangle getBounds()
returns an empty bounding rectangle for this GLabel
-
getColor
public java.awt.Color getColor()
returns the border color of this GLabel- Returns:
- the border color of this GLabel
-
getHeight
public double getHeight()
returns the height of this GLabel- Returns:
- the height of this GLabel
-
getWidth
public double getWidth()
returns the width of this GLabel- Returns:
- the width of this GLabel
-
setText
public void setText(java.lang.String text)
sets the text of this GLabel- Parameters:
text- the new text for this GLabel
-
setFontSize
public void setFontSize(int fontSize)
sets the font size of the GLabel- Parameters:
fontSize- the specified font size
-
setFont
public void setFont(java.lang.String font)
sets the font of the GLabel- Parameters:
font- a string representing the font (like "TimesRoman")
-
setColor
public void setColor(java.awt.Color color)
sets the border color of the GLabel to the specified color- Parameters:
color- the specified color
-
draw
public void draw(java.awt.Graphics g)
draws the GLabel (generally not called directly)
-
contains
public boolean contains(double x, double y)returns true if (x,y) is inside this GLabel
-
-