org.netbeans.microedition.svg
Class SVGSpinner
java.lang.Object
org.netbeans.microedition.svg.SVGComponent
org.netbeans.microedition.svg.SVGSpinner
- All Implemented Interfaces:
- DataListener, SVGForm.FocusListener
public class SVGSpinner
- extends SVGComponent
- implements DataListener
Suggested svg snippet:
<g id="age_spinner" transform="translate(20,140)">
<!-- Metadata information. Please don't edit. -->
<text display="none">type=spinner</text>
<rect x="0" y="-5" rx="5" ry="5" width="44" height="30" fill="none" stroke="rgb(255,165,0)" stroke-width="2" visibility="hidden">
<set attributeName="visibility" attributeType="XML" begin="age_spinner.focusin" fill="freeze" to="visible"/>
<set attributeName="visibility" attributeType="XML" begin="age_spinner.focusout" fill="freeze" to="hidden"/>
</rect>
<rect x="5.0" y="0.0" width="33" height="20" fill="none" stroke="black" stroke-width="2"/>
<g id="age_spinner_editor">
<!-- this editor is SVGTextField component -->
<!-- metadata definition-->
<text display="none">type=editor</text>
<text display="none">editable=false</text>
<text display="none">enabled=true</text>
<g>
<text id="age_spinner_editor_text" x="10" y="15" stroke="black" font-size="15" font-family="SunSansSemiBold">
0</text>
<!-- Metadata information. Please don't edit. -->
<text display="none">type=text</text>
</g>
<!-- The rectangle below is difference between rectangle that bounds spinner and spinner buttons ( the latter
has id = age_spinner_up and age_spinner_down ). It needed for counting bounds of input text area .
It should be created programatically or SVGTextField should have API for dealing with "width"
of editor not based only on width of text field component.-->
<rect visibility="hidden" x="5.0" y="0" width="33" height="20"/>
</g>
<g>
<!-- Metadata information. Please don't edit. -->
<text display="none">type=up_button</text>
<rect id="age_spinner_up_button" x="21.0" y="0.0" width="16" height="10" fill="rgb(220,220,220)" stroke="black" stroke-width="1.5">
<animate id="age_spinner_up_button_pressed" attributeName="fill" attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="rgb(170,170,170)"/>
<animate id="age_spinner_up_button_released" attributeName="fill" attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="rgb(220,220,220)"/>
</rect>
</g>
<g>
<!-- Metadata information. Please don't edit. -->
<text display="none">type=down_button</text>
<rect id="age_spinner_down_button" x="21.0" y="10.0" width="16" height="10" fill="rgb(220,220,220)" stroke="black" stroke-width="1.5">
<animate id="age_spinner_down_button_pressed" attributeName="fill" attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="rgb(170,170,170)"/>
<animate id="age_spinner_down_button_released" attributeName="fill" attributeType="XML" begin="indefinite" dur="0.25s" fill="freeze" to="rgb(220,220,220)"/>
</rect>
</g>
<polygon transform="translate(28,6)" points="0,0 2,0 1,-2" fill="blue" stroke="black" stroke-width="2"/>
<polygon transform="translate(28,14)" points="0,0 2,0 1,2" fill="blue" stroke="black" stroke-width="2"/>
</g>
Fields inherited from class org.netbeans.microedition.svg.SVGComponent |
actionListeners, DASH, ENABLED, form, LABEL_FOR, REF, SVG_NS, TR_VALUE_HIDDEN, TR_VALUE_INHERIT, TR_VALUE_VISIBLE, TRAIT_FILL, TRAIT_TEXT, TRAIT_VISIBILITY, TRAIT_X, TRAIT_Y, TYPE, wrapperElement |
Methods inherited from class org.netbeans.microedition.svg.SVGComponent |
addActionListener, fireActionPerformed, getElement, getElementById, getElementByMeta, getElementByMeta, getForm, getLabel, getNestedElementByMeta, getProperty, isFocusable, removeActionListener, requestFocus, setFocusable, setProperty, setTraitSafely, setTraitSafely |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVGSpinner
public SVGSpinner(SVGForm form,
java.lang.String elemId)
focusGained
public void focusGained()
- Specified by:
focusGained
in interface SVGForm.FocusListener
- Overrides:
focusGained
in class SVGComponent
focusLost
public void focusLost()
- Specified by:
focusLost
in interface SVGForm.FocusListener
- Overrides:
focusLost
in class SVGComponent
setModel
public void setModel(SVGSpinner.SVGSpinnerModel model)
getModel
public SVGSpinner.SVGSpinnerModel getModel()
getValue
public java.lang.Object getValue()
setEditor
public void setEditor(SVGComponent editor)
getEditor
public SVGComponent getEditor()
getInputHandler
public InputHandler getInputHandler()
- Overrides:
getInputHandler
in class SVGComponent
contentsChanged
public void contentsChanged(java.lang.Object source)
- Specified by:
contentsChanged
in interface DataListener