...
Wiki Markup |
---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="1ca73752fcd3d619-6396ada0-4b724150-80f6a031-81577a8133d06e169ce91179"><ac:parameter ac:name="">property_expansion</ac:parameter></ac:structured-macro>Note that {{isSettable}} should be implemented in a way that does not cause the expansion of the property. The {{isSettable}} check is performed before the CSS value is looked up. If the property is not settable, then no further CSS processing is done for that property (on any given pulse). The {{getWritableValue}} method is invoked only if there is a CSS value to apply. Thus, if the property is not settable or there is no CSS value, the property is not expanded\[[#1]\]. |
...
Code Block |
---|
package javafx.scene; public final class PseudoClass { /** * There is only one PseudoClass.State instance for a given pseudoClass. * @return The PseudoClass.State for the given pseudoClass. Will not return null. */ public static PseudoClass.State getState(String pseudoClass) { // Use pseudoClass as key to find State in a Map<String,State> // If not found, create it and add to the map. // return the PseudoClass.State } /** * @return A new PseudoClass.States instance */ public static PseudoClass.States createStatesInstance() { } public final class State { /** Cannot create an instance of State except through PseudoClass static methods */ private State() { } @Override public String toString() { // return the String that was used to create this PseudoClassState pseudo-class, e.g. "hover" } } public final class States { /** * Add the state to the current set of states. The result of the operation will be the union of * the existing set of states and the added state. * @param state The state to add */ public void addState(PseudoClass.State state) { } /** * Remove the state to the current states. The result of the operation will be the relative complement of * the removed state in the existing set of states. This implies that removing a state that is not in the * existing set of states had no effect. * @param state The state to remove */ public void removeState(PseudoClass.State state) { } /** * Test if the given state is in the set of states represented by this States object. * @return true if the given state is present. */ public boolean hasState(PseudoClass.State state) { } /** * Reset the set of states to the empty set. */ public void clear() { } /** @return The list of PseudoClass.State that are represented by this States object */ public List<PseudoClass.State> getStates() { } /** Cannot create an instance of States except through PseudoClass static methods */ private States() { } } } |
...
Code Block |
---|
/** * Used to notify that a pseudo-class has changed. Typically, this method is called from the invalidated * method of a property that is used as a pseudo-class. * <code> * private static final PseudoClass.State MY_PSEUDO_CLASS_STATE = PseudoClass.getState("my-state"); * * BooleanProperty myPseudoClassState = new BooleanPropertyBase(false) { * * @Override public void invalidated() { * pseudoClassStateChanged(MY_PSEUDO_CLASS_STATE); * } * * @Override public Object getBean() { * return MyControl.this; * } * * @Override public String getName() { * return "myPseudoClassState"; * } * }; * <code> * @param pseudoClassState The PseudoClass.State that has changed. */ protected void pseudoClassStateChanged(PseudoClass.State pseudoClassState) { // if there are styles that use the given pseudoClassState, mark this node as needing css update } /** * The pseudo-class state of a Node is the state pertaining to this class and all of its super classes. This method is * implemented by getting the pseudo-class state of the super class and then or'ing in the pseudo-class state of this class. * <code> * private static final PseudoClass.State MY_PSEUDO_CLASS_STATE = PseudoClass.getState("my-state"); * * @Override public PseudoClass.States getPseudoClassStates() { * PseudoClass.States states = super.getPseudoClassStates(); * if (isMyPseudoClassState()) { states.addState(MY_PSEUDO_CLASS_STATE); } * return state; * } * <code> * @return PseudoClass.States representing the pseudo-class state of this node and the state of its super classes. * */ public PseudoClass.States getPseudoClassStates() { PseudoClass.States states = PseudoClass.createStatesInstance(); ??[// TBD - better to have a instance member and just clear it?]?? if(isHover()) states.addState(HOVER_PSEUDOCLASS_STATE); if(isPressed()) states.addState(PRESSED_PSEUDOCLASS_STATE); if(isDisabled()) states.addState(DISABLED_PSEUDOCLASS_STATE); if(isFocused()) states.addState(FOCUSED_PSEUDOCLASS_STATE); if(impl_isShowMnemonics()) states.addState(SHOW_MNEMONICS_PSEUDOCLASS_STATE); return states; } |
...
Overview
Content Tools
ThemeBuilder