org.odftoolkit.simple.draw
public class Control extends Component
Constructor and Description |
---|
Control(DrawControlElement element) |
Modifier and Type | Method and Description |
---|---|
OdfElement |
getContainerElement()
Get the container element which contains this control.
|
static Control |
getInstanceof(DrawControlElement element)
Get an instance of control according to a DrawControlElement.
|
DrawControlElement |
getOdfElement()
Get the instance of DrawControlElement which represents this control.
|
FrameRectangle |
getRectangle()
Return the rectangle used by this control
|
ControlStyleHandler |
getStyleHandler()
Return the style handler for this control
|
static Control |
newDrawControl(ControlContainer container)
Create an instance of control and and append it at the end of a container
element.
|
boolean |
remove()
Remove the shape control from the container.
|
void |
setAchorType(StyleTypeDefinitions.AnchorType achorType)
Set how a form control is bound to a text document.
|
void |
setControl(String formControlId)
Set a control within a form that is linked to this control shape by its
ID.
|
void |
setFormatString(String formatStr,
String type)
Set the format string of the input control.
|
void |
setRectangle(FrameRectangle rectangle)
Set the rectangle used by this control
|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
public Control(DrawControlElement element)
public OdfElement getContainerElement()
public DrawControlElement getOdfElement()
getOdfElement
in class Component
public static Control newDrawControl(ControlContainer container)
container
- - the container elementpublic static Control getInstanceof(DrawControlElement element)
element
- - an instance of DrawControlElementpublic boolean remove()
The resource is removed if it's only used by this object.
public ControlStyleHandler getStyleHandler()
public void setControl(String formControlId)
formControlId
- - id of a form controlpublic void setAchorType(StyleTypeDefinitions.AnchorType achorType)
If the document is not text document, nothing will happen.
achorType
- - the point at which a form control is bound to a text
documentpublic void setRectangle(FrameRectangle rectangle)
rectangle
- - the rectangle used by this controlpublic FrameRectangle getRectangle()
public void setFormatString(String formatStr, String type)
This function only works for date, time and percentage, otherwise an
IllegalArgumentException
will be thrown.
For value type percentage, the formatStr
must follow the
encoding rule of
. For value type date and time, the
java.text.DecimalFormat
formatStr
must follow the encoding rule of
.java.text.SimpleDateFormat
formatStr
- -the input need be formatted as this specified format string.type
- - the type that need to be setIllegalArgumentException
- if formatStr
is null or the value type is
supported.SimpleDateFormat
,
DecimalFormat
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.