public class LabelController extends java.lang.Object implements Controller
Modifier and Type | Class and Description |
---|---|
static class |
LabelController.Property
The property that may be edited by the view associated to this controller.
|
Constructor and Description |
---|
LabelController(Home home,
float x,
float y,
UserPreferences preferences,
ViewFactory viewFactory,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of label creation with undo support.
|
LabelController(Home home,
UserPreferences preferences,
ViewFactory viewFactory,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of label modifications with undo support.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(LabelController.Property property,
java.beans.PropertyChangeListener listener)
Adds the property change
listener in parameter to this controller. |
void |
createLabel()
Controls the creation of a label.
|
protected Label |
createLabel(java.lang.String text,
float x,
float y)
Returns a new label instance placed at the given coordinates and added to home.
|
void |
displayView(View parentView)
Displays the view controlled by this controller.
|
TextStyle.Alignment |
getAlignment()
Returns the edited text alignment.
|
java.lang.Integer |
getColor()
Returns the edited color.
|
java.lang.Float |
getElevation()
Returns the edited elevation.
|
java.lang.String |
getFontName()
Returns the edited font name or
null for default system font. |
java.lang.Float |
getFontSize()
Returns the edited font size.
|
java.lang.Float |
getPitch()
Returns the edited pitch.
|
java.lang.String |
getText()
Returns the edited text.
|
DialogView |
getView()
Returns the view associated with this controller.
|
boolean |
isFontNameSet()
Returns
true if all edited labels use the same font name. |
protected boolean |
isLabelPartOfBasePlan(Label label)
Returns
true . |
java.lang.Boolean |
isPitchEnabled()
Returns
Boolean.TRUE if all edited labels are viewed in 3D,
or Boolean.FALSE if no label is viewed in 3D. |
void |
modifyLabels()
Controls the modification of selected labels.
|
void |
removePropertyChangeListener(LabelController.Property property,
java.beans.PropertyChangeListener listener)
Removes the property change
listener in parameter from this controller. |
void |
setAlignment(TextStyle.Alignment alignment)
Sets the edited text alignment.
|
void |
setColor(java.lang.Integer color)
Sets the edited color.
|
void |
setElevation(java.lang.Float elevation)
Sets the edited elevation.
|
void |
setFontName(java.lang.String fontName)
Sets the edited font name.
|
void |
setFontSize(java.lang.Float fontSize)
Sets the edited font size.
|
void |
setPitch(java.lang.Float pitch)
Sets the edited pitch.
|
void |
setText(java.lang.String text)
Sets the edited text.
|
protected void |
updateProperties()
Updates edited properties from selected labels in the home edited by this controller.
|
public LabelController(Home home, UserPreferences preferences, ViewFactory viewFactory, javax.swing.undo.UndoableEditSupport undoSupport)
public LabelController(Home home, float x, float y, UserPreferences preferences, ViewFactory viewFactory, javax.swing.undo.UndoableEditSupport undoSupport)
protected void updateProperties()
public DialogView getView()
getView
in interface Controller
public void displayView(View parentView)
public void addPropertyChangeListener(LabelController.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter to this controller.public void removePropertyChangeListener(LabelController.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter from this controller.public void setText(java.lang.String text)
public java.lang.String getText()
public void setAlignment(TextStyle.Alignment alignment)
public TextStyle.Alignment getAlignment()
public void setFontName(java.lang.String fontName)
public java.lang.String getFontName()
null
for default system font.public void setFontSize(java.lang.Float fontSize)
public java.lang.Float getFontSize()
public boolean isFontNameSet()
true
if all edited labels use the same font name.public void setColor(java.lang.Integer color)
public java.lang.Integer getColor()
public void setPitch(java.lang.Float pitch)
public java.lang.Float getPitch()
public java.lang.Boolean isPitchEnabled()
Boolean.TRUE
if all edited labels are viewed in 3D,
or Boolean.FALSE
if no label is viewed in 3D.public void setElevation(java.lang.Float elevation)
public java.lang.Float getElevation()
protected Label createLabel(java.lang.String text, float x, float y)
public void createLabel()
protected boolean isLabelPartOfBasePlan(Label label)
true
.public void modifyLabels()
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License