站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

LabelWidget (Visual Library API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.visual 2.2

org.netbeans.api.visual.widget
Class LabelWidget

java.lang.Object
  extended by org.netbeans.api.visual.widget.Widget
      extended by org.netbeans.api.visual.widget.LabelWidget
Direct Known Subclasses:
ListItemWidget

public class LabelWidget
extends Widget

A widget representing a text. The widget is not opaque and is checking clipping for by default. It allows to set 4 types of horizontal and vertical alignments (by default LEFT as horizontal and BASELINE as vertical).


Nested Class Summary
static class LabelWidget.Alignment
          The text alignment
static class LabelWidget.Orientation
          The text orientation
static class LabelWidget.VerticalAlignment
          The text vertical alignment
 
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget
Widget.Dependency
 
Constructor Summary
LabelWidget(Scene scene)
          Creates a label widget.
LabelWidget(Scene scene, String label)
          Creates a label widget with a label.
 
Method Summary
protected  Rectangle calculateClientArea()
          Calculates a client area for the label.
 LabelWidget.Alignment getAlignment()
          Returns a text horizontal alignment.
 String getLabel()
          Returns a label.
 LabelWidget.Orientation getOrientation()
          Gets a text orientation.
 LabelWidget.VerticalAlignment getVerticalAlignment()
          Gets a text vertical alignment.
 boolean isPaintAsDisabled()
          Returns whether the label is painted as disabled.
protected  void paintWidget()
          Paints the label widget.
 void setAlignment(LabelWidget.Alignment alignment)
          Sets a text horizontal alignment.
 void setLabel(String label)
          Sets a label.
 void setOrientation(LabelWidget.Orientation orientation)
          Sets a text orientation.
 void setPaintAsDisabled(boolean paintAsDisabled)
          Sets whether the label is painted as disabled.
 void setVerticalAlignment(LabelWidget.VerticalAlignment verticalAlignment)
          Sets a text vertical alignment.
 
Methods inherited from class org.netbeans.api.visual.widget.Widget
addChild, addChild, addChild, addChild, addChildren, addDependency, bringToBack, bringToFront, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getChildConstraint, getChildren, getClientArea, getCursor, getFont, getForeground, getGraphics, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isRepaintRequiredForRevalidating, isValidated, isVisible, notifyAdded, notifyRemoved, notifyStateChanged, paint, paintBackground, paintBorder, paintChildren, removeChild, removeChildren, removeChildren, removeDependency, removeFromParent, repaint, resolveBounds, revalidate, revalidate, setAccessibleContext, setBackground, setBorder, setBorder, setCheckClipping, setChildConstraint, setCursor, setEnabled, setFont, setForeground, setLayout, setMaximumSize, setMinimumSize, setOpaque, setPreferredBounds, setPreferredLocation, setPreferredSize, setState, setToolTipText, setVisible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelWidget

public LabelWidget(Scene scene)
Creates a label widget.

Parameters:
scene - the scene

LabelWidget

public LabelWidget(Scene scene,
                   String label)
Creates a label widget with a label.

Parameters:
scene - the scene
label - the label
Method Detail

getLabel

public String getLabel()
Returns a label.

Returns:
the label

setLabel

public void setLabel(String label)
Sets a label.

Parameters:
label - the label

getAlignment

public LabelWidget.Alignment getAlignment()
Returns a text horizontal alignment.

Returns:
the text horizontal alignment

setAlignment

public void setAlignment(LabelWidget.Alignment alignment)
Sets a text horizontal alignment.

Parameters:
alignment - the text horizontal alignment

getVerticalAlignment

public LabelWidget.VerticalAlignment getVerticalAlignment()
Gets a text vertical alignment.

Returns:
the text vertical alignment

setVerticalAlignment

public void setVerticalAlignment(LabelWidget.VerticalAlignment verticalAlignment)
Sets a text vertical alignment.

Parameters:
verticalAlignment - the text vertical alignment

getOrientation

public LabelWidget.Orientation getOrientation()
Gets a text orientation.

Returns:
the text orientation
Since:
2.1

setOrientation

public void setOrientation(LabelWidget.Orientation orientation)
Sets a text orientation.

Parameters:
orientation - the text orientation
Since:
2.1

isPaintAsDisabled

public boolean isPaintAsDisabled()
Returns whether the label is painted as disabled.

Returns:
true, if the label is painted as disabled

setPaintAsDisabled

public void setPaintAsDisabled(boolean paintAsDisabled)
Sets whether the label is painted as disabled.

Parameters:
paintAsDisabled - if true, then the label is painted as disabled

calculateClientArea

protected Rectangle calculateClientArea()
Calculates a client area for the label.

Overrides:
calculateClientArea in class Widget
Returns:
the client area

paintWidget

protected void paintWidget()
Paints the label widget.

Overrides:
paintWidget in class Widget

org.netbeans.api.visual 2.2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.